summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Kirchhoff <debian@usertracker.org>2018-08-04 20:08:57 -0700
committerAndrej Shadura <andrewsh@debian.org>2018-08-05 11:42:33 +0200
commita2f615da39bfb2f0659ac90f97acc6b28f159635 (patch)
tree0dcc47a067044c553707cdb84ad0449367349db2
parentea27cde858e3ef72889062e06cc1b4c90945f51f (diff)
parent293202087ef00accaa85af02c2c9359ab6b2513c (diff)
New upstream version (1.2018.9)debian/1%1.2018.9-1
* Update pdf.patch; add libavalon-framework-java, libcommons-io-java, libcommons-logging-java, libxml-commons-external-java, libxmlgraphics-commons-java as dependencies * Fix "Upgrade to version 1.2018.4 and improve description" by updating to newest upstream and updating description with new features (Closes: #897414) * Update Standards-Version from 4.0.0 to 4.1.5 (no change needed)
-rw-r--r--README.md13
-rw-r--r--build.xml7
-rw-r--r--debian/changelog15
-rw-r--r--debian/control26
-rw-r--r--debian/patches/pdf.patch6
-rw-r--r--license.txt49
-rw-r--r--pom.xml8
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/ACearth.java (renamed from src/com/ctreber/acearth/ACearth.java)56
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/Configuration.java (renamed from src/com/ctreber/acearth/Configuration.java)14
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/ConfigurationACearth.java (renamed from src/com/ctreber/acearth/ConfigurationACearth.java)18
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/MapData.java (renamed from src/com/ctreber/acearth/MapData.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/MapDataReader.java (renamed from src/com/ctreber/acearth/MapDataReader.java)6
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/gui/CanvasACearth.java (renamed from src/com/ctreber/acearth/gui/CanvasACearth.java)4
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/gui/PixelCanvas.java (renamed from src/com/ctreber/acearth/gui/PixelCanvas.java)4
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/plugins/Plugin.java (renamed from src/com/ctreber/acearth/plugins/Plugin.java)8
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/plugins/markers/Marker.java (renamed from src/com/ctreber/acearth/plugins/markers/Marker.java)16
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/plugins/markers/PluginMarkers.java (renamed from src/com/ctreber/acearth/plugins/markers/PluginMarkers.java)4
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/projection/Projection.java (renamed from src/com/ctreber/acearth/projection/Projection.java)10
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/projection/ProjectionCyl.java (renamed from src/com/ctreber/acearth/projection/ProjectionCyl.java)6
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/projection/ProjectionMerc.java (renamed from src/com/ctreber/acearth/projection/ProjectionMerc.java)6
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/projection/ProjectionOrtho.java (renamed from src/com/ctreber/acearth/projection/ProjectionOrtho.java)6
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/renderer/RenderTarget.java (renamed from src/com/ctreber/acearth/renderer/RenderTarget.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/renderer/Renderer.java (renamed from src/com/ctreber/acearth/renderer/Renderer.java)4
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/renderer/RowTypeRenderer.java (renamed from src/com/ctreber/acearth/renderer/RowTypeRenderer.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/renderer/RowTypeRendererScanBit.java (renamed from src/com/ctreber/acearth/renderer/RowTypeRendererScanBit.java)6
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/renderer/RowTypeRendererScanDot.java (renamed from src/com/ctreber/acearth/renderer/RowTypeRendererScanDot.java)6
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/scanbit/BitGeneratorMap.java (renamed from src/com/ctreber/acearth/scanbit/BitGeneratorMap.java)16
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/scanbit/BitGeneratorMapDefault.java (renamed from src/com/ctreber/acearth/scanbit/BitGeneratorMapDefault.java)10
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/scanbit/BitGeneratorMapOrtho.java (renamed from src/com/ctreber/acearth/scanbit/BitGeneratorMapOrtho.java)10
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/scanbit/ScanBit.java (renamed from src/com/ctreber/acearth/scanbit/ScanBit.java)4
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/scanbit/ScanBitGenerator.java (renamed from src/com/ctreber/acearth/scanbit/ScanBitGenerator.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/scanbit/ScanBuf.java (renamed from src/com/ctreber/acearth/scanbit/ScanBuf.java)6
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/scandot/DotGeneratorLines.java (renamed from src/com/ctreber/acearth/scandot/DotGeneratorLines.java)10
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/scandot/DotGeneratorStars.java (renamed from src/com/ctreber/acearth/scandot/DotGeneratorStars.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/scandot/ScanDot.java (renamed from src/com/ctreber/acearth/scandot/ScanDot.java)4
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/scandot/ScanDotGenerator.java (renamed from src/com/ctreber/acearth/scandot/ScanDotGenerator.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/shader/Shader.java (renamed from src/com/ctreber/acearth/shader/Shader.java)10
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/shader/ShaderDefault.java (renamed from src/com/ctreber/acearth/shader/ShaderDefault.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/shader/ShaderFlat.java (renamed from src/com/ctreber/acearth/shader/ShaderFlat.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/shader/ShaderOrtho.java (renamed from src/com/ctreber/acearth/shader/ShaderOrtho.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/util/Coordinate.java (renamed from src/com/ctreber/acearth/util/Coordinate.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/util/EdgeCrossing.java (renamed from src/com/ctreber/acearth/util/EdgeCrossing.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/util/Point2D.java (renamed from src/com/ctreber/acearth/util/Point2D.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/util/Point3D.java (renamed from src/com/ctreber/acearth/util/Point3D.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/util/Polygon.java (renamed from src/com/ctreber/acearth/util/Polygon.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/util/StringParser.java (renamed from src/com/ctreber/acearth/util/StringParser.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/util/SunPositionCalculator.java (renamed from src/com/ctreber/acearth/util/SunPositionCalculator.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/acearth/util/Toolkit.java (renamed from src/com/ctreber/acearth/util/Toolkit.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/aclib/gui/MOBoolean.java (renamed from src/com/ctreber/aclib/gui/MOBoolean.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/aclib/gui/MOChangeListener.java (renamed from src/com/ctreber/aclib/gui/MOChangeListener.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/aclib/gui/MODouble.java (renamed from src/com/ctreber/aclib/gui/MODouble.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/aclib/gui/MOEnum.java (renamed from src/com/ctreber/aclib/gui/MOEnum.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/aclib/gui/MOInteger.java (renamed from src/com/ctreber/aclib/gui/MOInteger.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/aclib/gui/MOString.java (renamed from src/com/ctreber/aclib/gui/MOString.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/aclib/gui/MonitoredObject.java (renamed from src/com/ctreber/aclib/gui/MonitoredObject.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/aclib/sort/CTSort.java (renamed from src/com/ctreber/aclib/sort/CTSort.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/aclib/sort/DefaultComparator.java (renamed from src/com/ctreber/aclib/sort/DefaultComparator.java)2
-rw-r--r--src/ext/plantuml/com/ctreber/aclib/sort/QuickSort.java (renamed from src/com/ctreber/aclib/sort/QuickSort.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/BarcodeFormat.java (renamed from src/com/google/zxing/BarcodeFormat.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/ChecksumException.java (renamed from src/com/google/zxing/ChecksumException.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/DecodeHintType.java (renamed from src/com/google/zxing/DecodeHintType.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/EncodeHintType.java (renamed from src/com/google/zxing/EncodeHintType.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/FormatException.java (renamed from src/com/google/zxing/FormatException.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/NotFoundException.java (renamed from src/com/google/zxing/NotFoundException.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/ReaderException.java (renamed from src/com/google/zxing/ReaderException.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/ResultPoint.java (renamed from src/com/google/zxing/ResultPoint.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/Writer.java (renamed from src/com/google/zxing/Writer.java)4
-rw-r--r--src/ext/plantuml/com/google/zxing/WriterException.java (renamed from src/com/google/zxing/WriterException.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/client/j2se/MatrixToImageWriter.java (renamed from src/com/google/zxing/client/j2se/MatrixToImageWriter.java)4
-rw-r--r--src/ext/plantuml/com/google/zxing/common/BitArray.java (renamed from src/com/google/zxing/common/BitArray.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/common/BitMatrix.java (renamed from src/com/google/zxing/common/BitMatrix.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/common/BitSource.java (renamed from src/com/google/zxing/common/BitSource.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/common/CharacterSetECI.java (renamed from src/com/google/zxing/common/CharacterSetECI.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/common/DecoderResult.java (renamed from src/com/google/zxing/common/DecoderResult.java)4
-rw-r--r--src/ext/plantuml/com/google/zxing/common/DetectorResult.java (renamed from src/com/google/zxing/common/DetectorResult.java)4
-rw-r--r--src/ext/plantuml/com/google/zxing/common/ECI.java (renamed from src/com/google/zxing/common/ECI.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/common/StringUtils.java (renamed from src/com/google/zxing/common/StringUtils.java)4
-rw-r--r--src/ext/plantuml/com/google/zxing/common/reedsolomon/GF256.java (renamed from src/com/google/zxing/common/reedsolomon/GF256.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/common/reedsolomon/GF256Poly.java (renamed from src/com/google/zxing/common/reedsolomon/GF256Poly.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/common/reedsolomon/ReedSolomonEncoder.java (renamed from src/com/google/zxing/common/reedsolomon/ReedSolomonEncoder.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/common/reedsolomon/ReedSolomonException.java (renamed from src/com/google/zxing/common/reedsolomon/ReedSolomonException.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/datamatrix/decoder/BitMatrixParser.java (renamed from src/com/google/zxing/datamatrix/decoder/BitMatrixParser.java)6
-rw-r--r--src/ext/plantuml/com/google/zxing/datamatrix/decoder/DataBlock.java (renamed from src/com/google/zxing/datamatrix/decoder/DataBlock.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/datamatrix/decoder/Version.java (renamed from src/com/google/zxing/datamatrix/decoder/Version.java)4
-rw-r--r--src/ext/plantuml/com/google/zxing/qrcode/QRCodeWriter.java (renamed from src/com/google/zxing/qrcode/QRCodeWriter.java)20
-rw-r--r--src/ext/plantuml/com/google/zxing/qrcode/decoder/BitMatrixParser.java (renamed from src/com/google/zxing/qrcode/decoder/BitMatrixParser.java)6
-rw-r--r--src/ext/plantuml/com/google/zxing/qrcode/decoder/DataBlock.java (renamed from src/com/google/zxing/qrcode/decoder/DataBlock.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/qrcode/decoder/DataMask.java (renamed from src/com/google/zxing/qrcode/decoder/DataMask.java)4
-rw-r--r--src/ext/plantuml/com/google/zxing/qrcode/decoder/ErrorCorrectionLevel.java (renamed from src/com/google/zxing/qrcode/decoder/ErrorCorrectionLevel.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/qrcode/decoder/FormatInformation.java (renamed from src/com/google/zxing/qrcode/decoder/FormatInformation.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/qrcode/decoder/Mode.java (renamed from src/com/google/zxing/qrcode/decoder/Mode.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/qrcode/decoder/Version.java (renamed from src/com/google/zxing/qrcode/decoder/Version.java)6
-rw-r--r--src/ext/plantuml/com/google/zxing/qrcode/encoder/BlockPair.java (renamed from src/com/google/zxing/qrcode/encoder/BlockPair.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/qrcode/encoder/ByteMatrix.java (renamed from src/com/google/zxing/qrcode/encoder/ByteMatrix.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/qrcode/encoder/Encoder.java (renamed from src/com/google/zxing/qrcode/encoder/Encoder.java)22
-rw-r--r--src/ext/plantuml/com/google/zxing/qrcode/encoder/MaskUtil.java (renamed from src/com/google/zxing/qrcode/encoder/MaskUtil.java)2
-rw-r--r--src/ext/plantuml/com/google/zxing/qrcode/encoder/MatrixUtil.java (renamed from src/com/google/zxing/qrcode/encoder/MatrixUtil.java)8
-rw-r--r--src/ext/plantuml/com/google/zxing/qrcode/encoder/QRCode.java (renamed from src/com/google/zxing/qrcode/encoder/QRCode.java)6
-rw-r--r--src/gen/lib/cdt/dtdisc__c.java15
-rw-r--r--src/gen/lib/cgraph/graph__c.java3
-rw-r--r--src/gen/lib/common/arrows__c.java5
-rw-r--r--src/gen/lib/common/emit__c.java5
-rw-r--r--src/gen/lib/common/labels__c.java4
-rw-r--r--src/gen/lib/common/postproc__c.java356
-rw-r--r--src/gen/lib/common/routespl__c.java19
-rw-r--r--src/gen/lib/common/splines__c.java11
-rw-r--r--src/gen/lib/common/utils__c.java53
-rw-r--r--src/gen/lib/dotgen/decomp__c.java3
-rw-r--r--src/gen/lib/dotgen/dotsplines__c.java7
-rw-r--r--src/gen/lib/gvc/gvc__c.java8
-rw-r--r--src/gen/lib/gvc/gvconfig__c.java241
-rw-r--r--src/gen/lib/gvc/gvusershape__c.java977
-rw-r--r--src/gen/lib/gvc/regex_win32__c.java3083
-rw-r--r--src/gen/lib/label/index__c.java140
-rw-r--r--src/gen/lib/label/node__c.java13
-rw-r--r--src/gen/lib/label/xlabels__c.java49
-rw-r--r--src/gen/lib/pathplan/route__c.java5
-rw-r--r--src/gen/lib/pathplan/shortest__c.java3
-rw-r--r--src/h/STArray.java156
-rw-r--r--src/h/STStarArrayOfPointer.java117
-rw-r--r--src/h/ST_Agattr_s.java125
-rw-r--r--src/h/ST_Agcbstack_s.java80
-rw-r--r--src/h/ST_Agclos_s.java203
-rw-r--r--src/h/ST_Agdatadict_s.java139
-rw-r--r--src/h/ST_Agdesc_s.java1
-rw-r--r--src/h/ST_Agdisc_s.java113
-rw-r--r--src/h/ST_Agdstate_s.java108
-rw-r--r--src/h/ST_Agedge_s.java315
-rw-r--r--src/h/ST_Agedgeinfo_t.java368
-rw-r--r--src/h/ST_Agedgepair_s.java97
-rw-r--r--src/h/ST_Agiddisc_s.java50
-rw-r--r--src/h/ST_Agiodisc_s.java105
-rw-r--r--src/h/ST_Agmemdisc_s.java23
-rw-r--r--src/h/ST_Agnode_s.java231
-rw-r--r--src/h/ST_Agnodeinfo_t.java519
-rw-r--r--src/h/ST_Agobj_s.java187
-rw-r--r--src/h/ST_Agraph_s.java341
-rw-r--r--src/h/ST_Agraphinfo_t.java592
-rw-r--r--src/h/ST_Agrec_s.java197
-rw-r--r--src/h/ST_Agsubnode_s.java238
-rw-r--r--src/h/ST_Agsym_s.java218
-rw-r--r--src/h/ST_EMPTY.java73
-rw-r--r--src/h/ST_GVCOMMON_t.java142
-rw-r--r--src/h/ST_GVC_s.java212
-rw-r--r--src/h/ST_HDict_t.java91
-rw-r--r--src/h/ST_IMapEntry_t.java93
-rw-r--r--src/h/ST_Node_t___.java90
-rw-r--r--src/h/ST_Pedge_t.java135
-rw-r--r--src/h/ST_Ppoly_t.java258
-rw-r--r--src/h/ST_RTree.java165
-rw-r--r--src/h/ST_XLabels_t.java116
-rw-r--r--src/h/ST_adjmatrix_t.java139
-rw-r--r--src/h/ST_aspect_t.java133
-rw-r--r--src/h/ST_bezier.java251
-rw-r--r--src/h/ST_boxf.java35
-rw-r--r--src/h/ST_deque_t.java133
-rw-r--r--src/h/ST_dt_s.java206
-rw-r--r--src/h/ST_dtdata_s.java183
-rw-r--r--src/h/ST_dtdisc_s.java13
-rw-r--r--src/h/ST_dthold_s.java115
-rw-r--r--src/h/ST_dtlink_s.java227
-rw-r--r--src/h/ST_dtmethod_s.java47
-rw-r--r--src/h/ST_fontinfo.java164
-rw-r--r--src/h/ST_gvlayout_engine_s.java117
-rw-r--r--src/h/ST_gvlayout_features_t.java90
-rw-r--r--src/h/ST_gvplugin_active_layout_t.java104
-rw-r--r--src/h/ST_gvplugin_installed_t.java140
-rw-r--r--src/h/ST_inside_t.java150
-rw-r--r--src/h/ST_label_params_t.java110
-rw-r--r--src/h/ST_layout_t.java192
-rw-r--r--src/h/ST_nodequeue.java145
-rw-r--r--src/h/ST_object_t.java168
-rw-r--r--src/h/ST_pack_info.java161
-rw-r--r--src/h/ST_path.java160
-rw-r--r--src/h/ST_pathend_t.java210
-rw-r--r--src/h/ST_point.java122
-rw-r--r--src/h/ST_pointf.java41
-rw-r--r--src/h/ST_pointnlink_t.java233
-rw-r--r--src/h/ST_polygon_t.java221
-rw-r--r--src/h/ST_port.java2
-rw-r--r--src/h/ST_rank_t.java375
-rw-r--r--src/h/ST_refstr_t.java190
-rw-r--r--src/h/ST_shape_desc.java128
-rw-r--r--src/h/ST_shape_functions.java160
-rw-r--r--src/h/ST_splineInfo.java138
-rw-r--r--src/h/ST_spline_info_t.java153
-rw-r--r--src/h/ST_splines.java133
-rw-r--r--src/h/ST_tedge_t.java206
-rw-r--r--src/h/ST_textfont_t.java104
-rw-r--r--src/h/ST_textlabel_t.java275
-rw-r--r--src/h/ST_textspan_t.java153
-rw-r--r--src/h/ST_tna_t.java180
-rw-r--r--src/h/ST_triangle_t.java179
-rw-r--r--src/h/ST_xlabel_t.java161
-rw-r--r--src/h/WithParent.java54
-rw-r--r--src/h/_Node_t___.java (renamed from src/h/_Note_t___.java)2
-rw-r--r--src/net/sourceforge/plantuml/AbstractPSystem.java13
-rw-r--r--src/net/sourceforge/plantuml/AlignmentParam.java (renamed from src/net/sourceforge/plantuml/AlignParam.java)14
-rw-r--r--src/net/sourceforge/plantuml/Annotated.java5
-rw-r--r--src/net/sourceforge/plantuml/AnnotatedWorker.java53
-rw-r--r--src/net/sourceforge/plantuml/BackSlash.java11
-rw-r--r--src/net/sourceforge/plantuml/BasicEnsureVisible.java4
-rw-r--r--src/net/sourceforge/plantuml/BlockUml.java6
-rw-r--r--src/net/sourceforge/plantuml/BlockUmlBuilder.java35
-rw-r--r--src/net/sourceforge/plantuml/CMapData.java8
-rw-r--r--src/net/sourceforge/plantuml/CharSequence2Impl.java31
-rw-r--r--src/net/sourceforge/plantuml/ClipboardLoop.java122
-rw-r--r--src/net/sourceforge/plantuml/ColorParam.java30
-rw-r--r--src/net/sourceforge/plantuml/CornerParam.java55
-rw-r--r--src/net/sourceforge/plantuml/Dimension2DDouble.java7
-rw-r--r--src/net/sourceforge/plantuml/EmptyImageBuilder.java6
-rw-r--r--src/net/sourceforge/plantuml/FileFormat.java76
-rw-r--r--src/net/sourceforge/plantuml/FileFormatOption.java28
-rw-r--r--src/net/sourceforge/plantuml/FileImageData.java10
-rw-r--r--src/net/sourceforge/plantuml/FileUtils.java51
-rw-r--r--src/net/sourceforge/plantuml/FontParam.java12
-rw-r--r--src/net/sourceforge/plantuml/GeneratedImage.java2
-rw-r--r--src/net/sourceforge/plantuml/GeneratedImageImpl.java8
-rw-r--r--src/net/sourceforge/plantuml/ISkinParam.java24
-rw-r--r--src/net/sourceforge/plantuml/ISourceFileReader.java5
-rw-r--r--src/net/sourceforge/plantuml/ImageSelection.java64
-rw-r--r--src/net/sourceforge/plantuml/LineBreakStrategy.java6
-rw-r--r--src/net/sourceforge/plantuml/LineLocationImpl.java6
-rw-r--r--src/net/sourceforge/plantuml/LineParam.java7
-rw-r--r--src/net/sourceforge/plantuml/Option.java61
-rw-r--r--src/net/sourceforge/plantuml/OptionFlags.java57
-rw-r--r--src/net/sourceforge/plantuml/OptionPreprocOutputMode.java41
-rw-r--r--src/net/sourceforge/plantuml/OptionPrint.java7
-rw-r--r--src/net/sourceforge/plantuml/PSystemBuilder.java5
-rw-r--r--src/net/sourceforge/plantuml/PSystemError.java97
-rw-r--r--src/net/sourceforge/plantuml/PSystemUtils.java86
-rw-r--r--src/net/sourceforge/plantuml/Pipe.java16
-rw-r--r--src/net/sourceforge/plantuml/Run.java128
-rw-r--r--src/net/sourceforge/plantuml/SignatureUtils.java85
-rw-r--r--src/net/sourceforge/plantuml/SkinParam.java206
-rw-r--r--src/net/sourceforge/plantuml/SkinParamDelegator.java36
-rw-r--r--src/net/sourceforge/plantuml/SourceFileReader.java148
-rw-r--r--src/net/sourceforge/plantuml/SourceFileReader2.java74
-rw-r--r--src/net/sourceforge/plantuml/SourceFileReaderAbstract.java176
-rw-r--r--src/net/sourceforge/plantuml/SourceStringReader.java2
-rw-r--r--src/net/sourceforge/plantuml/StringUtils.java19
-rw-r--r--src/net/sourceforge/plantuml/SuggestedFile.java4
-rw-r--r--src/net/sourceforge/plantuml/SvgString.java5
-rw-r--r--src/net/sourceforge/plantuml/TikzFontDistortion.java86
-rw-r--r--src/net/sourceforge/plantuml/UmlDiagram.java38
-rw-r--r--src/net/sourceforge/plantuml/Url.java5
-rw-r--r--src/net/sourceforge/plantuml/WithSprite.java44
-rw-r--r--src/net/sourceforge/plantuml/acearth/PSystemXearth.java6
-rw-r--r--src/net/sourceforge/plantuml/acearth/PSystemXearthFactory.java2
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram/ActivityDiagram.java11
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkActivity.java24
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkLongActivity.java33
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram/command/CommandPartition.java6
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagram3.java27
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagramFactory3.java2
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/Branch.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/InstructionList.java11
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/InstructionRepeat.java13
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/InstructionSpot.java (renamed from src/net/sourceforge/plantuml/code/CompressionGZip.java)66
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivityLong3.java2
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandArrow3.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandArrowLong3.java2
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandCircleSpot3.java64
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandNoteLong3.java2
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java20
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeatWhile3Multilines.java2
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java35
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/CollisionDetector.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileAssemblySimple.java17
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileBreak.java5
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileEmpty.java7
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactory.java7
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java14
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileGoto.java5
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileHeightFixed.java3
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileKilled.java3
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMarged.java3
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMargedRight.java3
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMargedVertically.java9
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/Snake.java14
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlane.java10
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlanes.java133
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/SwimlanesA.java309
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/SwimlanesB.java112
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/SwimlanesC.java89
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/TextBlockInterceptorUDrawable.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java18
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/WormMutation.java6
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/Zad.java74
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/ZadBuilder.java (renamed from src/net/sourceforge/plantuml/ugraphic/SlotFinder.java)100
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorRepeat.java12
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorWhile.java50
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInner.java3
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInnerOverlapped.java3
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java26
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java3
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfDown.java3
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongHorizontal.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongVertical.java3
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileNoteAlone.java3
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileRepeat.java18
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSplit1.java3
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWhile.java23
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java3
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNotes.java3
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit2.java3
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java13
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java16
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfNude.java3
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java3
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java13
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleEnd.java3
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleSpot.java119
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStart.java3
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStop.java3
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamond.java3
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondFoo1.java3
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside.java3
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside2.java3
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside3.java3
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileThinSplit.java4
-rw-r--r--src/net/sourceforge/plantuml/ant/PlantUmlTask.java8
-rw-r--r--src/net/sourceforge/plantuml/api/INumberAnalyzed.java2
-rw-r--r--src/net/sourceforge/plantuml/api/ImageDataAbstract.java73
-rw-r--r--src/net/sourceforge/plantuml/api/ImageDataComplex.java21
-rw-r--r--src/net/sourceforge/plantuml/api/ImageDataSimple.java32
-rw-r--r--src/net/sourceforge/plantuml/api/NumberAnalyzed.java13
-rw-r--r--src/net/sourceforge/plantuml/api/NumberAnalyzed2.java12
-rw-r--r--src/net/sourceforge/plantuml/asciiart/BasicCharAreaImpl.java26
-rw-r--r--src/net/sourceforge/plantuml/asciiart/ComponentTextActor.java2
-rw-r--r--src/net/sourceforge/plantuml/asciiart/ComponentTextArrow.java4
-rw-r--r--src/net/sourceforge/plantuml/asciiart/ComponentTextDelay.java4
-rw-r--r--src/net/sourceforge/plantuml/asciiart/ComponentTextDivider.java4
-rw-r--r--src/net/sourceforge/plantuml/asciiart/ComponentTextGroupingHeader.java2
-rw-r--r--src/net/sourceforge/plantuml/asciiart/ComponentTextNote.java2
-rw-r--r--src/net/sourceforge/plantuml/asciiart/ComponentTextParticipant.java2
-rw-r--r--src/net/sourceforge/plantuml/asciiart/ComponentTextSelfArrow.java2
-rw-r--r--src/net/sourceforge/plantuml/asciiart/ComponentTextShape.java2
-rw-r--r--src/net/sourceforge/plantuml/asciiart/Wcwidth.java253
-rw-r--r--src/net/sourceforge/plantuml/bpm/BpmElement.java5
-rw-r--r--src/net/sourceforge/plantuml/bpm/ConnectorPuzzleEmpty.java6
-rw-r--r--src/net/sourceforge/plantuml/braille/UGraphicBraille.java3
-rw-r--r--src/net/sourceforge/plantuml/brotli/BitReader.java269
-rw-r--r--src/net/sourceforge/plantuml/brotli/BrotliInputStream.java150
-rw-r--r--src/net/sourceforge/plantuml/brotli/BrotliRuntimeException.java21
-rw-r--r--src/net/sourceforge/plantuml/brotli/Context.java58
-rw-r--r--src/net/sourceforge/plantuml/brotli/Decode.java1002
-rw-r--r--src/net/sourceforge/plantuml/brotli/Dictionary.java54
-rw-r--r--src/net/sourceforge/plantuml/brotli/DictionaryData.java55
-rw-r--r--src/net/sourceforge/plantuml/brotli/Huffman.java132
-rw-r--r--src/net/sourceforge/plantuml/brotli/State.java87
-rw-r--r--src/net/sourceforge/plantuml/brotli/Transform.java115
-rw-r--r--src/net/sourceforge/plantuml/brotli/Utils.java74
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/ClassDiagram.java126
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/ClassDiagramFactory.java27
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java4
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java44
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandCreateElementFull2.java4
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandHideShow2.java67
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandHideShowSpecificClass.java35
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandHideShowSpecificStereotype.java9
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java125
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandRemoveRestore.java67
-rw-r--r--src/net/sourceforge/plantuml/code/ArobaseStringCompressor.java3
-rw-r--r--src/net/sourceforge/plantuml/code/ArobaseStringCompressor2.java62
-rw-r--r--src/net/sourceforge/plantuml/code/AsciiEncoder.java50
-rw-r--r--src/net/sourceforge/plantuml/code/AsciiEncoderBase64.java147
-rw-r--r--src/net/sourceforge/plantuml/code/AsciiEncoderFinalZeros.java66
-rw-r--r--src/net/sourceforge/plantuml/code/AsciiEncoderHex.java62
-rw-r--r--src/net/sourceforge/plantuml/code/CompressionBrotli.java60
-rw-r--r--src/net/sourceforge/plantuml/code/CompressionZlib.java8
-rw-r--r--src/net/sourceforge/plantuml/code/CompressionZopfliZlib.java65
-rw-r--r--src/net/sourceforge/plantuml/code/PairInt.java69
-rw-r--r--src/net/sourceforge/plantuml/code/Spiral.java67
-rw-r--r--src/net/sourceforge/plantuml/code/SpiralOnRectangle.java65
-rw-r--r--src/net/sourceforge/plantuml/code/TranscoderImpl.java18
-rw-r--r--src/net/sourceforge/plantuml/code/TranscoderSmart.java57
-rw-r--r--src/net/sourceforge/plantuml/code/TranscoderSmart2.java109
-rw-r--r--src/net/sourceforge/plantuml/code/TranscoderUtil.java4
-rw-r--r--src/net/sourceforge/plantuml/command/BlocLines.java43
-rw-r--r--src/net/sourceforge/plantuml/command/CommandCaption.java2
-rw-r--r--src/net/sourceforge/plantuml/command/CommandComment.java2
-rw-r--r--src/net/sourceforge/plantuml/command/CommandFooter.java6
-rw-r--r--src/net/sourceforge/plantuml/command/CommandHeader.java6
-rw-r--r--src/net/sourceforge/plantuml/command/CommandMultilines2.java25
-rw-r--r--src/net/sourceforge/plantuml/command/CommandMultilines3.java8
-rw-r--r--src/net/sourceforge/plantuml/command/CommandMultilinesComment.java2
-rw-r--r--src/net/sourceforge/plantuml/command/CommandMultilinesFooter.java5
-rw-r--r--src/net/sourceforge/plantuml/command/CommandMultilinesHeader.java5
-rw-r--r--src/net/sourceforge/plantuml/command/CommandMultilinesLegend.java4
-rw-r--r--src/net/sourceforge/plantuml/command/CommandMultilinesTitle.java2
-rw-r--r--src/net/sourceforge/plantuml/command/CommandNamespace.java5
-rw-r--r--src/net/sourceforge/plantuml/command/CommandPackage.java16
-rw-r--r--src/net/sourceforge/plantuml/command/CommandPackageEmpty.java9
-rw-r--r--src/net/sourceforge/plantuml/command/CommandScale.java15
-rw-r--r--src/net/sourceforge/plantuml/command/CommandScaleMaxHeight.java6
-rw-r--r--src/net/sourceforge/plantuml/command/CommandScaleMaxWidth.java6
-rw-r--r--src/net/sourceforge/plantuml/command/CommandScaleMaxWidthAndHeight.java6
-rw-r--r--src/net/sourceforge/plantuml/command/CommandScaleWidthAndHeight.java6
-rw-r--r--src/net/sourceforge/plantuml/command/CommandScaleWidthOrHeight.java6
-rw-r--r--src/net/sourceforge/plantuml/command/CommandSkinParamMultilines.java1
-rw-r--r--src/net/sourceforge/plantuml/command/CommandSpriteFile.java2
-rw-r--r--src/net/sourceforge/plantuml/command/CommandTitle.java3
-rw-r--r--src/net/sourceforge/plantuml/command/FactorySpriteCommand.java43
-rw-r--r--src/net/sourceforge/plantuml/command/Position.java4
-rw-r--r--src/net/sourceforge/plantuml/command/ProtectedCommand.java7
-rw-r--r--src/net/sourceforge/plantuml/command/SingleLineCommand.java2
-rw-r--r--src/net/sourceforge/plantuml/command/SingleLineCommand2.java30
-rw-r--r--src/net/sourceforge/plantuml/command/UmlDiagramFactory.java141
-rw-r--r--src/net/sourceforge/plantuml/command/UmlDiagramFactoryOld.java374
-rw-r--r--src/net/sourceforge/plantuml/command/note/FactoryNoteActivityCommand.java2
-rw-r--r--src/net/sourceforge/plantuml/command/note/FactoryNoteCommand.java10
-rw-r--r--src/net/sourceforge/plantuml/command/note/FactoryNoteOnEntityCommand.java16
-rw-r--r--src/net/sourceforge/plantuml/command/note/FactoryNoteOnLinkCommand.java2
-rw-r--r--src/net/sourceforge/plantuml/command/note/FactoryTipOnEntityCommand.java2
-rw-r--r--src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteCommand.java3
-rw-r--r--src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteOnArrowCommand.java30
-rw-r--r--src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteOverSeveralCommand.java2
-rw-r--r--src/net/sourceforge/plantuml/command/regex/Matcher2.java24
-rw-r--r--src/net/sourceforge/plantuml/compositediagram/command/CommandCreatePackageBlock.java4
-rw-r--r--src/net/sourceforge/plantuml/compositediagram/command/CommandLinkBlock.java10
-rw-r--r--src/net/sourceforge/plantuml/core/DiagramType.java5
-rw-r--r--src/net/sourceforge/plantuml/core/ImageData.java2
-rw-r--r--src/net/sourceforge/plantuml/creole/AtomEmbededSystem.java19
-rw-r--r--src/net/sourceforge/plantuml/creole/AtomHorizontalTexts.java (renamed from src/net/sourceforge/plantuml/graphic/TextBlockCompressed2.java)47
-rw-r--r--src/net/sourceforge/plantuml/creole/AtomImg.java26
-rw-r--r--src/net/sourceforge/plantuml/creole/AtomMath.java3
-rw-r--r--src/net/sourceforge/plantuml/creole/AtomOpenIcon.java15
-rw-r--r--src/net/sourceforge/plantuml/creole/AtomSprite.java18
-rw-r--r--src/net/sourceforge/plantuml/creole/AtomText.java59
-rw-r--r--src/net/sourceforge/plantuml/creole/AtomVerticalTexts.java (renamed from src/net/sourceforge/plantuml/creole/AtomTexts.java)10
-rw-r--r--src/net/sourceforge/plantuml/creole/CommandCreoleImg.java2
-rw-r--r--src/net/sourceforge/plantuml/creole/CreoleParser.java4
-rw-r--r--src/net/sourceforge/plantuml/creole/Fission.java2
-rw-r--r--src/net/sourceforge/plantuml/creole/StripeSimple.java2
-rw-r--r--src/net/sourceforge/plantuml/creole/StripeTable.java25
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/Bodier.java13
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced.java18
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced2.java7
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/Code.java54
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java182
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/Display.java44
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/DisplayPositionned.java11
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/DisplaySection.java105
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/GroupRoot.java11
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/GroupType.java5
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/HideOrShow2.java102
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/IEntity.java6
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/LeafType.java2
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/Link.java75
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/LinkMiddleDecor.java11
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/LinkStyle.java112
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/LinkType.java76
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java3
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/Namespace.java32
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/NamespaceStrategy.java42
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/Stereotag.java77
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/Stereotype.java27
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/WithLinkType.java122
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramTxtMaker.java80
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizLinux.java7
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizUtils.java14
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersion.java6
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersionFinder.java15
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java48
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/entity/EntityImpl.java86
-rw-r--r--src/net/sourceforge/plantuml/dedication/1.pngbin0 -> 34884 bytes
-rw-r--r--src/net/sourceforge/plantuml/dedication/Dedication.java17
-rw-r--r--src/net/sourceforge/plantuml/dedication/Dedications.java1
-rw-r--r--src/net/sourceforge/plantuml/dedication/QBlock.java34
-rw-r--r--src/net/sourceforge/plantuml/dedication/QBlocks.java38
-rw-r--r--src/net/sourceforge/plantuml/dedication/TurningBytes.java2
-rw-r--r--src/net/sourceforge/plantuml/descdiagram/BoxedCharacter.java94
-rw-r--r--src/net/sourceforge/plantuml/descdiagram/CommandCreateDomain.java144
-rw-r--r--src/net/sourceforge/plantuml/descdiagram/DescriptionDiagram.java16
-rw-r--r--src/net/sourceforge/plantuml/descdiagram/DescriptionDiagramFactory.java8
-rw-r--r--src/net/sourceforge/plantuml/descdiagram/EntityImageDesignedDomain.java164
-rw-r--r--src/net/sourceforge/plantuml/descdiagram/EntityImageDomain.java174
-rw-r--r--src/net/sourceforge/plantuml/descdiagram/EntityImageMachine.java163
-rw-r--r--src/net/sourceforge/plantuml/descdiagram/EntityImageRequirement.java203
-rw-r--r--src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementFull.java12
-rw-r--r--src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementMultilines.java26
-rw-r--r--src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java57
-rw-r--r--src/net/sourceforge/plantuml/descdiagram/command/CommandPackageWithUSymbol.java31
-rw-r--r--src/net/sourceforge/plantuml/directdot/PSystemDot.java21
-rw-r--r--src/net/sourceforge/plantuml/ditaa/PSystemDitaa.java6
-rw-r--r--src/net/sourceforge/plantuml/donors/PSystemDonors.java31
-rw-r--r--src/net/sourceforge/plantuml/donors/PSystemSkinparameterList.java111
-rw-r--r--src/net/sourceforge/plantuml/donors/PSystemSkinparameterListFactory.java51
-rw-r--r--src/net/sourceforge/plantuml/eps/EpsGraphics.java23
-rw-r--r--src/net/sourceforge/plantuml/flashcode/FlashCodeUtilsZxing.java14
-rw-r--r--src/net/sourceforge/plantuml/flowdiagram/FlowDiagram.java12
-rw-r--r--src/net/sourceforge/plantuml/fun/IconLoader.java2
-rw-r--r--src/net/sourceforge/plantuml/fun/sprite000.pngbin223 -> 116 bytes
-rw-r--r--src/net/sourceforge/plantuml/fun/sprite001.pngbin229 -> 134 bytes
-rw-r--r--src/net/sourceforge/plantuml/fun/sprite002.pngbin227 -> 108 bytes
-rw-r--r--src/net/sourceforge/plantuml/fun/sprite003.pngbin309 -> 193 bytes
-rw-r--r--src/net/sourceforge/plantuml/fun/sprite004.pngbin236 -> 150 bytes
-rw-r--r--src/net/sourceforge/plantuml/fun/sprite005.pngbin216 -> 126 bytes
-rw-r--r--src/net/sourceforge/plantuml/fun/sprite006.pngbin249 -> 141 bytes
-rw-r--r--src/net/sourceforge/plantuml/fun/sprite007.pngbin338 -> 161 bytes
-rw-r--r--src/net/sourceforge/plantuml/fun/sprite008.pngbin534 -> 181 bytes
-rw-r--r--src/net/sourceforge/plantuml/fun/sprite009.pngbin223 -> 124 bytes
-rw-r--r--src/net/sourceforge/plantuml/fun/sprite010.pngbin240 -> 133 bytes
-rw-r--r--src/net/sourceforge/plantuml/fun/sprite011.pngbin285 -> 160 bytes
-rw-r--r--src/net/sourceforge/plantuml/fun/sprite012.pngbin3112 -> 802 bytes
-rw-r--r--src/net/sourceforge/plantuml/fun/sprite013.pngbin323 -> 160 bytes
-rw-r--r--src/net/sourceforge/plantuml/fun/sprite014.pngbin263 -> 136 bytes
-rw-r--r--src/net/sourceforge/plantuml/fun/sprite015.pngbin245 -> 122 bytes
-rw-r--r--src/net/sourceforge/plantuml/fun/sprite016.pngbin252 -> 134 bytes
-rw-r--r--src/net/sourceforge/plantuml/fun/sprite017.pngbin226 -> 128 bytes
-rw-r--r--src/net/sourceforge/plantuml/fun/sprite018.pngbin272 -> 164 bytes
-rw-r--r--src/net/sourceforge/plantuml/fun/sprite019.pngbin457 -> 199 bytes
-rw-r--r--src/net/sourceforge/plantuml/fun/sprite020.pngbin261 -> 143 bytes
-rw-r--r--src/net/sourceforge/plantuml/fun/sprite021.pngbin0 -> 2040 bytes
-rw-r--r--src/net/sourceforge/plantuml/fun/sprite022.pngbin0 -> 360 bytes
-rw-r--r--src/net/sourceforge/plantuml/fun/sprite023.pngbin0 -> 770 bytes
-rw-r--r--src/net/sourceforge/plantuml/fun/sprite024.pngbin0 -> 1472 bytes
-rw-r--r--src/net/sourceforge/plantuml/graphic/AbstractTextBlock.java6
-rw-r--r--src/net/sourceforge/plantuml/graphic/DateEventUtils.java165
-rw-r--r--src/net/sourceforge/plantuml/graphic/GraphicStrings.java1
-rw-r--r--src/net/sourceforge/plantuml/graphic/HorizontalAlignment.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/HtmlColorAndStyle.java8
-rw-r--r--src/net/sourceforge/plantuml/graphic/HtmlColorAutomatic.java39
-rw-r--r--src/net/sourceforge/plantuml/graphic/HtmlColorSetSimple.java5
-rw-r--r--src/net/sourceforge/plantuml/graphic/Img.java13
-rw-r--r--src/net/sourceforge/plantuml/graphic/QuoteUtils.java29
-rw-r--r--src/net/sourceforge/plantuml/graphic/SkinParameter.java44
-rw-r--r--src/net/sourceforge/plantuml/graphic/Splitter.java2
-rw-r--r--src/net/sourceforge/plantuml/graphic/SymbolContext.java42
-rw-r--r--src/net/sourceforge/plantuml/graphic/TextBlock.java6
-rw-r--r--src/net/sourceforge/plantuml/graphic/TextBlockBordered.java18
-rw-r--r--src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java21
-rw-r--r--src/net/sourceforge/plantuml/graphic/TextBlockTitle.java8
-rw-r--r--src/net/sourceforge/plantuml/graphic/TextBlockUtils.java7
-rw-r--r--src/net/sourceforge/plantuml/graphic/TextBlockWithUrl.java5
-rw-r--r--src/net/sourceforge/plantuml/graphic/UGraphicAddAriaLabel.java64
-rw-r--r--src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java3
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbol.java8
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolArtifact.java22
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolCard.java25
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolCloud.java13
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolCollections.java147
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolComponent1.java14
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolComponent2.java17
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolDatabase.java15
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolFile.java57
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolFolder.java59
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolFrame.java18
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolNode.java6
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolQueue.java6
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolRect.java41
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolSimpleAbstract.java9
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolStack.java32
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolStorage.java12
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolTogether.java6
-rw-r--r--src/net/sourceforge/plantuml/graphic/color/Colors.java19
-rw-r--r--src/net/sourceforge/plantuml/jasic/Jasic.java1672
-rw-r--r--src/net/sourceforge/plantuml/jdot/CucaDiagramFileMakerJDot.java2
-rw-r--r--src/net/sourceforge/plantuml/math/AsciiMath.java6
-rw-r--r--src/net/sourceforge/plantuml/math/PSystemMath.java53
-rw-r--r--src/net/sourceforge/plantuml/math/ScientificEquationSafe.java2
-rw-r--r--src/net/sourceforge/plantuml/mda/MDADiagramImpl.java2
-rw-r--r--src/net/sourceforge/plantuml/objectdiagram/AbstractClassOrObjectDiagram.java78
-rw-r--r--src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObjectMultilines.java2
-rw-r--r--src/net/sourceforge/plantuml/pdf/PdfConverter.java4
-rw-r--r--src/net/sourceforge/plantuml/png/PngIO.java45
-rw-r--r--src/net/sourceforge/plantuml/png/PngIOMetadata.java16
-rw-r--r--src/net/sourceforge/plantuml/png/PngTitler.java26
-rw-r--r--src/net/sourceforge/plantuml/posimo/DecorInterfaceProvider.java12
-rw-r--r--src/net/sourceforge/plantuml/posimo/DotPath.java47
-rw-r--r--src/net/sourceforge/plantuml/posimo/GraphvizSolverB.java41
-rw-r--r--src/net/sourceforge/plantuml/posimo/PathDrawerInterface.java37
-rw-r--r--src/net/sourceforge/plantuml/posimo/data.txt38
-rw-r--r--src/net/sourceforge/plantuml/postit/PostIt.java3
-rw-r--r--src/net/sourceforge/plantuml/postit/PostItDiagram.java4
-rw-r--r--src/net/sourceforge/plantuml/preproc/Define.java4
-rw-r--r--src/net/sourceforge/plantuml/preproc/DefineSignature.java29
-rw-r--r--src/net/sourceforge/plantuml/preproc/Defines.java15
-rw-r--r--src/net/sourceforge/plantuml/preproc/IfManager.java8
-rw-r--r--src/net/sourceforge/plantuml/preproc/Preprocessor.java172
-rw-r--r--src/net/sourceforge/plantuml/preproc/PreprocessorDefine.java201
-rw-r--r--src/net/sourceforge/plantuml/preproc/PreprocessorInclude.java98
-rw-r--r--src/net/sourceforge/plantuml/preproc/ReadLineConcat.java72
-rw-r--r--src/net/sourceforge/plantuml/preproc/ReadLineInstrumented.java98
-rw-r--r--src/net/sourceforge/plantuml/preproc/ReadLineQuoteComment.java86
-rw-r--r--src/net/sourceforge/plantuml/preproc/ReadLineReader.java36
-rw-r--r--src/net/sourceforge/plantuml/preproc/StartDiagramExtractReader.java30
-rw-r--r--src/net/sourceforge/plantuml/preproc/Stdlib.java317
-rw-r--r--src/net/sourceforge/plantuml/preproc/Sub.java61
-rw-r--r--src/net/sourceforge/plantuml/preproc/SubPreprocessor.java185
-rw-r--r--src/net/sourceforge/plantuml/preproc/UncommentReadLine.java21
-rw-r--r--src/net/sourceforge/plantuml/preproc/Variables.java67
-rw-r--r--src/net/sourceforge/plantuml/project/PSystemProject.java7
-rw-r--r--src/net/sourceforge/plantuml/project2/PSystemProject2.java7
-rw-r--r--src/net/sourceforge/plantuml/project2/PSystemProjectFactory2.java4
-rw-r--r--src/net/sourceforge/plantuml/project3/CommandGanttArrow.java83
-rw-r--r--src/net/sourceforge/plantuml/project3/CommandGanttArrow2.java74
-rw-r--r--src/net/sourceforge/plantuml/project3/CommandPage.java63
-rw-r--r--src/net/sourceforge/plantuml/project3/CommandSeparator.java65
-rw-r--r--src/net/sourceforge/plantuml/project3/ComplementClose.java2
-rw-r--r--src/net/sourceforge/plantuml/project3/ComplementColors.java4
-rw-r--r--src/net/sourceforge/plantuml/project3/ComplementDates.java91
-rw-r--r--src/net/sourceforge/plantuml/project3/ComplementInColors2.java56
-rw-r--r--src/net/sourceforge/plantuml/project3/ComplementName.java (renamed from src/net/sourceforge/plantuml/project3/DurationDay.java)17
-rw-r--r--src/net/sourceforge/plantuml/project3/ComplementNamed.java52
-rw-r--r--src/net/sourceforge/plantuml/project3/ComplementSeveralDays.java11
-rw-r--r--src/net/sourceforge/plantuml/project3/ConstantPlan.java58
-rw-r--r--src/net/sourceforge/plantuml/project3/DayAsDate.java34
-rw-r--r--src/net/sourceforge/plantuml/project3/DaysAsDates.java90
-rw-r--r--src/net/sourceforge/plantuml/project3/GCalendar.java6
-rw-r--r--src/net/sourceforge/plantuml/project3/GCalendarSimple.java20
-rw-r--r--src/net/sourceforge/plantuml/project3/GanttArrow.java2
-rw-r--r--src/net/sourceforge/plantuml/project3/GanttDiagram.java333
-rw-r--r--src/net/sourceforge/plantuml/project3/GanttDiagramFactory.java28
-rw-r--r--src/net/sourceforge/plantuml/project3/Instant.java4
-rw-r--r--src/net/sourceforge/plantuml/project3/InstantDay.java10
-rw-r--r--src/net/sourceforge/plantuml/project3/Load.java42
-rw-r--r--src/net/sourceforge/plantuml/project3/LoadInDays.java65
-rw-r--r--src/net/sourceforge/plantuml/project3/LoadPlanable.java (renamed from src/net/sourceforge/plantuml/project3/Duration.java)3
-rw-r--r--src/net/sourceforge/plantuml/project3/NaturalCommand.java6
-rw-r--r--src/net/sourceforge/plantuml/project3/PlanUtils.java52
-rw-r--r--src/net/sourceforge/plantuml/project3/Resource.java (renamed from src/net/sourceforge/plantuml/webp/Portrait.java)69
-rw-r--r--src/net/sourceforge/plantuml/project3/ResourceDraw.java118
-rw-r--r--src/net/sourceforge/plantuml/project3/Resources.java53
-rw-r--r--src/net/sourceforge/plantuml/project3/Solver3.java (renamed from src/net/sourceforge/plantuml/project3/Solver.java)45
-rw-r--r--src/net/sourceforge/plantuml/project3/SubjectDayAsDate.java68
-rw-r--r--src/net/sourceforge/plantuml/project3/SubjectDaysAsDates.java107
-rw-r--r--src/net/sourceforge/plantuml/project3/SubjectResource.java63
-rw-r--r--src/net/sourceforge/plantuml/project3/SubjectTask.java26
-rw-r--r--src/net/sourceforge/plantuml/project3/Task.java8
-rw-r--r--src/net/sourceforge/plantuml/project3/TaskAttribute.java2
-rw-r--r--src/net/sourceforge/plantuml/project3/TaskCode.java5
-rw-r--r--src/net/sourceforge/plantuml/project3/TaskDraw.java104
-rw-r--r--src/net/sourceforge/plantuml/project3/TaskDrawRegular.java174
-rw-r--r--src/net/sourceforge/plantuml/project3/TaskDrawSeparator.java128
-rw-r--r--src/net/sourceforge/plantuml/project3/TaskImpl.java97
-rw-r--r--src/net/sourceforge/plantuml/project3/TaskSeparator.java99
-rw-r--r--src/net/sourceforge/plantuml/project3/TimeScale.java2
-rw-r--r--src/net/sourceforge/plantuml/project3/TimeScaleBasic.java4
-rw-r--r--src/net/sourceforge/plantuml/project3/TimeScaleBasic2.java79
-rw-r--r--src/net/sourceforge/plantuml/project3/TimeScaleWithoutWeekEnd.java4
-rw-r--r--src/net/sourceforge/plantuml/project3/VerbAre.java2
-rw-r--r--src/net/sourceforge/plantuml/project3/VerbHappens.java21
-rw-r--r--src/net/sourceforge/plantuml/project3/VerbIsOff.java74
-rw-r--r--src/net/sourceforge/plantuml/project3/VerbIsOrAre.java96
-rw-r--r--src/net/sourceforge/plantuml/project3/VerbIsOrAreNamed.java70
-rw-r--r--src/net/sourceforge/plantuml/project3/VerbLasts.java4
-rw-r--r--src/net/sourceforge/plantuml/project3/VerbTaskEndsAbsolute.java71
-rw-r--r--src/net/sourceforge/plantuml/project3/VerbTaskStarts.java (renamed from src/net/sourceforge/plantuml/project3/VerbStarts.java)2
-rw-r--r--src/net/sourceforge/plantuml/project3/VerbTaskStartsAbsolute.java71
-rw-r--r--src/net/sourceforge/plantuml/salt/DataSourceImpl.java8
-rw-r--r--src/net/sourceforge/plantuml/salt/Dictionary.java9
-rw-r--r--src/net/sourceforge/plantuml/salt/PSystemSalt.java125
-rw-r--r--src/net/sourceforge/plantuml/salt/PSystemSaltFactory.java2
-rw-r--r--src/net/sourceforge/plantuml/salt/SaltUtils.java115
-rw-r--r--src/net/sourceforge/plantuml/salt/element/ElementButton.java5
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/AbstractMessage.java22
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/AutoNumber.java97
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/DottedNumber.java112
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/Englober.java46
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/GroupingLeaf.java14
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/GroupingStart.java10
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/Note.java33
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/NoteOnMessage.java95
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/Participant.java8
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/SequenceDiagram.java121
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/SequenceDiagramFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandActivate.java34
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandArrow.java11
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumber.java44
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumberIncrement.java74
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumberResume.java34
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumberStop.java2
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandDeactivateShort.java73
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowAny.java7
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowLeft.java1
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowRight.java1
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandGrouping.java5
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipant.java20
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA.java2
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA2.java2
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA3.java2
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA4.java3
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/ArrowAndParticipant.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSet.java2
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSetInitializer.java7
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java41
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramTxtMaker.java50
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/Step1Abstract.java12
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/Step1Message.java20
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/Step1MessageExo.java12
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteLeft.java8
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteRight.java8
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileSelfNoteRight.java8
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/Englobers.java2
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/GroupingTile.java85
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/LifeEventTile.java2
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxFinder.java9
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java27
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/TeozLayer.java6
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/TileBuilder.java9
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/TileParallel.java137
-rw-r--r--src/net/sourceforge/plantuml/skin/AbstractTextualComponent.java14
-rw-r--r--src/net/sourceforge/plantuml/skin/StickMan.java14
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseArrow.java109
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseEnglober.java12
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingHeader.java52
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseNote.java25
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/Rose.java88
-rw-r--r--src/net/sourceforge/plantuml/statediagram/StateDiagram.java15
-rw-r--r--src/net/sourceforge/plantuml/statediagram/StateDiagramFactory.java7
-rw-r--r--src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackageState.java19
-rw-r--r--src/net/sourceforge/plantuml/statediagram/command/CommandLinkState.java18
-rw-r--r--src/net/sourceforge/plantuml/sudoku/GraphicsSudoku.java57
-rw-r--r--src/net/sourceforge/plantuml/sudoku/PSystemSudoku.java14
-rw-r--r--src/net/sourceforge/plantuml/suggest/SuggestEngine.java144
-rw-r--r--src/net/sourceforge/plantuml/svek/Boundary.java3
-rw-r--r--src/net/sourceforge/plantuml/svek/Cluster.java41
-rw-r--r--src/net/sourceforge/plantuml/svek/ClusterDecoration.java10
-rw-r--r--src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java9
-rw-r--r--src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek2InternalImage.java11
-rw-r--r--src/net/sourceforge/plantuml/svek/DecorateEntityImage.java19
-rw-r--r--src/net/sourceforge/plantuml/svek/DotDataImageBuilder.java41
-rw-r--r--src/net/sourceforge/plantuml/svek/DotStringFactory.java27
-rw-r--r--src/net/sourceforge/plantuml/svek/GraphvizCrash.java2
-rw-r--r--src/net/sourceforge/plantuml/svek/GroupPngMakerState.java2
-rw-r--r--src/net/sourceforge/plantuml/svek/HeaderLayout.java2
-rw-r--r--src/net/sourceforge/plantuml/svek/Line.java56
-rw-r--r--src/net/sourceforge/plantuml/svek/Point2DFunction.java44
-rw-r--r--src/net/sourceforge/plantuml/svek/PointListIterator.java46
-rw-r--r--src/net/sourceforge/plantuml/svek/PointListIteratorImpl.java90
-rw-r--r--src/net/sourceforge/plantuml/svek/Shape.java10
-rw-r--r--src/net/sourceforge/plantuml/svek/ShapeType.java2
-rw-r--r--src/net/sourceforge/plantuml/svek/SvekUtils.java111
-rw-r--r--src/net/sourceforge/plantuml/svek/SvgResult.java135
-rw-r--r--src/net/sourceforge/plantuml/svek/UGraphicForSnake.java11
-rw-r--r--src/net/sourceforge/plantuml/svek/YDelta.java59
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityCircle.java21
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCircle.java9
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCrowfoot.java6
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/MiddleCircle.java10
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/MiddleCircleCircled.java14
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/MiddleFactoryCircle.java9
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/MiddleFactoryCircleCircled.java7
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageClass.java12
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageClassHeader2.java109
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java85
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageEmptyPackage.java6
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageNote.java29
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageObject.java3
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageTips.java6
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageUseCase.java10
-rw-r--r--src/net/sourceforge/plantuml/svek/image/Footprint.java13
-rw-r--r--src/net/sourceforge/plantuml/svek/image/Opale.java206
-rw-r--r--src/net/sourceforge/plantuml/svg/SvgGraphics.java69
-rw-r--r--src/net/sourceforge/plantuml/swing/ImageHelper.java20
-rw-r--r--src/net/sourceforge/plantuml/swing/ImageWindow2.java64
-rw-r--r--src/net/sourceforge/plantuml/swing/MainWindow2.java2
-rw-r--r--src/net/sourceforge/plantuml/swing/SpriteWindow.java7
-rw-r--r--src/net/sourceforge/plantuml/syntax/LanguageDescriptor.java27
-rw-r--r--src/net/sourceforge/plantuml/syntax/SyntaxChecker.java12
-rw-r--r--src/net/sourceforge/plantuml/syntax/SyntaxResult.java26
-rw-r--r--src/net/sourceforge/plantuml/tikz/TikzGraphics.java208
-rw-r--r--src/net/sourceforge/plantuml/timingdiagram/CommandDefineStateLong.java74
-rw-r--r--src/net/sourceforge/plantuml/timingdiagram/CommandDefineStateShort.java71
-rw-r--r--src/net/sourceforge/plantuml/timingdiagram/CommandNote.java76
-rw-r--r--src/net/sourceforge/plantuml/timingdiagram/CommandNoteLong.java84
-rw-r--r--src/net/sourceforge/plantuml/timingdiagram/CommandTimeMessage.java14
-rw-r--r--src/net/sourceforge/plantuml/timingdiagram/Histogram.java35
-rw-r--r--src/net/sourceforge/plantuml/timingdiagram/Player.java37
-rw-r--r--src/net/sourceforge/plantuml/timingdiagram/Ribbon.java90
-rw-r--r--src/net/sourceforge/plantuml/timingdiagram/RibbonNew.java244
-rw-r--r--src/net/sourceforge/plantuml/timingdiagram/RibbonOld.java226
-rw-r--r--src/net/sourceforge/plantuml/timingdiagram/TickInPlayer.java3
-rw-r--r--src/net/sourceforge/plantuml/timingdiagram/TimeArrow.java30
-rw-r--r--src/net/sourceforge/plantuml/timingdiagram/TimeDrawing.java2
-rw-r--r--src/net/sourceforge/plantuml/timingdiagram/TimeMessage.java13
-rw-r--r--src/net/sourceforge/plantuml/timingdiagram/TimeTickBuilder.java2
-rw-r--r--src/net/sourceforge/plantuml/timingdiagram/TimingDiagram.java48
-rw-r--r--src/net/sourceforge/plantuml/timingdiagram/TimingDiagramFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/timingdiagram/TimingNote.java103
-rw-r--r--src/net/sourceforge/plantuml/timingdiagram/TimingRuler.java37
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/AbstractCommonUGraphic.java7
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/FontChecker.java3
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java31
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/LimitFinder.java6
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/MinMax.java23
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/SlotFinderX.java152
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/TextLimitFinder.java5
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UEllipse.java2
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UFont.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UGraphic.java2
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UGraphicCompress2.java98
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UGraphicNull.java3
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UGraphicUtils.java2
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UHorizontalLine.java9
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UImage.java32
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/ULine.java10
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/URectangle.java26
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UShapeSized.java44
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UStroke.java7
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UText.java14
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/comp/CompressionMode.java41
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/comp/CompressionTransform.java (renamed from src/net/sourceforge/plantuml/ugraphic/CompressionTransform.java)2
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/comp/Slot.java (renamed from src/net/sourceforge/plantuml/ugraphic/Slot.java)2
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/comp/SlotFinder.java208
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/comp/SlotSet.java (renamed from src/net/sourceforge/plantuml/ugraphic/SlotSet.java)6
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/comp/TextBlockCompressedOnXorY.java (renamed from src/net/sourceforge/plantuml/graphic/TextBlockCompressed.java)48
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/comp/UGraphicCompressOnXorY.java (renamed from src/net/sourceforge/plantuml/ugraphic/UGraphicCompress.java)60
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/crossing/UGraphicCrossing.java5
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/eps/DriverTextEps.java3
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/eps/UGraphicEps.java3
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/g2d/DriverEllipseG2d.java67
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/g2d/DriverImageG2d.java12
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/g2d/DriverLineG2d.java7
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/g2d/DriverPathG2d.java11
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/g2d/DriverRectangleG2d.java59
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/g2d/DriverTextAsPathG2d.java9
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/g2d/DriverTextG2d.java9
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/g2d/UGraphicG2d.java16
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/hand/UGraphicHandwritten.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/hand/UPathHand.java1
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/html5/UGraphicHtml5.java3
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/sprite/ColorPalette.java85
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/sprite/ColorPalette4096.java107
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/sprite/RessourcesUtils.java8
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/sprite/SpriteColor.java139
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/sprite/SpriteColorBuilder.java86
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/sprite/SpriteColorBuilder4096.java81
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/sprite/SpriteGrayLevel.java53
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/sprite/SpriteMonochrome.java116
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/sprite/SpriteUtils.java12
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/svg/DriverEllipseSvg.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/svg/DriverLineSvg.java13
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/svg/DriverRectangleSvg.java17
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/svg/UGraphicSvg.java27
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/tikz/DriverAtomTextTikz.java14
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/tikz/DriverCenteredCharacterTikz2.java55
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/tikz/DriverDotPathTikz.java1
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/tikz/DriverPolygonTikz.java14
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/tikz/DriverRectangleTikz.java14
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/tikz/DriverUPathTikz.java13
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/tikz/DriverUTextTikz.java18
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/tikz/UGraphicTikz.java16
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/txt/UGraphicTxt.java19
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/visio/UGraphicVdx.java7
-rw-r--r--src/net/sourceforge/plantuml/utils/Cypher.java98
-rw-r--r--src/net/sourceforge/plantuml/utils/StartUtils.java5
-rw-r--r--src/net/sourceforge/plantuml/version/IteratorCounter2.java2
-rw-r--r--src/net/sourceforge/plantuml/version/IteratorCounter2Impl.java8
-rw-r--r--src/net/sourceforge/plantuml/version/License.java196
-rw-r--r--src/net/sourceforge/plantuml/version/LicenseInfo.java221
-rw-r--r--src/net/sourceforge/plantuml/version/Magic.java192
-rw-r--r--src/net/sourceforge/plantuml/version/PSystemKeygen.java169
-rw-r--r--src/net/sourceforge/plantuml/version/PSystemVersion.java16
-rw-r--r--src/net/sourceforge/plantuml/version/PSystemVersionFactory.java9
-rw-r--r--src/net/sourceforge/plantuml/version/Professionnal.java119
-rw-r--r--src/net/sourceforge/plantuml/version/Version.java4
-rw-r--r--src/net/sourceforge/plantuml/vizjs/GraphvizJs.java6
-rw-r--r--src/net/sourceforge/plantuml/webp/Portraits.java155
-rw-r--r--src/net/sourceforge/plantuml/webp/VP8Decoder.java21
-rw-r--r--src/net/sourceforge/plantuml/zopfli/BlockSplitter.java159
-rw-r--r--src/net/sourceforge/plantuml/zopfli/Buffer.java75
-rw-r--r--src/net/sourceforge/plantuml/zopfli/Cookie.java191
-rw-r--r--src/net/sourceforge/plantuml/zopfli/Deflate.java796
-rw-r--r--src/net/sourceforge/plantuml/zopfli/Hash.java136
-rw-r--r--src/net/sourceforge/plantuml/zopfli/Katajainen.java124
-rw-r--r--src/net/sourceforge/plantuml/zopfli/LongestMatchCache.java126
-rw-r--r--src/net/sourceforge/plantuml/zopfli/LzStore.java45
-rw-r--r--src/net/sourceforge/plantuml/zopfli/Options.java48
-rw-r--r--src/net/sourceforge/plantuml/zopfli/Squeeze.java241
-rw-r--r--src/net/sourceforge/plantuml/zopfli/SymbolStats.java181
-rw-r--r--src/net/sourceforge/plantuml/zopfli/Util.java226
-rw-r--r--src/net/sourceforge/plantuml/zopfli/Zopfli.java144
-rw-r--r--src/smetana/core/AllH.java4
-rw-r--r--src/smetana/core/ArrayOfInteger.java92
-rw-r--r--src/smetana/core/JUtils.java500
-rw-r--r--src/smetana/core/JUtilsOk1.java652
-rw-r--r--src/smetana/core/Macro.java19
-rw-r--r--src/smetana/core/Memory.java11
-rw-r--r--src/smetana/core/UnsupportedArrayOfPtr.java5
-rw-r--r--src/smetana/core/UnsupportedArrayOfStruct.java107
-rw-r--r--src/smetana/core/UnsupportedSize_t.java80
-rw-r--r--src/smetana/core/UnsupportedStarStruct.java20
-rw-r--r--src/smetana/core/Z.java30
-rw-r--r--src/smetana/core/__array_of_cstring__.java113
-rw-r--r--src/smetana/core/__array_of_cstring_impl__.java156
-rw-r--r--src/smetana/core/__array_of_integer__.java107
-rw-r--r--src/smetana/core/__array_of_integer_impl__.java147
-rw-r--r--src/smetana/core/__array_of_ptr__.java2
-rw-r--r--src/smetana/core/__array_of_ptr_impl__.java9
-rw-r--r--src/smetana/core/__array_of_struct__.java170
-rw-r--r--src/smetana/core/__array_of_struct_impl__.java177
-rw-r--r--src/smetana/core/amiga/BucketToAreaFactory.java10
-rw-r--r--src/smetana/core/amiga/StarArrayOfInteger.java1
-rw-r--r--src/smetana/core/amiga/StarArrayOfPtr.java5
-rw-r--r--src/smetana/core/amiga/StarStructImpl.java14
-rw-r--r--src/smetana/core/size_t.java2
-rw-r--r--src/smetana/core/size_t_array_of_array_of_something_allocated.java7
-rw-r--r--src/smetana/core/size_t_array_of_array_of_something_empty.java5
-rw-r--r--src/smetana/core/size_t_array_of_charstars.java7
-rw-r--r--src/smetana/core/size_t_array_of_integer.java6
-rw-r--r--src/smetana/core/size_t_array_of_something.java5
-rw-r--r--src/smetana/core/size_t_of_element.java5
-rw-r--r--src/smetana/core/size_t_struct.java70
-rw-r--r--stdlib/aws-abx.repxbin0 -> 35339 bytes
-rw-r--r--stdlib/aws-dex.repxbin0 -> 443080 bytes
-rw-r--r--stdlib/cloudinsight-abx.repxbin0 -> 802 bytes
-rw-r--r--stdlib/cloudinsight-dex.repxbin0 -> 14989 bytes
-rw-r--r--stdlib/cloudogu-abx.repxbin0 -> 2162 bytes
-rw-r--r--stdlib/cloudogu-dex.repxbin0 -> 8433 bytes
-rw-r--r--stdlib/devicons-abx.repxbin0 -> 8209 bytes
-rw-r--r--stdlib/devicons-dex.repxbin0 -> 36910 bytes
-rw-r--r--stdlib/font-awesome-abx.repxbin0 -> 26659 bytes
-rw-r--r--stdlib/font-awesome-dex.repxbin0 -> 81625 bytes
-rw-r--r--stdlib/home.repx7
-rw-r--r--stdlib/material-abx.repxbin0 -> 86390 bytes
-rw-r--r--stdlib/material-dex.repxbin0 -> 144044 bytes
-rw-r--r--stdlib/office-abx.repxbin0 -> 22878 bytes
-rw-r--r--stdlib/office-dex.repxbin0 -> 74536 bytes
-rwxr-xr-xtools/create_sprites.sh175
922 files changed, 39582 insertions, 11223 deletions
diff --git a/README.md b/README.md
index a4604a4..d38b885 100644
--- a/README.md
+++ b/README.md
@@ -15,5 +15,18 @@ PlantUML is a component that allows to quickly write :
* [Object diagram](http://plantuml.com/object-diagram),
* [Deployment diagram](http://plantuml.com/deployment-diagram),
* [Timing diagram](http://plantuml.com/timing-diagram)
+
+And also:
+ * [Activity diagram (legacy syntax)](http://plantuml.com/activity-diagram-legacy)
+ * [Archimate diagram](http://plantuml.com/archimate)
+ * [Gantt charts](http://plantuml.com/gantt-diagram)
+ * [SALT UI mockups](http://plantuml.com/salt)
+
+Furthermore:
+ * [Hyperlinks and tooltips](http://plantuml.com/link)
+ * [Creole](http://plantuml.com/creole): rich text, emoticons, unicode, icons
+ * [OpenIconic icons](http://plantuml.com/openiconic)
+ * [Sprite icons](http://plantuml.com/sprite)
+ * [AsciiMath mathematical expressions](http://plantuml.com/ascii-math)
To know more about PlantUML, please visit http://plantuml.com/
diff --git a/build.xml b/build.xml
index fa13a26..eff6045 100644
--- a/build.xml
+++ b/build.xml
@@ -56,6 +56,11 @@
<include name="*.js" />
</fileset>
</copy>
+ <copy todir="build/stdlib">
+ <fileset dir="stdlib">
+ <include name="**/*.repx" />
+ </fileset>
+ </copy>
</target>
<target name="dist" depends="compile">
@@ -64,7 +69,7 @@
<jar jarfile="plantuml.jar" basedir="build">
<manifest>
<attribute name="Main-Class" value="net.sourceforge.plantuml.Run" />
- <attribute name="Class-Path" value="batik-all-1.7.jar jlatexmath-minimal-1.0.3.jar jlm_cyrillic.jar jlm_greek.jar vizjs.jar j2v8_win32_x86_64-3.1.6.jar j2v8_linux_x86_64-3.1.6.jar j2v8_macosx_x86_64-3.1.6.jar" />
+ <attribute name="Class-Path" value="avalon-framework-4.2.0.jar batik-all-1.7.jar commons-io-1.3.1.jar commons-logging-1.0.4.jar fop.jar xml-apis-ext-1.3.04.jar xmlgraphics-commons-1.4.jar jlatexmath-minimal-1.0.3.jar jlm_cyrillic.jar jlm_greek.jar vizjs.jar j2v8_win32_x86_64-3.1.6.jar j2v8_linux_x86_64-3.1.6.jar j2v8_macosx_x86_64-3.1.6.jar" />
</manifest>
</jar>
<delete dir="build" />
diff --git a/debian/changelog b/debian/changelog
index 16a25ce..7c84f6f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,18 @@
+plantuml (1:1.2018.9-1) unstable; urgency=medium
+
+ [ Alex Kirchhoff ]
+ * New upstream version (1.2018.9).
+ * Update pdf.patch:
+ - Add libavalon-framework-java, libcommons-io-java,
+ libcommons-logging-java, libxml-commons-external-java,
+ libxmlgraphics-commons-java as dependencies.
+ * Update the description with new features
+ (Closes: #897414).
+ * Update Vcs-* to point to Salsa.
+ * Update Standards-Version from 4.0.0 to 4.1.5 (no change needed)
+
+ -- Andrej Shadura <andrewsh@debian.org> Sun, 05 Aug 2018 11:39:13 +0200
+
plantuml (1:1.2017.15-1) unstable; urgency=medium
* Fix "New version available" package upstream release (1.2017.15), new
diff --git a/debian/control b/debian/control
index 8a5c10a..abda442 100644
--- a/debian/control
+++ b/debian/control
@@ -10,10 +10,10 @@ Build-Depends:
default-jdk,
libfop-java,
libbatik-java
-Standards-Version: 4.0.0
+Standards-Version: 4.1.5
Homepage: http://plantuml.com/
-Vcs-Git: https://anonscm.debian.org/git/collab-maint/plantuml.git
-Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/plantuml.git/
+Vcs-Git: https://salsa.debian.org/debian/plantuml.git
+Vcs-Browser: https://salsa.debian.org/debian/plantuml
Package: plantuml
Architecture: all
@@ -22,19 +22,35 @@ Depends:
default-jre,
libfop-java,
libbatik-java,
- libjlatexmath-java
+ libjlatexmath-java,
+ libavalon-framework-java,
+ libcommons-io-java,
+ libcommons-logging-java,
+ libxml-commons-external-java,
+ libxmlgraphics-commons-java
Recommends: graphviz
Description: text-to-UML converter
PlantUML is a program allowing to draw UML diagrams, using a simple
human readable text description.
.
- PlantUML supports the following diagram types:
+ PlantUML supports the following UML diagrams:
- sequence diagram
- use case diagram
- class diagram
- activity diagram
- component diagram
- state diagram
+ - object diagram
+ - deployment diagram
+ - timing diagram
+ .
+ The following non-UML diagrams are also supported:
+ - wireframe graphical interface (Salt)
+ - Archimate diagram
+ - Specification and Description Language (SDL)
+ - Ditaa diagram
+ - Gantt diagram
+ - mathematics with AsciiMath or JLaTeXMath notation
.
Output images can be generated in PNG, in SVG or LaTeX format.
PlantUML also supports generation of ASCII art diagrams (only for
diff --git a/debian/patches/pdf.patch b/debian/patches/pdf.patch
index beabd9c..9661736 100644
--- a/debian/patches/pdf.patch
+++ b/debian/patches/pdf.patch
@@ -1,7 +1,7 @@
Subject: Specify Class-Path to the libraries needed to support PDF (#807928).
Author: Andrew Shadura <andrewsh@debian.org>
Forwarded: not-needed
-Last-Update: 2017-09-16
+Last-Update: 2018-08-04
--- a/build.xml
+++ b/build.xml
@@ -9,8 +9,8 @@ Last-Update: 2017-09-16
<jar jarfile="plantuml.jar" basedir="build">
<manifest>
<attribute name="Main-Class" value="net.sourceforge.plantuml.Run" />
-- <attribute name="Class-Path" value="batik-all-1.7.jar jlatexmath-minimal-1.0.3.jar jlm_cyrillic.jar jlm_greek.jar vizjs.jar j2v8_win32_x86_64-3.1.6.jar j2v8_linux_x86_64-3.1.6.jar j2v8_macosx_x86_64-3.1.6.jar" />
-+ <attribute name="Class-Path" value="/usr/share/java/batik-all.jar /usr/share/java/fop.jar /usr/share/java/jlatexmath.jar" />
+- <attribute name="Class-Path" value="avalon-framework-4.2.0.jar batik-all-1.7.jar commons-io-1.3.1.jar commons-logging-1.0.4.jar fop.jar xml-apis-ext-1.3.04.jar xmlgraphics-commons-1.4.jar jlatexmath-minimal-1.0.3.jar jlm_cyrillic.jar jlm_greek.jar vizjs.jar j2v8_win32_x86_64-3.1.6.jar j2v8_linux_x86_64-3.1.6.jar j2v8_macosx_x86_64-3.1.6.jar" />
++ <attribute name="Class-Path" value="/usr/share/java/avalon-framework.jar /usr/share/java/batik-all.jar /usr/share/java/commons-io.jar /usr/share/java/commons-logging.jar /usr/share/java/fop.jar /usr/share/java/xml-apis-ext.jar /usr/share/java/xmlgraphics-commons.jar /usr/share/java/jlatexmath.jar" />
</manifest>
</jar>
<delete dir="build" />
diff --git a/license.txt b/license.txt
new file mode 100644
index 0000000..f627c20
--- /dev/null
+++ b/license.txt
@@ -0,0 +1,49 @@
+=======================================================================
+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
+
+PlantUML is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+PlantUML distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+License for more details.
+
+You should have received a copy of the GNU General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+USA.
+
+PlantUML can occasionally display sponsored or advertising messages. Those
+messages are usually generated on welcome or error images and never on
+functional diagrams.
+
+Images (whatever their format : PNG, SVG, EPS...) generated by running PlantUML
+are owned by the author of their corresponding sources code (that is, their
+textual description in PlantUML language). Those images are not covered by
+the GPL license.
+
+The generated images can then be used without any reference to the GPL license.
+It is not even necessary to stipulate that they have been generated with PlantUML,
+also this will be appreciate by PlantUML team.
+
+There is an exception : if the textual description in PlantUML language is also covered
+by a license (like the GPL), then the generated images are logically covered
+by the very same license.
+
+Icons provided by OpenIconic : https://useiconic.com/open
+Archimate sprites provided by Archi : http://www.archimatetool.com
+ASCIIMathML (c) Peter Jipsen http://www.chapman.edu/~jipsen
+ASCIIMathML (c) David Lippman http://www.pierce.ctc.edu/dlippman
diff --git a/pom.xml b/pom.xml
index c7f387a..642323d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -35,7 +35,7 @@
<groupId>net.sourceforge.plantuml</groupId>
<artifactId>plantuml</artifactId>
- <version>1.2017.15-SNAPSHOT</version>
+ <version>1.2018.10-SNAPSHOT</version>
<packaging>jar</packaging>
<name>PlantUML</name>
@@ -120,6 +120,12 @@
<include>net/sourceforge/plantuml/math/*.js</include>
</includes>
</resource>
+ <resource>
+ <directory>${project.basedir}</directory>
+ <includes>
+ <include>stdlib/**/*.repx</include>
+ </includes>
+ </resource>
</resources>
<plugins>
<plugin>
diff --git a/src/com/ctreber/acearth/ACearth.java b/src/ext/plantuml/com/ctreber/acearth/ACearth.java
index 64e7ad7..54adad5 100644
--- a/src/com/ctreber/acearth/ACearth.java
+++ b/src/ext/plantuml/com/ctreber/acearth/ACearth.java
@@ -1,4 +1,4 @@
-package com.ctreber.acearth;
+package ext.plantuml.com.ctreber.acearth;
import java.io.IOException;
import java.io.OutputStream;
@@ -7,33 +7,33 @@ import java.util.Iterator;
import java.util.List;
import java.util.Random;
-import com.ctreber.acearth.gui.CanvasACearth;
-import com.ctreber.acearth.plugins.Plugin;
-import com.ctreber.acearth.plugins.markers.Marker;
-import com.ctreber.acearth.plugins.markers.PluginMarkers;
-import com.ctreber.acearth.projection.Projection;
-import com.ctreber.acearth.projection.ProjectionCyl;
-import com.ctreber.acearth.projection.ProjectionMerc;
-import com.ctreber.acearth.projection.ProjectionOrtho;
-import com.ctreber.acearth.renderer.Renderer;
-import com.ctreber.acearth.renderer.RowTypeRendererScanBit;
-import com.ctreber.acearth.renderer.RowTypeRendererScanDot;
-import com.ctreber.acearth.scanbit.BitGeneratorMap;
-import com.ctreber.acearth.scanbit.BitGeneratorMapDefault;
-import com.ctreber.acearth.scanbit.BitGeneratorMapOrtho;
-import com.ctreber.acearth.scandot.DotGeneratorLines;
-import com.ctreber.acearth.scandot.DotGeneratorStars;
-import com.ctreber.acearth.scandot.ScanDot;
-import com.ctreber.acearth.scandot.ScanDotGenerator;
-import com.ctreber.acearth.shader.Shader;
-import com.ctreber.acearth.shader.ShaderDefault;
-import com.ctreber.acearth.shader.ShaderFlat;
-import com.ctreber.acearth.shader.ShaderOrtho;
-import com.ctreber.acearth.util.Coordinate;
-import com.ctreber.acearth.util.SunPositionCalculator;
-import com.ctreber.acearth.util.Toolkit;
-import com.ctreber.aclib.sort.CTSort;
-import com.ctreber.aclib.sort.QuickSort;
+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;
/**
* <h1>AC.earth - XEarth for Java
diff --git a/src/com/ctreber/acearth/Configuration.java b/src/ext/plantuml/com/ctreber/acearth/Configuration.java
index 95295d3..4da1604 100644
--- a/src/com/ctreber/acearth/Configuration.java
+++ b/src/ext/plantuml/com/ctreber/acearth/Configuration.java
@@ -1,14 +1,14 @@
-package com.ctreber.acearth;
+package ext.plantuml.com.ctreber.acearth;
import java.util.HashMap;
import java.util.Map;
-import com.ctreber.aclib.gui.MOBoolean;
-import com.ctreber.aclib.gui.MODouble;
-import com.ctreber.aclib.gui.MOEnum;
-import com.ctreber.aclib.gui.MOInteger;
-import com.ctreber.aclib.gui.MOString;
-import com.ctreber.aclib.gui.MonitoredObject;
+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;
/**
* <p>
diff --git a/src/com/ctreber/acearth/ConfigurationACearth.java b/src/ext/plantuml/com/ctreber/acearth/ConfigurationACearth.java
index d441e50..ae6529c 100644
--- a/src/com/ctreber/acearth/ConfigurationACearth.java
+++ b/src/ext/plantuml/com/ctreber/acearth/ConfigurationACearth.java
@@ -1,12 +1,12 @@
-package com.ctreber.acearth;
-
-import com.ctreber.acearth.util.Coordinate;
-import com.ctreber.aclib.gui.MOBoolean;
-import com.ctreber.aclib.gui.MODouble;
-import com.ctreber.aclib.gui.MOEnum;
-import com.ctreber.aclib.gui.MOInteger;
-import com.ctreber.aclib.gui.MOString;
-import com.ctreber.aclib.gui.MonitoredObject;
+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;
/**
* <p>
diff --git a/src/com/ctreber/acearth/MapData.java b/src/ext/plantuml/com/ctreber/acearth/MapData.java
index 3bd79a3..b1f66a7 100644
--- a/src/com/ctreber/acearth/MapData.java
+++ b/src/ext/plantuml/com/ctreber/acearth/MapData.java
@@ -1,4 +1,4 @@
-package com.ctreber.acearth;
+package ext.plantuml.com.ctreber.acearth;
import java.util.ArrayList;
import java.util.List;
diff --git a/src/com/ctreber/acearth/MapDataReader.java b/src/ext/plantuml/com/ctreber/acearth/MapDataReader.java
index 4729751..f768c7e 100644
--- a/src/com/ctreber/acearth/MapDataReader.java
+++ b/src/ext/plantuml/com/ctreber/acearth/MapDataReader.java
@@ -1,4 +1,4 @@
-package com.ctreber.acearth;
+package ext.plantuml.com.ctreber.acearth;
import java.io.IOException;
import java.util.ArrayList;
@@ -6,8 +6,8 @@ import java.util.Iterator;
import java.util.List;
import java.util.StringTokenizer;
-import com.ctreber.acearth.util.Point3D;
-import com.ctreber.acearth.util.Polygon;
+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
diff --git a/src/com/ctreber/acearth/gui/CanvasACearth.java b/src/ext/plantuml/com/ctreber/acearth/gui/CanvasACearth.java
index cd251cc..352ac37 100644
--- a/src/com/ctreber/acearth/gui/CanvasACearth.java
+++ b/src/ext/plantuml/com/ctreber/acearth/gui/CanvasACearth.java
@@ -1,6 +1,6 @@
-package com.ctreber.acearth.gui;
+package ext.plantuml.com.ctreber.acearth.gui;
-import com.ctreber.acearth.ACearth;
+import ext.plantuml.com.ctreber.acearth.ACearth;
/**
* <p>
diff --git a/src/com/ctreber/acearth/gui/PixelCanvas.java b/src/ext/plantuml/com/ctreber/acearth/gui/PixelCanvas.java
index 79da3f7..030d69e 100644
--- a/src/com/ctreber/acearth/gui/PixelCanvas.java
+++ b/src/ext/plantuml/com/ctreber/acearth/gui/PixelCanvas.java
@@ -1,4 +1,4 @@
-package com.ctreber.acearth.gui;
+package ext.plantuml.com.ctreber.acearth.gui;
import java.awt.Color;
import java.awt.Graphics2D;
@@ -9,7 +9,7 @@ import java.io.OutputStream;
import javax.imageio.ImageIO;
-import com.ctreber.acearth.renderer.RenderTarget;
+import ext.plantuml.com.ctreber.acearth.renderer.RenderTarget;
/**
* <p>
diff --git a/src/com/ctreber/acearth/plugins/Plugin.java b/src/ext/plantuml/com/ctreber/acearth/plugins/Plugin.java
index ddf3ec4..85de4bb 100644
--- a/src/com/ctreber/acearth/plugins/Plugin.java
+++ b/src/ext/plantuml/com/ctreber/acearth/plugins/Plugin.java
@@ -1,11 +1,11 @@
-package com.ctreber.acearth.plugins;
+package ext.plantuml.com.ctreber.acearth.plugins;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
-import com.ctreber.acearth.ACearth;
-import com.ctreber.acearth.gui.PixelCanvas;
-import com.ctreber.acearth.projection.Projection;
+import ext.plantuml.com.ctreber.acearth.ACearth;
+import ext.plantuml.com.ctreber.acearth.gui.PixelCanvas;
+import ext.plantuml.com.ctreber.acearth.projection.Projection;
/**
* <p></p>
diff --git a/src/com/ctreber/acearth/plugins/markers/Marker.java b/src/ext/plantuml/com/ctreber/acearth/plugins/markers/Marker.java
index 5b8b0d8..ccd8b15 100644
--- a/src/com/ctreber/acearth/plugins/markers/Marker.java
+++ b/src/ext/plantuml/com/ctreber/acearth/plugins/markers/Marker.java
@@ -1,17 +1,17 @@
-package com.ctreber.acearth.plugins.markers;
+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 com.ctreber.acearth.gui.PixelCanvas;
-import com.ctreber.acearth.projection.Projection;
-import com.ctreber.acearth.projection.ProjectionOrtho;
-import com.ctreber.acearth.util.Coordinate;
-import com.ctreber.acearth.util.Point2D;
-import com.ctreber.acearth.util.Point3D;
-import com.ctreber.acearth.util.StringParser;
+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;
/**
* <p>
diff --git a/src/com/ctreber/acearth/plugins/markers/PluginMarkers.java b/src/ext/plantuml/com/ctreber/acearth/plugins/markers/PluginMarkers.java
index 1bc826a..f4757d8 100644
--- a/src/com/ctreber/acearth/plugins/markers/PluginMarkers.java
+++ b/src/ext/plantuml/com/ctreber/acearth/plugins/markers/PluginMarkers.java
@@ -1,9 +1,9 @@
-package com.ctreber.acearth.plugins.markers;
+package ext.plantuml.com.ctreber.acearth.plugins.markers;
import java.util.Iterator;
import java.util.List;
-import com.ctreber.acearth.plugins.Plugin;
+import ext.plantuml.com.ctreber.acearth.plugins.Plugin;
/**
* <p>
diff --git a/src/com/ctreber/acearth/projection/Projection.java b/src/ext/plantuml/com/ctreber/acearth/projection/Projection.java
index 0b56eb0..8fd3ebf 100644
--- a/src/com/ctreber/acearth/projection/Projection.java
+++ b/src/ext/plantuml/com/ctreber/acearth/projection/Projection.java
@@ -1,9 +1,9 @@
-package com.ctreber.acearth.projection;
+package ext.plantuml.com.ctreber.acearth.projection;
-import com.ctreber.acearth.util.Coordinate;
-import com.ctreber.acearth.util.Point2D;
-import com.ctreber.acearth.util.Point3D;
-import com.ctreber.acearth.util.Toolkit;
+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;
/**
* <p>A projection for a globe on a flat surface (must be subclassed).
diff --git a/src/com/ctreber/acearth/projection/ProjectionCyl.java b/src/ext/plantuml/com/ctreber/acearth/projection/ProjectionCyl.java
index d30d664..e25071c 100644
--- a/src/com/ctreber/acearth/projection/ProjectionCyl.java
+++ b/src/ext/plantuml/com/ctreber/acearth/projection/ProjectionCyl.java
@@ -1,7 +1,7 @@
-package com.ctreber.acearth.projection;
+package ext.plantuml.com.ctreber.acearth.projection;
-import com.ctreber.acearth.util.Coordinate;
-import com.ctreber.acearth.util.Point3D;
+import ext.plantuml.com.ctreber.acearth.util.Coordinate;
+import ext.plantuml.com.ctreber.acearth.util.Point3D;
/**
* <p>Cylindrical projection. Show Earth flatly spread out on rectangle.
diff --git a/src/com/ctreber/acearth/projection/ProjectionMerc.java b/src/ext/plantuml/com/ctreber/acearth/projection/ProjectionMerc.java
index e27d0b9..775e35a 100644
--- a/src/com/ctreber/acearth/projection/ProjectionMerc.java
+++ b/src/ext/plantuml/com/ctreber/acearth/projection/ProjectionMerc.java
@@ -1,7 +1,7 @@
-package com.ctreber.acearth.projection;
+package ext.plantuml.com.ctreber.acearth.projection;
-import com.ctreber.acearth.util.Coordinate;
-import com.ctreber.acearth.util.Point3D;
+import ext.plantuml.com.ctreber.acearth.util.Coordinate;
+import ext.plantuml.com.ctreber.acearth.util.Point3D;
/**
diff --git a/src/com/ctreber/acearth/projection/ProjectionOrtho.java b/src/ext/plantuml/com/ctreber/acearth/projection/ProjectionOrtho.java
index e227277..6ff24a6 100644
--- a/src/com/ctreber/acearth/projection/ProjectionOrtho.java
+++ b/src/ext/plantuml/com/ctreber/acearth/projection/ProjectionOrtho.java
@@ -1,7 +1,7 @@
-package com.ctreber.acearth.projection;
+package ext.plantuml.com.ctreber.acearth.projection;
-import com.ctreber.acearth.util.Coordinate;
-import com.ctreber.acearth.util.Point3D;
+import ext.plantuml.com.ctreber.acearth.util.Coordinate;
+import ext.plantuml.com.ctreber.acearth.util.Point3D;
/**
diff --git a/src/com/ctreber/acearth/renderer/RenderTarget.java b/src/ext/plantuml/com/ctreber/acearth/renderer/RenderTarget.java
index 84ebfc7..1b4881f 100644
--- a/src/com/ctreber/acearth/renderer/RenderTarget.java
+++ b/src/ext/plantuml/com/ctreber/acearth/renderer/RenderTarget.java
@@ -1,4 +1,4 @@
-package com.ctreber.acearth.renderer;
+package ext.plantuml.com.ctreber.acearth.renderer;
import java.awt.Color;
diff --git a/src/com/ctreber/acearth/renderer/Renderer.java b/src/ext/plantuml/com/ctreber/acearth/renderer/Renderer.java
index a007d1e..ae9f389 100644
--- a/src/com/ctreber/acearth/renderer/Renderer.java
+++ b/src/ext/plantuml/com/ctreber/acearth/renderer/Renderer.java
@@ -1,11 +1,11 @@
-package com.ctreber.acearth.renderer;
+package ext.plantuml.com.ctreber.acearth.renderer;
import java.awt.Color;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import com.ctreber.acearth.shader.Shader;
+import ext.plantuml.com.ctreber.acearth.shader.Shader;
/**
* <p>
diff --git a/src/com/ctreber/acearth/renderer/RowTypeRenderer.java b/src/ext/plantuml/com/ctreber/acearth/renderer/RowTypeRenderer.java
index 5287a27..7ec8158 100644
--- a/src/com/ctreber/acearth/renderer/RowTypeRenderer.java
+++ b/src/ext/plantuml/com/ctreber/acearth/renderer/RowTypeRenderer.java
@@ -1,4 +1,4 @@
-package com.ctreber.acearth.renderer;
+package ext.plantuml.com.ctreber.acearth.renderer;
/**
* <p>Renders a row of pixel types.</p>
diff --git a/src/com/ctreber/acearth/renderer/RowTypeRendererScanBit.java b/src/ext/plantuml/com/ctreber/acearth/renderer/RowTypeRendererScanBit.java
index 216c8b0..312ce54 100644
--- a/src/com/ctreber/acearth/renderer/RowTypeRendererScanBit.java
+++ b/src/ext/plantuml/com/ctreber/acearth/renderer/RowTypeRendererScanBit.java
@@ -1,7 +1,7 @@
-package com.ctreber.acearth.renderer;
+package ext.plantuml.com.ctreber.acearth.renderer;
-import com.ctreber.acearth.scanbit.BitGeneratorMap;
-import com.ctreber.acearth.scanbit.ScanBit;
+import ext.plantuml.com.ctreber.acearth.scanbit.BitGeneratorMap;
+import ext.plantuml.com.ctreber.acearth.scanbit.ScanBit;
/**
* <p>Renders a row of ScanBits to pixel types.</p>
diff --git a/src/com/ctreber/acearth/renderer/RowTypeRendererScanDot.java b/src/ext/plantuml/com/ctreber/acearth/renderer/RowTypeRendererScanDot.java
index 11191ab..3223094 100644
--- a/src/com/ctreber/acearth/renderer/RowTypeRendererScanDot.java
+++ b/src/ext/plantuml/com/ctreber/acearth/renderer/RowTypeRendererScanDot.java
@@ -1,7 +1,7 @@
-package com.ctreber.acearth.renderer;
+package ext.plantuml.com.ctreber.acearth.renderer;
-import com.ctreber.acearth.scanbit.BitGeneratorMap;
-import com.ctreber.acearth.scandot.ScanDot;
+import ext.plantuml.com.ctreber.acearth.scanbit.BitGeneratorMap;
+import ext.plantuml.com.ctreber.acearth.scandot.ScanDot;
/**
* <p>Renders a row of ScanDots to pixel types.</p>
diff --git a/src/com/ctreber/acearth/scanbit/BitGeneratorMap.java b/src/ext/plantuml/com/ctreber/acearth/scanbit/BitGeneratorMap.java
index daeed0a..f907a70 100644
--- a/src/com/ctreber/acearth/scanbit/BitGeneratorMap.java
+++ b/src/ext/plantuml/com/ctreber/acearth/scanbit/BitGeneratorMap.java
@@ -1,16 +1,16 @@
-package com.ctreber.acearth.scanbit;
+package ext.plantuml.com.ctreber.acearth.scanbit;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
-import com.ctreber.acearth.projection.Projection;
-import com.ctreber.acearth.util.EdgeCrossing;
-import com.ctreber.acearth.util.Point2D;
-import com.ctreber.acearth.util.Point3D;
-import com.ctreber.acearth.util.Polygon;
-import com.ctreber.aclib.sort.CTSort;
-import com.ctreber.aclib.sort.QuickSort;
+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;
/**
* <p>
diff --git a/src/com/ctreber/acearth/scanbit/BitGeneratorMapDefault.java b/src/ext/plantuml/com/ctreber/acearth/scanbit/BitGeneratorMapDefault.java
index 2a069e8..7a3e861 100644
--- a/src/com/ctreber/acearth/scanbit/BitGeneratorMapDefault.java
+++ b/src/ext/plantuml/com/ctreber/acearth/scanbit/BitGeneratorMapDefault.java
@@ -1,11 +1,11 @@
-package com.ctreber.acearth.scanbit;
+package ext.plantuml.com.ctreber.acearth.scanbit;
import java.util.Comparator;
-import com.ctreber.acearth.projection.Projection;
-import com.ctreber.acearth.util.EdgeCrossing;
-import com.ctreber.acearth.util.Point2D;
-import com.ctreber.acearth.util.Point3D;
+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;
/**
* <p>Map scanner for mercator and cylindrical projections.
diff --git a/src/com/ctreber/acearth/scanbit/BitGeneratorMapOrtho.java b/src/ext/plantuml/com/ctreber/acearth/scanbit/BitGeneratorMapOrtho.java
index 75ddef0..980b4e5 100644
--- a/src/com/ctreber/acearth/scanbit/BitGeneratorMapOrtho.java
+++ b/src/ext/plantuml/com/ctreber/acearth/scanbit/BitGeneratorMapOrtho.java
@@ -1,11 +1,11 @@
-package com.ctreber.acearth.scanbit;
+package ext.plantuml.com.ctreber.acearth.scanbit;
import java.util.Comparator;
-import com.ctreber.acearth.projection.Projection;
-import com.ctreber.acearth.util.EdgeCrossing;
-import com.ctreber.acearth.util.Point2D;
-import com.ctreber.acearth.util.Point3D;
+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;
/**
* <p>Map scanner for orthographic projection.
diff --git a/src/com/ctreber/acearth/scanbit/ScanBit.java b/src/ext/plantuml/com/ctreber/acearth/scanbit/ScanBit.java
index 89f522f..d5f7624 100644
--- a/src/com/ctreber/acearth/scanbit/ScanBit.java
+++ b/src/ext/plantuml/com/ctreber/acearth/scanbit/ScanBit.java
@@ -1,4 +1,4 @@
-package com.ctreber.acearth.scanbit;
+package ext.plantuml.com.ctreber.acearth.scanbit;
/**
* <p>Instruction to paint points xFrom to xTo on line y.
@@ -53,7 +53,7 @@ public class ScanBit implements Comparable
/**
* <p>See values for
- * @see com.ctreber.acearth.util.Polygon
+ * @see ext.plantuml.com.ctreber.acearth.util.Polygon
*/
public int getType()
{
diff --git a/src/com/ctreber/acearth/scanbit/ScanBitGenerator.java b/src/ext/plantuml/com/ctreber/acearth/scanbit/ScanBitGenerator.java
index ec6f4a1..b8913bf 100644
--- a/src/com/ctreber/acearth/scanbit/ScanBitGenerator.java
+++ b/src/ext/plantuml/com/ctreber/acearth/scanbit/ScanBitGenerator.java
@@ -1,4 +1,4 @@
-package com.ctreber.acearth.scanbit;
+package ext.plantuml.com.ctreber.acearth.scanbit;
/**
* <p>A ScanBitGenerator produces ScanBits.</p>
diff --git a/src/com/ctreber/acearth/scanbit/ScanBuf.java b/src/ext/plantuml/com/ctreber/acearth/scanbit/ScanBuf.java
index 9e3d070..102d2cf 100644
--- a/src/com/ctreber/acearth/scanbit/ScanBuf.java
+++ b/src/ext/plantuml/com/ctreber/acearth/scanbit/ScanBuf.java
@@ -1,10 +1,10 @@
-package com.ctreber.acearth.scanbit;
+package ext.plantuml.com.ctreber.acearth.scanbit;
import java.util.ArrayList;
import java.util.List;
-import com.ctreber.aclib.sort.CTSort;
-import com.ctreber.aclib.sort.QuickSort;
+import ext.plantuml.com.ctreber.aclib.sort.CTSort;
+import ext.plantuml.com.ctreber.aclib.sort.QuickSort;
/**
* <p>For each line, the scanbuffer (= a raster divice) records the points hit
diff --git a/src/com/ctreber/acearth/scandot/DotGeneratorLines.java b/src/ext/plantuml/com/ctreber/acearth/scandot/DotGeneratorLines.java
index 05da3be..5392a4e 100644
--- a/src/com/ctreber/acearth/scandot/DotGeneratorLines.java
+++ b/src/ext/plantuml/com/ctreber/acearth/scandot/DotGeneratorLines.java
@@ -1,9 +1,9 @@
-package com.ctreber.acearth.scandot;
+package ext.plantuml.com.ctreber.acearth.scandot;
-import com.ctreber.acearth.projection.Projection;
-import com.ctreber.acearth.util.Coordinate;
-import com.ctreber.acearth.util.Point2D;
-import com.ctreber.acearth.util.Point3D;
+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;
/**
* <p>Generate latitude and longitude grid as dots.
diff --git a/src/com/ctreber/acearth/scandot/DotGeneratorStars.java b/src/ext/plantuml/com/ctreber/acearth/scandot/DotGeneratorStars.java
index 09cf49a..09a4821 100644
--- a/src/com/ctreber/acearth/scandot/DotGeneratorStars.java
+++ b/src/ext/plantuml/com/ctreber/acearth/scandot/DotGeneratorStars.java
@@ -1,4 +1,4 @@
-package com.ctreber.acearth.scandot;
+package ext.plantuml.com.ctreber.acearth.scandot;
import java.util.Random;
diff --git a/src/com/ctreber/acearth/scandot/ScanDot.java b/src/ext/plantuml/com/ctreber/acearth/scandot/ScanDot.java
index 3b25bce..ac0823a 100644
--- a/src/com/ctreber/acearth/scandot/ScanDot.java
+++ b/src/ext/plantuml/com/ctreber/acearth/scandot/ScanDot.java
@@ -1,6 +1,6 @@
-package com.ctreber.acearth.scandot;
+package ext.plantuml.com.ctreber.acearth.scandot;
-import com.ctreber.acearth.util.Point2D;
+import ext.plantuml.com.ctreber.acearth.util.Point2D;
/**
* <p>A single scandot (opposed to a Polygon).
diff --git a/src/com/ctreber/acearth/scandot/ScanDotGenerator.java b/src/ext/plantuml/com/ctreber/acearth/scandot/ScanDotGenerator.java
index c52d874..0013cf4 100644
--- a/src/com/ctreber/acearth/scandot/ScanDotGenerator.java
+++ b/src/ext/plantuml/com/ctreber/acearth/scandot/ScanDotGenerator.java
@@ -1,4 +1,4 @@
-package com.ctreber.acearth.scandot;
+package ext.plantuml.com.ctreber.acearth.scandot;
import java.util.ArrayList;
import java.util.List;
diff --git a/src/com/ctreber/acearth/shader/Shader.java b/src/ext/plantuml/com/ctreber/acearth/shader/Shader.java
index 26634a7..3882a5c 100644
--- a/src/com/ctreber/acearth/shader/Shader.java
+++ b/src/ext/plantuml/com/ctreber/acearth/shader/Shader.java
@@ -1,11 +1,11 @@
-package com.ctreber.acearth.shader;
+package ext.plantuml.com.ctreber.acearth.shader;
import java.awt.Color;
-import com.ctreber.acearth.projection.Projection;
-import com.ctreber.acearth.scanbit.BitGeneratorMap;
-import com.ctreber.acearth.util.Coordinate;
-import com.ctreber.acearth.util.Point3D;
+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;
/**
* <p>A shader computes Colors for a row of pixel types, depending
diff --git a/src/com/ctreber/acearth/shader/ShaderDefault.java b/src/ext/plantuml/com/ctreber/acearth/shader/ShaderDefault.java
index 5dab763..ffb01e4 100644
--- a/src/com/ctreber/acearth/shader/ShaderDefault.java
+++ b/src/ext/plantuml/com/ctreber/acearth/shader/ShaderDefault.java
@@ -1,4 +1,4 @@
-package com.ctreber.acearth.shader;
+package ext.plantuml.com.ctreber.acearth.shader;
import java.awt.Color;
diff --git a/src/com/ctreber/acearth/shader/ShaderFlat.java b/src/ext/plantuml/com/ctreber/acearth/shader/ShaderFlat.java
index 203790a..a5b983a 100644
--- a/src/com/ctreber/acearth/shader/ShaderFlat.java
+++ b/src/ext/plantuml/com/ctreber/acearth/shader/ShaderFlat.java
@@ -1,4 +1,4 @@
-package com.ctreber.acearth.shader;
+package ext.plantuml.com.ctreber.acearth.shader;
import java.awt.Color;
diff --git a/src/com/ctreber/acearth/shader/ShaderOrtho.java b/src/ext/plantuml/com/ctreber/acearth/shader/ShaderOrtho.java
index b4e3046..33c646b 100644
--- a/src/com/ctreber/acearth/shader/ShaderOrtho.java
+++ b/src/ext/plantuml/com/ctreber/acearth/shader/ShaderOrtho.java
@@ -1,4 +1,4 @@
-package com.ctreber.acearth.shader;
+package ext.plantuml.com.ctreber.acearth.shader;
import java.awt.Color;
diff --git a/src/com/ctreber/acearth/util/Coordinate.java b/src/ext/plantuml/com/ctreber/acearth/util/Coordinate.java
index 4c12bf2..76d16ae 100644
--- a/src/com/ctreber/acearth/util/Coordinate.java
+++ b/src/ext/plantuml/com/ctreber/acearth/util/Coordinate.java
@@ -1,4 +1,4 @@
-package com.ctreber.acearth.util;
+package ext.plantuml.com.ctreber.acearth.util;
import java.io.IOException;
import java.io.Writer;
diff --git a/src/com/ctreber/acearth/util/EdgeCrossing.java b/src/ext/plantuml/com/ctreber/acearth/util/EdgeCrossing.java
index e565bd9..adc3e23 100644
--- a/src/com/ctreber/acearth/util/EdgeCrossing.java
+++ b/src/ext/plantuml/com/ctreber/acearth/util/EdgeCrossing.java
@@ -1,4 +1,4 @@
-package com.ctreber.acearth.util;
+package ext.plantuml.com.ctreber.acearth.util;
/**
* <p>Holds information about a line crossing "the edge of Earth".
diff --git a/src/com/ctreber/acearth/util/Point2D.java b/src/ext/plantuml/com/ctreber/acearth/util/Point2D.java
index fde40d0..596f2b4 100644
--- a/src/com/ctreber/acearth/util/Point2D.java
+++ b/src/ext/plantuml/com/ctreber/acearth/util/Point2D.java
@@ -1,4 +1,4 @@
-package com.ctreber.acearth.util;
+package ext.plantuml.com.ctreber.acearth.util;
/**
* <p>A point in a 2 axis space.
diff --git a/src/com/ctreber/acearth/util/Point3D.java b/src/ext/plantuml/com/ctreber/acearth/util/Point3D.java
index 5c689e2..3d38bdc 100644
--- a/src/com/ctreber/acearth/util/Point3D.java
+++ b/src/ext/plantuml/com/ctreber/acearth/util/Point3D.java
@@ -1,4 +1,4 @@
-package com.ctreber.acearth.util;
+package ext.plantuml.com.ctreber.acearth.util;
/**
* <p>A point in a 2 axis space.
diff --git a/src/com/ctreber/acearth/util/Polygon.java b/src/ext/plantuml/com/ctreber/acearth/util/Polygon.java
index afc4faf..9ea5f71 100644
--- a/src/com/ctreber/acearth/util/Polygon.java
+++ b/src/ext/plantuml/com/ctreber/acearth/util/Polygon.java
@@ -1,4 +1,4 @@
-package com.ctreber.acearth.util;
+package ext.plantuml.com.ctreber.acearth.util;
/**
diff --git a/src/com/ctreber/acearth/util/StringParser.java b/src/ext/plantuml/com/ctreber/acearth/util/StringParser.java
index e3f0050..3ba3b1c 100644
--- a/src/com/ctreber/acearth/util/StringParser.java
+++ b/src/ext/plantuml/com/ctreber/acearth/util/StringParser.java
@@ -1,4 +1,4 @@
-package com.ctreber.acearth.util;
+package ext.plantuml.com.ctreber.acearth.util;
import java.util.ArrayList;
import java.util.List;
diff --git a/src/com/ctreber/acearth/util/SunPositionCalculator.java b/src/ext/plantuml/com/ctreber/acearth/util/SunPositionCalculator.java
index 8df1d0d..736a2c3 100644
--- a/src/com/ctreber/acearth/util/SunPositionCalculator.java
+++ b/src/ext/plantuml/com/ctreber/acearth/util/SunPositionCalculator.java
@@ -1,4 +1,4 @@
-package com.ctreber.acearth.util;
+package ext.plantuml.com.ctreber.acearth.util;
import java.util.Calendar;
import java.util.Date;
diff --git a/src/com/ctreber/acearth/util/Toolkit.java b/src/ext/plantuml/com/ctreber/acearth/util/Toolkit.java
index 453f83b..12f3655 100644
--- a/src/com/ctreber/acearth/util/Toolkit.java
+++ b/src/ext/plantuml/com/ctreber/acearth/util/Toolkit.java
@@ -1,4 +1,4 @@
-package com.ctreber.acearth.util;
+package ext.plantuml.com.ctreber.acearth.util;
import java.util.HashSet;
import java.util.StringTokenizer;
diff --git a/src/com/ctreber/aclib/gui/MOBoolean.java b/src/ext/plantuml/com/ctreber/aclib/gui/MOBoolean.java
index a7a0207..814b927 100644
--- a/src/com/ctreber/aclib/gui/MOBoolean.java
+++ b/src/ext/plantuml/com/ctreber/aclib/gui/MOBoolean.java
@@ -1,4 +1,4 @@
-package com.ctreber.aclib.gui;
+package ext.plantuml.com.ctreber.aclib.gui;
/**
* <p></p>
diff --git a/src/com/ctreber/aclib/gui/MOChangeListener.java b/src/ext/plantuml/com/ctreber/aclib/gui/MOChangeListener.java
index d11fee1..2941637 100644
--- a/src/com/ctreber/aclib/gui/MOChangeListener.java
+++ b/src/ext/plantuml/com/ctreber/aclib/gui/MOChangeListener.java
@@ -1,4 +1,4 @@
-package com.ctreber.aclib.gui;
+package ext.plantuml.com.ctreber.aclib.gui;
/**
* <p>Implemented by classes interetested in MonitoredObject values changes.</p>
diff --git a/src/com/ctreber/aclib/gui/MODouble.java b/src/ext/plantuml/com/ctreber/aclib/gui/MODouble.java
index 01ea06b..722a5db 100644
--- a/src/com/ctreber/aclib/gui/MODouble.java
+++ b/src/ext/plantuml/com/ctreber/aclib/gui/MODouble.java
@@ -1,4 +1,4 @@
-package com.ctreber.aclib.gui;
+package ext.plantuml.com.ctreber.aclib.gui;
/**
* <p></p>
diff --git a/src/com/ctreber/aclib/gui/MOEnum.java b/src/ext/plantuml/com/ctreber/aclib/gui/MOEnum.java
index 08f42b3..f2b3cbf 100644
--- a/src/com/ctreber/aclib/gui/MOEnum.java
+++ b/src/ext/plantuml/com/ctreber/aclib/gui/MOEnum.java
@@ -1,4 +1,4 @@
-package com.ctreber.aclib.gui;
+package ext.plantuml.com.ctreber.aclib.gui;
import java.util.HashSet;
diff --git a/src/com/ctreber/aclib/gui/MOInteger.java b/src/ext/plantuml/com/ctreber/aclib/gui/MOInteger.java
index 8a3f004..0816615 100644
--- a/src/com/ctreber/aclib/gui/MOInteger.java
+++ b/src/ext/plantuml/com/ctreber/aclib/gui/MOInteger.java
@@ -1,4 +1,4 @@
-package com.ctreber.aclib.gui;
+package ext.plantuml.com.ctreber.aclib.gui;
/**
* <p></p>
diff --git a/src/com/ctreber/aclib/gui/MOString.java b/src/ext/plantuml/com/ctreber/aclib/gui/MOString.java
index e26ca40..dc1f92e 100644
--- a/src/com/ctreber/aclib/gui/MOString.java
+++ b/src/ext/plantuml/com/ctreber/aclib/gui/MOString.java
@@ -1,4 +1,4 @@
-package com.ctreber.aclib.gui;
+package ext.plantuml.com.ctreber.aclib.gui;
diff --git a/src/com/ctreber/aclib/gui/MonitoredObject.java b/src/ext/plantuml/com/ctreber/aclib/gui/MonitoredObject.java
index c2df8bf..8bb4824 100644
--- a/src/com/ctreber/aclib/gui/MonitoredObject.java
+++ b/src/ext/plantuml/com/ctreber/aclib/gui/MonitoredObject.java
@@ -1,4 +1,4 @@
-package com.ctreber.aclib.gui;
+package ext.plantuml.com.ctreber.aclib.gui;
import java.util.ArrayList;
import java.util.Iterator;
diff --git a/src/com/ctreber/aclib/sort/CTSort.java b/src/ext/plantuml/com/ctreber/aclib/sort/CTSort.java
index 5075c5e..4e9950b 100644
--- a/src/com/ctreber/aclib/sort/CTSort.java
+++ b/src/ext/plantuml/com/ctreber/aclib/sort/CTSort.java
@@ -1,4 +1,4 @@
-package com.ctreber.aclib.sort;
+package ext.plantuml.com.ctreber.aclib.sort;
import java.util.Comparator;
diff --git a/src/com/ctreber/aclib/sort/DefaultComparator.java b/src/ext/plantuml/com/ctreber/aclib/sort/DefaultComparator.java
index 10aa0ab..b183e41 100644
--- a/src/com/ctreber/aclib/sort/DefaultComparator.java
+++ b/src/ext/plantuml/com/ctreber/aclib/sort/DefaultComparator.java
@@ -1,4 +1,4 @@
-package com.ctreber.aclib.sort;
+package ext.plantuml.com.ctreber.aclib.sort;
import java.util.Comparator;
diff --git a/src/com/ctreber/aclib/sort/QuickSort.java b/src/ext/plantuml/com/ctreber/aclib/sort/QuickSort.java
index 588bc6d..a0922db 100644
--- a/src/com/ctreber/aclib/sort/QuickSort.java
+++ b/src/ext/plantuml/com/ctreber/aclib/sort/QuickSort.java
@@ -1,4 +1,4 @@
-package com.ctreber.aclib.sort;
+package ext.plantuml.com.ctreber.aclib.sort;
import java.util.Comparator;
diff --git a/src/com/google/zxing/BarcodeFormat.java b/src/ext/plantuml/com/google/zxing/BarcodeFormat.java
index 1cca09a..1356763 100644
--- a/src/com/google/zxing/BarcodeFormat.java
+++ b/src/ext/plantuml/com/google/zxing/BarcodeFormat.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing;
+package ext.plantuml.com.google.zxing;
import java.util.Hashtable;
diff --git a/src/com/google/zxing/ChecksumException.java b/src/ext/plantuml/com/google/zxing/ChecksumException.java
index dedb4be..fa2a890 100644
--- a/src/com/google/zxing/ChecksumException.java
+++ b/src/ext/plantuml/com/google/zxing/ChecksumException.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing;
+package ext.plantuml.com.google.zxing;
/**
* Thrown when a barcode was successfully detected and decoded, but
diff --git a/src/com/google/zxing/DecodeHintType.java b/src/ext/plantuml/com/google/zxing/DecodeHintType.java
index fb08bb3..133abb9 100644
--- a/src/com/google/zxing/DecodeHintType.java
+++ b/src/ext/plantuml/com/google/zxing/DecodeHintType.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing;
+package ext.plantuml.com.google.zxing;
import java.io.Reader;
diff --git a/src/com/google/zxing/EncodeHintType.java b/src/ext/plantuml/com/google/zxing/EncodeHintType.java
index 35afc15..8fc30c1 100644
--- a/src/com/google/zxing/EncodeHintType.java
+++ b/src/ext/plantuml/com/google/zxing/EncodeHintType.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing;
+package ext.plantuml.com.google.zxing;
/**
* These are a set of hints that you may pass to Writers to specify their behavior.
diff --git a/src/com/google/zxing/FormatException.java b/src/ext/plantuml/com/google/zxing/FormatException.java
index 6967e93..b8282a6 100644
--- a/src/com/google/zxing/FormatException.java
+++ b/src/ext/plantuml/com/google/zxing/FormatException.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing;
+package ext.plantuml.com.google.zxing;
/**
* Thrown when a barcode was successfully detected, but some aspect of
diff --git a/src/com/google/zxing/NotFoundException.java b/src/ext/plantuml/com/google/zxing/NotFoundException.java
index dedab8d..7d76242 100644
--- a/src/com/google/zxing/NotFoundException.java
+++ b/src/ext/plantuml/com/google/zxing/NotFoundException.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing;
+package ext.plantuml.com.google.zxing;
/**
* Thrown when a barcode was not found in the image. It might have been
diff --git a/src/com/google/zxing/ReaderException.java b/src/ext/plantuml/com/google/zxing/ReaderException.java
index 224a497..515d717 100644
--- a/src/com/google/zxing/ReaderException.java
+++ b/src/ext/plantuml/com/google/zxing/ReaderException.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing;
+package ext.plantuml.com.google.zxing;
/**
* The general exception class throw when something goes wrong during decoding of a barcode.
diff --git a/src/com/google/zxing/ResultPoint.java b/src/ext/plantuml/com/google/zxing/ResultPoint.java
index 0c8e883..b139d51 100644
--- a/src/com/google/zxing/ResultPoint.java
+++ b/src/ext/plantuml/com/google/zxing/ResultPoint.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing;
+package ext.plantuml.com.google.zxing;
/**
* <p>Encapsulates a point of interest in an image containing a barcode. Typically, this
diff --git a/src/com/google/zxing/Writer.java b/src/ext/plantuml/com/google/zxing/Writer.java
index c0b74d7..6d04bf0 100644
--- a/src/com/google/zxing/Writer.java
+++ b/src/ext/plantuml/com/google/zxing/Writer.java
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package com.google.zxing;
+package ext.plantuml.com.google.zxing;
import java.util.Hashtable;
-import com.google.zxing.common.BitMatrix;
+import ext.plantuml.com.google.zxing.common.BitMatrix;
/**
* The base class for all objects which encode/generate a barcode image.
diff --git a/src/com/google/zxing/WriterException.java b/src/ext/plantuml/com/google/zxing/WriterException.java
index 0c19af0..e605dd6 100644
--- a/src/com/google/zxing/WriterException.java
+++ b/src/ext/plantuml/com/google/zxing/WriterException.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing;
+package ext.plantuml.com.google.zxing;
/**
* A base class which covers the range of exceptions which may occur when encoding a barcode using
diff --git a/src/com/google/zxing/client/j2se/MatrixToImageWriter.java b/src/ext/plantuml/com/google/zxing/client/j2se/MatrixToImageWriter.java
index c4bcb1f..0d7db4f 100644
--- a/src/com/google/zxing/client/j2se/MatrixToImageWriter.java
+++ b/src/ext/plantuml/com/google/zxing/client/j2se/MatrixToImageWriter.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing.client.j2se;
+package ext.plantuml.com.google.zxing.client.j2se;
import java.awt.image.BufferedImage;
import java.io.File;
@@ -23,7 +23,7 @@ import java.io.OutputStream;
import javax.imageio.ImageIO;
-import com.google.zxing.common.BitMatrix;
+import ext.plantuml.com.google.zxing.common.BitMatrix;
/**
* Writes a {@link BitMatrix} to {@link BufferedImage},
diff --git a/src/com/google/zxing/common/BitArray.java b/src/ext/plantuml/com/google/zxing/common/BitArray.java
index bce6cee..341ddb6 100644
--- a/src/com/google/zxing/common/BitArray.java
+++ b/src/ext/plantuml/com/google/zxing/common/BitArray.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing.common;
+package ext.plantuml.com.google.zxing.common;
/**
* <p>A simple, fast array of bits, represented compactly by an array of ints internally.</p>
diff --git a/src/com/google/zxing/common/BitMatrix.java b/src/ext/plantuml/com/google/zxing/common/BitMatrix.java
index 26cd599..650fc24 100644
--- a/src/com/google/zxing/common/BitMatrix.java
+++ b/src/ext/plantuml/com/google/zxing/common/BitMatrix.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing.common;
+package ext.plantuml.com.google.zxing.common;
/**
* <p>Represents a 2D matrix of bits. In function arguments below, and throughout the common
diff --git a/src/com/google/zxing/common/BitSource.java b/src/ext/plantuml/com/google/zxing/common/BitSource.java
index e5d7b1c..50e39af 100644
--- a/src/com/google/zxing/common/BitSource.java
+++ b/src/ext/plantuml/com/google/zxing/common/BitSource.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing.common;
+package ext.plantuml.com.google.zxing.common;
/**
* <p>This provides an easy abstraction to read bits at a time from a sequence of bytes, where the
diff --git a/src/com/google/zxing/common/CharacterSetECI.java b/src/ext/plantuml/com/google/zxing/common/CharacterSetECI.java
index 26a1518..2b8bc18 100644
--- a/src/com/google/zxing/common/CharacterSetECI.java
+++ b/src/ext/plantuml/com/google/zxing/common/CharacterSetECI.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing.common;
+package ext.plantuml.com.google.zxing.common;
import java.util.Hashtable;
diff --git a/src/com/google/zxing/common/DecoderResult.java b/src/ext/plantuml/com/google/zxing/common/DecoderResult.java
index 6e6659b..97884c8 100644
--- a/src/com/google/zxing/common/DecoderResult.java
+++ b/src/ext/plantuml/com/google/zxing/common/DecoderResult.java
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package com.google.zxing.common;
+package ext.plantuml.com.google.zxing.common;
import java.util.Vector;
-import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
+import ext.plantuml.com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
/**
* <p>Encapsulates the result of decoding a matrix of bits. This typically
diff --git a/src/com/google/zxing/common/DetectorResult.java b/src/ext/plantuml/com/google/zxing/common/DetectorResult.java
index 5e3786a..d62d4b6 100644
--- a/src/com/google/zxing/common/DetectorResult.java
+++ b/src/ext/plantuml/com/google/zxing/common/DetectorResult.java
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-package com.google.zxing.common;
+package ext.plantuml.com.google.zxing.common;
-import com.google.zxing.ResultPoint;
+import ext.plantuml.com.google.zxing.ResultPoint;
/**
* <p>Encapsulates the result of detecting a barcode in an image. This includes the raw
diff --git a/src/com/google/zxing/common/ECI.java b/src/ext/plantuml/com/google/zxing/common/ECI.java
index 9d725db..5414732 100644
--- a/src/com/google/zxing/common/ECI.java
+++ b/src/ext/plantuml/com/google/zxing/common/ECI.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing.common;
+package ext.plantuml.com.google.zxing.common;
/**
* Superclass of classes encapsulating types ECIs, according to "Extended Channel Interpretations"
diff --git a/src/com/google/zxing/common/StringUtils.java b/src/ext/plantuml/com/google/zxing/common/StringUtils.java
index d3a7c2b..fbb516f 100644
--- a/src/com/google/zxing/common/StringUtils.java
+++ b/src/ext/plantuml/com/google/zxing/common/StringUtils.java
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package com.google.zxing.common;
+package ext.plantuml.com.google.zxing.common;
import java.util.Hashtable;
-import com.google.zxing.DecodeHintType;
+import ext.plantuml.com.google.zxing.DecodeHintType;
/**
* Common string-related functions.
diff --git a/src/com/google/zxing/common/reedsolomon/GF256.java b/src/ext/plantuml/com/google/zxing/common/reedsolomon/GF256.java
index 9c58275..3a726ac 100644
--- a/src/com/google/zxing/common/reedsolomon/GF256.java
+++ b/src/ext/plantuml/com/google/zxing/common/reedsolomon/GF256.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing.common.reedsolomon;
+package ext.plantuml.com.google.zxing.common.reedsolomon;
/**
* <p>This class contains utility methods for performing mathematical operations over
diff --git a/src/com/google/zxing/common/reedsolomon/GF256Poly.java b/src/ext/plantuml/com/google/zxing/common/reedsolomon/GF256Poly.java
index 8da7f93..288800a 100644
--- a/src/com/google/zxing/common/reedsolomon/GF256Poly.java
+++ b/src/ext/plantuml/com/google/zxing/common/reedsolomon/GF256Poly.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing.common.reedsolomon;
+package ext.plantuml.com.google.zxing.common.reedsolomon;
/**
* <p>Represents a polynomial whose coefficients are elements of GF(256).
diff --git a/src/com/google/zxing/common/reedsolomon/ReedSolomonEncoder.java b/src/ext/plantuml/com/google/zxing/common/reedsolomon/ReedSolomonEncoder.java
index 5ce80c8..bdc62c8 100644
--- a/src/com/google/zxing/common/reedsolomon/ReedSolomonEncoder.java
+++ b/src/ext/plantuml/com/google/zxing/common/reedsolomon/ReedSolomonEncoder.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing.common.reedsolomon;
+package ext.plantuml.com.google.zxing.common.reedsolomon;
import java.util.Vector;
diff --git a/src/com/google/zxing/common/reedsolomon/ReedSolomonException.java b/src/ext/plantuml/com/google/zxing/common/reedsolomon/ReedSolomonException.java
index d5b45a6..65301ef 100644
--- a/src/com/google/zxing/common/reedsolomon/ReedSolomonException.java
+++ b/src/ext/plantuml/com/google/zxing/common/reedsolomon/ReedSolomonException.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing.common.reedsolomon;
+package ext.plantuml.com.google.zxing.common.reedsolomon;
/**
* <p>Thrown when an exception occurs during Reed-Solomon decoding, such as when
diff --git a/src/com/google/zxing/datamatrix/decoder/BitMatrixParser.java b/src/ext/plantuml/com/google/zxing/datamatrix/decoder/BitMatrixParser.java
index c33839b..545e633 100644
--- a/src/com/google/zxing/datamatrix/decoder/BitMatrixParser.java
+++ b/src/ext/plantuml/com/google/zxing/datamatrix/decoder/BitMatrixParser.java
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-package com.google.zxing.datamatrix.decoder;
+package ext.plantuml.com.google.zxing.datamatrix.decoder;
-import com.google.zxing.FormatException;
-import com.google.zxing.common.BitMatrix;
+import ext.plantuml.com.google.zxing.FormatException;
+import ext.plantuml.com.google.zxing.common.BitMatrix;
/**
* @author bbrown@google.com (Brian Brown)
diff --git a/src/com/google/zxing/datamatrix/decoder/DataBlock.java b/src/ext/plantuml/com/google/zxing/datamatrix/decoder/DataBlock.java
index 1e605ac..21a8d20 100644
--- a/src/com/google/zxing/datamatrix/decoder/DataBlock.java
+++ b/src/ext/plantuml/com/google/zxing/datamatrix/decoder/DataBlock.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing.datamatrix.decoder;
+package ext.plantuml.com.google.zxing.datamatrix.decoder;
/**
* <p>Encapsulates a block of data within a Data Matrix Code. Data Matrix Codes may split their data into
diff --git a/src/com/google/zxing/datamatrix/decoder/Version.java b/src/ext/plantuml/com/google/zxing/datamatrix/decoder/Version.java
index 45f9e35..7e2ba20 100644
--- a/src/com/google/zxing/datamatrix/decoder/Version.java
+++ b/src/ext/plantuml/com/google/zxing/datamatrix/decoder/Version.java
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-package com.google.zxing.datamatrix.decoder;
+package ext.plantuml.com.google.zxing.datamatrix.decoder;
-import com.google.zxing.FormatException;
+import ext.plantuml.com.google.zxing.FormatException;
/**
* The Version object encapsulates attributes about a particular
diff --git a/src/com/google/zxing/qrcode/QRCodeWriter.java b/src/ext/plantuml/com/google/zxing/qrcode/QRCodeWriter.java
index bb20008..be6e8e1 100644
--- a/src/com/google/zxing/qrcode/QRCodeWriter.java
+++ b/src/ext/plantuml/com/google/zxing/qrcode/QRCodeWriter.java
@@ -14,19 +14,19 @@
* limitations under the License.
*/
-package com.google.zxing.qrcode;
+package ext.plantuml.com.google.zxing.qrcode;
import java.util.Hashtable;
-import com.google.zxing.BarcodeFormat;
-import com.google.zxing.EncodeHintType;
-import com.google.zxing.Writer;
-import com.google.zxing.WriterException;
-import com.google.zxing.common.BitMatrix;
-import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
-import com.google.zxing.qrcode.encoder.ByteMatrix;
-import com.google.zxing.qrcode.encoder.Encoder;
-import com.google.zxing.qrcode.encoder.QRCode;
+import ext.plantuml.com.google.zxing.BarcodeFormat;
+import ext.plantuml.com.google.zxing.EncodeHintType;
+import ext.plantuml.com.google.zxing.Writer;
+import ext.plantuml.com.google.zxing.WriterException;
+import ext.plantuml.com.google.zxing.common.BitMatrix;
+import ext.plantuml.com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
+import ext.plantuml.com.google.zxing.qrcode.encoder.ByteMatrix;
+import ext.plantuml.com.google.zxing.qrcode.encoder.Encoder;
+import ext.plantuml.com.google.zxing.qrcode.encoder.QRCode;
/**
* This object renders a QR Code as a BitMatrix 2D array of greyscale values.
diff --git a/src/com/google/zxing/qrcode/decoder/BitMatrixParser.java b/src/ext/plantuml/com/google/zxing/qrcode/decoder/BitMatrixParser.java
index dfe6fd3..3fe58c2 100644
--- a/src/com/google/zxing/qrcode/decoder/BitMatrixParser.java
+++ b/src/ext/plantuml/com/google/zxing/qrcode/decoder/BitMatrixParser.java
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-package com.google.zxing.qrcode.decoder;
+package ext.plantuml.com.google.zxing.qrcode.decoder;
-import com.google.zxing.FormatException;
-import com.google.zxing.common.BitMatrix;
+import ext.plantuml.com.google.zxing.FormatException;
+import ext.plantuml.com.google.zxing.common.BitMatrix;
/**
* @author Sean Owen
diff --git a/src/com/google/zxing/qrcode/decoder/DataBlock.java b/src/ext/plantuml/com/google/zxing/qrcode/decoder/DataBlock.java
index 215f6c0..b6f673c 100644
--- a/src/com/google/zxing/qrcode/decoder/DataBlock.java
+++ b/src/ext/plantuml/com/google/zxing/qrcode/decoder/DataBlock.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing.qrcode.decoder;
+package ext.plantuml.com.google.zxing.qrcode.decoder;
/**
* <p>Encapsulates a block of data within a QR Code. QR Codes may split their data into
diff --git a/src/com/google/zxing/qrcode/decoder/DataMask.java b/src/ext/plantuml/com/google/zxing/qrcode/decoder/DataMask.java
index 48036b1..c705a8d 100644
--- a/src/com/google/zxing/qrcode/decoder/DataMask.java
+++ b/src/ext/plantuml/com/google/zxing/qrcode/decoder/DataMask.java
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-package com.google.zxing.qrcode.decoder;
+package ext.plantuml.com.google.zxing.qrcode.decoder;
-import com.google.zxing.common.BitMatrix;
+import ext.plantuml.com.google.zxing.common.BitMatrix;
/**
* <p>Encapsulates data masks for the data bits in a QR code, per ISO 18004:2006 6.8. Implementations
diff --git a/src/com/google/zxing/qrcode/decoder/ErrorCorrectionLevel.java b/src/ext/plantuml/com/google/zxing/qrcode/decoder/ErrorCorrectionLevel.java
index 400611a..61760cc 100644
--- a/src/com/google/zxing/qrcode/decoder/ErrorCorrectionLevel.java
+++ b/src/ext/plantuml/com/google/zxing/qrcode/decoder/ErrorCorrectionLevel.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing.qrcode.decoder;
+package ext.plantuml.com.google.zxing.qrcode.decoder;
/**
* <p>See ISO 18004:2006, 6.5.1. This enum encapsulates the four error correction levels
diff --git a/src/com/google/zxing/qrcode/decoder/FormatInformation.java b/src/ext/plantuml/com/google/zxing/qrcode/decoder/FormatInformation.java
index 1b76b0d..6ae6bb9 100644
--- a/src/com/google/zxing/qrcode/decoder/FormatInformation.java
+++ b/src/ext/plantuml/com/google/zxing/qrcode/decoder/FormatInformation.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing.qrcode.decoder;
+package ext.plantuml.com.google.zxing.qrcode.decoder;
/**
* <p>Encapsulates a QR Code's format information, including the data mask used and
diff --git a/src/com/google/zxing/qrcode/decoder/Mode.java b/src/ext/plantuml/com/google/zxing/qrcode/decoder/Mode.java
index 24117dc..882a5c6 100644
--- a/src/com/google/zxing/qrcode/decoder/Mode.java
+++ b/src/ext/plantuml/com/google/zxing/qrcode/decoder/Mode.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing.qrcode.decoder;
+package ext.plantuml.com.google.zxing.qrcode.decoder;
/**
* <p>See ISO 18004:2006, 6.4.1, Tables 2 and 3. This enum encapsulates the various modes in which
diff --git a/src/com/google/zxing/qrcode/decoder/Version.java b/src/ext/plantuml/com/google/zxing/qrcode/decoder/Version.java
index e496005..93b0732 100644
--- a/src/com/google/zxing/qrcode/decoder/Version.java
+++ b/src/ext/plantuml/com/google/zxing/qrcode/decoder/Version.java
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-package com.google.zxing.qrcode.decoder;
+package ext.plantuml.com.google.zxing.qrcode.decoder;
-import com.google.zxing.FormatException;
-import com.google.zxing.common.BitMatrix;
+import ext.plantuml.com.google.zxing.FormatException;
+import ext.plantuml.com.google.zxing.common.BitMatrix;
/**
* See ISO 18004:2006 Annex D
diff --git a/src/com/google/zxing/qrcode/encoder/BlockPair.java b/src/ext/plantuml/com/google/zxing/qrcode/encoder/BlockPair.java
index 5714d9c..b0e0312 100644
--- a/src/com/google/zxing/qrcode/encoder/BlockPair.java
+++ b/src/ext/plantuml/com/google/zxing/qrcode/encoder/BlockPair.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing.qrcode.encoder;
+package ext.plantuml.com.google.zxing.qrcode.encoder;
final class BlockPair {
diff --git a/src/com/google/zxing/qrcode/encoder/ByteMatrix.java b/src/ext/plantuml/com/google/zxing/qrcode/encoder/ByteMatrix.java
index eb248a2..51ca1a1 100644
--- a/src/com/google/zxing/qrcode/encoder/ByteMatrix.java
+++ b/src/ext/plantuml/com/google/zxing/qrcode/encoder/ByteMatrix.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing.qrcode.encoder;
+package ext.plantuml.com.google.zxing.qrcode.encoder;
/**
* A class which wraps a 2D array of bytes. The default usage is signed. If you want to use it as a
diff --git a/src/com/google/zxing/qrcode/encoder/Encoder.java b/src/ext/plantuml/com/google/zxing/qrcode/encoder/Encoder.java
index 5891488..04ea0b6 100644
--- a/src/com/google/zxing/qrcode/encoder/Encoder.java
+++ b/src/ext/plantuml/com/google/zxing/qrcode/encoder/Encoder.java
@@ -14,22 +14,22 @@
* limitations under the License.
*/
-package com.google.zxing.qrcode.encoder;
+package ext.plantuml.com.google.zxing.qrcode.encoder;
import java.io.UnsupportedEncodingException;
import java.util.Hashtable;
import java.util.Vector;
-import com.google.zxing.EncodeHintType;
-import com.google.zxing.WriterException;
-import com.google.zxing.common.BitArray;
-import com.google.zxing.common.CharacterSetECI;
-import com.google.zxing.common.ECI;
-import com.google.zxing.common.reedsolomon.GF256;
-import com.google.zxing.common.reedsolomon.ReedSolomonEncoder;
-import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
-import com.google.zxing.qrcode.decoder.Mode;
-import com.google.zxing.qrcode.decoder.Version;
+import ext.plantuml.com.google.zxing.EncodeHintType;
+import ext.plantuml.com.google.zxing.WriterException;
+import ext.plantuml.com.google.zxing.common.BitArray;
+import ext.plantuml.com.google.zxing.common.CharacterSetECI;
+import ext.plantuml.com.google.zxing.common.ECI;
+import ext.plantuml.com.google.zxing.common.reedsolomon.GF256;
+import ext.plantuml.com.google.zxing.common.reedsolomon.ReedSolomonEncoder;
+import ext.plantuml.com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
+import ext.plantuml.com.google.zxing.qrcode.decoder.Mode;
+import ext.plantuml.com.google.zxing.qrcode.decoder.Version;
/**
* @author satorux@google.com (Satoru Takabayashi) - creator
diff --git a/src/com/google/zxing/qrcode/encoder/MaskUtil.java b/src/ext/plantuml/com/google/zxing/qrcode/encoder/MaskUtil.java
index c7f3c48..b142084 100644
--- a/src/com/google/zxing/qrcode/encoder/MaskUtil.java
+++ b/src/ext/plantuml/com/google/zxing/qrcode/encoder/MaskUtil.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.zxing.qrcode.encoder;
+package ext.plantuml.com.google.zxing.qrcode.encoder;
/**
* @author satorux@google.com (Satoru Takabayashi) - creator
diff --git a/src/com/google/zxing/qrcode/encoder/MatrixUtil.java b/src/ext/plantuml/com/google/zxing/qrcode/encoder/MatrixUtil.java
index 76bdb18..bbf1c22 100644
--- a/src/com/google/zxing/qrcode/encoder/MatrixUtil.java
+++ b/src/ext/plantuml/com/google/zxing/qrcode/encoder/MatrixUtil.java
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package com.google.zxing.qrcode.encoder;
+package ext.plantuml.com.google.zxing.qrcode.encoder;
-import com.google.zxing.WriterException;
-import com.google.zxing.common.BitArray;
-import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
+import ext.plantuml.com.google.zxing.WriterException;
+import ext.plantuml.com.google.zxing.common.BitArray;
+import ext.plantuml.com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
/**
* @author satorux@google.com (Satoru Takabayashi) - creator
diff --git a/src/com/google/zxing/qrcode/encoder/QRCode.java b/src/ext/plantuml/com/google/zxing/qrcode/encoder/QRCode.java
index 05c8185..c14a6c3 100644
--- a/src/com/google/zxing/qrcode/encoder/QRCode.java
+++ b/src/ext/plantuml/com/google/zxing/qrcode/encoder/QRCode.java
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-package com.google.zxing.qrcode.encoder;
+package ext.plantuml.com.google.zxing.qrcode.encoder;
-import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
-import com.google.zxing.qrcode.decoder.Mode;
+import ext.plantuml.com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
+import ext.plantuml.com.google.zxing.qrcode.decoder.Mode;
/**
* @author satorux@google.com (Satoru Takabayashi) - creator
diff --git a/src/gen/lib/cdt/dtdisc__c.java b/src/gen/lib/cdt/dtdisc__c.java
index 125c860..2e361a7 100644
--- a/src/gen/lib/cdt/dtdisc__c.java
+++ b/src/gen/lib/cdt/dtdisc__c.java
@@ -54,6 +54,7 @@ import h._dt_s;
import h._dtdisc_s;
import h._dtlink_s;
import smetana.core.CString;
+import smetana.core.size_t;
public class dtdisc__c {
//1 9k44uhd5foylaeoekf3llonjq
@@ -124,19 +125,15 @@ public class dtdisc__c {
//3 507t9jcy6v9twvl30rs9i2nwi
// static void* dtmemory(Dt_t* dt,void* addr,size_t size,Dtdisc_t* disc)
-public static Object dtmemory(Object... arg) {
-UNSUPPORTED("18b3dn3pevbf7ajed6fftvnzk"); // static void* dtmemory(Dt_t* dt,void* addr,size_t size,Dtdisc_t* disc)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("cmb0rxzo3c2wr18j0upjz9iml"); // if(addr)
-UNSUPPORTED("bn1cyxafod2777wzl55qh14xq"); // { if(size == 0)
+public static Object dtmemory(_dt_s dt, Object addr, size_t size, _dtdisc_s disc) {
+if(addr!=null) {
+UNSUPPORTED("bn1cyxafod2777wzl55qh14xq"); // if(size == 0)
UNSUPPORTED("15j5ccp5owse1ebc5ljhbzg59"); // { free(addr);
UNSUPPORTED("aihzmr4oo3tuh6kkxwtn9tlbd"); // return ((void*)0);
UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
UNSUPPORTED("9ed8imo9cbvwtwe92qmavoqko"); // else return realloc(addr,size);
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("ew5p7pzg1fmdih1t3u25rqz6y"); // else return size > 0 ? malloc(size) : ((void*)0);
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
+}
+else return size.isStrictPositive() ? size.malloc() : null;
throw new UnsupportedOperationException();
}
diff --git a/src/gen/lib/cgraph/graph__c.java b/src/gen/lib/cgraph/graph__c.java
index 01bbe3a..64a36c3 100644
--- a/src/gen/lib/cgraph/graph__c.java
+++ b/src/gen/lib/cgraph/graph__c.java
@@ -241,7 +241,8 @@ try {
rv.getStruct("disc").setPtr("mem", memdisc);
rv.getStruct("state").setPtr("mem", memclosure);
rv.getStruct("disc").setPtr("id", ((proto != null && proto.getPtr("id") != null) ? proto.getPtr("id") : Z.z().AgIdDisc.amp()));
- rv.getStruct("disc").setPtr("io", ((proto != null && proto.getPtr("io") != null) ? proto.getPtr("io") : Z.z().AgIdDisc.amp()));
+ // Translation bug in next line: should be AgIoDisc and not AgIdDisc
+ // rv.getStruct("disc").setPtr("io", ((proto != null && proto.getPtr("io") != null) ? proto.getPtr("io") : Z.z().AgIdDisc.amp()));
rv.setBoolean("callbacks_enabled", (N(0)));
return rv;
} finally {
diff --git a/src/gen/lib/common/arrows__c.java b/src/gen/lib/common/arrows__c.java
index 1c49c22..00af6c0 100644
--- a/src/gen/lib/common/arrows__c.java
+++ b/src/gen/lib/common/arrows__c.java
@@ -68,6 +68,7 @@ import smetana.core.JUtils;
import smetana.core.MutableDouble;
import smetana.core.Z;
import smetana.core.__array_of_struct__;
+import smetana.core.__array_of_struct_impl__;
import smetana.core.__ptr__;
import smetana.core.__struct__;
@@ -934,7 +935,7 @@ public static int arrowEndClip(Agedge_s e, __ptr__ ps, int startp, int endp, bez
ENTERING("9eellwhg4gsa2pdszpeqihs2d","arrowEndClip");
try {
final __struct__<inside_t> inside_context = JUtils.from(inside_t.class);
- final __array_of_struct__ sp = __array_of_struct__.malloc(pointf.class, 4);
+ final __array_of_struct__ sp = __array_of_struct_impl__.malloc(pointf.class, 4);
double elen;
MutableDouble elen2 = new MutableDouble(0);
elen = arrow_length(e, eflag);
@@ -971,7 +972,7 @@ public static int arrowStartClip(Agedge_s e, __ptr__ ps, int startp, int endp, b
ENTERING("q7y4oxn0paexbgynmtg2zmiv","arrowStartClip");
try {
final __struct__<inside_t> inside_context = JUtils.from(inside_t.class);
- final __array_of_struct__ sp = __array_of_struct__.malloc(pointf.class, 4);
+ final __array_of_struct__ sp = __array_of_struct_impl__.malloc(pointf.class, 4);
double slen;
MutableDouble slen2 = new MutableDouble(0);
slen = arrow_length(e, sflag);
diff --git a/src/gen/lib/common/emit__c.java b/src/gen/lib/common/emit__c.java
index c58ad80..03a0459 100644
--- a/src/gen/lib/common/emit__c.java
+++ b/src/gen/lib/common/emit__c.java
@@ -58,6 +58,7 @@ import h.xdot;
import smetana.core.CString;
import smetana.core.JUtils;
import smetana.core.__array_of_struct__;
+import smetana.core.__array_of_struct_impl__;
import smetana.core.__ptr__;
import smetana.core.__struct__;
@@ -1444,8 +1445,8 @@ try {
}
}
else { /* else refine the segment */
- final __array_of_struct__ left = __array_of_struct__.malloc(pointf.class, 4);
- final __array_of_struct__ right = __array_of_struct__.malloc(pointf.class, 4);
+ final __array_of_struct__ left = __array_of_struct_impl__.malloc(pointf.class, 4);
+ final __array_of_struct__ right = __array_of_struct_impl__.malloc(pointf.class, 4);
Bezier (cp, 3, 0.5, left.asPtr(), right.asPtr());
update_bb_bz(bb, left);
update_bb_bz(bb, right);
diff --git a/src/gen/lib/common/labels__c.java b/src/gen/lib/common/labels__c.java
index 4aa1671..824601b 100644
--- a/src/gen/lib/common/labels__c.java
+++ b/src/gen/lib/common/labels__c.java
@@ -1085,8 +1085,8 @@ try {
h_len = strlen(h_str);
tl = ED_label(obj.castTo(Agedge_s.class));
if (tl!=null) {
-UNSUPPORTED("88b430s6vk0irhr2k7x9crz9l"); // l_str = tl->text;
-UNSUPPORTED("5hjl5oveu3muui5b0fffh0dz2"); // if (str) l_len = strlen(l_str);
+ l_str = tl.getCString("text");
+ if (str!=null) l_len = strlen(l_str);
}
if (agisdirected(agroot(agraphof(agtail((obj.castTo(Agedge_s.class)))))))
e_str = new CString("->");
diff --git a/src/gen/lib/common/postproc__c.java b/src/gen/lib/common/postproc__c.java
index f705512..40ee2fd 100644
--- a/src/gen/lib/common/postproc__c.java
+++ b/src/gen/lib/common/postproc__c.java
@@ -44,18 +44,26 @@
*
*/
package gen.lib.common;
+import static gen.lib.cgraph.attr__c.agattr;
import static gen.lib.cgraph.edge__c.agfstout;
import static gen.lib.cgraph.edge__c.aghead;
import static gen.lib.cgraph.edge__c.agnxtout;
import static gen.lib.cgraph.edge__c.agtail;
+import static gen.lib.cgraph.graph__c.agnnodes;
import static gen.lib.cgraph.id__c.agnameof;
import static gen.lib.cgraph.node__c.agfstnode;
import static gen.lib.cgraph.node__c.agnxtnode;
import static gen.lib.cgraph.obj__c.agroot;
import static gen.lib.common.geom__c.ccwrotatepf;
+import static gen.lib.common.memory__c.zmalloc;
+import static gen.lib.common.splines__c.getsplinepoints;
+import static gen.lib.common.utils__c.late_bool;
+import static gen.lib.label.xlabels__c.placeLabels;
import static smetana.core.JUtils.NEQ;
+import static smetana.core.JUtils.sizeof;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
+import static smetana.core.Macro.AGRAPH;
import static smetana.core.Macro.ED_edge_type;
import static smetana.core.Macro.ED_head_label;
import static smetana.core.Macro.ED_label;
@@ -72,8 +80,13 @@ import static smetana.core.Macro.GD_label;
import static smetana.core.Macro.GD_label_pos;
import static smetana.core.Macro.GD_n_cluster;
import static smetana.core.Macro.GD_rankdir;
+import static smetana.core.Macro.INT_MAX;
+import static smetana.core.Macro.MAX;
+import static smetana.core.Macro.MIN;
import static smetana.core.Macro.N;
import static smetana.core.Macro.ND_coord;
+import static smetana.core.Macro.ND_height;
+import static smetana.core.Macro.ND_width;
import static smetana.core.Macro.ND_xlabel;
import static smetana.core.Macro.NOT;
import static smetana.core.Macro.UNSUPPORTED;
@@ -87,10 +100,13 @@ import h.boxf;
import h.label_params_t;
import h.object_t;
import h.pointf;
+import h.splines;
import h.textlabel_t;
import h.xlabel_t;
+import smetana.core.CString;
import smetana.core.JUtils;
import smetana.core.Z;
+import smetana.core.__ptr__;
import smetana.core.__struct__;
public class postproc__c {
@@ -975,24 +991,25 @@ throw new UnsupportedOperationException();
//3 av67wf2xi70ncgl90j1ttrjjs
// static pointf edgeHeadpoint (Agedge_t* e)
-public static Object edgeHeadpoint(Object... arg) {
-UNSUPPORTED("2zzd7mrm2u540dwuyzehozffj"); // static pointf
-UNSUPPORTED("ckf4uk77aptax4a60w2nhrdzl"); // edgeHeadpoint (Agedge_t* e)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("6tl9mepc2bett364jduh2q4mf"); // splines *spl;
-UNSUPPORTED("3hs99atzl1l857khumt6ycmbh"); // bezier *bez;
-UNSUPPORTED("26m18ntdxgq9wp5vlh2x7auh5"); // if ((spl = getsplinepoints(e)) == NULL) {
+public static __struct__<pointf> edgeHeadpoint(Agedge_s e) {
+ return edgeHeadpoint_(e).copy();
+}
+private static __struct__<pointf> edgeHeadpoint_(Agedge_s e) {
+ splines spl;
+ __ptr__ bez;
+ spl = getsplinepoints(e);
+if (spl == null) {
UNSUPPORTED("9wdrv4uc4c7ssn0qpmxgz5eu1"); // pointf p;
UNSUPPORTED("ezy0ey6dn5uqp6peuorn615x6"); // p.x = p.y = 0;
UNSUPPORTED("68kasxgknec72r19lohbk6n3q"); // return p;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("mjw3aaq1rghmemky1iymklp4"); // bez = &spl->list[spl->size - 1];
-UNSUPPORTED("5g1i4pbq9il9iba3urs6bxfa0"); // if (bez->eflag) {
-UNSUPPORTED("5vt6gwb8d8689fuwqbt5uhb12"); // return bez->ep;
-UNSUPPORTED("c07up7zvrnu2vhzy6d7zcu94g"); // } else {
+}
+bez = spl.getArrayOfPtr("list").plus(spl.getInt("size") - 1).getPtr();
+// bez = &spl->list[spl->size - 1];
+if (bez.getBoolean("eflag")) {
+ return bez.getStruct("ep");
+} else {
UNSUPPORTED("6qzm0hh4pxrspfbvxearcz9z8"); // return bez->list[bez->size - 1];
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
+}
throw new UnsupportedOperationException();
}
@@ -1002,22 +1019,19 @@ throw new UnsupportedOperationException();
//3 1ca6fh8ns5bgzfzcz8al4eh4k
// static boxf adjustBB (object_t* objp, boxf bb)
-public static Object adjustBB(Object... arg) {
-UNSUPPORTED("d5qt6s97burjfu5qe0oxyyrmr"); // static boxf
-UNSUPPORTED("2gtud943baz3kfj1vqqhjeaj4"); // adjustBB (object_t* objp, boxf bb)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("1ilrhzyqh05f2u3j3vzg0ys8u"); // pointf ur;
-UNSUPPORTED("a4qac74i3mtrli231q9zmy8pn"); // /* Adjust bounding box */
-UNSUPPORTED("cgmwicrpoafwh8qt3zob8r2ye"); // bb.LL.x = MIN(bb.LL.x, objp->pos.x);
-UNSUPPORTED("dqb32jehkpiyfzbiwusv0ex1n"); // bb.LL.y = MIN(bb.LL.y, objp->pos.y);
-UNSUPPORTED("coywjj9bhu737b59inwiumkbc"); // ur.x = objp->pos.x + objp->sz.x;
-UNSUPPORTED("4zg7x4gv3ox92n323b2vzaq32"); // ur.y = objp->pos.y + objp->sz.y;
-UNSUPPORTED("p351si3o2tnvdcb1o5i8et1b"); // bb.UR.x = MAX(bb.UR.x, ur.x);
-UNSUPPORTED("4a11bd6b7vdmcwc7r71y9k37z"); // bb.UR.y = MAX(bb.UR.y, ur.y);
-UNSUPPORTED("5v5hh30squmit8o2i5hs25eig"); // return bb;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static __struct__<boxf> adjustBB(__ptr__ objp, __struct__<boxf> bb) {
+ return adjustBB_(objp, bb.copy()).copy();
+}
+private static __struct__<boxf> adjustBB_(__ptr__ objp, __struct__<boxf> bb) {
+ final __struct__<pointf> ur = JUtils.from(pointf.class);
+ /* Adjust bounding box */
+ bb.getStruct("LL").setDouble("x", MIN(bb.getStruct("LL").getDouble("x"), objp.getPtr("pos").getDouble("x")));
+ bb.getStruct("LL").setDouble("y", MIN(bb.getStruct("LL").getDouble("y"), objp.getPtr("pos").getDouble("y")));
+ ur.setDouble("x", objp.getPtr("pos").getDouble("x") + objp.getPtr("sz").getDouble("x"));
+ ur.setDouble("y", objp.getPtr("pos").getDouble("y") + objp.getPtr("sz").getDouble("y"));
+ bb.getStruct("UR").setDouble("x", MAX(bb.getStruct("UR").getDouble("x"), ur.getDouble("x")));
+ bb.getStruct("UR").setDouble("y", MAX(bb.getStruct("UR").getDouble("y"), ur.getDouble("y")));
+ return bb;
}
@@ -1025,28 +1039,25 @@ throw new UnsupportedOperationException();
//3 3mefe722uemyoa0czmkkw6hjb
// static void addXLabel (textlabel_t* lp, object_t* objp, xlabel_t* xlp, int initObj, pointf pos)
-public static Object addXLabel(Object... arg) {
-UNSUPPORTED("e2z2o5ybnr5tgpkt8ty7hwan1"); // static void
-UNSUPPORTED("as13cbda9pe3uxi34emdcyw49"); // addXLabel (textlabel_t* lp, object_t* objp, xlabel_t* xlp, int initObj, pointf pos)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("47i4tbdfy05npmfnxoa2ljezv"); // if (initObj) {
-UNSUPPORTED("4brnnjtxt9czl9vlvf1hi62hq"); // objp->sz.x = 0;
-UNSUPPORTED("8vps14u07wyyud2ryypqvjgog"); // objp->sz.y = 0;
-UNSUPPORTED("eiw9ykn654ml54rs1bw0lf55b"); // objp->pos = pos;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("7e3xcf5dxjm2knry7yygcx3zv"); // if (Flip) {
+public static void addXLabel(textlabel_t lp, __ptr__ objp, __ptr__ xlp, int initObj, __struct__<pointf> pos) {
+ addXLabel_(lp, objp, xlp, initObj, pos.copy());
+}
+private static void addXLabel_(textlabel_t lp, __ptr__ objp, __ptr__ xlp, int initObj, __struct__<pointf> pos) {
+if (initObj!=0) {
+ objp.getStruct("sz").setDouble("x", 0);
+ objp.getStruct("sz").setDouble("y", 0);
+ objp.setStruct("pos", pos);
+}
+if (Z.z().Flip) {
UNSUPPORTED("99tzt7erbvtfsbo0jbdz0lc8m"); // xlp->sz.x = lp->dimen.y;
UNSUPPORTED("6v5t3ysaisj27bwc0r9zg3rpd"); // xlp->sz.y = lp->dimen.x;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("1nyzbeonram6636b1w955bypn"); // else {
-UNSUPPORTED("3fr3ccpgshd8wywufcfat4rf5"); // xlp->sz = lp->dimen;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("jd8wxj8hvqwupmayd743a386"); // xlp->lbl = lp;
-UNSUPPORTED("1z3b8kb1emm8lvcqvu8sm8r7j"); // xlp->set = 0;
-UNSUPPORTED("a1r2pwxgnrpltol41p04axtld"); // objp->lbl = xlp;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+}
+else {
+ xlp.setStruct("sz", lp.getStruct("dimen"));
+}
+xlp.setPtr("lbl", lp);
+xlp.setInt("set", 0);
+objp.setPtr("lbl", xlp);
}
@@ -1054,25 +1065,28 @@ throw new UnsupportedOperationException();
//3 dwxd5kvlanbcxqfuncjg0ea54
// static boxf addLabelObj (textlabel_t* lp, object_t* objp, boxf bb)
-public static Object addLabelObj(Object... arg) {
-UNSUPPORTED("d5qt6s97burjfu5qe0oxyyrmr"); // static boxf
-UNSUPPORTED("9yg6tco97jfdkxvya77inw8xx"); // addLabelObj (textlabel_t* lp, object_t* objp, boxf bb)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("7e3xcf5dxjm2knry7yygcx3zv"); // if (Flip) {
+public static __struct__<boxf> addLabelObj(textlabel_t lp, __ptr__ objp, __struct__<boxf> bb) {
+ // WARNING!! STRUCT
+ return addLabelObj_(lp, objp, bb.copy()).copy();
+}
+private static __struct__<boxf> addLabelObj_(textlabel_t lp, __ptr__ objp, __struct__<boxf> bb) {
+ ENTERING("b8tjygxnwny5qoiir1mha1d62","map_point");
+ try {
+ if (Z.z().Flip) {
UNSUPPORTED("6z2yrwq81gtsk3q9c5pofow1x"); // objp->sz.x = lp->dimen.y;
UNSUPPORTED("8xsm9kavrekjrsydqe1wh1pu"); // objp->sz.y = lp->dimen.x;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("1nyzbeonram6636b1w955bypn"); // else {
-UNSUPPORTED("40zw1ce6j4iw8dzvp9musrk6g"); // objp->sz.x = lp->dimen.x;
-UNSUPPORTED("3kmv74u3ihq63ptaixci1tlt5"); // objp->sz.y = lp->dimen.y;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("ekb3vmkpcdegpnlbuvebyijm8"); // objp->pos = lp->pos;
-UNSUPPORTED("6c49iw60twquhten0558iva1c"); // objp->pos.x -= (objp->sz.x) / 2.0;
-UNSUPPORTED("alrfakfz0nqemd3xl3m9q2gm4"); // objp->pos.y -= (objp->sz.y) / 2.0;
-UNSUPPORTED("5r3oym45e21gwxn3nsjucxlbi"); // return adjustBB(objp, bb);
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+ }
+ else {
+ objp.getPtr("sz").setDouble("x", lp.getStruct("dimen").getDouble("x"));
+ objp.getPtr("sz").setDouble("y", lp.getStruct("dimen").getDouble("y"));
+ }
+ objp.setStruct("pos", lp.getStruct("pos"));
+ objp.getStruct("pos").setDouble("x", objp.getStruct("pos").getDouble("x") - (objp.getStruct("sz").getDouble("x") / 2.0 ));
+ objp.getStruct("pos").setDouble("y", objp.getStruct("pos").getDouble("y") - (objp.getStruct("sz").getDouble("y") / 2.0 ));
+ return adjustBB(objp, bb);
+ } finally {
+ LEAVING("dajapw16wus3rwimkrk5ihi2b","map_point");
+ }
}
@@ -1080,25 +1094,28 @@ throw new UnsupportedOperationException();
//3 b8tjygxnwny5qoiir1mha1d62
// static boxf addNodeObj (node_t* np, object_t* objp, boxf bb)
-public static Object addNodeObj(Object... arg) {
-UNSUPPORTED("d5qt6s97burjfu5qe0oxyyrmr"); // static boxf
-UNSUPPORTED("cdh6qqtv45t605q7je7xomi2j"); // addNodeObj (node_t* np, object_t* objp, boxf bb)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("7e3xcf5dxjm2knry7yygcx3zv"); // if (Flip) {
-UNSUPPORTED("1ri5uimcd1z58iix8tp528l1m"); // objp->sz.x = ((ND_height(np))*(double)72);
-UNSUPPORTED("6r5gwwhz3sjxrssh8yo3v5c3v"); // objp->sz.y = ((ND_width(np))*(double)72);
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("1nyzbeonram6636b1w955bypn"); // else {
-UNSUPPORTED("6cuxjl9g4nxwyz58c201qdb94"); // objp->sz.x = ((ND_width(np))*(double)72);
-UNSUPPORTED("e3zk2j9kbexxv2xbsgu3pser6"); // objp->sz.y = ((ND_height(np))*(double)72);
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("d6gkdf4gkfagwtb6mkhxxvqrc"); // objp->pos = ND_coord(np);
-UNSUPPORTED("6c49iw60twquhten0558iva1c"); // objp->pos.x -= (objp->sz.x) / 2.0;
-UNSUPPORTED("alrfakfz0nqemd3xl3m9q2gm4"); // objp->pos.y -= (objp->sz.y) / 2.0;
-UNSUPPORTED("5r3oym45e21gwxn3nsjucxlbi"); // return adjustBB(objp, bb);
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static __struct__<boxf> addNodeObj(Agnode_s np, __ptr__ objp, __struct__<boxf> bb) {
+ // WARNING!! STRUCT
+ return addNodeObj_(np, objp, bb.copy()).copy();
+}
+public static __struct__<boxf> addNodeObj_(Agnode_s np, __ptr__ objp, __struct__<boxf> bb) {
+ENTERING("b8tjygxnwny5qoiir1mha1d62","map_point");
+try {
+ if (Z.z().Flip) {
+ UNSUPPORTED("1ri5uimcd1z58iix8tp528l1m"); // objp->sz.x = ((ND_height(np))*(double)72);
+ UNSUPPORTED("6r5gwwhz3sjxrssh8yo3v5c3v"); // objp->sz.y = ((ND_width(np))*(double)72);
+ }
+ else {
+ objp.getPtr("sz").setDouble("x", ((ND_width(np))*(double)72));
+ objp.getPtr("sz").setDouble("y", ((ND_height(np))*(double)72));
+ }
+ objp.setPtr("pos", ND_coord(np));
+ objp.getPtr("pos").setDouble("x", objp.getPtr("pos").getDouble("x") - objp.getPtr("sz").getDouble("x") / 2.0);
+ objp.getPtr("pos").setDouble("y", objp.getPtr("pos").getDouble("y") - objp.getPtr("sz").getDouble("y") / 2.0);
+ return adjustBB(objp, bb);
+} finally {
+ LEAVING("dajapw16wus3rwimkrk5ihi2b","map_point");
+}
}
@@ -1163,10 +1180,10 @@ try {
final __struct__<pointf> ur = JUtils.from(pointf.class);
textlabel_t lp;
final __struct__<label_params_t> params = JUtils.from(label_params_t.class);
- object_t objs;
- xlabel_t lbls;
- object_t objp;
- xlabel_t xlp;
+ __ptr__ objs;
+ __ptr__ lbls;
+ __ptr__ objp;
+ __ptr__ xlp;
Agsym_s force;
int et = (GD_flags(gp) & (7 << 1));
if (N(GD_has_labels(gp) & (1 << 4)) &&
@@ -1175,56 +1192,59 @@ try {
N(GD_has_labels(gp) & (1 << 1)) &&
(N(GD_has_labels(gp) & (1 << 0)) || Z.z().EdgeLabelsDone!=0))
return;
-UNSUPPORTED("27ppdplfezcqw6rdrkzyrr8yg"); // for (np = agfstnode(gp); np; np = agnxtnode(gp, np)) {
-UNSUPPORTED("eezvruvdh9ueqsgad8k5xzbqi"); // if (ND_xlabel(np)) {
+ for (np = agfstnode(gp); np!=null; np = agnxtnode(gp, np)) {
+ if (ND_xlabel(np)!=null) {
UNSUPPORTED("6oje33bnpp4jv5mclsrrhl005"); // if (ND_xlabel(np)->set)
UNSUPPORTED("cfkrw6t4lrs7dfgx86sgrz26"); // n_set_lbls++;
UNSUPPORTED("5c97f6vfxny0zz35l2bu4maox"); // else
UNSUPPORTED("26eewzzknvqt2nbcrqds5fmti"); // n_nlbls++;
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("41dpbku41lh3gpb30ds9ex6aa"); // for (ep = agfstout(gp, np); ep; ep = agnxtout(gp, ep)) {
-UNSUPPORTED("9c5vwy3kfweqsgk827cpj3d6q"); // if (ED_xlabel(ep)) {
+ }
+ for (ep = agfstout(gp, np); ep!=null; ep = agnxtout(gp, ep)) {
+ if (ED_xlabel(ep)!=null) {
UNSUPPORTED("appkettxihy2o612jk6fahbnh"); // if (ED_xlabel(ep)->set)
UNSUPPORTED("8k2rclvg6eaoph9r2pz4620xq"); // n_set_lbls++;
UNSUPPORTED("14y6caappoxe17mogr979qf75"); // else if (((et != (0 << 1)) && (ED_spl(ep) != NULL)))
UNSUPPORTED("q3t8uxncrxc4n8rtuabtzxya"); // n_elbls++;
-UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
-UNSUPPORTED("1mk50yh8pbs8jzn7h8otaonfd"); // if (ED_head_label(ep)) {
-UNSUPPORTED("4xstfnjw4gi0ja4inv8o0n8z"); // if (ED_head_label(ep)->set)
-UNSUPPORTED("8k2rclvg6eaoph9r2pz4620xq"); // n_set_lbls++;
-UNSUPPORTED("14y6caappoxe17mogr979qf75"); // else if (((et != (0 << 1)) && (ED_spl(ep) != NULL)))
-UNSUPPORTED("q3t8uxncrxc4n8rtuabtzxya"); // n_elbls++;
-UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
-UNSUPPORTED("4micw28bcx68bfiqihi9ruani"); // if (ED_tail_label(ep)) {
+ }
+ if (ED_head_label(ep)!=null) {
+ if (ED_head_label(ep).getBoolean("set"))
+ n_set_lbls++;
+ else if (((et != (0 << 1)) && (ED_spl(ep) != null)))
+ n_elbls++;
+ }
+ if (ED_tail_label(ep)!=null) {
UNSUPPORTED("abwl715n01quq34u2qs1kn9xn"); // if (ED_tail_label(ep)->set)
UNSUPPORTED("8k2rclvg6eaoph9r2pz4620xq"); // n_set_lbls++;
UNSUPPORTED("14y6caappoxe17mogr979qf75"); // else if (((et != (0 << 1)) && (ED_spl(ep) != NULL)))
UNSUPPORTED("q3t8uxncrxc4n8rtuabtzxya"); // n_elbls++;
-UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
-UNSUPPORTED("92f340ohb0u21xl6jgpc2hieo"); // if (ED_label(ep)) {
-UNSUPPORTED("5skvrpmqqjq5cj6a8uiylmjsw"); // if (ED_label(ep)->set)
-UNSUPPORTED("8k2rclvg6eaoph9r2pz4620xq"); // n_set_lbls++;
-UNSUPPORTED("14y6caappoxe17mogr979qf75"); // else if (((et != (0 << 1)) && (ED_spl(ep) != NULL)))
-UNSUPPORTED("q3t8uxncrxc4n8rtuabtzxya"); // n_elbls++;
-UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("2uqg2vrduqxs9hk9hmamj7wlu"); // if (GD_has_labels(gp) & (1 << 3))
+ }
+ if (ED_label(ep)!=null) {
+ if (ED_label(ep).getBoolean("set"))
+ n_set_lbls++;
+ else if (((et != (0 << 1)) && (ED_spl(ep) != null)))
+ n_elbls++;
+ }
+ }
+ }
+ if ((GD_has_labels(gp) & (1 << 3))!=0)
UNSUPPORTED("4z3bgexjlrmdrfgpdaajems8q"); // n_clbls = countClusterLabels (gp);
-UNSUPPORTED("19labxj7f93ljlhkpmrde0zgt"); // /* A label for each unpositioned external label */
-UNSUPPORTED("5kla6rwar4q1ig2olguocajn6"); // n_lbls = n_nlbls + n_elbls;
-UNSUPPORTED("apjqar4agmf5jlfd88kbn4f4d"); // if (n_lbls == 0) return;
-UNSUPPORTED("4j54hc42lgojcuorb9p42tlr"); // /* An object for each node, each positioned external label, any cluster label,
-UNSUPPORTED("adxf9gd6tasafb302px9vqgum"); // * and all unset edge labels and xlabels.
-UNSUPPORTED("795vpnc8yojryr8b46aidsu69"); // */
-UNSUPPORTED("6id92o3db6qu5zuuj8q40n3zn"); // n_objs = agnnodes(gp) + n_set_lbls + n_clbls + n_elbls;
-UNSUPPORTED("3e10kvi719e134x675xgwi1tj"); // objp = objs = (object_t*)zmalloc((n_objs)*sizeof(object_t));
-UNSUPPORTED("6z86cmeenod2nx8ej72n0qotk"); // xlp = lbls = (xlabel_t*)zmalloc((n_lbls)*sizeof(xlabel_t));
-UNSUPPORTED("f2nzvg1xnr11v28w2feg923cs"); // bb.LL = pointfof(INT_MAX, INT_MAX);
-UNSUPPORTED("7tttoj8cnxfqgnq2aagnnav48"); // bb.UR = pointfof(-INT_MAX, -INT_MAX);
-UNSUPPORTED("27ppdplfezcqw6rdrkzyrr8yg"); // for (np = agfstnode(gp); np; np = agnxtnode(gp, np)) {
-UNSUPPORTED("38hh82sue091x6ybm9e34wy61"); // bb = addNodeObj (np, objp, bb);
-UNSUPPORTED("ex5hwora23t1cl8hpjo4uvphm"); // if ((lp = ND_xlabel(np))) {
+ /* A label for each unpositioned external label */
+ n_lbls = n_nlbls + n_elbls;
+ if (n_lbls == 0) return;
+ /* An object for each node, each positioned external label, any cluster label,
+ * and all unset edge labels and xlabels.
+ */
+ n_objs = agnnodes(gp) + n_set_lbls + n_clbls + n_elbls;
+ objs = zmalloc(sizeof(object_t.class, n_objs));
+ objp = objs;
+ lbls = zmalloc(sizeof(xlabel_t.class, n_lbls));
+ xlp = lbls;
+ bb.setStruct("LL", pointfof(INT_MAX, INT_MAX));
+ bb.setStruct("UR", pointfof(-INT_MAX, -INT_MAX));
+ for (np = agfstnode(gp); np!=null; np = agnxtnode(gp, np)) {
+ bb.___(addNodeObj (np, objp, bb));
+ lp = ND_xlabel(np);
+ if (lp != null) {
UNSUPPORTED("d5pjy3dwui27jfdz550cy0cln"); // if (lp->set) {
UNSUPPORTED("cls7z8l7wi371a4wrec0viqil"); // objp++;
UNSUPPORTED("3zy3jhlqyioeyh9mlrspjjgc6"); // bb = addLabelObj (lp, objp, bb);
@@ -1233,28 +1253,30 @@ UNSUPPORTED("6q044im7742qhglc4553noina"); // else {
UNSUPPORTED("2msn58w2dse7pbq2esv7awk4r"); // addXLabel (lp, objp, xlp, 0, ur);
UNSUPPORTED("1zpq9rd3nn9kjrmun8ivs9zx5"); // xlp++;
UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("bhbvoj12subdn6905juhiubo2"); // objp++;
-UNSUPPORTED("41dpbku41lh3gpb30ds9ex6aa"); // for (ep = agfstout(gp, np); ep; ep = agnxtout(gp, ep)) {
-UNSUPPORTED("9zaprre819fwswan5wvid0h6g"); // if ((lp = ED_label(ep))) {
-UNSUPPORTED("5dapykbxjvnhw0dpi7jfpcazk"); // if (lp->set) {
-UNSUPPORTED("7rwrlod7lkgin3rnnzy3iw2rw"); // bb = addLabelObj (lp, objp, bb);
-UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
-UNSUPPORTED("dfnmpe0hri6ksye0gnxssi4zz"); // else if (((et != (0 << 1)) && (ED_spl(ep) != NULL))) {
+ }
+ objp = objp.plus(1);
+ for (ep = agfstout(gp, np); ep!=null; ep = agnxtout(gp, ep)) {
+ lp = ED_label(ep);
+ if (lp != null) {
+ if (lp.getBoolean("set")) {
+ bb.___(addLabelObj (lp, objp, bb));
+ }
+ else if (((et != (0 << 1)) && (ED_spl(ep) != null))) {
UNSUPPORTED("9ffmrymv8cg4h4b3ea97t9qbp"); // addXLabel (lp, objp, xlp, 1, edgeMidpoint(gp, ep));
UNSUPPORTED("808184nt3k6cxj5dsg27yvpvg"); // xlp++;
-UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
-UNSUPPORTED("d28blrbmwwqp80cyksuz7dwx9"); // else {
+}
+else {
UNSUPPORTED("3ia66n3hqrwmh3hybkoh6f8wa"); // agerr(AGWARN, "no position for edge with label %s",
UNSUPPORTED("9npeksy1st7v005znerttzzzv"); // ED_label(ep)->text);
UNSUPPORTED("2yi9az7ibt7j9bwztjilyo0v2"); // continue;
-UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
-UNSUPPORTED("d23ocobgp22a33eopdnqe9o4u"); // objp++;
-UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
-UNSUPPORTED("a5mn7dpum21w95ku1l27m9rpk"); // if ((lp = ED_tail_label(ep))) {
-UNSUPPORTED("5dapykbxjvnhw0dpi7jfpcazk"); // if (lp->set) {
+}
+objp = objp.plus(1);
+ }
+ lp = ED_tail_label(ep);
+ if (lp != null) {
+if (lp.getBoolean("set")) {
UNSUPPORTED("7rwrlod7lkgin3rnnzy3iw2rw"); // bb = addLabelObj (lp, objp, bb);
-UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
+}
UNSUPPORTED("dfnmpe0hri6ksye0gnxssi4zz"); // else if (((et != (0 << 1)) && (ED_spl(ep) != NULL))) {
UNSUPPORTED("bqc6ukxlmt6l3osbpsmqbzutc"); // addXLabel (lp, objp, xlp, 1, edgeTailpoint(ep));
UNSUPPORTED("808184nt3k6cxj5dsg27yvpvg"); // xlp++;
@@ -1264,24 +1286,26 @@ UNSUPPORTED("5ixexxcbcix5hrfl43td7pj4s"); // agerr(AGWARN, "no position fo
UNSUPPORTED("cf9qaysecgkvv4165la4uu6cb"); // ED_tail_label(ep)->text);
UNSUPPORTED("2yi9az7ibt7j9bwztjilyo0v2"); // continue;
UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
-UNSUPPORTED("cls7z8l7wi371a4wrec0viqil"); // objp++;
-UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
-UNSUPPORTED("6rvkuvq5nj7p2za2zqxf74l3c"); // if ((lp = ED_head_label(ep))) {
-UNSUPPORTED("5dapykbxjvnhw0dpi7jfpcazk"); // if (lp->set) {
+ objp = objp.plus(1);
+ }
+ lp = ED_head_label(ep);
+ if (lp != null) {
+if (lp.getBoolean("set")) {
UNSUPPORTED("7rwrlod7lkgin3rnnzy3iw2rw"); // bb = addLabelObj (lp, objp, bb);
-UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
-UNSUPPORTED("dfnmpe0hri6ksye0gnxssi4zz"); // else if (((et != (0 << 1)) && (ED_spl(ep) != NULL))) {
-UNSUPPORTED("7gewvtwwzj3unxzrtbqpwduzg"); // addXLabel (lp, objp, xlp, 1, edgeHeadpoint(ep));
-UNSUPPORTED("808184nt3k6cxj5dsg27yvpvg"); // xlp++;
-UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
-UNSUPPORTED("d28blrbmwwqp80cyksuz7dwx9"); // else {
+}
+else if (((et != (0 << 1)) && (ED_spl(ep) != null))) {
+addXLabel (lp, objp, xlp, 1, edgeHeadpoint(ep));
+xlp = xlp.plus(1);
+}
+else {
UNSUPPORTED("8nrkavpg9ifts9yylhfijn9rp"); // agerr(AGWARN, "no position for edge with head label %s",
UNSUPPORTED("a5omwtwd411hsfrc37d8t6m8b"); // ED_head_label(ep)->text);
UNSUPPORTED("2yi9az7ibt7j9bwztjilyo0v2"); // continue;
-UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
-UNSUPPORTED("cls7z8l7wi371a4wrec0viqil"); // objp++;
-UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
-UNSUPPORTED("1pb88fhz51khiwboqgii8qayw"); // if ((lp = ED_xlabel(ep))) {
+}
+ objp = objp.plus(1);
+ }
+ lp = ED_xlabel(ep);
+ if (lp != null) {
UNSUPPORTED("5dapykbxjvnhw0dpi7jfpcazk"); // if (lp->set) {
UNSUPPORTED("7rwrlod7lkgin3rnnzy3iw2rw"); // bb = addLabelObj (lp, objp, bb);
UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
@@ -1295,20 +1319,20 @@ UNSUPPORTED("dtpynjioyrbt2xfca2o46eb0j"); // ED_xlabel(ep)->text);
UNSUPPORTED("2yi9az7ibt7j9bwztjilyo0v2"); // continue;
UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
UNSUPPORTED("cls7z8l7wi371a4wrec0viqil"); // objp++;
-UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("5zntyu3vcfnjveucnumrmbjig"); // if (n_clbls) {
+ }
+ }
+}
+if (n_clbls!=0) {
UNSUPPORTED("48ipxdlv7xlti99g0yhi5zuai"); // cinfo_t info;
UNSUPPORTED("7c5iohb8t706p273ae1lxal8r"); // info.bb = bb;
UNSUPPORTED("b1474fakrbyw7p5ja42jgv90c"); // info.objp = objp;
UNSUPPORTED("6ygw8idplugc5u6w7ro3gakmb"); // info = addClusterObj (gp, info);
UNSUPPORTED("1l2cwgzediv4hztjhtm052rl3"); // bb = info.bb;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("79ifzl4zpx3wbd5szboa2x2vb"); // force = (agattr(gp,AGRAPH,"forcelabels",NULL));
-UNSUPPORTED("1if7tdbcs4rwvb0polsdlbfh4"); // params.force = late_bool(gp, force, NOT(0));
-UNSUPPORTED("2ol916ffwy0e2vxinxn4v4sgt"); // params.bb = bb;
-UNSUPPORTED("25rb35acbkepp55u3bkjxb1gc"); // placeLabels(objs, n_objs, lbls, n_lbls, &params);
+}
+force = (agattr(gp,AGRAPH,new CString("forcelabels"),null));
+params.setBoolean("force", late_bool(gp, force, 1));
+params.setStruct("bb", bb);
+placeLabels(objs, n_objs, lbls, n_lbls, params.amp());
UNSUPPORTED("2di5wqm6caczzl6bvqe35ry8y"); // if (Verbose)
UNSUPPORTED("4iypau1fdov37qnq2ub6iq5ra"); // printData(objs, n_objs, lbls, n_lbls, &params);
UNSUPPORTED("52mefujap7scy273ud7nyj9hn"); // xlp = lbls;
diff --git a/src/gen/lib/common/routespl__c.java b/src/gen/lib/common/routespl__c.java
index 17f6a97..7478aaf 100644
--- a/src/gen/lib/common/routespl__c.java
+++ b/src/gen/lib/common/routespl__c.java
@@ -80,6 +80,7 @@ import smetana.core.Memory;
import smetana.core.Z;
import smetana.core.__array_of_ptr__;
import smetana.core.__array_of_struct__;
+import smetana.core.__array_of_struct_impl__;
import smetana.core.__ptr__;
import smetana.core.__struct__;
@@ -765,8 +766,8 @@ private static pointf simpleSplineRoute_w_(final __struct__<pointf> tp, final __
ENTERING("7ebl6qohcfpf1b9ucih5r9qgp","simpleSplineRoute");
try {
final __struct__<Ppoly_t> pl = JUtils.from(Ppoly_t.class), spl = JUtils.from(Ppoly_t.class);
- final __array_of_struct__ eps = __array_of_struct__.malloc(pointf.class, 2);
- final __array_of_struct__ evs = __array_of_struct__.malloc(pointf.class, 2);
+ final __array_of_struct__ eps = __array_of_struct_impl__.malloc(pointf.class, 2);
+ final __array_of_struct__ evs = __array_of_struct_impl__.malloc(pointf.class, 2);
int i;
eps.plus(0).setDouble("x", tp.getDouble("x"));
eps.plus(0).setDouble("y", tp.getDouble("y"));
@@ -857,7 +858,7 @@ ENTERING("cu8ssjizw7ileqe9u7tcclq7k","limitBoxes");
try {
int bi, si, splinepi;
double t;
- final __array_of_struct__ sp = __array_of_struct__.malloc(pointf.class, 4);
+ final __array_of_struct__ sp = __array_of_struct_impl__.malloc(pointf.class, 4);
int num_div = delta * boxn;
for (splinepi = 0; splinepi + 3 < pn; splinepi += 3) {
for (si = 0; si <= num_div; si++) {
@@ -906,8 +907,8 @@ try {
final __struct__<Ppoly_t> poly = JUtils.from(Ppoly_t.class);
final __struct__<Ppoly_t> pl = JUtils.from(Ppoly_t.class), spl = JUtils.from(Ppoly_t.class);
int splinepi;
- final __array_of_struct__ eps = __array_of_struct__.malloc(pointf.class, 2);
- final __array_of_struct__ evs = __array_of_struct__.malloc(pointf.class, 2);
+ final __array_of_struct__ eps = __array_of_struct_impl__.malloc(pointf.class, 2);
+ final __array_of_struct__ evs = __array_of_struct_impl__.malloc(pointf.class, 2);
int edgei, prev, next;
int pi=0, bi;
__array_of_ptr__ boxes;
@@ -1249,8 +1250,12 @@ UNSUPPORTED("btmwubugs9vkexo4yb7a5nqel"); // return 1;
bb.getStruct("UR").setDouble("x", xy);
r = 0;
}
- else if (d == 1)
-UNSUPPORTED("eg1w87s0blk4i583rqumhmv6n"); // xy = ba.getStruct("UR").getDouble("y"), ba.getStruct("UR").getDouble("y") = bb.getStruct("LL").getDouble("y"), bb.getStruct("LL").getDouble("y") = xy, d = 0;
+ else if (d == 1) {
+ xy = (int)(ba.getStruct("UR").getDouble("y"));
+ ba.getStruct("UR").setDouble("y", bb.getStruct("LL").getDouble("y"));
+ bb.getStruct("LL").setDouble("y", xy);
+ d = 0;
+ }
else if (u == 1)
UNSUPPORTED("5kcd52bwvbxxs0md0enfs100u"); // xy = ba.getStruct("LL").getDouble("y"), ba.getStruct("LL").getDouble("y") = bb.getStruct("UR").getDouble("y"), bb.getStruct("UR").getDouble("y") = xy, u = 0;
for (i = 0; i < errs - 1; i++) {
diff --git a/src/gen/lib/common/splines__c.java b/src/gen/lib/common/splines__c.java
index a354c74..dd80a56 100644
--- a/src/gen/lib/common/splines__c.java
+++ b/src/gen/lib/common/splines__c.java
@@ -99,6 +99,7 @@ import smetana.core.CFunction;
import smetana.core.JUtils;
import smetana.core.MutableDouble;
import smetana.core.__array_of_struct__;
+import smetana.core.__array_of_struct_impl__;
import smetana.core.__ptr__;
import smetana.core.__struct__;
@@ -793,8 +794,8 @@ LEAVING("6izm0fbkejw7odmiw4zaw1ycp","arrow_clip");
public static void bezier_clip(__ptr__ inside_context, __ptr__ inside, __array_of_struct__ sp, boolean left_inside) {
ENTERING("q4t1ywnk3wm1vyh5seoj7xye","bezier_clip");
try {
- final __array_of_struct__ seg = __array_of_struct__.malloc(pointf.class, 4);
- final __array_of_struct__ best = __array_of_struct__.malloc(pointf.class, 4);
+ final __array_of_struct__ seg = __array_of_struct_impl__.malloc(pointf.class, 4);
+ final __array_of_struct__ best = __array_of_struct_impl__.malloc(pointf.class, 4);
final __struct__<pointf> pt = JUtils.from(pointf.class), opt = JUtils.from(pointf.class);
__ptr__ left, right;
final MutableDouble low = new MutableDouble(0), high = new MutableDouble(0);
@@ -852,7 +853,7 @@ ENTERING("1fjkj1ydhtlf13pqj5r041orq","shape_clip0");
try {
int i;
double save_real_size;
- final __array_of_struct__ c = __array_of_struct__.malloc(pointf.class, 4);
+ final __array_of_struct__ c = __array_of_struct_impl__.malloc(pointf.class, 4);
save_real_size = ND_rw(n);
for (i = 0; i < 4; i++) {
c.plus(i).setDouble("x", curve.plus(i).getDouble("x") - ND_coord(n).getDouble("x"));
@@ -1001,7 +1002,7 @@ try {
break;
arrow_clip(fe, hn, ps, start, end, newspl, info);
for (i = start[0]; i < end[0] + 4; ) {
- final __array_of_struct__ cp = __array_of_struct__.malloc(pointf.class, 4);
+ final __array_of_struct__ cp = __array_of_struct_impl__.malloc(pointf.class, 4);
newspl.getArrayOfPtr("list").plus(i - start[0]).setStruct(ps.plus(i).getStruct());
cp.plus(0).setStruct(ps.plus(i).getStruct());
i++;
@@ -1716,7 +1717,7 @@ try {
final ST_pointf tp = new ST_pointf(), hp = new ST_pointf(), np = new ST_pointf();
Agnode_s n;
Agedge_s e;
- final __array_of_struct__ points = __array_of_struct__.malloc(pointf.class, 1000);
+ final __array_of_struct__ points = __array_of_struct_impl__.malloc(pointf.class, 1000);
int pointn;
e = (Agedge_s) edges.plus(ind).getPtr();
n = agtail(e);
diff --git a/src/gen/lib/common/utils__c.java b/src/gen/lib/common/utils__c.java
index a2428d9..2391482 100644
--- a/src/gen/lib/common/utils__c.java
+++ b/src/gen/lib/common/utils__c.java
@@ -68,6 +68,7 @@ import static smetana.core.JUtils.strtol;
import static smetana.core.JUtils.tolower;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
+import static smetana.core.Macro.ED_head_label;
import static smetana.core.Macro.ED_head_port;
import static smetana.core.Macro.ED_label;
import static smetana.core.Macro.ED_label_ontop;
@@ -94,6 +95,7 @@ import h.Agedge_s;
import h.Agnode_s;
import h.Agraph_s;
import h.Agsym_s;
+import h.ST_Agsym_s;
import h.ST_boxf;
import h.ST_port;
import h.boxf;
@@ -109,6 +111,7 @@ import smetana.core.JUtils;
import smetana.core.Memory;
import smetana.core.Z;
import smetana.core.__array_of_struct__;
+import smetana.core.__array_of_struct_impl__;
import smetana.core.__ptr__;
import smetana.core.__struct__;
@@ -932,11 +935,9 @@ LEAVING("8oon4q1mrublaru177xfntqgd","late_nnstring");
//3 87ifze04q7qzigjj1fb9y9by2
// boolean late_bool(void *obj, attrsym_t * attr, int def)
-public static Object late_bool(Object... arg) {
-UNSUPPORTED("4p67t5j48pxpmswky3dw3s392"); // boolean late_bool(void *obj, attrsym_t * attr, int def)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("183nee60g5fytepk82gop4u8s"); // if (attr == (void *)0)
-UNSUPPORTED("1jfc1szr9lzyizq62jp9jz7ah"); // return def;
+public static boolean late_bool(__ptr__ obj, Agsym_s attr, int def) {
+if (attr == null)
+ return def!=0;
UNSUPPORTED("a0kh1y5n8u59z0xo7mag3zmt6"); // return mapbool(agxget(obj, attr));
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
@@ -1074,12 +1075,12 @@ private static __struct__<pointf> Bezier_w_(__array_of_struct__ V, int degree, d
ENTERING("6p0ey2c2ujk2o7h221p0b4xon","Bezier");
try {
int i, j; /* Index variables */
- final __array_of_struct__ Vtemp[] = new __array_of_struct__[] { __array_of_struct__.malloc(pointf.class, 5+1),
- __array_of_struct__.malloc(pointf.class, 5+1),
- __array_of_struct__.malloc(pointf.class, 5+1),
- __array_of_struct__.malloc(pointf.class, 5+1),
- __array_of_struct__.malloc(pointf.class, 5+1),
- __array_of_struct__.malloc(pointf.class, 5+1) };
+ final __array_of_struct__ Vtemp[] = new __array_of_struct__[] { __array_of_struct_impl__.malloc(pointf.class, 5+1),
+ __array_of_struct_impl__.malloc(pointf.class, 5+1),
+ __array_of_struct_impl__.malloc(pointf.class, 5+1),
+ __array_of_struct_impl__.malloc(pointf.class, 5+1),
+ __array_of_struct_impl__.malloc(pointf.class, 5+1),
+ __array_of_struct_impl__.malloc(pointf.class, 5+1) };
/* Copy control points */
for (j = 0; j <= degree; j++) {
Vtemp[0].plus(j).setStruct(V.plus(j).getStruct());
@@ -1500,18 +1501,16 @@ LEAVING("d2v8l80y27ue2fag5c0qplah8","initFontEdgeAttr");
//3 ak3pxrdrq900wymudwnjmbito
// static void initFontLabelEdgeAttr(edge_t * e, struct fontinfo *fi, struct fontinfo *lfi)
-public static Object initFontLabelEdgeAttr(Object... arg) {
-UNSUPPORTED("e2z2o5ybnr5tgpkt8ty7hwan1"); // static void
-UNSUPPORTED("64kdcuymwqrq619sxnmgnuyal"); // initFontLabelEdgeAttr(edge_t * e, struct fontinfo *fi,
-UNSUPPORTED("rd78u02b7ldtc7gt7aw5t8fz"); // struct fontinfo *lfi)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("9rkwm6oonv051kf4hnage0877"); // if (!fi->fontname) initFontEdgeAttr(e, fi);
-UNSUPPORTED("aok5f09eydgwsqtsl0xmmhft"); // lfi->fontsize = late_double(e, E_labelfontsize, fi->fontsize, 1.0);
-UNSUPPORTED("aviu0lhq8s4ez3n8cil4bwac6"); // lfi->fontname = late_nnstring(e, E_labelfontname, fi->fontname);
-UNSUPPORTED("75il36n46r24ag5njqgshp8xz"); // lfi->fontcolor = late_nnstring(e, E_labelfontcolor, fi->fontcolor);
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static void initFontLabelEdgeAttr(Agedge_s e, fontinfo fi, fontinfo lfi) {
+ENTERING("ak3pxrdrq900wymudwnjmbito","initFontLabelEdgeAttr");
+try {
+ if (N(fi.getPtr("fontname"))) initFontEdgeAttr(e, fi);
+ lfi.setDouble("fontsize", late_double(e, Z.z().E_labelfontsize, fi.getDouble("fontsize"), 1.0));
+ lfi.setPtr("fontname", late_nnstring(e, Z.z().E_labelfontname, fi.getCString("fontname")));
+ lfi.setPtr("fontcolor", late_nnstring(e, Z.z().E_labelfontcolor, fi.getCString("fontcolor")));
+} finally {
+LEAVING("ak3pxrdrq900wymudwnjmbito","initFontLabelEdgeAttr");
+}
}
@@ -1599,10 +1598,10 @@ UNSUPPORTED("c078bypfszv0nsvp1nc0x28wx"); // (((Agraphinfo_t*)(((Agobj_t*)(sg))
}
/* vladimir */
if (Z.z().E_headlabel!=null && (str = agxget(e, Z.z().E_headlabel))!=null && (str.charAt(0)!='\0')) {
-UNSUPPORTED("cgznvdnh671wl8jq8q3tyhv1r"); // initFontLabelEdgeAttr(e, &fi, &lfi);
-UNSUPPORTED("6nfh8swason2akjp45hm0o5b0"); // (((Agedgeinfo_t*)(((Agobj_t*)(e))->data))->head_label) = make_label((void*)e, str, (aghtmlstr(str) ? (1 << 1) : (0 << 1)),
-UNSUPPORTED("eu3ztkfva2x87y72tnu7vv4re"); // lfi.fontsize, lfi.fontname, lfi.fontcolor);
-UNSUPPORTED("axtvdewh7zhtm1diu8c6dprx4"); // (((Agraphinfo_t*)(((Agobj_t*)(sg))->data))->has_labels) |= (1 << 1);
+ initFontLabelEdgeAttr(e, fi.amp(), lfi.amp());
+ ED_head_label(e, make_label(e, str, (aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)),
+ lfi.getDouble("fontsize"), lfi.getCString("fontname"), lfi.getCString("fontcolor")));
+ GD_has_labels(sg, GD_has_labels(sg) | (1 << 1));
}
if (Z.z().E_taillabel!=null && (str = agxget(e, Z.z().E_taillabel))!=null && (str.charAt(0)!='\0')) {
UNSUPPORTED("6y6e1y496y6j6a6065nfesr8o"); // if (!lfi.fontname)
diff --git a/src/gen/lib/dotgen/decomp__c.java b/src/gen/lib/dotgen/decomp__c.java
index 75e30a6..4c04a39 100644
--- a/src/gen/lib/dotgen/decomp__c.java
+++ b/src/gen/lib/dotgen/decomp__c.java
@@ -76,6 +76,7 @@ import h.pointf;
import smetana.core.JUtils;
import smetana.core.Z;
import smetana.core.__array_of_struct__;
+import smetana.core.__array_of_struct_impl__;
import smetana.core.__struct__;
public class decomp__c {
@@ -790,7 +791,7 @@ public static void search_component(Agraph_s g, Agnode_s n) {
ENTERING("c5u5lnfbu0pmlk6vsvyrdj8ep","search_component");
try {
int c, i;
- __array_of_struct__ vec = __array_of_struct__.malloc(elist.class, 4);
+ __array_of_struct__ vec = __array_of_struct_impl__.malloc(elist.class, 4);
Agnode_s other;
Agedge_s e;
add_to_component(n);
diff --git a/src/gen/lib/dotgen/dotsplines__c.java b/src/gen/lib/dotgen/dotsplines__c.java
index 4265f90..c7c5d9a 100644
--- a/src/gen/lib/dotgen/dotsplines__c.java
+++ b/src/gen/lib/dotgen/dotsplines__c.java
@@ -143,6 +143,7 @@ import smetana.core.JUtils;
import smetana.core.Memory;
import smetana.core.Z;
import smetana.core.__array_of_struct__;
+import smetana.core.__array_of_struct_impl__;
import smetana.core.__ptr__;
import smetana.core.__struct__;
@@ -1716,7 +1717,7 @@ try {
final __struct__<Ppoly_t> poly = JUtils.from(Ppoly_t.class);
int pn[] = new int[1];
Agedge_s e = (Agedge_s) edges.plus(ind).getPtr();
- final __array_of_struct__ points = __array_of_struct__.malloc(pointf.class, 10);
+ final __array_of_struct__ points = __array_of_struct_impl__.malloc(pointf.class, 10);
final __struct__<pointf> tp = JUtils.from(pointf.class), hp = JUtils.from(pointf.class);
int i, pointn;
double leftend, rightend, ctrx=0, ctry=0, miny, maxy;
@@ -1865,7 +1866,7 @@ public static void makeSimpleFlat(Agnode_s tn, Agnode_s hn, __ptr__ edges, int i
ENTERING("8kqyzk43ovc2sq6jegua6ytp","makeSimpleFlat");
try {
Agedge_s e = (Agedge_s) edges.plus(ind).getPtr();
- final __array_of_struct__ points = __array_of_struct__.malloc(pointf.class, 10);
+ final __array_of_struct__ points = __array_of_struct_impl__.malloc(pointf.class, 10);
final __struct__<pointf> tp = JUtils.from(pointf.class), hp = JUtils.from(pointf.class);
int i, pointn;
double stepy, dy;
@@ -2109,7 +2110,7 @@ try {
int boxn, i, ydelta;
int pn[] = new int[1];
Agedge_s f;
- final __array_of_struct__ points = __array_of_struct__.malloc(pointf.class, 7);
+ final __array_of_struct__ points = __array_of_struct_impl__.malloc(pointf.class, 7);
tn = agtail(e);
hn = aghead(e);
for (f = ED_to_virt(e); ED_to_virt(f)!=null; f = ED_to_virt(f));
diff --git a/src/gen/lib/gvc/gvc__c.java b/src/gen/lib/gvc/gvc__c.java
index 3ec2c2c..b084fa0 100644
--- a/src/gen/lib/gvc/gvc__c.java
+++ b/src/gen/lib/gvc/gvc__c.java
@@ -45,8 +45,9 @@
*/
package gen.lib.gvc;
import static gen.lib.cgraph.attr__c.agattr;
-import static gen.lib.gvc.gvconfig__c.gvconfig;
+import static gen.lib.common.textspan__c.textfont_dict_open;
import static gen.lib.gvc.gvcontext__c.gvNEWcontext;
+import static gen.lib.gvc.gvtextlayout__c.gvtextlayout_select;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGNODE;
@@ -167,7 +168,10 @@ try {
agattr(null, AGNODE, new CString("label"), new CString("\\N"));
/* default to no builtins, demand loading enabled */
gvc = (GVC_s) gvNEWcontext(null, (NOT(0)));
- gvconfig(gvc, false); /* configure for available plugins */
+ /* builtins don't require LTDL */
+ gvc.setInt("config_found", 0);
+ gvtextlayout_select(gvc); /* choose best available textlayout plugin immediately */
+ textfont_dict_open(gvc); /* initialize font dict */
return gvc;
} finally {
LEAVING("f3vdhir2c7dz3pvmx9d3m4lx1","gvContext");
diff --git a/src/gen/lib/gvc/gvconfig__c.java b/src/gen/lib/gvc/gvconfig__c.java
deleted file mode 100644
index 7cd8c9a..0000000
--- a/src/gen/lib/gvc/gvconfig__c.java
+++ /dev/null
@@ -1,241 +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 Smetana.
- * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
- *
- * (C) Copyright 2009-2017, Arnaud Roques
- *
- * This translation is distributed under the same Licence as the original C program:
- *
- *************************************************************************
- * Copyright (c) 2011 AT&T Intellectual Property
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: See CVS logs. Details at http://www.graphviz.org/
- *************************************************************************
- *
- * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
- * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
- *
- * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
- * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
- *
- * You may obtain a copy of the License at
- *
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package gen.lib.gvc;
-import static gen.lib.common.textspan__c.textfont_dict_open;
-import static gen.lib.gvc.gvtextlayout__c.gvtextlayout_select;
-import static smetana.core.JUtilsDebug.ENTERING;
-import static smetana.core.JUtilsDebug.LEAVING;
-import static smetana.core.Macro.UNSUPPORTED;
-import h.GVC_s;
-import h.lt_symlist_t;
-import smetana.core.CString;
-
-public class gvconfig__c {
-//1 2digov3edok6d5srhgtlmrycs
-// extern lt_symlist_t lt_preloaded_symbols[]
-
-
-//1 baedz5i9est5csw3epz3cv7z
-// typedef Ppoly_t Ppolyline_t
-
-
-//1 9k44uhd5foylaeoekf3llonjq
-// extern Dtmethod_t* Dtset
-
-
-//1 1ahfywsmzcpcig2oxm7pt9ihj
-// extern Dtmethod_t* Dtbag
-
-
-//1 anhghfj3k7dmkudy2n7rvt31v
-// extern Dtmethod_t* Dtoset
-
-
-//1 5l6oj1ux946zjwvir94ykejbc
-// extern Dtmethod_t* Dtobag
-
-
-//1 2wtf222ak6cui8cfjnw6w377z
-// extern Dtmethod_t* Dtlist
-
-
-//1 d1s1s6ibtcsmst88e3057u9r7
-// extern Dtmethod_t* Dtstack
-
-
-//1 axa7mflo824p6fspjn1rdk0mt
-// extern Dtmethod_t* Dtqueue
-
-
-//1 ega812utobm4xx9oa9w9ayij6
-// extern Dtmethod_t* Dtdeque
-
-
-//1 cyfr996ur43045jv1tjbelzmj
-// extern Dtmethod_t* Dtorder
-
-
-//1 wlofoiftbjgrrabzb2brkycg
-// extern Dtmethod_t* Dttree
-
-
-//1 12bds94t7voj7ulwpcvgf6agr
-// extern Dtmethod_t* Dthash
-
-
-//1 9lqknzty480cy7zsubmabkk8h
-// extern Dtmethod_t _Dttree
-
-
-//1 bvn6zkbcp8vjdhkccqo1xrkrb
-// extern Dtmethod_t _Dthash
-
-
-//1 9lidhtd6nsmmv3e7vjv9e10gw
-// extern Dtmethod_t _Dtlist
-
-
-//1 34ujfamjxo7xn89u90oh2k6f8
-// extern Dtmethod_t _Dtqueue
-
-
-//1 3jy4aceckzkdv950h89p4wjc8
-// extern Dtmethod_t _Dtstack
-
-
-//1 8dfqgf3u1v830qzcjqh9o8ha7
-// extern Agmemdisc_t AgMemDisc
-
-
-//1 18k2oh2t6llfsdc5x0wlcnby8
-// extern Agiddisc_t AgIdDisc
-
-
-//1 a4r7hi80gdxtsv4hdoqpyiivn
-// extern Agiodisc_t AgIoDisc
-
-
-//1 bnzt5syjb7mgeru19114vd6xx
-// extern Agdisc_t AgDefaultDisc
-
-
-//1 35y2gbegsdjilegaribes00mg
-// extern Agdesc_t Agdirected, Agstrictdirected, Agundirected, Agstrictundirected
-
-
-//1 c2rygslq6bcuka3awmvy2b3ow
-// typedef Agsubnode_t Agnoderef_t
-
-
-//1 xam6yv0dcsx57dtg44igpbzn
-// typedef Dtlink_t Agedgeref_t
-
-
-
-
-//3 btaticnvqvav6giyqk5dhvl0b
-// static gvplugin_package_t * gvplugin_package_record(GVC_t * gvc, char *path, char *name)
-public static Object gvplugin_package_record(Object... arg) {
-UNSUPPORTED("d0v4w7mmhzyohr3cydmk39msc"); // static gvplugin_package_t * gvplugin_package_record(GVC_t * gvc, char *path, char *name)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("3l201ckgkdpkadl64dgd5t34a"); // gvplugin_package_t *package = gmalloc(sizeof(gvplugin_package_t));
-UNSUPPORTED("e1ux222fnf2pzhlllspc0n9z6"); // package->path = (path) ? strdup(path) : NULL;
-UNSUPPORTED("6tx9kbkb680t4nrzo9h6wmxt7"); // package->name = strdup(name);
-UNSUPPORTED("2ddoa0el03kdry52dvxdp02xi"); // package->next = gvc->packages;
-UNSUPPORTED("2wtcp1phunrqzsy2eyeelnisd"); // gvc->packages = package;
-UNSUPPORTED("1cvdn1usbhmpxzhmfo5t0qhv0"); // return package;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 7b32j8w9cd211oy7f26zd2ld6
-// void gvconfig_plugin_install_from_library(GVC_t * gvc, char *path, gvplugin_library_t *library)
-public static Object gvconfig_plugin_install_from_library(Object... arg) {
-UNSUPPORTED("9qlio5kiswebv40u9nmcxh1um"); // void gvconfig_plugin_install_from_library(GVC_t * gvc, char *path, gvplugin_library_t *library)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("1tb07tzg54jallfz0upl62c1g"); // gvplugin_api_t *apis;
-UNSUPPORTED("2ihbo5t1nbmg4dq1qvwi9sqoh"); // gvplugin_installed_t *types;
-UNSUPPORTED("as58mgqb4uw4c8n4sdq7m0qz3"); // gvplugin_package_t *package;
-UNSUPPORTED("b17di9c7wgtqm51bvsyxz6e2f"); // int i;
-UNSUPPORTED("21xt0dglbm2xme4gg1b8b9tfl"); // package = gvplugin_package_record(gvc, path, library->packagename);
-UNSUPPORTED("44g9muiwx72zahb9xx5xzmfyv"); // for (apis = library->apis; (types = apis->types); apis++) {
-UNSUPPORTED("bslr2lh149d2y32qozijhg1pj"); // for (i = 0; types[i].type; i++) {
-UNSUPPORTED("7xl5c8mkdfmtazqddql72rl4l"); // gvplugin_install(gvc, apis->api, types[i].type,
-UNSUPPORTED("81elyir1t9mhizwx6bh2dy6fc"); // types[i].quality, package, &types[i]);
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 a0u25p4ndz2d3mpylo4jnz9cc
-// static void gvconfig_plugin_install_builtins(GVC_t * gvc)
-public static void gvconfig_plugin_install_builtins(GVC_s gvc) {
-ENTERING("a0u25p4ndz2d3mpylo4jnz9cc","gvconfig_plugin_install_builtins");
-try {
- lt_symlist_t s;
- CString name;
- if (gvc.getStruct("common").getPtr("builtins") == null) return;
-UNSUPPORTED("5h6ty7bll7yb1rvxiy8b1a17y"); // for (s = gvc->common.builtins; (name = s->name); s++)
-UNSUPPORTED("efvffxomvrmz7nbrcbcvananw"); // if (name[0] == 'g' && strstr(name, "_LTX_library"))
-UNSUPPORTED("95pie5przmmzrwnym8ye97v2e"); // gvconfig_plugin_install_from_library(gvc, NULL,
-UNSUPPORTED("ezsy5hnc71vs70pla8x24w5py"); // (gvplugin_library_t *)(s->address));
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-} finally {
-LEAVING("a0u25p4ndz2d3mpylo4jnz9cc","gvconfig_plugin_install_builtins");
-}
-}
-
-
-
-
-//3 f5fyxnkmknydgjt6dtc035z9w
-// void gvconfig(GVC_t * gvc, boolean rescan)
-public static void gvconfig(GVC_s gvc, boolean rescan) {
-ENTERING("f5fyxnkmknydgjt6dtc035z9w","gvconfig");
-try {
- /* builtins don't require LTDL */
- gvconfig_plugin_install_builtins(gvc);
- gvc.setInt("config_found", 0);
- gvtextlayout_select(gvc); /* choose best available textlayout plugin immediately */
- textfont_dict_open(gvc); /* initialize font dict */
-} finally {
-LEAVING("f5fyxnkmknydgjt6dtc035z9w","gvconfig");
-}
-}
-
-
-}
diff --git a/src/gen/lib/gvc/gvusershape__c.java b/src/gen/lib/gvc/gvusershape__c.java
deleted file mode 100644
index ba8c41e..0000000
--- a/src/gen/lib/gvc/gvusershape__c.java
+++ /dev/null
@@ -1,977 +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 Smetana.
- * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
- *
- * (C) Copyright 2009-2017, Arnaud Roques
- *
- * This translation is distributed under the same Licence as the original C program:
- *
- *************************************************************************
- * Copyright (c) 2011 AT&T Intellectual Property
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: See CVS logs. Details at http://www.graphviz.org/
- *************************************************************************
- *
- * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
- * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
- *
- * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
- * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
- *
- * You may obtain a copy of the License at
- *
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package gen.lib.gvc;
-import static smetana.core.Macro.UNSUPPORTED;
-
-public class gvusershape__c {
-//1 2digov3edok6d5srhgtlmrycs
-// extern lt_symlist_t lt_preloaded_symbols[]
-
-
-//1 baedz5i9est5csw3epz3cv7z
-// typedef Ppoly_t Ppolyline_t
-
-
-//1 9k44uhd5foylaeoekf3llonjq
-// extern Dtmethod_t* Dtset
-
-
-//1 1ahfywsmzcpcig2oxm7pt9ihj
-// extern Dtmethod_t* Dtbag
-
-
-//1 anhghfj3k7dmkudy2n7rvt31v
-// extern Dtmethod_t* Dtoset
-
-
-//1 5l6oj1ux946zjwvir94ykejbc
-// extern Dtmethod_t* Dtobag
-
-
-//1 2wtf222ak6cui8cfjnw6w377z
-// extern Dtmethod_t* Dtlist
-
-
-//1 d1s1s6ibtcsmst88e3057u9r7
-// extern Dtmethod_t* Dtstack
-
-
-//1 axa7mflo824p6fspjn1rdk0mt
-// extern Dtmethod_t* Dtqueue
-
-
-//1 ega812utobm4xx9oa9w9ayij6
-// extern Dtmethod_t* Dtdeque
-
-
-//1 cyfr996ur43045jv1tjbelzmj
-// extern Dtmethod_t* Dtorder
-
-
-//1 wlofoiftbjgrrabzb2brkycg
-// extern Dtmethod_t* Dttree
-
-
-//1 12bds94t7voj7ulwpcvgf6agr
-// extern Dtmethod_t* Dthash
-
-
-//1 9lqknzty480cy7zsubmabkk8h
-// extern Dtmethod_t _Dttree
-
-
-//1 bvn6zkbcp8vjdhkccqo1xrkrb
-// extern Dtmethod_t _Dthash
-
-
-//1 9lidhtd6nsmmv3e7vjv9e10gw
-// extern Dtmethod_t _Dtlist
-
-
-//1 34ujfamjxo7xn89u90oh2k6f8
-// extern Dtmethod_t _Dtqueue
-
-
-//1 3jy4aceckzkdv950h89p4wjc8
-// extern Dtmethod_t _Dtstack
-
-
-//1 8dfqgf3u1v830qzcjqh9o8ha7
-// extern Agmemdisc_t AgMemDisc
-
-
-//1 18k2oh2t6llfsdc5x0wlcnby8
-// extern Agiddisc_t AgIdDisc
-
-
-//1 a4r7hi80gdxtsv4hdoqpyiivn
-// extern Agiodisc_t AgIoDisc
-
-
-//1 bnzt5syjb7mgeru19114vd6xx
-// extern Agdisc_t AgDefaultDisc
-
-
-//1 35y2gbegsdjilegaribes00mg
-// extern Agdesc_t Agdirected, Agstrictdirected, Agundirected, Agstrictundirected
-
-
-//1 c2rygslq6bcuka3awmvy2b3ow
-// typedef Agsubnode_t Agnoderef_t
-
-
-//1 xam6yv0dcsx57dtg44igpbzn
-// typedef Dtlink_t Agedgeref_t
-
-
-//1 9jp96pa73kseya3w6sulxzok6
-// extern char *Gvimagepath
-
-
-//1 c6f8whijgjwwagjigmxlwz3gb
-// extern char *HTTPServerEnVar
-
-
-//1 9brvabw9vk27d2nrq4p8tf971
-// static Dict_t *ImageDict
-
-
-//1 9pk2f9zg2k7nxk2pay6uw1ecz
-// static knowntype_t knowntypes[] =
-
-
-
-
-//3 afsdkf8ez5ohl6dd2prle0bgt
-// static int imagetype (usershape_t *us)
-public static Object imagetype(Object... arg) {
-UNSUPPORTED("7vhzi3i3q0uu1byz03i34arpi"); // static int imagetype (usershape_t *us)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("4xkzi87btn54hoh901yqje0t2"); // char header[20];
-UNSUPPORTED("34btb8w1kvws7rrywxitht2dt"); // char line[200];
-UNSUPPORTED("b17di9c7wgtqm51bvsyxz6e2f"); // int i;
-UNSUPPORTED("ayo4w7poqzsosr46zq587rive"); // if (us->f && fread(header, 1, 20, us->f) == 20) {
-UNSUPPORTED("4f6p9x65zgxhi7g72c6rr85ez"); // for (i = 0; i < sizeof(knowntypes) / sizeof(knowntype_t); i++) {
-UNSUPPORTED("ken197schvdfnlj4tbd1ajsg"); // if (!memcmp (header, knowntypes[i].template, knowntypes[i].size)) {
-UNSUPPORTED("boxmes4yvhbhxz864uev9jrkn"); // us->stringtype = knowntypes[i].stringtype;
-UNSUPPORTED("ot0inunld2mj1q1v9ubb1meg"); // us->type = knowntypes[i].type;
-UNSUPPORTED("itn78hlno7a8ug22ta41xds5"); // if (us->type == FT_XML) {
-UNSUPPORTED("152itmr8zxm9bdyohwofdarej"); // /* check for SVG in case of XML */
-UNSUPPORTED("3hr9t6mkxbajyo66bbwwo671x"); // while (fgets(line, sizeof(line), us->f) != (void *)0) {
-UNSUPPORTED("3t6168qdbfqfv25fv7zx4xfms"); // if (!memcmp(line, "<svg", sizeof("<svg")-1)) {
-UNSUPPORTED("4n0qtaiukl38cr3i4ghl56e29"); // us->stringtype = "svg";
-UNSUPPORTED("ano6zabqu54wu0a40t35lj2q8"); // return (us->type = FT_SVG);
-UNSUPPORTED("3rk33w1xf0jaka2h033sgnx06"); // }
-UNSUPPORTED("dkxvw03k2gg9anv4dbze06axd"); // }
-UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
-UNSUPPORTED("f1kxll0fswekbe2gwilmen2m7"); // else if (us->type == FT_RIFF) {
-UNSUPPORTED("cm5s3kh98e66k97v45ofiyv82"); // /* check for WEBP in case of RIFF */
-UNSUPPORTED("4ma0gwqxr9j5qek6xkrskevsl"); // if (!memcmp(header+8, "WEBP", sizeof("WEBP")-1)) {
-UNSUPPORTED("3zasc2uxnxlgetbuyifmr97bf"); // us->stringtype = "webp";
-UNSUPPORTED("cgno6et27of87vw0o38rnarxx"); // return (us->type = FT_WEBP);
-UNSUPPORTED("dkxvw03k2gg9anv4dbze06axd"); // }
-UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
-UNSUPPORTED("60vq78txdp1vk965f5jgtlboc"); // return us->type;
-UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("775efiysp2o60ingiihr8o6kq"); // us->stringtype = "(lib)";
-UNSUPPORTED("acr9g7qhtz1yhdxvbzfapnlad"); // us->type = FT_NULL;
-UNSUPPORTED("7yivuk2g5w938mbst7quo3jxa"); // return FT_NULL;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 bnikn3k3s008dmhsa2qu6lh34
-// static boolean get_int_lsb_first (FILE *f, unsigned int sz, unsigned int *val)
-public static Object get_int_lsb_first(Object... arg) {
-UNSUPPORTED("cj03ffwnafffjxcznknyyp45b"); // static boolean get_int_lsb_first (FILE *f, unsigned int sz, unsigned int *val)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("70g3qubiio6uxhg2gxt141bff"); // int ch, i;
-UNSUPPORTED("f3wi4z18bhg0unx5i47wp28hb"); // *val = 0;
-UNSUPPORTED("6p1fgfnk4itt60e21fa48roiq"); // for (i = 0; i < sz; i++) {
-UNSUPPORTED("7zywfbf1jevwjemy5yzpfiiza"); // ch = fgetc(f);
-UNSUPPORTED("1t7v5vi7ec6r3mhla23o1v3w2"); // if (feof(f))
-UNSUPPORTED("6f1138i13x0xz1bf1thxgjgka"); // return 0;
-UNSUPPORTED("1ewc3hwvqjod1e2ou7c4u02h1"); // *val |= (ch << 8*i);
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("4si0cf97a5sfd9ozuunds9goz"); // return (!(0));
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 87ifzytv1xgex4vf4ffa1fx28
-// static boolean get_int_msb_first (FILE *f, unsigned int sz, unsigned int *val)
-public static Object get_int_msb_first(Object... arg) {
-UNSUPPORTED("ad8pamcrkweeq9xmkgw9docv9"); // static boolean get_int_msb_first (FILE *f, unsigned int sz, unsigned int *val)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("70g3qubiio6uxhg2gxt141bff"); // int ch, i;
-UNSUPPORTED("f3wi4z18bhg0unx5i47wp28hb"); // *val = 0;
-UNSUPPORTED("6p1fgfnk4itt60e21fa48roiq"); // for (i = 0; i < sz; i++) {
-UNSUPPORTED("7zywfbf1jevwjemy5yzpfiiza"); // ch = fgetc(f);
-UNSUPPORTED("1t7v5vi7ec6r3mhla23o1v3w2"); // if (feof(f))
-UNSUPPORTED("6f1138i13x0xz1bf1thxgjgka"); // return 0;
-UNSUPPORTED("ac2fcmmhoviu6vu7od03xd2fz"); // *val <<= 8;
-UNSUPPORTED("2aeq31k5bdbmozogiex8thool"); // *val |= ch;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("4si0cf97a5sfd9ozuunds9goz"); // return (!(0));
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 e6zw0qebmgir30wjyodre1w3q
-// static unsigned int svg_units_convert(double n, char *u)
-public static Object svg_units_convert(Object... arg) {
-UNSUPPORTED("1q167s10zcp2ohq3mqsaucn6q"); // static unsigned int svg_units_convert(double n, char *u)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("as83qujnkumxgvltowl9k84pa"); // if (strcmp(u, "in") == 0)
-UNSUPPORTED("cz9p5u3tzm0vtfcypzsqjjznz"); // return ROUND(n * 72);
-UNSUPPORTED("a3ea8buut0466me8422yze7nk"); // if (strcmp(u, "px") == 0)
-UNSUPPORTED("17k340tdedf8kyw8jjau617ji"); // return ROUND(n * 72 / 96);
-UNSUPPORTED("e1voxws30sz7bauvt2nz3e43i"); // if (strcmp(u, "pc") == 0)
-UNSUPPORTED("dgfrr8ul58nbz256i7zg3dfnv"); // return ROUND(n * 72 / 6);
-UNSUPPORTED("3zt4017at03z9nmfg4b6j33nl"); // if (strcmp(u, "pt") == 0 || strcmp(u, "\"") == 0) /* ugly!! - if there are no inits then the %2s get the trailing '"' */
-UNSUPPORTED("3bme0piy1kqu5q9y4eqbrr5fm"); // return ROUND(n);
-UNSUPPORTED("4kvfi7mn3m1cvs8748w6apqe6"); // if (strcmp(u, "cm") == 0)
-UNSUPPORTED("40fcy0h4yq1mhgc6sig41xkiz"); // return ROUND(n * ((double)72 * 0.393700787));
-UNSUPPORTED("795vmm17p8fultyx81btq2qj7"); // if (strcmp(u, "mm") == 0)
-UNSUPPORTED("2p58445vgby41tw5y37sb952f"); // return ROUND(n * ((double)72 * 0.0393700787));
-UNSUPPORTED("5oxhd3fvp0gfmrmz12vndnjt"); // return 0;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-//1 48cx4t8oc5776gxxsx3wj1459
-// static char* svg_attr_value_re =
-
-
-//1 urpt4udx4umgv15x10ssv67m
-// static regex_t re, *pre = (void *)0
-
-
-
-
-//3 di4bxm03m9srcwmfu82mzqtu
-// static void svg_size (usershape_t *us)
-public static Object svg_size(Object... arg) {
-UNSUPPORTED("3bpommb3a197xaax86ebpnapc"); // static void svg_size (usershape_t *us)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("16qpk89sms5wm32xxhdjsrhj1"); // unsigned int w = 0, h = 0;
-UNSUPPORTED("3bfgwfzonzqutm2m3s241ggmq"); // double n, x0, y0, x1, y1;
-UNSUPPORTED("5urpczqwzlgz812axw5w07irp"); // char u[10];
-UNSUPPORTED("e7xkcvvhzn89z17vzxp5d9wqf"); // char *attribute, *value, *re_string;
-UNSUPPORTED("34btb8w1kvws7rrywxitht2dt"); // char line[200];
-UNSUPPORTED("1kfdqzk554dccavlk1sr8hc6k"); // boolean wFlag = 0, hFlag = 0;
-UNSUPPORTED("txcitt9410z35lsx2a1qr3zb"); // regmatch_t re_pmatch[4];
-UNSUPPORTED("2elnezsihato03euhhcjmczz6"); // /* compile on first use */
-UNSUPPORTED("b3qk4y1nm971zossf7ba67c39"); // if (! pre) {
-UNSUPPORTED("4k0rhf891tka3e5fomw7gygix"); // if (regcomp(&re, svg_attr_value_re, REG_EXTENDED) != 0) {
-UNSUPPORTED("bvbawrzsgnxy8a4de3iuwaeqb"); // agerr(AGERR,"cannot compile regular expression %s", svg_attr_value_re);
-UNSUPPORTED("klxoy56t7b20wxnwqm0qoofz"); // }
-UNSUPPORTED("9let8u6jhsriwmr05bp3gwoy5"); // pre = &re;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("7iygf89yc0kwp5pocixawdaed"); // fseek(us->f, 0, SEEK_SET);
-UNSUPPORTED("40jwwwlrum66g8u94aha46ac6"); // while (fgets(line, sizeof(line), us->f) != (void *)0 && (!wFlag || !hFlag)) {
-UNSUPPORTED("1d8ii0hljelb18gmpwwrtvano"); // re_string = line;
-UNSUPPORTED("5bh0ae9np7zl19gk8h3h9317e"); // while (regexec(&re, re_string, 4, re_pmatch, 0) == 0) {
-UNSUPPORTED("b355fkvcamz9jmg27def9b8x3"); // re_string[re_pmatch[1].rm_eo] = '\0';
-UNSUPPORTED("aef3m3p3zi96h0zt0sjw03lj4"); // re_string[re_pmatch[2].rm_eo] = '\0';
-UNSUPPORTED("eipkd5535u39a7ub3xbstkeu2"); // attribute = re_string + re_pmatch[1].rm_so;
-UNSUPPORTED("bqe4861o77yhd2c4hm2q9ryqg"); // value = re_string + re_pmatch[2].rm_so;
-UNSUPPORTED("c9y0ykkvqmbho7jwq1hq2v8rg"); // re_string += re_pmatch[0].rm_eo + 1;
-UNSUPPORTED("4x0vivqfmvb5kxu3yv8zlj0z8"); // if (strcmp(attribute,"width") == 0) {
-UNSUPPORTED("cjoilrknjlp3580a79aeduafs"); // if (sscanf(value, "%lf%2s", &n, u) == 2) {
-UNSUPPORTED("5804xn01sb0nsqc4oand73j71"); // w = svg_units_convert(n, u);
-UNSUPPORTED("boxr36cof383w0qjpos68wr3p"); // wFlag = (!(0));
-UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
-UNSUPPORTED("coem1appm7al4by2xogxcf79v"); // else if (sscanf(value, "%lf", &n) == 1) {
-UNSUPPORTED("d20bsvecsbla4zfrgr8vs0axk"); // w = svg_units_convert(n, "pt");
-UNSUPPORTED("boxr36cof383w0qjpos68wr3p"); // wFlag = (!(0));
-UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
-UNSUPPORTED("bokpcg0aj7i7sody2nk55sn1m"); // if (hFlag)
-UNSUPPORTED("czyohktf9bkx4udfqhx42f4lu"); // break;
-UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
-UNSUPPORTED("349wmcj9pjfzzogsgqytbecep"); // else if (strcmp(attribute,"height") == 0) {
-UNSUPPORTED("cjoilrknjlp3580a79aeduafs"); // if (sscanf(value, "%lf%2s", &n, u) == 2) {
-UNSUPPORTED("4e8rpne5p90nqhwswzkila8du"); // h = svg_units_convert(n, u);
-UNSUPPORTED("75lsnpofiu7aq6tvk1bytezfx"); // hFlag = (!(0));
-UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
-UNSUPPORTED("318wbwzbtyt293618awt8oi7j"); // else if (sscanf(value, "%lf", &n) == 1) {
-UNSUPPORTED("8roq2ozo7ghuukkquxg4vi3o8"); // h = svg_units_convert(n, "pt");
-UNSUPPORTED("75lsnpofiu7aq6tvk1bytezfx"); // hFlag = (!(0));
-UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
-UNSUPPORTED("3f72eveov59pnntffs33fh1o9"); // if (wFlag)
-UNSUPPORTED("czyohktf9bkx4udfqhx42f4lu"); // break;
-UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
-UNSUPPORTED("evrgwvbtefbhi8c4vpurqyncz"); // else if (strcmp(attribute,"viewBox") == 0
-UNSUPPORTED("7knynrz6icv4twtp5re2u2tyu"); // && sscanf(value, "%lf %lf %lf %lf", &x0,&y0,&x1,&y1) == 4) {
-UNSUPPORTED("b75jl7dtq9qf4ike38i53sb5b"); // w = x1 - x0 + 1;
-UNSUPPORTED("ccjsgjzpqovbgplagso2d6wvk"); // h = y1 - y0 + 1;
-UNSUPPORTED("agh2p3816w463hvgmt7pji00p"); // wFlag = (!(0));
-UNSUPPORTED("b0kbr8vydi49ibjics3e3mlip"); // hFlag = (!(0));
-UNSUPPORTED("7f9nr53m374zf5jnncru7yfn6"); // break;
-UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("7337vyphkrv1lekq0dncy8j6s"); // us->dpi = 0;
-UNSUPPORTED("avyq4e4me4o2pteunxjmfehds"); // us->w = w;
-UNSUPPORTED("evkuhplkb5xfea6ln3h8f6ly2"); // us->h = h;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 2phgl4coa8enkvltpf0938lit
-// static void png_size (usershape_t *us)
-public static Object png_size(Object... arg) {
-UNSUPPORTED("5qra9bwfkjw5syv0odudm6gam"); // static void png_size (usershape_t *us)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("8l3f9beos057zjxgk0cdj323o"); // unsigned int w, h;
-UNSUPPORTED("7337vyphkrv1lekq0dncy8j6s"); // us->dpi = 0;
-UNSUPPORTED("3135bp24afhqdzs2uj5l7sjr1"); // fseek(us->f, 16, SEEK_SET);
-UNSUPPORTED("1luxqut1mknrn8qp0yakx9czw"); // if (get_int_msb_first(us->f, 4, &w) && get_int_msb_first(us->f, 4, &h)) {
-UNSUPPORTED("73axoa9apyrx2829eqsezmfik"); // us->w = w;
-UNSUPPORTED("993qcme7jlmcsi918hu491ld5"); // us->h = h;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 lqow6tkjqnnbqz6msa6cmzlk
-// static void ico_size (usershape_t *us)
-public static Object ico_size(Object... arg) {
-UNSUPPORTED("6eqck7knu0bxd3sib3fpca2hf"); // static void ico_size (usershape_t *us)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("8l3f9beos057zjxgk0cdj323o"); // unsigned int w, h;
-UNSUPPORTED("7337vyphkrv1lekq0dncy8j6s"); // us->dpi = 0;
-UNSUPPORTED("bunso4je5hrb29m4984fw7bh6"); // fseek(us->f, 6, SEEK_SET);
-UNSUPPORTED("875b5zt62o9flpi731becymv4"); // if (get_int_msb_first(us->f, 1, &w) && get_int_msb_first(us->f, 1, &h)) {
-UNSUPPORTED("73axoa9apyrx2829eqsezmfik"); // us->w = w;
-UNSUPPORTED("993qcme7jlmcsi918hu491ld5"); // us->h = h;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 dleljswqxf1oa4gzr8l8fomcl
-// static void webp_size (usershape_t *us)
-public static Object webp_size(Object... arg) {
-UNSUPPORTED("dl59ajg8cu2fj1vuagj6pumce"); // static void webp_size (usershape_t *us)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("8l3f9beos057zjxgk0cdj323o"); // unsigned int w, h;
-UNSUPPORTED("7337vyphkrv1lekq0dncy8j6s"); // us->dpi = 0;
-UNSUPPORTED("3mt62dnri0kt6p9g6nmf6x78i"); // fseek(us->f, 15, SEEK_SET);
-UNSUPPORTED("bro476e5tdpqu4kqzjhadepr8"); // if (fgetc(us->f) == 'X') { //VP8X
-UNSUPPORTED("ciyvs7xrf1sc336ipavk7gjbs"); // fseek(us->f, 24, SEEK_SET);
-UNSUPPORTED("77gjxe5g6u7c6371ziwedefxf"); // if (get_int_lsb_first(us->f, 4, &w) && get_int_lsb_first(us->f, 4, &h)) {
-UNSUPPORTED("9htwijlhm4ad9uo70xn5d5tvl"); // us->w = w;
-UNSUPPORTED("3hh8nl3qystuq8wcwsm411fej"); // us->h = h;
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("bwt2eurukj3m7fsbr441rf1pj"); // else { //VP8
-UNSUPPORTED("5fthwx7kwgddogs4n4fsbb0o8"); // fseek(us->f, 26, SEEK_SET);
-UNSUPPORTED("621fvdyd12vnbfyxpw6j0z7cr"); // if (get_int_lsb_first(us->f, 2, &w) && get_int_lsb_first(us->f, 2, &h)) {
-UNSUPPORTED("9htwijlhm4ad9uo70xn5d5tvl"); // us->w = w;
-UNSUPPORTED("3hh8nl3qystuq8wcwsm411fej"); // us->h = h;
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 2s3ms72agp5gyfqz15zbpp3u1
-// static void gif_size (usershape_t *us)
-public static Object gif_size(Object... arg) {
-UNSUPPORTED("ac8be5d24wrrx24tnddiukvl7"); // static void gif_size (usershape_t *us)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("8l3f9beos057zjxgk0cdj323o"); // unsigned int w, h;
-UNSUPPORTED("7337vyphkrv1lekq0dncy8j6s"); // us->dpi = 0;
-UNSUPPORTED("bunso4je5hrb29m4984fw7bh6"); // fseek(us->f, 6, SEEK_SET);
-UNSUPPORTED("ezkdvuggkyj11n6ca6xrhm72g"); // if (get_int_lsb_first(us->f, 2, &w) && get_int_lsb_first(us->f, 2, &h)) {
-UNSUPPORTED("73axoa9apyrx2829eqsezmfik"); // us->w = w;
-UNSUPPORTED("993qcme7jlmcsi918hu491ld5"); // us->h = h;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 bpjeya6em7jp6m6l86m6t4u4a
-// static void bmp_size (usershape_t *us)
-public static Object bmp_size(Object... arg) {
-UNSUPPORTED("ba2pylwi2xu10asnonw92pxw1"); // static void bmp_size (usershape_t *us) {
-UNSUPPORTED("ct1272vz7j34sqkcwzdiq2x0i"); // unsigned int size_x_msw, size_x_lsw, size_y_msw, size_y_lsw;
-UNSUPPORTED("7337vyphkrv1lekq0dncy8j6s"); // us->dpi = 0;
-UNSUPPORTED("9b418veiss4t0o7s8cqq28owo"); // fseek (us->f, 16, SEEK_SET);
-UNSUPPORTED("1q9kmvi2ajod9wlev8s5p50rv"); // if ( get_int_lsb_first (us->f, 2, &size_x_msw) &&
-UNSUPPORTED("5f5k6cp1ota9f8a2ciircybdh"); // get_int_lsb_first (us->f, 2, &size_x_lsw) &&
-UNSUPPORTED("9n6cqmhzmbkf1vt9fyu6zw0kp"); // get_int_lsb_first (us->f, 2, &size_y_msw) &&
-UNSUPPORTED("cid929pl3ogyk2kecod7opvz0"); // get_int_lsb_first (us->f, 2, &size_y_lsw) ) {
-UNSUPPORTED("a6g25f4k8ew6jja5m9rnccf5o"); // us->w = size_x_msw << 16 | size_x_lsw;
-UNSUPPORTED("8exqj264llut5d629ydwne5k2"); // us->h = size_y_msw << 16 | size_y_lsw;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 c7yvo5wd816hjqxejnluaol0a
-// static void jpeg_size (usershape_t *us)
-public static Object jpeg_size(Object... arg) {
-UNSUPPORTED("c8uakwctlakoj06f07juq8r2a"); // static void jpeg_size (usershape_t *us) {
-UNSUPPORTED("3o57tczyjy6z9uvry23b9xkw5"); // unsigned int marker, length, size_x, size_y, junk;
-UNSUPPORTED("4ylph99ph3r2v7uhxyd2hq0io"); // /* These are the markers that follow 0xff in the file.
-UNSUPPORTED("1pzctl0feh1bhiqnxtmawvxg4"); // * Other markers implicitly have a 2-byte length field that follows.
-UNSUPPORTED("795vpnc8yojryr8b46aidsu69"); // */
-UNSUPPORTED("1lgv3mem6buwpyuef4b9h8rzp"); // static unsigned char standalone_markers [] = {
-UNSUPPORTED("e00djw6cjtdaxejgnewp8nus6"); // 0x01, /* Temporary */
-UNSUPPORTED("1urwngq6m3z6m5mr3egwgq9mr"); // 0xd0, 0xd1, 0xd2, 0xd3, /* Reset */
-UNSUPPORTED("e1vwc4842h5c84ojr8w3onuno"); // 0xd4, 0xd5, 0xd6,
-UNSUPPORTED("1uig2kz9nbo8j6vj3r7493n8"); // 0xd7,
-UNSUPPORTED("927bzm317ui2xj8ugbwhm5xb7"); // 0xd8, /* Start of image */
-UNSUPPORTED("9ybi9mcsggfw3zbh6zn9hotef"); // 0xd9, /* End of image */
-UNSUPPORTED("fbagrxdnmyjkvt7zaukczscg"); // 0
-UNSUPPORTED("9u8qqu9tw95qjbv3cxv3hj4bd"); // };
-UNSUPPORTED("7337vyphkrv1lekq0dncy8j6s"); // us->dpi = 0;
-UNSUPPORTED("5owjshc6gmd9o9lmekzcl6rvg"); // while ((!(0))) {
-UNSUPPORTED("7kq4b2hkhf3vcx97hwoelgcxz"); // /* Now we must be at a 0xff or at a series of 0xff's.
-UNSUPPORTED("cga1geam6con9djkcofzmw0ko"); // * If that is not the case, or if we're at EOF, then there's
-UNSUPPORTED("exr8s1ongonmgsucjdf4zsmb4"); // * a parsing error.
-UNSUPPORTED("3vesx4cskuo1q42jvwmoum2xs"); // */
-UNSUPPORTED("79jgtuw1xg9dgik49e3hx1068"); // if (! get_int_msb_first (us->f, 1, &marker))
-UNSUPPORTED("3zyp4vhegf9dl2g8a4ffmxah8"); // return;
-UNSUPPORTED("e7cevpg68ih107a2ggfgkq1la"); // if (marker == 0xff)
-UNSUPPORTED("9j8yk6fxm4tnpr3yrev0f9bhm"); // continue;
-UNSUPPORTED("99hdbrpbwvb3lwfyhz43xnoxf"); // /* Ok.. marker now read. If it is not a stand-alone marker,
-UNSUPPORTED("b7dntxmllxk3wzmg9mclxs71r"); // * then continue. If it's a Start Of Frame (0xc?), then we're there.
-UNSUPPORTED("8aramua11q89c43osky6tgha5"); // * If it's another marker with a length field, then skip ahead
-UNSUPPORTED("5w0fy7m3152rri519xzsydb2w"); // * over that length field.
-UNSUPPORTED("3vesx4cskuo1q42jvwmoum2xs"); // */
-UNSUPPORTED("7itrbaa4e2u9uh86wydx2r1wq"); // /* A stand-alone... */
-UNSUPPORTED("7m1dttkv67ixwryn1ukl94hel"); // if (strchr ((char*)standalone_markers, marker))
-UNSUPPORTED("9j8yk6fxm4tnpr3yrev0f9bhm"); // continue;
-UNSUPPORTED("sb3rjk9k59soh7qvm0qpkzoh"); // /* Incase of a 0xc0 marker: */
-UNSUPPORTED("6u3lv1x78jskc1qjam25s00h1"); // if (marker == 0xc0) {
-UNSUPPORTED("4kucipi8uw6ujeuh489csoowf"); // /* Skip length and 2 lengths. */
-UNSUPPORTED("30gcyw02iuybxoyj28nhlbwbl"); // if ( get_int_msb_first (us->f, 3, &junk) &&
-UNSUPPORTED("b6ypup1v81rta7mfh68arftfd"); // get_int_msb_first (us->f, 2, &size_x) &&
-UNSUPPORTED("f2mbg2ezlyocn5228wkhy658f"); // get_int_msb_first (us->f, 2, &size_y) ) {
-UNSUPPORTED("eps17wh894vxn0oojbitsn1lr"); // /* Store length. */
-UNSUPPORTED("danamcguxf0st13b0euh47y8v"); // us->h = size_x;
-UNSUPPORTED("gva1bl1ygb6xzrrjwpma3dpp"); // us->w = size_y;
-UNSUPPORTED("7g94ubxa48a1yi3mf9v521b7c"); // }
-UNSUPPORTED("6cprbghvenu9ldc0ez1ifc63q"); // return;
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("7jc4v9i136pgfvwakfui3aupm"); // /* Incase of a 0xc2 marker: */
-UNSUPPORTED("a1ww3q31w3xsq697vt32phj9d"); // if (marker == 0xc2) {
-UNSUPPORTED("7xwfuqyvolr45lp6gdcnmqyna"); // /* Skip length and one more byte */
-UNSUPPORTED("dhyz02dvhk6z01p9nh8knpdnp"); // if (! get_int_msb_first (us->f, 3, &junk))
-UNSUPPORTED("6an8ocqq0sjru42k4aathe94m"); // return;
-UNSUPPORTED("7b106vc3jzqz2eyjlo758xw2n"); // /* Get length and store. */
-UNSUPPORTED("akbj7dadm0nq5ujmuwiw50ukl"); // if ( get_int_msb_first (us->f, 2, &size_x) &&
-UNSUPPORTED("f2mbg2ezlyocn5228wkhy658f"); // get_int_msb_first (us->f, 2, &size_y) ) {
-UNSUPPORTED("danamcguxf0st13b0euh47y8v"); // us->h = size_x;
-UNSUPPORTED("gva1bl1ygb6xzrrjwpma3dpp"); // us->w = size_y;
-UNSUPPORTED("7g94ubxa48a1yi3mf9v521b7c"); // }
-UNSUPPORTED("6cprbghvenu9ldc0ez1ifc63q"); // return;
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("9qz6tc2665rtirz7egtertjyl"); // /* Any other marker is assumed to be followed by 2 bytes length. */
-UNSUPPORTED("5xvajayqclvcxxqkozzorzbdi"); // if (! get_int_msb_first (us->f, 2, &length))
-UNSUPPORTED("3zyp4vhegf9dl2g8a4ffmxah8"); // return;
-UNSUPPORTED("cv5sg5k6hy1kwgiinb4i5xr6"); // fseek (us->f, length - 2, SEEK_CUR);
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 9vi0gtfjnp35ie6bx15grm4gp
-// static void ps_size (usershape_t *us)
-public static Object ps_size(Object... arg) {
-UNSUPPORTED("8kctdt9asc26knxxydik2v8ug"); // static void ps_size (usershape_t *us)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("18vi5vqd0r4k0kxsl3h3rwa4y"); // char line[BUFSIZ];
-UNSUPPORTED("4qk2wsv83bxm1lchsnd6splfr"); // boolean saw_bb;
-UNSUPPORTED("5rcgzsa5rlhtyjz964tcthts2"); // int lx, ly, ux, uy;
-UNSUPPORTED("5fewhg0dt0vbugqk2bmyfr34l"); // char* linep;
-UNSUPPORTED("891wob6d9fi1zsdfvumw7tx5y"); // us->dpi = 72;
-UNSUPPORTED("7iygf89yc0kwp5pocixawdaed"); // fseek(us->f, 0, SEEK_SET);
-UNSUPPORTED("w6asn9e9wasakvoc3kn19lwt"); // saw_bb = 0;
-UNSUPPORTED("cpypiyiyiq875wcq5pix66en2"); // while (fgets(line, sizeof(line), us->f)) {
-UNSUPPORTED("7vmkqwijdn7elebqrq3q3qqlv"); // /* PostScript accepts \r as EOL, so using fgets () and looking for a
-UNSUPPORTED("ccqysd4ji4ezs2u937a1tq93k"); // * bounding box comment at the beginning doesn't work in this case.
-UNSUPPORTED("a548nncd0y8n2a01c5z3akmhg"); // * As a heuristic, we first search for a bounding box comment in line.
-UNSUPPORTED("djrf0gim2rh71i0skg41uw6zn"); // * This obviously fails if not all of the numbers make it into the
-UNSUPPORTED("x3dg0lfzyp7yc2hldpo3cbge"); // * current buffer. This shouldn't be a problem, as the comment is
-UNSUPPORTED("4uvbwtwj71pylu4bfe3pu79le"); // * typically near the beginning, and so should be read within the first
-UNSUPPORTED("426auswwt3iw0kmtesztdy9ff"); // * BUFSIZ bytes (even on Windows where this is 512).
-UNSUPPORTED("62wb43w2xc6ex6hootjubbx22"); // */
-UNSUPPORTED("8iwr2d3ooqy0tw5eisixpectn"); // if (!(linep = strstr (line, "%%BoundingBox:")))
-UNSUPPORTED("6hqli9m8yickz1ox1qfgtdbnd"); // continue;
-UNSUPPORTED("2s519tr2mhoj177f79vzllnyq"); // if (sscanf (linep, "%%%%BoundingBox: %d %d %d %d", &lx, &ly, &ux, &uy) == 4) {
-UNSUPPORTED("6dekl3sp6brld4uq5ep5859l3"); // saw_bb = (!(0));
-UNSUPPORTED("ai3czg6gaaxspsmndknpyvuiu"); // break;
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("8p3jjm43yrzygpor71hdkfs1g"); // if (saw_bb) {
-UNSUPPORTED("5dym7sjpxsgdgav57jvyuohe8"); // us->x = lx;
-UNSUPPORTED("da04q03gf0w4upkkrsn74w1dc"); // us->y = ly;
-UNSUPPORTED("6mpj1u4n7cyggpme1vsa6je8t"); // us->w = ux - lx;
-UNSUPPORTED("dqnhfatraydhv6fdx3gsi22ao"); // us->h = uy - ly;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 87i5xtm6lbxo4asqfnu0v9rz1
-// static unsigned char nxtc (stream_t* str)
-public static Object nxtc(Object... arg) {
-UNSUPPORTED("at0aua2ntxsp0j1h4yidmr4si"); // static unsigned char
-UNSUPPORTED("9rrtdlhn8kugpol3lky8rgp5n"); // nxtc (stream_t* str)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("9jyosg56ecd165ua22kq89ggj"); // if (fgets(str->buf, BUFSIZ, str->fp)) {
-UNSUPPORTED("bo88dnmxymbe4e1rppc0ex9ve"); // str->s = str->buf;
-UNSUPPORTED("8tdhptj2ed5dv8sew624q4jec"); // return *(str->s);
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("278hcy3fayv5vclqcgtpjbzdi"); // return '\0';
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 2fq3qaeuu4gjr89xmwwy7i4xe
-// static void skipWS (stream_t* str)
-public static Object skipWS(Object... arg) {
-UNSUPPORTED("e2z2o5ybnr5tgpkt8ty7hwan1"); // static void
-UNSUPPORTED("cactz8998uk8ou1c5zwtwg601"); // skipWS (stream_t* str)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("10sir32iwi5l2jyfgp65pihto"); // unsigned char c;
-UNSUPPORTED("91zm214vvm6477gtei1ggjkef"); // while ((c = (*(str->s)?*(str->s):nxtc(str)))) {
-UNSUPPORTED("dilzs0pemy12rvmpnko0iel59"); // if (isspace(c)) (str->s++);
-UNSUPPORTED("9wafzg86cpce49qfuv8wsl6in"); // else return;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 dwmuhk2xjfndhxozxfrdz5nk8
-// static int scanNum (char* tok, double* dp)
-public static Object scanNum(Object... arg) {
-UNSUPPORTED("eyp5xkiyummcoc88ul2b6tkeg"); // static int
-UNSUPPORTED("eq0ltrbhzwt422rffdlm4d20e"); // scanNum (char* tok, double* dp)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("bkz9mqmemp1ljxdwdbu8xv3e9"); // char* endp;
-UNSUPPORTED("avrsd77b596s5g291ozzdpxf8"); // double d = strtod(tok, &endp);
-UNSUPPORTED("2qoq2nf2jpfoyc68njwm2ajkq"); // if (tok == endp) return 1;
-UNSUPPORTED("636uh4i1x8w844yxwd2u322d1"); // *dp = d;
-UNSUPPORTED("5oxhd3fvp0gfmrmz12vndnjt"); // return 0;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 dhjmc8hrpmiohrejyu72mrhno
-// static void getNum (stream_t* str, char* buf)
-public static Object getNum(Object... arg) {
-UNSUPPORTED("e2z2o5ybnr5tgpkt8ty7hwan1"); // static void
-UNSUPPORTED("doymhclp9a2fukna3vd3r7xf8"); // getNum (stream_t* str, char* buf)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("bsj3r19ko668lwj5fqk8tlbhc"); // int len = 0;
-UNSUPPORTED("wrvu9u7a8j6i6y6552zncxfk"); // char c;
-UNSUPPORTED("936voey3mecmlo6hla9hyrmun"); // skipWS(str);
-UNSUPPORTED("tuyymjn2lfs038e1rm6hbw8w"); // while ((c = (*(str->s)?*(str->s):nxtc(str))) && (isdigit(c) || (c == '.'))) {
-UNSUPPORTED("4rvasxp4ert1zz5jaasrqeft1"); // buf[len++] = c;
-UNSUPPORTED("8vm8y5ewr5ra87d4f8exah65d"); // (str->s++);
-UNSUPPORTED("5zs9wc8ip6zkde4o33aadh30c"); // if (len == BUFSIZ-1) break;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("3w01p3l63zt07scumxz12foyc"); // buf[len] = '\0';
-UNSUPPORTED("b9185t6i77ez1ac587ul8ndnc"); // return;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 6kdhce4shbkw92wtfgufyqecs
-// static int boxof (stream_t* str, boxf* bp)
-public static Object boxof(Object... arg) {
-UNSUPPORTED("eyp5xkiyummcoc88ul2b6tkeg"); // static int
-UNSUPPORTED("d810hoc5e8uu0odpm097odpfu"); // boxof (stream_t* str, boxf* bp)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("1z7b1t0srtne632sd3ma9jbp7"); // char tok[BUFSIZ];
-UNSUPPORTED("araz8ffm0d5v424qzgyh7bsvy"); // skipWS(str);
-UNSUPPORTED("1uwfhdftjs4loqhg7ecaermjd"); // if ((*(str->s)?*(str->s):nxtc(str)) != '[') return 1;
-UNSUPPORTED("8vm8y5ewr5ra87d4f8exah65d"); // (str->s++);
-UNSUPPORTED("6jh13u8w5qiy4ij2ebx6zmqwa"); // getNum(str, tok);
-UNSUPPORTED("1m5wgiebygd9j5o6m68etvwh0"); // if (scanNum(tok,&bp->LL.x)) return 1;
-UNSUPPORTED("6jh13u8w5qiy4ij2ebx6zmqwa"); // getNum(str, tok);
-UNSUPPORTED("9bcg5vhxd4fqd8ykkbivfm3d4"); // if (scanNum(tok,&bp->LL.y)) return 1;
-UNSUPPORTED("6jh13u8w5qiy4ij2ebx6zmqwa"); // getNum(str, tok);
-UNSUPPORTED("1z0q9nrhj393zbs1mok3h84tf"); // if (scanNum(tok,&bp->UR.x)) return 1;
-UNSUPPORTED("6jh13u8w5qiy4ij2ebx6zmqwa"); // getNum(str, tok);
-UNSUPPORTED("247082ftkwl5jzjorvyt3sgcl"); // if (scanNum(tok,&bp->UR.y)) return 1;
-UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 dedr09vl6y9ax357arh6tayi
-// static int bboxPDF (FILE* fp, boxf* bp)
-public static Object bboxPDF(Object... arg) {
-UNSUPPORTED("eyp5xkiyummcoc88ul2b6tkeg"); // static int
-UNSUPPORTED("9icxkxwqm6flp3sl9ulkp4fyd"); // bboxPDF (FILE* fp, boxf* bp)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("f3gl6562biaxa4139uus0d370"); // stream_t str;
-UNSUPPORTED("5pjh3c3u4lxh1jdyyk966intb"); // char* s;
-UNSUPPORTED("8c7x8di5w36ib05qan9z4sl9"); // char buf[BUFSIZ];
-UNSUPPORTED("8w39jbbwqjx63enrf5fdvcm9r"); // while (fgets(buf, BUFSIZ, fp)) {
-UNSUPPORTED("b7wioadlc5j3p2q8w7tsq1gam"); // if ((s = strstr(buf,"/MediaBox"))) {
-UNSUPPORTED("ecmojjd7fnaeah045va2t5eg8"); // str.buf = buf;
-UNSUPPORTED("5k89yh945d2crbir8397vkavv"); // str.s = s+(sizeof("/MediaBox")-1);
-UNSUPPORTED("dj08qw9n5j8nlqx752hipu46u"); // str.fp = fp;
-UNSUPPORTED("uhua7rc3vef3nawzjyh3w1k5"); // return boxof(&str,bp);
-UNSUPPORTED("yoqd73ulpi5tn8snro7dt3jc"); // }
-UNSUPPORTED("8nzcpbtoi924xzu8ze3z6dbft"); // }
-UNSUPPORTED("eleqpc2p2r3hvma6tipoy7tr"); // return 1;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 3fdvwmb09jpyu6h40pj206vv3
-// static void pdf_size (usershape_t *us)
-public static Object pdf_size(Object... arg) {
-UNSUPPORTED("97swmsrhwped1e1n72fyev1ai"); // static void pdf_size (usershape_t *us)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("2lzsl1e035wt5epd1h8f4bn8m"); // boxf bb;
-UNSUPPORTED("7337vyphkrv1lekq0dncy8j6s"); // us->dpi = 0;
-UNSUPPORTED("7iygf89yc0kwp5pocixawdaed"); // fseek(us->f, 0, SEEK_SET);
-UNSUPPORTED("cu1kld68jk8qm12c9f0n61vyd"); // if ( ! bboxPDF (us->f, &bb)) {
-UNSUPPORTED("14kgzu9x57imt127uyibumhif"); // us->x = bb.LL.x;
-UNSUPPORTED("51rq1d6stvtvjgfta18hxoiyg"); // us->y = bb.LL.y;
-UNSUPPORTED("encm75ymc6wgridj70fk0jf47"); // us->w = bb.UR.x - bb.LL.x;
-UNSUPPORTED("dy52i81burd516zy265e83wel"); // us->h = bb.UR.y - bb.LL.y;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 cxhbj2es2sky90cnd8qf89prs
-// static void usershape_close (Dict_t * dict, void * p, Dtdisc_t * disc)
-public static Object usershape_close(Object... arg) {
-UNSUPPORTED("b7or8sf6zjmnj6wjf08brm0r"); // static void usershape_close (Dict_t * dict, void * p, Dtdisc_t * disc)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("58pwyr0d4numnoai5v987l5ml"); // usershape_t *us = (usershape_t *)p;
-UNSUPPORTED("ad2wgtudijnm3bp4549lrva3l"); // if (us->f)
-UNSUPPORTED("13i1v3mxl0sjnx4rgaden880d"); // fclose(us->f);
-UNSUPPORTED("e5bs4fy1a1v5ptm2bcrm2m9ai"); // if (us->data && us->datafree)
-UNSUPPORTED("1wod8ffcoluizmoc72db2htxb"); // us->datafree(us);
-UNSUPPORTED("73p2w162ujnuoboekx5udlion"); // free (us);
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-//1 es7jtx4lx7bg26412fcjit8ri
-// static Dtdisc_t ImageDictDisc =
-
-
-
-
-//3 9msk7qh9auq8w21r32k0ffcsa
-// usershape_t *gvusershape_find(char *name)
-public static Object gvusershape_find(Object... arg) {
-UNSUPPORTED("a9366bkr4gt4nvcj5bnkjrtrd"); // usershape_t *gvusershape_find(char *name)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("exneoozy5g8al0a8y6fxb88zv"); // usershape_t *us;
-UNSUPPORTED("265kxn69043hh3vmr1ma8pbpg"); // assert(name);
-UNSUPPORTED("1av8we70pcc0ni7489zk2ttcg"); // assert(name[0]);
-UNSUPPORTED("4qhyd93m9v57fwb1anljrxfd3"); // if (!ImageDict)
-UNSUPPORTED("45tfw7tcm68298aro2tdiv8pc"); // return (void *)0;
-UNSUPPORTED("dzt5b4nn4x2oidxk4g4wzt8et"); // us = (*(((Dt_t*)(ImageDict))->searchf))((ImageDict),(void*)(name),0001000);
-UNSUPPORTED("2iqrgjc97xskxvw6791yf0sl7"); // return us;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 3cgay03dg8pq23kln9kuc0ym5
-// boolean gvusershape_file_access(usershape_t *us)
-public static Object gvusershape_file_access(Object... arg) {
-UNSUPPORTED("dm8po5i2hu4arliyfc2ea2a47"); // boolean gvusershape_file_access(usershape_t *us)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("8u0o5i27i1no60qjs9r4os0f9"); // static int usershape_files_open_cnt;
-UNSUPPORTED("vadeh8lzzwz0ugk6azcwaayu"); // const char *fn;
-UNSUPPORTED("7gqi0ait1bhc4v9zl8rnn0wbs"); // assert(us);
-UNSUPPORTED("xlffgd4fqdckxg2nbs0mxtlj"); // assert(us->name);
-UNSUPPORTED("fk4kdjctgb13swd2h14t0yvh"); // assert(us->name[0]);
-UNSUPPORTED("ad2wgtudijnm3bp4549lrva3l"); // if (us->f)
-UNSUPPORTED("1te90msr6mhllwn4y3ghlahc0"); // fseek(us->f, 0, SEEK_SET);
-UNSUPPORTED("1nyzbeonram6636b1w955bypn"); // else {
-UNSUPPORTED("d6n6b94e02ntmefeqcoo0ueon"); // if (! (fn = safefile(us->name))) {
-UNSUPPORTED("778vwup2lml5qa9eyxd88416u"); // agerr(AGWARN, "Filename \"%s\" is unsafe\n", us->name);
-UNSUPPORTED("6f1138i13x0xz1bf1thxgjgka"); // return 0;
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("31rnydpzhmzclqs3q4flw9ce2"); // us->f = fopen(fn, "r");
-UNSUPPORTED("cmb2imwpnm4tgu1dm9r5tgtj5"); // if (us->f == (void *)0) {
-UNSUPPORTED("ebzon8h2oywxvasmfmyhnw5pq"); // agerr(AGWARN, "%s while opening %s\n", strerror(errno), fn);
-UNSUPPORTED("6f1138i13x0xz1bf1thxgjgka"); // return 0;
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("e17a7n92m8ieuby8sa8jm1r3o"); // if (usershape_files_open_cnt >= 50)
-UNSUPPORTED("c9jo9gbhp1on7wctnk1o7q8vu"); // us->nocache = (!(0));
-UNSUPPORTED("9352ql3e58qs4fzapgjfrms2s"); // else
-UNSUPPORTED("81eb64f0supcvkt4drj4djmby"); // usershape_files_open_cnt++;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("3ebwn2weruwgdz4tfaxj2htek"); // assert(us->f);
-UNSUPPORTED("4si0cf97a5sfd9ozuunds9goz"); // return (!(0));
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 9y4wcbk4jp03lbul2i25xzmp6
-// void gvusershape_file_release(usershape_t *us)
-public static Object gvusershape_file_release(Object... arg) {
-UNSUPPORTED("6i3sc3o39zrjf80hb57rmbe1t"); // void gvusershape_file_release(usershape_t *us)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("5a8j5zrw7vbgoyy4ogtlsywui"); // if (us->nocache) {
-UNSUPPORTED("47xp2oczqdec6db0z36u2n84r"); // if (us->f) {
-UNSUPPORTED("bzvrsl2iafc3pw0qughvm761m"); // fclose(us->f);
-UNSUPPORTED("amwbxewujlnkm7a19q6zl4xq0"); // us->f = (void *)0;
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 8gvu7lmp0zomg3yy0a76n8pjh
-// static usershape_t *gvusershape_open (char *name)
-public static Object gvusershape_open(Object... arg) {
-UNSUPPORTED("5kyko9vxn3aqt1awhp5hd8c6a"); // static usershape_t *gvusershape_open (char *name)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("exneoozy5g8al0a8y6fxb88zv"); // usershape_t *us;
-UNSUPPORTED("265kxn69043hh3vmr1ma8pbpg"); // assert(name);
-UNSUPPORTED("4qhyd93m9v57fwb1anljrxfd3"); // if (!ImageDict)
-UNSUPPORTED("7tvne0duj1fh44ndje8hlq8nt"); // ImageDict = dtopen(&ImageDictDisc, Dttree);
-UNSUPPORTED("be9pwrhxzz4ia299kongm87uq"); // if (! (us = gvusershape_find(name))) {
-UNSUPPORTED("9suqlrwjg77jwdm7tlgzsc0by"); // if (! (us = zmalloc(sizeof(usershape_t))))
-UNSUPPORTED("7f8nrnyuywny79cpzv6a49d8v"); // return (void *)0;
-UNSUPPORTED("6viwgw3bdyvknckol3dsh1s5v"); // us->name = agstrdup (0, name);
-UNSUPPORTED("ewc238znlsx5axoejodocqoyp"); // if (!gvusershape_file_access(us))
-UNSUPPORTED("7f8nrnyuywny79cpzv6a49d8v"); // return (void *)0;
-UNSUPPORTED("4i933mk1cyf6xcljbpn69na20"); // assert(us->f);
-UNSUPPORTED("43qnzsg978s9yom42c0n33wx3"); // switch(imagetype(us)) {
-UNSUPPORTED("7eenfnk5yzoj21g2agitce6kx"); // case FT_NULL:
-UNSUPPORTED("azdoxaxgz4fzzdoeyruqj36jk"); // if (!(us->data = (void*)find_user_shape(us->name)))
-UNSUPPORTED("9mepm6hu7uqhpdwcg60h6pc3o"); // agerr(AGWARN, "\"%s\" was not found as a file or as a shape library member\n", us->name);
-UNSUPPORTED("9bu5332flxhc1ivhmzuiqcjdh"); // free(us);
-UNSUPPORTED("6948880uywn56ppo1fuqbm2rt"); // return (void *)0;
-UNSUPPORTED("9ekmvj13iaml5ndszqyxa8eq"); // break;
-UNSUPPORTED("4p4ayucon7vqli1ylni5hjrfb"); // case FT_GIF:
-UNSUPPORTED("c68gkmazl6aratmtonsx4fan9"); // gif_size(us);
-UNSUPPORTED("7f9nr53m374zf5jnncru7yfn6"); // break;
-UNSUPPORTED("7da7e6aavwlcxg7eglorxy23g"); // case FT_PNG:
-UNSUPPORTED("ubixbe52lmq7uzqie7h12582"); // png_size(us);
-UNSUPPORTED("7f9nr53m374zf5jnncru7yfn6"); // break;
-UNSUPPORTED("9ysbcxl45mbfo0lhfihqfby4d"); // case FT_BMP:
-UNSUPPORTED("9xqkpupuhywfcx0rkky4pnu5q"); // bmp_size(us);
-UNSUPPORTED("7f9nr53m374zf5jnncru7yfn6"); // break;
-UNSUPPORTED("bhf95qvvxhf47ek76yf2a45l0"); // case FT_JPEG:
-UNSUPPORTED("bq0stf6n5x5tzvjir50smcifq"); // jpeg_size(us);
-UNSUPPORTED("7f9nr53m374zf5jnncru7yfn6"); // break;
-UNSUPPORTED("bazpzxo4uq0pwp7j4k94ngrtz"); // case FT_PS:
-UNSUPPORTED("7bs1bijtavu2jceudpors0jbp"); // ps_size(us);
-UNSUPPORTED("7f9nr53m374zf5jnncru7yfn6"); // break;
-UNSUPPORTED("8xv8jf3eindz5gftkzluercwh"); // case FT_WEBP:
-UNSUPPORTED("91d89xyv6dtk8a479p0cfwyy7"); // webp_size(us);
-UNSUPPORTED("7f9nr53m374zf5jnncru7yfn6"); // break;
-UNSUPPORTED("c8km9iw5nmks5lp6jl9j5s5q2"); // case FT_SVG:
-UNSUPPORTED("a147xv5hgfkmevlpr3jb7fzci"); // svg_size(us);
-UNSUPPORTED("7f9nr53m374zf5jnncru7yfn6"); // break;
-UNSUPPORTED("242ztnyfnn9hx8sb3u5z3omun"); // case FT_PDF:
-UNSUPPORTED("9ef2eux36pp9nf00d1ijmfbhm"); // pdf_size(us);
-UNSUPPORTED("9ekmvj13iaml5ndszqyxa8eq"); // break;
-UNSUPPORTED("3h2lioytqam297xdu0a7l0y6w"); // case FT_ICO:
-UNSUPPORTED("dj7xjql9twvpafx4qoyb07ra8"); // ico_size(us);
-UNSUPPORTED("9ekmvj13iaml5ndszqyxa8eq"); // break;
-UNSUPPORTED("90yyikfl7j30g6npbi9n0jxyw"); // // case FT_TIFF:
-UNSUPPORTED("72cnoy8x3q67t6323yzwcdim8"); // // tiff_size(us);
-UNSUPPORTED("1sbah8d4teszwq6tgzsohjpba"); // // break;
-UNSUPPORTED("2hkvwieff33mlzyovvk76tpzn"); // case FT_EPS: /* no eps_size code available */
-UNSUPPORTED("bt2g0yhsy3c7keqyftf3c98ut"); // default:
-UNSUPPORTED("7f9nr53m374zf5jnncru7yfn6"); // break;
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("1ju3i4hja8fc5wwdkk9ed70t0"); // gvusershape_file_release(us);
-UNSUPPORTED("6ovs68xjm9urfsh1qtosv57gi"); // (*(((Dt_t*)(ImageDict))->searchf))((ImageDict),(void*)(us),0000001);
-UNSUPPORTED("e7wyuaoyszuqilaizfjv1mnp9"); // return us;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("7xahvc82av8lspjlm80i6ycqx"); // gvusershape_file_release(us);
-UNSUPPORTED("2iqrgjc97xskxvw6791yf0sl7"); // return us;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 1uc6t1ylgvem0d3xb73wkh6k5
-// point gvusershape_size_dpi (usershape_t* us, pointf dpi)
-public static Object gvusershape_size_dpi(Object... arg) {
-UNSUPPORTED("5vjx3ewef6ht20ld1et4ghr4y"); // point
-UNSUPPORTED("5mxbu6cb95ay6dfs0i5n8icbs"); // gvusershape_size_dpi (usershape_t* us, pointf dpi)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("e5r3mj8btrkw973m7l0rritko"); // point rv;
-UNSUPPORTED("6n6sowowfpx2bppltl0zu5v7v"); // if (!us) {
-UNSUPPORTED("4zusj5p9eg9pazvp0px1fxvhy"); // rv.x = rv.y = -1;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("1nyzbeonram6636b1w955bypn"); // else {
-UNSUPPORTED("8egqtg148lkga2f8fnti0xikl"); // if (us->dpi != 0) {
-UNSUPPORTED("appsmczgq79si2bttb9rrlf1n"); // dpi.x = dpi.y = us->dpi;
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("8z1a50vlhe7l1e7lnn7h5r90w"); // rv.x = us->w * 72 / dpi.x;
-UNSUPPORTED("b8wlsi5z8klt27ehe7vr9ue61"); // rv.y = us->h * 72 / dpi.y;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("v7vqc9l7ge2bfdwnw11z7rzi"); // return rv;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 1vqiwf4q9iqmxqvd9e5qa1vo7
-// point gvusershape_size(graph_t * g, char *name)
-public static Object gvusershape_size(Object... arg) {
-UNSUPPORTED("3a8kgtxwhe9qi1f5wde0npt4d"); // point gvusershape_size(graph_t * g, char *name)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("e5r3mj8btrkw973m7l0rritko"); // point rv;
-UNSUPPORTED("aj7pw6lpv6z6nan96bx4pdfu2"); // pointf dpi;
-UNSUPPORTED("114dkd9d0mrkmtgl0ncfy2y88"); // static char* oldpath;
-UNSUPPORTED("709e07k0mmaqqdi3botr9zj87"); // usershape_t* us;
-UNSUPPORTED("d5ucq7enfbvarib2hwpi6y9qi"); // /* no shape file, no shape size */
-UNSUPPORTED("crs7cps8buaugcwtbezaqxd0q"); // if (!name || (*name == '\0')) {
-UNSUPPORTED("4zusj5p9eg9pazvp0px1fxvhy"); // rv.x = rv.y = -1;
-UNSUPPORTED("cs1ejkx9cw658cl8cagdzqrzm"); // return rv;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("24me4s4cte11xoie4uxxwajbs"); // if (!HTTPServerEnVar && (oldpath != Gvimagepath)) {
-UNSUPPORTED("ba3zx115acxf5hiob55lfwvhd"); // oldpath = Gvimagepath;
-UNSUPPORTED("63hyc3s3c95h5g1lp6aypzd8k"); // if (ImageDict) {
-UNSUPPORTED("50x4kwt6y5jkwbeqmhvki188q"); // dtclose(ImageDict);
-UNSUPPORTED("75t9qfgcu2fz0o59mjqh5rruv"); // ImageDict = (void *)0;
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("d77jz2hp035qgnn72uyy7evkj"); // if ((dpi.y = GD_drawing(g)->dpi) >= 1.0)
-UNSUPPORTED("8kboj4mypdab20ax7qfuq8oyp"); // dpi.x = dpi.y;
-UNSUPPORTED("div10atae09n36x269sl208r1"); // else
-UNSUPPORTED("6buslnzh8a0nuwlk9wkfaytt8"); // dpi.x = dpi.y = (double)DEFAULT_DPI;
-UNSUPPORTED("16h3qy8ek57tauhtrw8xkodar"); // us = gvusershape_open (name);
-UNSUPPORTED("6tq0lkl6cmjltetu68liok738"); // rv = gvusershape_size_dpi (us, dpi);
-UNSUPPORTED("v7vqc9l7ge2bfdwnw11z7rzi"); // return rv;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-}
diff --git a/src/gen/lib/gvc/regex_win32__c.java b/src/gen/lib/gvc/regex_win32__c.java
deleted file mode 100644
index 64fd4e3..0000000
--- a/src/gen/lib/gvc/regex_win32__c.java
+++ /dev/null
@@ -1,3083 +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 Smetana.
- * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
- *
- * (C) Copyright 2009-2017, Arnaud Roques
- *
- * This translation is distributed under the same Licence as the original C program:
- *
- *************************************************************************
- * Copyright (c) 2011 AT&T Intellectual Property
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: See CVS logs. Details at http://www.graphviz.org/
- *************************************************************************
- *
- * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
- * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
- *
- * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
- * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
- *
- * You may obtain a copy of the License at
- *
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package gen.lib.gvc;
-import static smetana.core.Macro.UNSUPPORTED;
-
-public class regex_win32__c {
-//1 11gt8s6kgcau21nr404v703de
-// static char re_syntax_table[256]
-
-
-
-
-//3 70j25rmarcwvzsh361zahv8zo
-// static void init_syntax_once ()
-public static Object init_syntax_once(Object... arg) {
-UNSUPPORTED("e2z2o5ybnr5tgpkt8ty7hwan1"); // static void
-UNSUPPORTED("efoxnnabz2ejqjq7yhilggwkl"); // init_syntax_once ()
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("ch8iyg809c0lyd0bc1ytqve9u"); // register int c;
-UNSUPPORTED("e5h3t56qntljcivxieh5a2mkl"); // static int done = 0;
-UNSUPPORTED("97t7ymgg630qac6285iprjw9v"); // if (done)
-UNSUPPORTED("z22f11bf96kkfe4raxc9v85x"); // return;
-UNSUPPORTED("9t38w19yl5jyjw7oodb9irryl"); // bzero (re_syntax_table, sizeof re_syntax_table);
-UNSUPPORTED("2rmhh76mmq03za3zgh7h64oxo"); // for (c = 'a'; c <= 'z'; c++)
-UNSUPPORTED("c9iqf6ajwc71dgjf9wrkrmbc4"); // re_syntax_table[c] = 1;
-UNSUPPORTED("7su4oyfxw838uiaf1heiygrem"); // for (c = 'A'; c <= 'Z'; c++)
-UNSUPPORTED("c9iqf6ajwc71dgjf9wrkrmbc4"); // re_syntax_table[c] = 1;
-UNSUPPORTED("3204uyvac8xoymt69hx2jb6xy"); // for (c = '0'; c <= '9'; c++)
-UNSUPPORTED("c9iqf6ajwc71dgjf9wrkrmbc4"); // re_syntax_table[c] = 1;
-UNSUPPORTED("bh45yjprswi5um0lyt9x4oony"); // re_syntax_table['_'] = 1;
-UNSUPPORTED("2py1y9xsuhv2b6cmhyzmcm7c5"); // done = 1;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-//1 cnkdb29e6yd10874mh5xc3onb
-// typedef long int s_reg_t
-
-
-//1 112kj8zza71a63rts3ariqovo
-// typedef unsigned long int active_reg_t
-
-
-//1 5mb2m65nd4m3w2de4v3md7o7m
-// typedef unsigned long int reg_syntax_t
-
-
-//1 289hb08yhe1j84wgbo0riknbd
-// extern reg_syntax_t re_syntax_options
-
-
-//1 3tctp51mbz3u1lyv5hope3jn4
-// typedef int regoff_t
-
-
-//1 5bxw12pxo297kjn20mqjfmb86
-// reg_syntax_t re_syntax_options
-
-
-
-
-//3 cxgvt7ypgdfqf2pew3m9adw9i
-// reg_syntax_t re_set_syntax(reg_syntax_t syntax)
-public static Object re_set_syntax(Object... arg) {
-UNSUPPORTED("1jmrr8fkrd2tsxzkjzybt7zfh"); // reg_syntax_t
-UNSUPPORTED("54rdixdzkwy1r5i8yfr9pfenx"); // re_set_syntax(reg_syntax_t syntax)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("8mpejiyi92887r7wji6mys7nq"); // reg_syntax_t ret = re_syntax_options;
-UNSUPPORTED("4kgq73hxpobga7t16qgh5znpe"); // re_syntax_options = syntax;
-UNSUPPORTED("f3b7mj138albdr4lodyomke0z"); // return ret;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-//1 4vl073wk5uvf75of82q0v5yyo
-// static const char *re_error_msgid[] =
-
-
-//1 1nsczrbp8olzcxwsty8y22p1n
-// static int re_max_failures = 20000
-
-
-//1 bktlq1f2qk5dg76humjskteaa
-// static char reg_unset_dummy
-
-
-//1 1lj2324om1rijb97q9h9lxrhv
-// typedef unsigned regnum_t
-
-
-//1 e3zkpgg5cfqoq1zcfbcl2p5au
-// typedef long pattern_offset_t
-
-
-
-
-//3 b8oct2odjhnzacejd6swmozqo
-// static reg_errcode_t regex_compile (const char *pattern, size_t size, reg_syntax_t syntax, struct re_pattern_buffer *bufp)
-public static Object regex_compile(Object... arg) {
-UNSUPPORTED("9aerjmw5n52ektwk47t1r9bh0"); // static reg_errcode_t
-UNSUPPORTED("d6mg3ls5pg233p4i2fdv7ex1n"); // regex_compile (const char *pattern,
-UNSUPPORTED("6t71eiupt12wdbfduq8n5i2sz"); // size_t size,
-UNSUPPORTED("rg73gczoqylzcinp4bt2p1bw"); // reg_syntax_t syntax,
-UNSUPPORTED("86tpwausdjloqigvxe0g3anqv"); // struct re_pattern_buffer *bufp)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("7mnubzvdt62l8vdiefqprs10u"); // /* We fetch characters from PATTERN here. Even though PATTERN is
-UNSUPPORTED("a1g4ovz742smqh486dhwytetq"); // `char *' (i.e., signed), we declare these variables as unsigned, so
-UNSUPPORTED("6yz29a8qermrzbhvqskuno14k"); // they can be reliably used as array indices. */
-UNSUPPORTED("9zgwtw1nsbdz6hcmyfrgkt63h"); // register unsigned char c, c1;
-UNSUPPORTED("4z9j463uvcrdj4sj8xj9ye9py"); // /* A random temporary spot in PATTERN. */
-UNSUPPORTED("7ccacvizh7wnu163gfkc81hu9"); // const char *p1;
-UNSUPPORTED("a293r2jyasseioor4io0pp504"); // /* Points to the end of the buffer, where we should append. */
-UNSUPPORTED("5o1tyy96cneoiw799jnb2n7ke"); // register unsigned char *b;
-UNSUPPORTED("cb629v9wydhjaoevjdzc89oy7"); // /* Keeps track of unclosed groups. */
-UNSUPPORTED("dgr9dbgbyc1ook38b1euoeouv"); // compile_stack_type compile_stack;
-UNSUPPORTED("39kpylizmi208i8v5yv2jhjp1"); // /* Points to the current (ending) position in the pattern. */
-UNSUPPORTED("9mu7yzuommm5kljxb28ceesow"); // const char *p = pattern;
-UNSUPPORTED("9ok1q4b2nv6m90q14x6i0k0vm"); // const char *pend = pattern + size;
-UNSUPPORTED("3oga1grlge5vw6xitb7bzcjw9"); // /* How to translate the characters in the pattern. */
-UNSUPPORTED("b6qhkmvrybk31a74eyxl9sf73"); // char * translate = bufp->translate;
-UNSUPPORTED("34h9x8riezst40pxo4ww0500r"); // /* Address of the count-byte of the most recently inserted `exactn'
-UNSUPPORTED("a8lirzoby6qul9ds74xai8gbs"); // command. This makes it possible to tell if a new exact-match
-UNSUPPORTED("6w2dibeuk4g54m7pwlej7e8g8"); // character can be added to that command or if the character requires
-UNSUPPORTED("atv0mvbd2maopv2ing97xuaph"); // a new `exactn' command. */
-UNSUPPORTED("s22nw5te3tpx7wkcpookrrve"); // unsigned char *pending_exact = 0;
-UNSUPPORTED("er4ntnybigvcvnva5ls2gkx9f"); // /* Address of start of the most recently finished expression.
-UNSUPPORTED("d9z7cp97wfgynilwmgxdn4w5p"); // This tells, e.g., postfix * where to find the start of its
-UNSUPPORTED("cwisfez4xccc9t277piikcz7u"); // operand. Reset at the beginning of groups and alternatives. */
-UNSUPPORTED("5319mhfghffljm52aipkegz7i"); // unsigned char *laststart = 0;
-UNSUPPORTED("asyqn8tnmhbn0u8yih4eowlsv"); // /* Address of beginning of regexp, or inside of last group. */
-UNSUPPORTED("2prv77rl1a0ic6cloa505n74"); // unsigned char *begalt;
-UNSUPPORTED("1mpmicgb0aqvs4efkuf1423bb"); // /* Place in the uncompiled pattern (i.e., the {) to
-UNSUPPORTED("6vlkvivbip6585ngqifn0yut3"); // which to go back if the interval is invalid. */
-UNSUPPORTED("dhc5wj4xmde53jd8j5mmpspo2"); // const char *beg_interval;
-UNSUPPORTED("3gbwrgdnq67nw2ais7b1oaood"); // /* Address of the place where a forward jump should go to the end of
-UNSUPPORTED("39t3zafmxkdw0y4k5jpg705xl"); // the containing expression. Each alternative of an `or' -- except the
-UNSUPPORTED("7ax9rzx6regnwitqwud6fas5h"); // last -- ends with a forward jump of this sort. */
-UNSUPPORTED("c8bejewn623onq21mfqd22e2w"); // unsigned char *fixup_alt_jump = 0;
-UNSUPPORTED("a0p6z20zonf6yhyd6u7i62l1f"); // /* Counts open-groups as they are encountered. Remembered for the
-UNSUPPORTED("f3mw4fx5ayqshia0u0wfwq612"); // matching close-group on the compile stack, so the same register
-UNSUPPORTED("albygnk4x6lv0oonnbwcx9zse"); // number is put in the stop_memory as the start_memory. */
-UNSUPPORTED("1jexufhhoiubt850z3ndj8ej5"); // regnum_t regnum = 0;
-UNSUPPORTED("7481cz4i3vyo797cewvok0k4c"); // /* Initialize the compile stack. */
-UNSUPPORTED("ao1ytyamhvicfeyzqsidalxsk"); // compile_stack.stack = ((compile_stack_elt_t *) malloc ((32) * sizeof (compile_stack_elt_t)));
-UNSUPPORTED("3pmfpvmkfjp9kx78cvcxd6cpy"); // if (compile_stack.stack == (void *)0)
-UNSUPPORTED("ex5zj292r0bm8ons2oenc7d53"); // return REG_ESPACE;
-UNSUPPORTED("6rth766rpftr2lf9tsj3ipcy3"); // compile_stack.size = 32;
-UNSUPPORTED("7l76n0edqpze4bfgwt0jnlr23"); // compile_stack.avail = 0;
-UNSUPPORTED("4d5adh0083zve5yjpmlxli8h1"); // /* Initialize the pattern buffer. */
-UNSUPPORTED("6qgussdbr9ruavpzcr0y58ts9"); // bufp->syntax = syntax;
-UNSUPPORTED("c9tm2xzkehz9kbyrn2bkv3dwg"); // bufp->fastmap_accurate = 0;
-UNSUPPORTED("91jbv9it8qe6sah0sxn6nd4w2"); // bufp->not_bol = bufp->not_eol = 0;
-UNSUPPORTED("3rafz8q4yl9qbchg80xvodlsy"); // /* Set `used' to zero, so that if we return an error, the pattern
-UNSUPPORTED("b6wnwmphpmnza6rdw0x8yy5kj"); // printer (for debugging) will think there's no pattern. We reset it
-UNSUPPORTED("8xe4i97w2l1mmth54di1u7rrd"); // at the end. */
-UNSUPPORTED("b65vrlaj7a5mdhjx1m4vm2kzu"); // bufp->used = 0;
-UNSUPPORTED("5v5ffm48jpbjz5t7q75z95oqu"); // /* Always count groups, whether or not bufp->no_sub is set. */
-UNSUPPORTED("fcycoe4nhtup93j74aqh2jlu"); // bufp->re_nsub = 0;
-UNSUPPORTED("57cfyb08w4wnczh1o759ayl4l"); // /* Initialize the syntax table. */
-UNSUPPORTED("eoiuv77ltbli38ssdpi2gptkk"); // init_syntax_once ();
-UNSUPPORTED("f0l0ry0lbt2gj40a13217dx11"); // if (bufp->allocated == 0)
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("eblz85b36y9pboxm6zt66xr2h"); // if (bufp->buffer)
-UNSUPPORTED("53s3p7apfgsn3pkcwkqznue34"); // { /* If zero allocated, but buffer is non-null, try to realloc
-UNSUPPORTED("3mwc7vljmgej2pox1thi77h1t"); // enough space. This loses if buffer's address is bogus, but
-UNSUPPORTED("2hni8mwtvtzlrz7iztjmo1gkm"); // that is the user's responsibility. */
-UNSUPPORTED("4soy7dr6bhuvmx7k9nk1d0ql8"); // ((bufp->buffer) = (unsigned char *) realloc (bufp->buffer, (32) * sizeof (unsigned char)));
-UNSUPPORTED("7nxu74undh30brb8laojud3f9"); // }
-UNSUPPORTED("1knjyao8ci3w18zqqcnmnitir"); // else
-UNSUPPORTED("17v9yg0xtevf2uu5v3tmolocu"); // { /* Caller did not allocate a buffer. Do it for them. */
-UNSUPPORTED("6fravsvvcv922fixqgd9sfp3z"); // bufp->buffer = ((unsigned char *) malloc ((32) * sizeof (unsigned char)));
-UNSUPPORTED("7nxu74undh30brb8laojud3f9"); // }
-UNSUPPORTED("4as6xhocbf55x8cvv0z11to2x"); // if (!bufp->buffer) return (free (compile_stack.stack), REG_ESPACE);
-UNSUPPORTED("af932qywpz9q6n0xek5lztd84"); // bufp->allocated = 32;
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("5mg602ef37gzyyfswwutbcqs8"); // begalt = b = bufp->buffer;
-UNSUPPORTED("89ht4djrhvh6xphi9py7k3pam"); // /* Loop through the uncompiled pattern until we're at the end. */
-UNSUPPORTED("5r7butg5genmj9dzegcwao4et"); // while (p != pend)
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("42vbjcv24l0oaozyfwaw4j5nc"); // do {if (p == pend) return REG_EEND; c = (unsigned char) *p++; if (translate) c = (unsigned char) translate[c]; } while (0);
-UNSUPPORTED("719kmsx403baae0d0ox2gyi3a"); // switch (c)
-UNSUPPORTED("9ua540u2gx5jpu302s81qfxhi"); // {
-UNSUPPORTED("32y7yv66mqjhrdqaf9ck9oi4y"); // case '^':
-UNSUPPORTED("4vdjxw5o61xlsk38ouw1wsypc"); // {
-UNSUPPORTED("3j5jurrtqcxdphc3jlcg8lu39"); // if ( /* If at start of pattern, it's an operator. */
-UNSUPPORTED("acrtuah53gidq3uywocguoav"); // p == pattern + 1
-UNSUPPORTED("bs7cbfp1wd9jknqlj749u3bj3"); // /* If context independent, it's an operator. */
-UNSUPPORTED("9sznx5vvd3orgqcisdh571wv9"); // || syntax & (((((unsigned long int) 1) << 1) << 1) << 1)
-UNSUPPORTED("7gzhx2l4j1gaba7epz2kdwhlj"); // /* Otherwise, depends on what's come before. */
-UNSUPPORTED("10earmgj12izv0tbj9aimxmji"); // || at_begline_loc_p (pattern, p, syntax))
-UNSUPPORTED("clssp7ivct1ku99qbhyb7dtzy"); // do { while ((unsigned long) (b - bufp->buffer + (1)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0); *b++ = (unsigned char) (begline); } while (0);
-UNSUPPORTED("euvqyl9ihnvv92dr2v2zshlo"); // else
-UNSUPPORTED("dxpbgmfj2w220xy1q99fxje94"); // goto normal_char;
-UNSUPPORTED("3e08x1y395304nd0y3uwffvim"); // }
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("9ogqrievi7oirs7cd4cs33egg"); // case '$':
-UNSUPPORTED("4vdjxw5o61xlsk38ouw1wsypc"); // {
-UNSUPPORTED("hai791a97htfukh6iawb46oz"); // if ( /* If at end of pattern, it's an operator. */
-UNSUPPORTED("a0h309uru3crtdmsxpji7m2j3"); // p == pend
-UNSUPPORTED("bs7cbfp1wd9jknqlj749u3bj3"); // /* If context independent, it's an operator. */
-UNSUPPORTED("9sznx5vvd3orgqcisdh571wv9"); // || syntax & (((((unsigned long int) 1) << 1) << 1) << 1)
-UNSUPPORTED("2iqqtdvj90ata5pvx2o27gw4s"); // /* Otherwise, depends on what's next. */
-UNSUPPORTED("67wgd1do640yncemi3ce0qj90"); // || at_endline_loc_p (p, pend, syntax))
-UNSUPPORTED("35lv6vfpgmavt421g5ug4tdbc"); // do { while ((unsigned long) (b - bufp->buffer + (1)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0); *b++ = (unsigned char) (endline); } while (0);
-UNSUPPORTED("euvqyl9ihnvv92dr2v2zshlo"); // else
-UNSUPPORTED("dxpbgmfj2w220xy1q99fxje94"); // goto normal_char;
-UNSUPPORTED("3e08x1y395304nd0y3uwffvim"); // }
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("4yw8evd0fubkfck5nezds5dhn"); // case '+':
-UNSUPPORTED("f0rooqc2e80a2plohrq4c3c91"); // case '?':
-UNSUPPORTED("1ku9g8vhwccbudpz9e300f03z"); // if ((syntax & (((unsigned long int) 1) << 1))
-UNSUPPORTED("7sxu3x1nkq0rp14piw14s336e"); // || (syntax & ((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)))
-UNSUPPORTED("uivpjrr5me8j92jky5okan1c"); // goto normal_char;
-UNSUPPORTED("ak9il2l94xwmflwso0qxuq07i"); // handle_plus:
-UNSUPPORTED("77sjlj9q2m2icdnuxqgd896ux"); // case '*':
-UNSUPPORTED("bog9pqkld0m0t6ypotbesbb2s"); // /* If there is no previous pattern... */
-UNSUPPORTED("6horrl50ttv3j0vlv0d550qe5"); // if (!laststart)
-UNSUPPORTED("5k2digv672hnrndhc9ktw0oii"); // {
-UNSUPPORTED("8qgst65bgbkg69wykq7paitn0"); // if (syntax & (((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("4zp3pjt3o3sewewdrckac5e7t"); // return (free (compile_stack.stack), REG_BADRPT);
-UNSUPPORTED("2ji76vo0qsyt5ldqyext7tdsg"); // else if (!(syntax & ((((((unsigned long int) 1) << 1) << 1) << 1) << 1)))
-UNSUPPORTED("ck4wdxm4o1ub3048vodmtvy6s"); // goto normal_char;
-UNSUPPORTED("b86ovw6olwwo6gnqlt1wqqzb4"); // }
-UNSUPPORTED("4vdjxw5o61xlsk38ouw1wsypc"); // {
-UNSUPPORTED("2vnh9foicn3ppcbpvb6hdon87"); // /* Are we optimizing this jump? */
-UNSUPPORTED("60ry57pj80rgxp87816o6vpy2"); // boolean keep_string_p = 0;
-UNSUPPORTED("6qwgte4fwcf1xqfiuge2ssau3"); // /* 1 means zero (many) matches is allowed. */
-UNSUPPORTED("7z75b80h28y72skvw3v96x2y5"); // char zero_times_ok = 0, many_times_ok = 0;
-UNSUPPORTED("a3pm3eb949njdi5ypawoqc46v"); // /* If there is a sequence of repetition chars, collapse it
-UNSUPPORTED("dovcg85ak5c45w4j2nz1vphpt"); // down to just one (the right one). We can't combine
-UNSUPPORTED("enmqxu33e2oz4v7ad1h3regi1"); // interval operators with these because of, e.g., `a{2}*',
-UNSUPPORTED("2ic453t1t5s0w63b328mvtw1h"); // which should only match an even number of `a's. */
-UNSUPPORTED("1nx31c51hb376ceydwsae35jq"); // for (;;)
-UNSUPPORTED("9aq2ft2quyeattze0cwemwweo"); // {
-UNSUPPORTED("1998skt4l5yp1v1sml3xtum0t"); // zero_times_ok |= c != '+';
-UNSUPPORTED("d4p0t1ujgqb32xcytuivs2m0m"); // many_times_ok |= c != '?';
-UNSUPPORTED("891uwttbfnv5bc58wpbg1fhgl"); // if (p == pend)
-UNSUPPORTED("1fg4xctmq8acy7m0oob45guaz"); // break;
-UNSUPPORTED("1ph6d2iv2trnwdx326iuetr4g"); // do {if (p == pend) return REG_EEND; c = (unsigned char) *p++; if (translate) c = (unsigned char) translate[c]; } while (0);
-UNSUPPORTED("do4ccpdwh7h97tg1nxsm8tt4d"); // if (c == '*'
-UNSUPPORTED("b9cokjueamyv69axw1ekph5qa"); // || (!(syntax & (((unsigned long int) 1) << 1)) && (c == '+' || c == '?')))
-UNSUPPORTED("c6tldeu5ffnykyfto7hi9ixau"); // ;
-UNSUPPORTED("4zyx7dzchkorh28bz90x76p2g"); // else if (syntax & (((unsigned long int) 1) << 1) && c == '\\')
-UNSUPPORTED("3trws9zymzc11hz9w8m2b4fl9"); // {
-UNSUPPORTED("e9xhg2qnbm79uk0vrkf792u29"); // if (p == pend) return (free (compile_stack.stack), REG_EESCAPE);
-UNSUPPORTED("518hxi8xgn35zetedpma2oo2k"); // do {if (p == pend) return REG_EEND; c1 = (unsigned char) *p++; if (translate) c1 = (unsigned char) translate[c1]; } while (0);
-UNSUPPORTED("31364dtwzgpxty30b38zc4zkj"); // if (!(c1 == '+' || c1 == '?'))
-UNSUPPORTED("el767oi7fhlc4apdbx8dsvnk6"); // {
-UNSUPPORTED("2t22wkw5f3ffgm4ga51u5nrej"); // p--;
-UNSUPPORTED("2t22wkw5f3ffgm4ga51u5nrej"); // p--;
-UNSUPPORTED("brutz3uly6r5jyimug3eb5y9n"); // break;
-UNSUPPORTED("b5m0ttlk23avgs4i47o8lbzg1"); // }
-UNSUPPORTED("e31jqqw74li41ohhn86f6dom7"); // c = c1;
-UNSUPPORTED("2v7ai112w6nt2xgs1gbzo22oe"); // }
-UNSUPPORTED("a4hbs6luulhltmygux2zimbcc"); // else
-UNSUPPORTED("3trws9zymzc11hz9w8m2b4fl9"); // {
-UNSUPPORTED("5cyajgw0lqe5reqenlh6er6vk"); // p--;
-UNSUPPORTED("7vckzntfuo1ibi8r53gsfg8al"); // break;
-UNSUPPORTED("2v7ai112w6nt2xgs1gbzo22oe"); // }
-UNSUPPORTED("5usbancvr06c7aua10b6rnz2v"); // /* If we get here, we found another repeat character. */
-UNSUPPORTED("13jcwbk3vyfh9xrmwi5hbe7so"); // }
-UNSUPPORTED("4z09n9ulcj74vli0m0kclo5i"); // /* Star, etc. applied to an empty pattern is equivalent
-UNSUPPORTED("1ixkehs9qjp0ehix96jklbcfm"); // to an empty pattern. */
-UNSUPPORTED("60xmx571g6e7xq9uvs63uu1eq"); // if (!laststart)
-UNSUPPORTED("7mosouhqcis2k8sbg88g9wol8"); // break;
-UNSUPPORTED("hi54423z7c97klm7jyc2i54y"); // /* Now we know whether or not zero matches is allowed
-UNSUPPORTED("cdhyalprzmam31a4ky61gdsu5"); // and also whether or not two or more matches is allowed. */
-UNSUPPORTED("82umz1mp8urx9qjjtqh65sk5"); // if (many_times_ok)
-UNSUPPORTED("8omf20fupbos0ngb4nxaz3sj"); // { /* More than one repetition is allowed, so put in at the
-UNSUPPORTED("6vwybrs5isd11ynby19imvgnc"); // end a backward relative jump from `b' to before the next
-UNSUPPORTED("7k3po89z1y12gwpxracwd1zwr"); // jump we're going to put in below (which jumps from
-UNSUPPORTED("497rlrbp2r6kokgq8fic5z8li"); // laststart to after this jump).
-UNSUPPORTED("elt3pujxvh1j9wbns2s7urafl"); // But if we are at the `*' in the exact sequence `.*\n',
-UNSUPPORTED("aq9r7pdk4mwsuo46v85xd7nle"); // insert an unconditional jump backwards to the .,
-UNSUPPORTED("afees40xo77whl3qvfrsjg0p2"); // instead of the beginning of the loop. This way we only
-UNSUPPORTED("2f6wchn2e63ok4vso04jpeozp"); // push a failure point once, instead of every time
-UNSUPPORTED("2mne6btvrwz6ly84kpb5k8fz2"); // through the loop. */
-UNSUPPORTED("9fy78dg2q1uu4c2t1zsyaestf"); // ;
-UNSUPPORTED("7osfsgzoickbv6hh4uet35ib8"); // /* Allocate the space for the jump. */
-UNSUPPORTED("38dw1m55ji4uptkiga2iwgab7"); // while ((unsigned long) (b - bufp->buffer + (3)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0);
-UNSUPPORTED("2v0jxylpfaawr8vdl2dov0us5"); // /* We know we are not at the first character of the pattern,
-UNSUPPORTED("djrrtgjb76xh1l5pw5u4kxcnv"); // because laststart was nonzero. And we've already
-UNSUPPORTED("5f4ly8ng2ytcbc7ypdbpa8e11"); // incremented `p', by the way, to be the character after
-UNSUPPORTED("4as3ltw89z2kch0mrty7q58ey"); // the `*'. Do we have to do something analogous here
-UNSUPPORTED("d3grtqmpebse1zxznnwl3jm7c"); // for null bytes, because of RE_DOT_NOT_NULL? */
-UNSUPPORTED("vbl73uentmynsl9r6evk8ulc"); // if ((translate ? (char) translate[(unsigned char) (*(p - 2))] : (*(p - 2))) == (translate ? (char) translate[(unsigned char) ('.')] : ('.'))
-UNSUPPORTED("3lbv5kv4tdnxzqobvqv6gz12l"); // && zero_times_ok
-UNSUPPORTED("1ykhfelz1q80iguwwtohwqvm2"); // && p < pend && (translate ? (char) translate[(unsigned char) (*p)] : (*p)) == (translate ? (char) translate[(unsigned char) ('\n')] : ('\n'))
-UNSUPPORTED("bxrp4x7jxoo38mvd9ft3k5db"); // && !(syntax & ((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1)))
-UNSUPPORTED("741cloh2pdrplimiiruq6t4ct"); // { /* We have .*\n. */
-UNSUPPORTED("317e9s7jnbmgql8x4fdezgmv0"); // store_op1 (jump, b, (int) ((laststart) - (b) - 3));
-UNSUPPORTED("8ryrgqjl7v6ohb01o5em2psns"); // keep_string_p = 1;
-UNSUPPORTED("2v7ai112w6nt2xgs1gbzo22oe"); // }
-UNSUPPORTED("a4hbs6luulhltmygux2zimbcc"); // else
-UNSUPPORTED("3ksp6xs2pd8hkq033e06g4a00"); // /* Anything else. */
-UNSUPPORTED("4ab5zrwtdkltgbt8onvdet2r1"); // store_op1 (maybe_pop_jump, b, (int) ((laststart - 3) - (b) - 3));
-UNSUPPORTED("f4gsd1otghvhc8czjmw8qq776"); // /* We've added more stuff to the buffer. */
-UNSUPPORTED("7hdmsj9mi4jwnv83ar1ez4kwn"); // b += 3;
-UNSUPPORTED("13jcwbk3vyfh9xrmwi5hbe7so"); // }
-UNSUPPORTED("7htghz4zhsf1uqpwp6ytvbhih"); // /* On failure, jump from laststart to b + 3, which will be the
-UNSUPPORTED("c630s54imd7p1b0raogcspf6p"); // end of the buffer after this jump is inserted. */
-UNSUPPORTED("5i16nim58sq8mvfckzqrj7q7e"); // while ((unsigned long) (b - bufp->buffer + (3)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0);
-UNSUPPORTED("e1gqwwg06ek9zwsxdqko22t8"); // insert_op1 (keep_string_p ? on_failure_keep_string_jump
-UNSUPPORTED("od51xm1io9lvsdmwr60fm9nx"); // : on_failure_jump,
-UNSUPPORTED("demgpwduvdu6c55lzwftle76m"); // laststart, (int) ((b + 3) - (
-UNSUPPORTED("a887hw7h3lz3jofwz10uxjcdp"); // laststart) - 3), b);
-UNSUPPORTED("1t3kkww9qyeskw70p028ll4r1"); // pending_exact = 0;
-UNSUPPORTED("1jpgahganw1gip7gnwn5n2vx6"); // b += 3;
-UNSUPPORTED("38n9qcy0vfr2upedrm1d6by5o"); // if (!zero_times_ok)
-UNSUPPORTED("9aq2ft2quyeattze0cwemwweo"); // {
-UNSUPPORTED("15rx6swjp6qikvp0jmiy5rm4m"); // /* At least one repetition is required, so insert a
-UNSUPPORTED("5xq4uy1msul1zhp9ptz49bbvn"); // `dummy_failure_jump' before the initial
-UNSUPPORTED("3q62p85szhotzr22iijxb1lzh"); // `on_failure_jump' instruction of the loop. This
-UNSUPPORTED("5ukburrf5iegq4x208czcfxp7"); // effects a skip over that instruction the first time
-UNSUPPORTED("9zr6wiepyct1g2798ohlu821l"); // we hit that loop. */
-UNSUPPORTED("38dw1m55ji4uptkiga2iwgab7"); // while ((unsigned long) (b - bufp->buffer + (3)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0);
-UNSUPPORTED("caftp211etknfq81tggr97kq3"); // insert_op1 (dummy_failure_jump, laststart, (int) ((laststart + 6) - (laststart) - 3), b);
-UNSUPPORTED("7hdmsj9mi4jwnv83ar1ez4kwn"); // b += 3;
-UNSUPPORTED("13jcwbk3vyfh9xrmwi5hbe7so"); // }
-UNSUPPORTED("3e08x1y395304nd0y3uwffvim"); // }
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("a2evu0k4b91gqn1jmn3a0jwzw"); // case '.':
-UNSUPPORTED("5nlf7z9fx92ejvc0jjc27l3ks"); // laststart = b;
-UNSUPPORTED("14r433r50a5mz9kdbq4siwjqy"); // do { while ((unsigned long) (b - bufp->buffer + (1)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0); *b++ = (unsigned char) (anychar); } while (0);
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("7r93xgyv26x925aap3ia8ymon"); // case '[':
-UNSUPPORTED("4vdjxw5o61xlsk38ouw1wsypc"); // {
-UNSUPPORTED("2dyj1s6d9ag4nvt1f1crrdjfn"); // boolean had_char_class = 0;
-UNSUPPORTED("4a3jhscbb3cd0w52yk8g7bkhm"); // if (p == pend) return (free (compile_stack.stack), REG_EBRACK);
-UNSUPPORTED("18lthbap52pmrc5qc0gdkqazi"); // /* Ensure that we have enough space to push a charset: the
-UNSUPPORTED("64im3as1hhwe4tfm27p855icz"); // opcode, the length count, and the bitset; 34 bytes in all. */
-UNSUPPORTED("dtfdonlqdk0z7gsn1s36st33w"); // while ((unsigned long) (b - bufp->buffer + (34)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0);
-UNSUPPORTED("8dx5294ey8snj5idlltwvrhb1"); // laststart = b;
-UNSUPPORTED("610aa188uk96qcj24orwjx8fs"); // /* We test `*p == '^' twice, instead of using an if
-UNSUPPORTED("5bc7brntk24ooxfmk1srxj8cb"); // statement, so we only need one BUF_PUSH. */
-UNSUPPORTED("f50kr5oskb25svx2g868njm8n"); // do { while ((unsigned long) (b - bufp->buffer + (1)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0); *b++ = (unsigned char) (*p == '^' ? charset_not : charset); } while (0);
-UNSUPPORTED("8evba7dkivr9l77jkvcmqcwz8"); // if (*p == '^')
-UNSUPPORTED("6qmpdja8bt371mk2seyaa2gbr"); // p++;
-UNSUPPORTED("7cikubv9dt5tpzkohonns5grc"); // /* Remember the first position in the bracket expression. */
-UNSUPPORTED("ams11hw6png742la6sel3atlf"); // p1 = p;
-UNSUPPORTED("7xg1okqa5l3piclyijoek8ed8"); // /* Push the number of bytes in the bitmap. */
-UNSUPPORTED("attsgdtz0wo8uzzx0jzzakd9s"); // do { while ((unsigned long) (b - bufp->buffer + (1)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0); *b++ = (unsigned char) ((1 << 8) / 8); } while (0);
-UNSUPPORTED("9i1ubvjzgw51kylobwxvkoguf"); // /* Clear the whole map. */
-UNSUPPORTED("3yt3lfhbs0hx9w9ci87vt4p51"); // bzero (b, (1 << 8) / 8);
-UNSUPPORTED("2m8299zx4gtxg4ncikd476gkx"); // /* charset_not matches newline according to a syntax bit. */
-UNSUPPORTED("16flegxkvnil6me4t0kb73hcj"); // if ((re_opcode_t) b[-2] == charset_not
-UNSUPPORTED("44gymzta58w37g7hbxz29z8ht"); // && (syntax & ((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)))
-UNSUPPORTED("bm4wsfgshzu6e47pvkdqzgoz6"); // (b[((unsigned char) ('\n')) / 8] |= 1 << (((unsigned char) '\n') % 8));
-UNSUPPORTED("2dle8bszohkrok9ivamd6wqu8"); // /* Read in characters and ranges, setting map bits. */
-UNSUPPORTED("1nx31c51hb376ceydwsae35jq"); // for (;;)
-UNSUPPORTED("9aq2ft2quyeattze0cwemwweo"); // {
-UNSUPPORTED("6jfb28a8r43ndwdevd7rrjlb2"); // if (p == pend) return (free (compile_stack.stack), REG_EBRACK);
-UNSUPPORTED("1ph6d2iv2trnwdx326iuetr4g"); // do {if (p == pend) return REG_EEND; c = (unsigned char) *p++; if (translate) c = (unsigned char) translate[c]; } while (0);
-UNSUPPORTED("djf8gjrarnydrvlu8tzndsd4t"); // /* \ might escape characters inside [...] and [^...]. */
-UNSUPPORTED("89w50n0xz0xx1wgf8ls0sce25"); // if ((syntax & ((unsigned long int) 1)) && c == '\\')
-UNSUPPORTED("3trws9zymzc11hz9w8m2b4fl9"); // {
-UNSUPPORTED("e9xhg2qnbm79uk0vrkf792u29"); // if (p == pend) return (free (compile_stack.stack), REG_EESCAPE);
-UNSUPPORTED("518hxi8xgn35zetedpma2oo2k"); // do {if (p == pend) return REG_EEND; c1 = (unsigned char) *p++; if (translate) c1 = (unsigned char) translate[c1]; } while (0);
-UNSUPPORTED("d1ssg2hoazmd76m91z40sp5sn"); // (b[((unsigned char) (c1)) / 8] |= 1 << (((unsigned char) c1) % 8));
-UNSUPPORTED("cke4ze78n6mw03utm8hpk0ozq"); // continue;
-UNSUPPORTED("2v7ai112w6nt2xgs1gbzo22oe"); // }
-UNSUPPORTED("bvll4h37ech1nvv3p44tc97ia"); // /* Could be the end of the bracket expression. If it's
-UNSUPPORTED("464yveauwiujz5tkl76ikld18"); // not (i.e., when the bracket expression is `[]' so
-UNSUPPORTED("ekv9yerdywogeillz767k3yq9"); // far), the ']' character bit gets set way below. */
-UNSUPPORTED("39qeut34k7f0lyjj4z495n6am"); // if (c == ']' && p != p1 + 1)
-UNSUPPORTED("1fg4xctmq8acy7m0oob45guaz"); // break;
-UNSUPPORTED("d3v48zs419s4mxk9yyv5xgccj"); // /* Look ahead to see if it's a range when the last thing
-UNSUPPORTED("65vqnx3pinl0sxqecc7937imc"); // was a character class. */
-UNSUPPORTED("8dtiybchqrzjmzzltkvknsq96"); // if (had_char_class && c == '-' && *p != ']')
-UNSUPPORTED("8zurthmteo7b71btgvw1ke4rg"); // return (free (compile_stack.stack), REG_ERANGE);
-UNSUPPORTED("d3v48zs419s4mxk9yyv5xgccj"); // /* Look ahead to see if it's a range when the last thing
-UNSUPPORTED("5wt9bnagn7y3isqyb5kxh04s7"); // was a character: if this is a hyphen not at the
-UNSUPPORTED("342gxn589rm7wkuq6jbilt9fr"); // beginning or the end of a list, then it's the range
-UNSUPPORTED("8a0p71nhvq7jckckna5u4qr7t"); // operator. */
-UNSUPPORTED("bfxjivoy25rc3bw7qrspkzv1k"); // if (c == '-'
-UNSUPPORTED("93mph3xo98uvv6qn8e4tbid15"); // && !(p - 2 >= pattern && p[-2] == '[')
-UNSUPPORTED("1ce2lptewofyiq5ojhwc5va79"); // && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^')
-UNSUPPORTED("5e843qj23bor49sf7nbcpwezc"); // && *p != ']')
-UNSUPPORTED("3trws9zymzc11hz9w8m2b4fl9"); // {
-UNSUPPORTED("f3s9czjbpp43p2benwj88e4vz"); // reg_errcode_t ret
-UNSUPPORTED("bgzy0fkxhr0j88bt28d2oeo7m"); // = compile_range (&p, pend, translate, syntax, b);
-UNSUPPORTED("6to7cm3b6s0m5pujlkqqm3m2x"); // if (ret != REG_NOERROR) return (free (compile_stack.stack), ret);
-UNSUPPORTED("2v7ai112w6nt2xgs1gbzo22oe"); // }
-UNSUPPORTED("65gxrs7y9lu8v93z6nz75m4ck"); // else if (p[0] == '-' && p[1] != ']')
-UNSUPPORTED("5av67x62ybjftr7suvc3tfqay"); // { /* This handles ranges made up of characters only. */
-UNSUPPORTED("cmimxguouw0qbcmhrejq3dnrm"); // reg_errcode_t ret;
-UNSUPPORTED("6th47hqx3651aqvqnkzfm9yhl"); // /* Move past the `-'. */
-UNSUPPORTED("518hxi8xgn35zetedpma2oo2k"); // do {if (p == pend) return REG_EEND; c1 = (unsigned char) *p++; if (translate) c1 = (unsigned char) translate[c1]; } while (0);
-UNSUPPORTED("8tyv3mj3db8ezfohi5j249qg9"); // ret = compile_range (&p, pend, translate, syntax, b);
-UNSUPPORTED("6to7cm3b6s0m5pujlkqqm3m2x"); // if (ret != REG_NOERROR) return (free (compile_stack.stack), ret);
-UNSUPPORTED("2v7ai112w6nt2xgs1gbzo22oe"); // }
-UNSUPPORTED("60ee1e25m2s16fec1vpvlz4n7"); // /* See if we're at the beginning of a possible character
-UNSUPPORTED("5paafwhmjbew6wm1r82cmglhi"); // class. */
-UNSUPPORTED("1fxr5b7xujuw4t8tdfwstlhb5"); // else if (syntax & ((((unsigned long int) 1) << 1) << 1) && c == '[' && *p == ':')
-UNSUPPORTED("c6rvznitpculxv2jbhy4ncxyq"); // { /* Leave room for the null. */
-UNSUPPORTED("35kxjv2sfddffc4bqeyh4imoc"); // char str[6 + 1];
-UNSUPPORTED("eqri2rfe7jnz1m2rij615jaj1"); // do {if (p == pend) return REG_EEND; c = (unsigned char) *p++; if (translate) c = (unsigned char) translate[c]; } while (0);
-UNSUPPORTED("d4co4ddeumifnjey3eestnfzq"); // c1 = 0;
-UNSUPPORTED("4w2zfigedythaavjy46j6zdev"); // /* If pattern is `[[:'. */
-UNSUPPORTED("7eef052f6ws02kwwd07t2gogt"); // if (p == pend) return (free (compile_stack.stack), REG_EBRACK);
-UNSUPPORTED("6rl79w31o26w7y9v243bzntd1"); // for (;;)
-UNSUPPORTED("el767oi7fhlc4apdbx8dsvnk6"); // {
-UNSUPPORTED("5rs5zp1k5smyekvir9pcnto9c"); // do {if (p == pend) return REG_EEND; c = (unsigned char) *p++; if (translate) c = (unsigned char) translate[c]; } while (0);
-UNSUPPORTED("5epbd4u9xrfpj6miw9wkaw3as"); // if (c == ':' || c == ']' || p == pend
-UNSUPPORTED("1xzx4vfazvv793wm3hh5e4ixz"); // || c1 == 6)
-UNSUPPORTED("1lzsscwayr2ygeagix6ouorzi"); // break;
-UNSUPPORTED("a6wcfy57u3wkrc8jiwpoxhutg"); // str[c1++] = c;
-UNSUPPORTED("b5m0ttlk23avgs4i47o8lbzg1"); // }
-UNSUPPORTED("6hm7an9ruv18077h9go7vsgf4"); // str[c1] = '\0';
-UNSUPPORTED("bi9fgjbp9y3y2pyuu9tszhyox"); // /* If isn't a word bracketed by `[:' and:`]':
-UNSUPPORTED("7nvg1ljm6ad0h7g7s60ej9uca"); // undo the ending character, the letters, and leave
-UNSUPPORTED("2272ea1yqp1bpznxgbrxbp00w"); // the leading `:' and `[' (but set bits for them). */
-UNSUPPORTED("5tqbx68w26ea5218a43fyowz3"); // if (c == ':' && *p == ']')
-UNSUPPORTED("el767oi7fhlc4apdbx8dsvnk6"); // {
-UNSUPPORTED("dicsp7memxlin76m5jtuhk6dv"); // int ch;
-UNSUPPORTED("74i3rk9pefjb3y4b7o4aa2iq9"); // boolean is_alnum = ((strcmp (str, "alnum") == 0));
-UNSUPPORTED("89wnjt7xu39ig5ibxfz800la7"); // boolean is_alpha = ((strcmp (str, "alpha") == 0));
-UNSUPPORTED("70u6gm5ko26rbqgsh5w8iswjq"); // boolean is_blank = ((strcmp (str, "blank") == 0));
-UNSUPPORTED("1aaohxjchuctfrlc9v29p77u8"); // boolean is_cntrl = ((strcmp (str, "cntrl") == 0));
-UNSUPPORTED("74upuhtioo8extzco95rwsrj8"); // boolean is_digit = ((strcmp (str, "digit") == 0));
-UNSUPPORTED("44vvyq4v0mo3kf1e60wcz5pq1"); // boolean is_graph = ((strcmp (str, "graph") == 0));
-UNSUPPORTED("ampk1k6gw3p7tnpd7rlk9zpbh"); // boolean is_lower = ((strcmp (str, "lower") == 0));
-UNSUPPORTED("dfcf36k8u7asts9g1790th87m"); // boolean is_print = ((strcmp (str, "print") == 0));
-UNSUPPORTED("94toygdeo23h0nswi5ypjemuj"); // boolean is_punct = ((strcmp (str, "punct") == 0));
-UNSUPPORTED("5gzado7yzz8iw3b7wmsnnv1c"); // boolean is_space = ((strcmp (str, "space") == 0));
-UNSUPPORTED("brptc46jbde0ytz2cf57z0qj9"); // boolean is_upper = ((strcmp (str, "upper") == 0));
-UNSUPPORTED("6y30d6k6j6v6mo0u34x84x7pi"); // boolean is_xdigit = ((strcmp (str, "xdigit") == 0));
-UNSUPPORTED("5xbajy2nf78y44rt7wqi0ipvw"); // if (!(((strcmp (str, "alpha") == 0)) || ((strcmp (str, "upper") == 0)) || ((strcmp (str, "lower") == 0)) || ((strcmp (str, "digit") == 0)) || ((strcmp (str, "alnum") == 0)) || ((strcmp (str, "xdigit") == 0)) || ((strcmp (str, "space") == 0)) || ((strcmp (str, "print") == 0)) || ((strcmp (str, "punct") == 0)) || ((strcmp (str, "graph") == 0)) || ((strcmp (str, "cntrl") == 0)) || ((strcmp (str, "blank") == 0))))
-UNSUPPORTED("9roq2o5jp44jioxvumhpzhasp"); // return (free (compile_stack.stack), REG_ECTYPE);
-UNSUPPORTED("b01volng00k0jszlwguip1za2"); // /* Throw away the ] at the end of the character
-UNSUPPORTED("6v4ad7tk28ej4z6x4p9zfn9ip"); // class. */
-UNSUPPORTED("5rs5zp1k5smyekvir9pcnto9c"); // do {if (p == pend) return REG_EEND; c = (unsigned char) *p++; if (translate) c = (unsigned char) translate[c]; } while (0);
-UNSUPPORTED("ahygyv10li3nm82zryhpg9mbm"); // if (p == pend) return (free (compile_stack.stack), REG_EBRACK);
-UNSUPPORTED("e0htyvo32yvtsowvtr07q7jcw"); // for (ch = 0; ch < 1 << 8; ch++)
-UNSUPPORTED("ednrjrwumcyqj77ytrr2eszv"); // {
-UNSUPPORTED("3k2ocusl5iq9ds3ppdqj68572"); // /* This was split into 3 if's to
-UNSUPPORTED("9gbw8s1phg1eyew1sfpr5kp3f"); // avoid an arbitrary limit in some compiler. */
-UNSUPPORTED("2cntwsg5hxbdi0ckf9y8w0mnq"); // if ( (is_alnum && (1 && isalnum (ch)))
-UNSUPPORTED("1zgfij4s84eufjba2ozx3lkrk"); // || (is_alpha && (1 && isalpha (ch)))
-UNSUPPORTED("bqa0xuagje3ikuybu56a5lsfa"); // || (is_blank && ((ch) == ' ' || (ch) == '\t'))
-UNSUPPORTED("dnw7neodbiod4p16f06qsugzl"); // || (is_cntrl && (1 && iscntrl (ch))))
-UNSUPPORTED("6qfn7xakyg09tnfa2ie1sh8p6"); // (b[((unsigned char) (ch)) / 8] |= 1 << (((unsigned char) ch) % 8));
-UNSUPPORTED("6a1x5lr2tbh4dux8kqoyovq6z"); // if ( (is_digit && (1 && isdigit (ch)))
-UNSUPPORTED("6uh9v7mcu8jqpc8ab1xqdpupe"); // || (is_graph && (1 && isprint (ch) && !isspace (ch)))
-UNSUPPORTED("2kza3pwfg7co598ybwubyyjtb"); // || (is_lower && (1 && islower (ch)))
-UNSUPPORTED("2ve5o48kbom0zknpyyo4nrw8b"); // || (is_print && (1 && isprint (ch))))
-UNSUPPORTED("6qfn7xakyg09tnfa2ie1sh8p6"); // (b[((unsigned char) (ch)) / 8] |= 1 << (((unsigned char) ch) % 8));
-UNSUPPORTED("eu7igk6hg1s58sklwzk61h4b7"); // if ( (is_punct && (1 && ispunct (ch)))
-UNSUPPORTED("eu3t6ngjxiw3bd3n428dpndsz"); // || (is_space && (1 && isspace (ch)))
-UNSUPPORTED("cyrylgd8tsf5lm7q40ozat1u6"); // || (is_upper && (1 && isupper (ch)))
-UNSUPPORTED("6uhsgqbeke0ipkactcwfponfm"); // || (is_xdigit && (1 && isxdigit (ch))))
-UNSUPPORTED("6qfn7xakyg09tnfa2ie1sh8p6"); // (b[((unsigned char) (ch)) / 8] |= 1 << (((unsigned char) ch) % 8));
-UNSUPPORTED("d10pfpemohjrojtw32b9u288j"); // if ( translate && (is_upper || is_lower)
-UNSUPPORTED("dn91c7ek6aq14v8orwpui41nf"); // && ((1 && isupper (ch)) || (1 && islower (ch))))
-UNSUPPORTED("6qfn7xakyg09tnfa2ie1sh8p6"); // (b[((unsigned char) (ch)) / 8] |= 1 << (((unsigned char) ch) % 8));
-UNSUPPORTED("4mlmk54q1pd097btjgvhds4or"); // }
-UNSUPPORTED("377au4sk1ya757gr7n0hqcmrn"); // had_char_class = 1;
-UNSUPPORTED("b5m0ttlk23avgs4i47o8lbzg1"); // }
-UNSUPPORTED("61qf7b2jxc7j3knm5ts69f0b6"); // else
-UNSUPPORTED("el767oi7fhlc4apdbx8dsvnk6"); // {
-UNSUPPORTED("7m4co85wi9arl9dcdfqpb4za8"); // c1++;
-UNSUPPORTED("20tgbjihyvtowact7dzcr1ecf"); // while (c1--)
-UNSUPPORTED("8je1mldqzk080hkvqxenba16t"); // p--;
-UNSUPPORTED("48kiij4wie0njh1vtga7it2dv"); // (b[((unsigned char) ('[')) / 8] |= 1 << (((unsigned char) '[') % 8));
-UNSUPPORTED("dv206lne3atc9xm9yvrhv1ybg"); // (b[((unsigned char) (':')) / 8] |= 1 << (((unsigned char) ':') % 8));
-UNSUPPORTED("41vc3rnsrwhzg40t2l6ddpjfb"); // had_char_class = 0;
-UNSUPPORTED("b5m0ttlk23avgs4i47o8lbzg1"); // }
-UNSUPPORTED("2v7ai112w6nt2xgs1gbzo22oe"); // }
-UNSUPPORTED("a4hbs6luulhltmygux2zimbcc"); // else
-UNSUPPORTED("3trws9zymzc11hz9w8m2b4fl9"); // {
-UNSUPPORTED("nugbt1in6a1t1qaxqdyyi3ep"); // had_char_class = 0;
-UNSUPPORTED("17maz3hujafwurweozb151wdn"); // (b[((unsigned char) (c)) / 8] |= 1 << (((unsigned char) c) % 8));
-UNSUPPORTED("2v7ai112w6nt2xgs1gbzo22oe"); // }
-UNSUPPORTED("13jcwbk3vyfh9xrmwi5hbe7so"); // }
-UNSUPPORTED("ehzhyhula77mysp4xro2dci8t"); // /* Discard any (non)matching list bytes that are all 0 at the
-UNSUPPORTED("el3n9zylp6tlrb6d73napyvmy"); // end of the map. Decrease the map-length byte too. */
-UNSUPPORTED("5aojv97eoyl5m04xfurgaavwm"); // while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
-UNSUPPORTED("ajlocpcq3igxmb5gmsoqvv2es"); // b[-1]--;
-UNSUPPORTED("bhvngkxhzl8kmmso1yya535k3"); // b += b[-1];
-UNSUPPORTED("3e08x1y395304nd0y3uwffvim"); // }
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("6bh4kues0yl62d5yxc9atvjif"); // case '(':
-UNSUPPORTED("10vjrts0i5hyw8tlbrt0z7rxn"); // if (syntax & (((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("bmyrcl5ximm9vy0tneijgrytk"); // goto handle_open;
-UNSUPPORTED("cunk7vpvzj28y1x4gn62gxpce"); // else
-UNSUPPORTED("uivpjrr5me8j92jky5okan1c"); // goto normal_char;
-UNSUPPORTED("1e0dw1ejy35o3woadzbcsm7fr"); // case ')':
-UNSUPPORTED("10vjrts0i5hyw8tlbrt0z7rxn"); // if (syntax & (((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("3s6h8cwqnf4sxe6ctgnhnea58"); // goto handle_close;
-UNSUPPORTED("cunk7vpvzj28y1x4gn62gxpce"); // else
-UNSUPPORTED("uivpjrr5me8j92jky5okan1c"); // goto normal_char;
-UNSUPPORTED("e3rwmj3a70hs7pld4kwdx60mn"); // case '\n':
-UNSUPPORTED("70gx6eoougt8rlinl56yw83xr"); // if (syntax & (((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("5jivfhwm58xf3nhm2fe6mhe63"); // goto handle_alt;
-UNSUPPORTED("cunk7vpvzj28y1x4gn62gxpce"); // else
-UNSUPPORTED("uivpjrr5me8j92jky5okan1c"); // goto normal_char;
-UNSUPPORTED("4alxh05h1fjl2sladyp35v6wj"); // case '|':
-UNSUPPORTED("3torkuptfbkp3zjwrckz7pqdn"); // if (syntax & (((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("5jivfhwm58xf3nhm2fe6mhe63"); // goto handle_alt;
-UNSUPPORTED("cunk7vpvzj28y1x4gn62gxpce"); // else
-UNSUPPORTED("uivpjrr5me8j92jky5okan1c"); // goto normal_char;
-UNSUPPORTED("4pyfskl7wp2jd81x0kmp62qoi"); // case '{':
-UNSUPPORTED("5b1d1n2on553ca86p9l993tzn"); // if (syntax & (((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) && syntax & ((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("48zoic9u273bq7o6wfz7y7fsv"); // goto handle_interval;
-UNSUPPORTED("cunk7vpvzj28y1x4gn62gxpce"); // else
-UNSUPPORTED("uivpjrr5me8j92jky5okan1c"); // goto normal_char;
-UNSUPPORTED("5350k8qj9jz4pvuqs0weppxzm"); // case '\\':
-UNSUPPORTED("drfl8x3xhp9nddd3popxg4kkf"); // if (p == pend) return (free (compile_stack.stack), REG_EESCAPE);
-UNSUPPORTED("27v1be7swlc5n86wdyk7yqicm"); // /* Do not translate the character after the \, so that we can
-UNSUPPORTED("aimxtldmdqlup4n4gcasbmjpm"); // distinguish, e.g., \B from \b, even if we normally would
-UNSUPPORTED("8y750xv4fwoof20pgyb54iljp"); // translate, e.g., B to b. */
-UNSUPPORTED("emr80p3t30z3qcchdf6qsg7op"); // do {if (p == pend) return REG_EEND; c = (unsigned char) *p++; } while (0);
-UNSUPPORTED("1wwqm41fujo96fngaibe11cs"); // switch (c)
-UNSUPPORTED("5k2digv672hnrndhc9ktw0oii"); // {
-UNSUPPORTED("8jxolljx883gvj5ry1lre79rm"); // case '(':
-UNSUPPORTED("59nlrexduxa9d2pv4p8p4wfyn"); // if (syntax & (((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("duzsz5s9lw56m1on7ajxgk9o2"); // goto normal_backslash;
-UNSUPPORTED("1mo91efxfidrlkj7o2hpimm5g"); // handle_open:
-UNSUPPORTED("cc2g9mgbjo7991epy9celv5dq"); // bufp->re_nsub++;
-UNSUPPORTED("e816ua3kiygoarxwt4u3kjw2e"); // regnum++;
-UNSUPPORTED("abfkotx8f2o71l3ungy2dc61b"); // if ((compile_stack.avail == compile_stack.size))
-UNSUPPORTED("4hzaau620c4rh7xorkrmxfut7"); // {
-UNSUPPORTED("5r9ltvya89zzc88t9p8g86dxp"); // ((compile_stack.stack) = (
-UNSUPPORTED("5q6n9lfuwcrd4xf1g8vam0mqg"); // compile_stack_elt_t *) realloc (compile_stack.stack, (compile_stack.size << 1) * sizeof (
-UNSUPPORTED("2a7bsn9w2iinvqmd970g996fq"); // compile_stack_elt_t)));
-UNSUPPORTED("dsrcc4quas84hhfjjm5yh2be8"); // if (compile_stack.stack == (void *)0) return REG_ESPACE;
-UNSUPPORTED("8kq2kc3jebolynu1cy6403pl0"); // compile_stack.size <<= 1;
-UNSUPPORTED("2tfish0jog6m8uhlhaokmzvm3"); // }
-UNSUPPORTED("e0bq2fat5uym1sf4darkcwl7v"); // /* These are the values to restore when we hit end of this
-UNSUPPORTED("3vpixvd7xctqmc3ngtezp4xh4"); // group. They are all relative offsets, so that if the
-UNSUPPORTED("2v6zztbhem2o09k7pqvggwe8h"); // whole pattern moves because of realloc, they will still
-UNSUPPORTED("57di400em2riuffwpvny0f24u"); // be valid. */
-UNSUPPORTED("8rxnof37j5xup2c6z4diq79ou"); // (compile_stack.stack[compile_stack.avail]).begalt_offset = begalt - bufp->buffer;
-UNSUPPORTED("9nay0qlhefwna3c6dilyk0ljp"); // (compile_stack.stack[compile_stack.avail]).fixup_alt_jump
-UNSUPPORTED("aq269vu0tq0y8wvt7vg6y41u8"); // = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0;
-UNSUPPORTED("f2a1p7nj50nhzemnvvv85l9wp"); // (compile_stack.stack[compile_stack.avail]).laststart_offset = b - bufp->buffer;
-UNSUPPORTED("3ikd9wh2ibpe6fnfbwac6mal"); // (compile_stack.stack[compile_stack.avail]).regnum = regnum;
-UNSUPPORTED("1222t3yuwlm1hv92xmzgstlpj"); // /* We will eventually replace the 0 with the number of
-UNSUPPORTED("b5a63c42wobd53sp3c64zj34u"); // groups inner to this one. But do not push a
-UNSUPPORTED("1indupc2ufbt22ci1btaoi3w1"); // start_memory for groups beyond the last one we can
-UNSUPPORTED("clbbjbwg9b4yr40r3qt26gayn"); // represent in the compiled pattern. */
-UNSUPPORTED("dn6qx81h224i04gen8lz36bur"); // if (regnum <= 255)
-UNSUPPORTED("4hzaau620c4rh7xorkrmxfut7"); // {
-UNSUPPORTED("b55i0sl0dvhuj7r94cz8uascg"); // (compile_stack.stack[compile_stack.avail]).inner_group_offset = b - bufp->buffer + 2;
-UNSUPPORTED("crcx4g4ali1dijvt94wdz6nsm"); // do { while ((unsigned long) (b - bufp->buffer + (3)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0); *b++ = (unsigned char) (start_memory); *b++ = (unsigned char) (regnum); *b++ = (unsigned char) (0); } while (0);
-UNSUPPORTED("2tfish0jog6m8uhlhaokmzvm3"); // }
-UNSUPPORTED("94rzmxep7enhqkfnp2762ytyy"); // compile_stack.avail++;
-UNSUPPORTED("dphv9qka2txhy68rnsif6jynt"); // fixup_alt_jump = 0;
-UNSUPPORTED("dvt6va09huijx10zufnnjqgl3"); // laststart = 0;
-UNSUPPORTED("90zo4it529eaunfkfdxoxrdgj"); // begalt = b;
-UNSUPPORTED("dvj2nuag66y7el3zrpla0153y"); // /* If we've reached MAX_REGNUM groups, then this open
-UNSUPPORTED("2u4e034ze821746znru3h0b45"); // won't actually generate any code, so we'll have to
-UNSUPPORTED("dk5vb9d5gkrw8sibofm4qt4ue"); // clear pending_exact explicitly. */
-UNSUPPORTED("7s8z4qnugzgnbuvds8u8a5jep"); // pending_exact = 0;
-UNSUPPORTED("7mosouhqcis2k8sbg88g9wol8"); // break;
-UNSUPPORTED("f58m8dl8wsiu09tv3k6hddsnz"); // case ')':
-UNSUPPORTED("8rxf228e9g6ihw68iqgw5ye4v"); // if (syntax & (((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) goto normal_backslash;
-UNSUPPORTED("7yogipyu9e9xkgapyvsso5js4"); // if ((compile_stack.avail == 0)) {
-UNSUPPORTED("8jaoyupj1e28u8vqk14htwrtv"); // if (syntax & (((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("7twsisd1xmsx52xuobbqhozvn"); // goto normal_backslash;
-UNSUPPORTED("a4hbs6luulhltmygux2zimbcc"); // else
-UNSUPPORTED("dn8ttvbrvj1svr73kt4zmcugv"); // return (free (compile_stack.stack), REG_ERPAREN);
-UNSUPPORTED("13jcwbk3vyfh9xrmwi5hbe7so"); // }
-UNSUPPORTED("3bc4i0fs7quuiznm2wabuv57g"); // handle_close:
-UNSUPPORTED("cba08qms5w8uqvkd4p9iqz909"); // if (fixup_alt_jump)
-UNSUPPORTED("1lzprxcdmzqjb9whh02ptkgin"); // { /* Push a dummy failure point at the end of the
-UNSUPPORTED("cc7pak11xcdny8f782y93y6d4"); // alternative for a possible future
-UNSUPPORTED("4iprb2tgw3ra22d8s7u4ny04z"); // `pop_failure_jump' to pop. See comments at
-UNSUPPORTED("il2pao7ylwdupdmwkc63wt74"); // `push_dummy_failure' in `re_match_2'. */
-UNSUPPORTED("bsoqdb55d2fj7nrshha8baj79"); // do { while ((unsigned long) (b - bufp->buffer + (1)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0); *b++ = (unsigned char) (push_dummy_failure); } while (0);
-UNSUPPORTED("bsg3cvulx3vuba3c4g7h8wi9e"); // /* We allocated space for this jump when we assigned
-UNSUPPORTED("81pcbxblcl9t5t7fqo3daz26"); // to `fixup_alt_jump', in the `handle_alt' case below. */
-UNSUPPORTED("42dp50c2b5kexwd7wxmwewwe1"); // store_op1 (jump_past_alt, fixup_alt_jump, (int) ((b - 1) - (fixup_alt_jump) - 3));
-UNSUPPORTED("2tfish0jog6m8uhlhaokmzvm3"); // }
-UNSUPPORTED("172uzd85uuznm53m6t1nv9ke5"); // /* See similar code for backslashed left paren above. */
-UNSUPPORTED("7yogipyu9e9xkgapyvsso5js4"); // if ((compile_stack.avail == 0)) {
-UNSUPPORTED("8jaoyupj1e28u8vqk14htwrtv"); // if (syntax & (((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("6gqrsbcf35slq98fdu38ysotz"); // goto normal_char;
-UNSUPPORTED("a4hbs6luulhltmygux2zimbcc"); // else
-UNSUPPORTED("dn8ttvbrvj1svr73kt4zmcugv"); // return (free (compile_stack.stack), REG_ERPAREN);
-UNSUPPORTED("13jcwbk3vyfh9xrmwi5hbe7so"); // }
-UNSUPPORTED("eniovbcxrkcn8texhpvd1c3j"); // /* Since we just checked for an empty stack above, this
-UNSUPPORTED("oah0j3x85xy0y5snf99b5uto"); // ``can't happen''. */
-UNSUPPORTED("e4kt1tmmevqvy3cbyk6xnznck"); // ;
-UNSUPPORTED("9aq2ft2quyeattze0cwemwweo"); // {
-UNSUPPORTED("zxem7lefmt7jmq1sphx8jq5d"); // /* We don't just want to restore into `regnum', because
-UNSUPPORTED("eshff1bkln1euqcvo55z6arar"); // later groups should continue to be numbered higher,
-UNSUPPORTED("hyn2g413dbg1jtec9jsz3ujb"); // as in `(ab)c(de)' -- the second group is #2. */
-UNSUPPORTED("e26xy4hqgvbad7pusqf04i868"); // regnum_t this_group_regnum;
-UNSUPPORTED("6n0r61042a9cp17p8uaa2pvkk"); // compile_stack.avail--;
-UNSUPPORTED("b8x4vi5eywvcxrfzoej5bwryf"); // begalt = bufp->buffer + (compile_stack.stack[compile_stack.avail]).begalt_offset;
-UNSUPPORTED("1xvm5ivpx5tz8e199a7p2rmqz"); // fixup_alt_jump
-UNSUPPORTED("4umag2hy9kw4kqozrwydhawfq"); // = (compile_stack.stack[compile_stack.avail]).fixup_alt_jump
-UNSUPPORTED("5gcmnf7zgwup5dbu5kddwwfq5"); // ? bufp->buffer + (compile_stack.stack[compile_stack.avail]).fixup_alt_jump - 1
-UNSUPPORTED("1gewh4lotwkkm4iqn6ggzwkoq"); // : 0;
-UNSUPPORTED("85k6r2lf00egr6wmh6ynrl2p5"); // laststart = bufp->buffer + (compile_stack.stack[compile_stack.avail]).laststart_offset;
-UNSUPPORTED("8hnnnyzrlgnojw4fgthz9m20m"); // this_group_regnum = (compile_stack.stack[compile_stack.avail]).regnum;
-UNSUPPORTED("dlko1f9w54peneqoca91cgrci"); // /* If we've reached MAX_REGNUM groups, then this open
-UNSUPPORTED("74txdb0o7dhsdiultkxutc0e7"); // won't actually generate any code, so we'll have to
-UNSUPPORTED("185wciv8bzl59e6kldksp04w4"); // clear pending_exact explicitly. */
-UNSUPPORTED("47qf9noup192j3ixvbaqfafxw"); // pending_exact = 0;
-UNSUPPORTED("askuaehvoj7enatduzagqwmbk"); // /* We're at the end of the group, so now we know how many
-UNSUPPORTED("autf5q3thbf8mmptmgx0msnh4"); // groups were inside this one. */
-UNSUPPORTED("a8riafizqdv5zjapabhopp72g"); // if (this_group_regnum <= 255)
-UNSUPPORTED("3trws9zymzc11hz9w8m2b4fl9"); // {
-UNSUPPORTED("2wmjb2xbz36ytg6g1bgfd4hb1"); // unsigned char *inner_group_loc
-UNSUPPORTED("bzfdj6g2ck20pq1mb50l27a9v"); // = bufp->buffer + (compile_stack.stack[compile_stack.avail]).inner_group_offset;
-UNSUPPORTED("el3pwrfnbqiexy2sk0rffy0cf"); // *inner_group_loc = regnum - this_group_regnum;
-UNSUPPORTED("cguv9rjc1iive3bv1yez75f03"); // do { while ((unsigned long) (b - bufp->buffer + (3)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0); *b++ = (unsigned char) (stop_memory); *b++ = (unsigned char) (this_group_regnum); *b++ = (unsigned char) (
-UNSUPPORTED("7sev1sdu00ye0rtlo3hndpvge"); // regnum - this_group_regnum); } while (0);
-UNSUPPORTED("2v7ai112w6nt2xgs1gbzo22oe"); // }
-UNSUPPORTED("13jcwbk3vyfh9xrmwi5hbe7so"); // }
-UNSUPPORTED("7mosouhqcis2k8sbg88g9wol8"); // break;
-UNSUPPORTED("1r6y7bujaca34ru0thv040wer"); // case '|': /* `\|'. */
-UNSUPPORTED("46dgptds7v1z98qko5xqgje7h"); // if (syntax & ((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) || syntax & (((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("duzsz5s9lw56m1on7ajxgk9o2"); // goto normal_backslash;
-UNSUPPORTED("4zdduwo0bies2nyvyh3rkqec5"); // handle_alt:
-UNSUPPORTED("eh6qytrwlnojjauu38ckl7ieo"); // if (syntax & ((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("ck4wdxm4o1ub3048vodmtvy6s"); // goto normal_char;
-UNSUPPORTED("71lbycb6i00gg9x1a2qrb3eip"); // /* Insert before the previous alternative a jump which
-UNSUPPORTED("7e4xxb42diyggtjzhyj0r4iht"); // jumps to this alternative if the former fails. */
-UNSUPPORTED("12a3mmfyhz3lv9g634sbhwpnl"); // while ((unsigned long) (b - bufp->buffer + (3)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0);
-UNSUPPORTED("e3r36lsf9nfoaplwmusccx2ko"); // insert_op1 (on_failure_jump, begalt, (int) ((b + 6) - (begalt) - 3), b);
-UNSUPPORTED("7s8z4qnugzgnbuvds8u8a5jep"); // pending_exact = 0;
-UNSUPPORTED("ebm7g0g1nuacoouvopi1thit2"); // b += 3;
-UNSUPPORTED("2oav1ek69wp16iydew6ok9ox8"); // /* The alternative before this one has a jump after it
-UNSUPPORTED("cmcbmjy59tx8k81e3ek6xwlvq"); // which gets executed if it gets matched. Adjust that
-UNSUPPORTED("7jb4wxi0em6v0jucfjtw3a4up"); // jump so it will jump to this alternative's analogous
-UNSUPPORTED("5zlorzwitjp83i56wns9w8u0r"); // jump (put in below, which in turn will jump to the next
-UNSUPPORTED("3y12zjyrd8x7fd4xc7uz7wk9b"); // (if any) alternative's such jump, etc.). The last such
-UNSUPPORTED("7oj6n4fel5k5oe1hc1w024dj5"); // jump jumps to the correct final destination. A picture:
-UNSUPPORTED("ey74hniulk9kz47tqr8by3ul4"); // _____ _____
-UNSUPPORTED("ded5vl0okjroo4lbzal107hid"); // | | | |
-UNSUPPORTED("8dlq9vw86vwqva8uk09fpjhnz"); // | v | v
-UNSUPPORTED("6xr500bohtokobmkx1m276vk2"); // a | b | c
-UNSUPPORTED("k27r9mjl8i2jpghyf3yd76ss"); // If we are at `b', then fixup_alt_jump right now points to a
-UNSUPPORTED("9jlwvx46zdiyc0cgpc9aichx2"); // three-byte space after `a'. We'll put in the jump, set
-UNSUPPORTED("7gw6bsjyzgswrermi9mrvnnd9"); // fixup_alt_jump to right after `b', and leave behind three
-UNSUPPORTED("996t1kfvkq1wsgyy9twl2hmf5"); // bytes which we'll fill in when we get to after `c'. */
-UNSUPPORTED("cba08qms5w8uqvkd4p9iqz909"); // if (fixup_alt_jump)
-UNSUPPORTED("1na9w390cmfhlvzr6zo51tmtb"); // store_op1 (jump_past_alt, fixup_alt_jump, (int) ((b) - (fixup_alt_jump) - 3));
-UNSUPPORTED("8ed964065ejrs0q6lzv94yez1"); // /* Mark and leave space for a jump after this alternative,
-UNSUPPORTED("25baag8i46m3zhww0ac4k5o0x"); // to be filled in later either by next alternative or
-UNSUPPORTED("87vumt536jh7giifqd1s7e35m"); // when know we're at the end of a series of alternatives. */
-UNSUPPORTED("ev3p48k8fo943q12gph5h8h5i"); // fixup_alt_jump = b;
-UNSUPPORTED("12a3mmfyhz3lv9g634sbhwpnl"); // while ((unsigned long) (b - bufp->buffer + (3)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0);
-UNSUPPORTED("ebm7g0g1nuacoouvopi1thit2"); // b += 3;
-UNSUPPORTED("dvt6va09huijx10zufnnjqgl3"); // laststart = 0;
-UNSUPPORTED("90zo4it529eaunfkfdxoxrdgj"); // begalt = b;
-UNSUPPORTED("7mosouhqcis2k8sbg88g9wol8"); // break;
-UNSUPPORTED("99gf69q37flmk5nul07d806ch"); // case '{':
-UNSUPPORTED("eh7o49r6vtoc1lilgh11tvn4b"); // /* If \{ is a literal. */
-UNSUPPORTED("bpfokxd4igwyfns09495mnyj8"); // if (!(syntax & (((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("5qn7772e7nzkqvtlkiys53olq"); // /* If we're at `\{' and it's not the open-interval
-UNSUPPORTED("8a0p71nhvq7jckckna5u4qr7t"); // operator. */
-UNSUPPORTED("cswuz8yxul8hsi2ysw71xb9rz"); // || ((syntax & (((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) && (syntax & ((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)))
-UNSUPPORTED("d0s744fq2fs9l9aaekpxlqj4e"); // || (p - 2 == pattern && p == pend))
-UNSUPPORTED("duzsz5s9lw56m1on7ajxgk9o2"); // goto normal_backslash;
-UNSUPPORTED("bxsvs3tj432mvaj55kae5o9ue"); // handle_interval:
-UNSUPPORTED("9aq2ft2quyeattze0cwemwweo"); // {
-UNSUPPORTED("ey78j6wwy5vn22b5iutepsjvj"); // /* If got here, then the syntax allows intervals. */
-UNSUPPORTED("22u5dv9jzoa3qwk32b1729l4r"); // /* At least (most) this many matches must be made. */
-UNSUPPORTED("8hhxunayr90degkndrot61r2v"); // int lower_bound = -1, upper_bound = -1;
-UNSUPPORTED("b3m9z0v48oef8fma37xkjtew6"); // beg_interval = p - 1;
-UNSUPPORTED("891uwttbfnv5bc58wpbg1fhgl"); // if (p == pend)
-UNSUPPORTED("3trws9zymzc11hz9w8m2b4fl9"); // {
-UNSUPPORTED("cbdohhh0bm6q3vbmnwn4e1vyq"); // if (syntax & ((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("ckqpiwbyjnqn5cpwu2kw8rzbb"); // goto unfetch_interval;
-UNSUPPORTED("61qf7b2jxc7j3knm5ts69f0b6"); // else
-UNSUPPORTED("5ln10oel04ejmsrfm7uzyxmm3"); // return (free (compile_stack.stack), REG_EBRACE);
-UNSUPPORTED("2v7ai112w6nt2xgs1gbzo22oe"); // }
-UNSUPPORTED("3imw63qg7eb3mef09yezz6uj7"); // { if (p != pend) { do {if (p == pend) return REG_EEND; c = (unsigned char) *p++; if (translate) c = (unsigned char) translate[c]; } while (0); while ((1 && isdigit (c))) { if (lower_bound < 0) lower_bound = 0; lower_bound = lower_bound * 10 + c - '0'; if (p == pend) break; do {if (p == pend) return REG_EEND; c = (unsigned char) *p++; if (translate) c = (unsigned char) translate[c]; } while (0); } } };
-UNSUPPORTED("1uyn0tiw7bqjiss70oyjn9l7f"); // if (c == ',')
-UNSUPPORTED("3trws9zymzc11hz9w8m2b4fl9"); // {
-UNSUPPORTED("5xu6gzc4kvvybje2lnr7qdjka"); // { if (p != pend) { do {if (p == pend) return REG_EEND; c = (unsigned char) *p++; if (translate) c = (unsigned char) translate[c]; } while (0); while ((1 && isdigit (c))) { if (upper_bound < 0) upper_bound = 0; upper_bound = upper_bound * 10 + c - '0'; if (p == pend) break; do {if (p == pend) return REG_EEND; c = (unsigned char) *p++; if (translate) c = (unsigned char) translate[c]; } while (0); } } };
-UNSUPPORTED("36f9x0yetwobrju6guskv8zsf"); // if (upper_bound < 0) upper_bound = (0x7fff);
-UNSUPPORTED("2v7ai112w6nt2xgs1gbzo22oe"); // }
-UNSUPPORTED("a4hbs6luulhltmygux2zimbcc"); // else
-UNSUPPORTED("76by7r7x6guk4yvf4na11j7fa"); // /* Interval such as `{1}' => match exactly once. */
-UNSUPPORTED("7oi51mz0kxn0ljkpu564jd1zz"); // upper_bound = lower_bound;
-UNSUPPORTED("7ec3ilddc87ddo0ohyphhvkag"); // if (lower_bound < 0 || upper_bound > (0x7fff)
-UNSUPPORTED("dg03lkmdnpyic7onasg3rhqv3"); // || lower_bound > upper_bound)
-UNSUPPORTED("3trws9zymzc11hz9w8m2b4fl9"); // {
-UNSUPPORTED("cbdohhh0bm6q3vbmnwn4e1vyq"); // if (syntax & ((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("ckqpiwbyjnqn5cpwu2kw8rzbb"); // goto unfetch_interval;
-UNSUPPORTED("61qf7b2jxc7j3knm5ts69f0b6"); // else
-UNSUPPORTED("dncd6ntkh4fds08gm3c4f7y7z"); // return (free (compile_stack.stack), REG_BADBR);
-UNSUPPORTED("2v7ai112w6nt2xgs1gbzo22oe"); // }
-UNSUPPORTED("8zi6rfr6252dxyzqv0myhm4xm"); // if (!(syntax & ((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)))
-UNSUPPORTED("3trws9zymzc11hz9w8m2b4fl9"); // {
-UNSUPPORTED("3nwh4wgghtnfkscuiwfo0cu3y"); // if (c != '\\') return (free (compile_stack.stack), REG_EBRACE);
-UNSUPPORTED("eqri2rfe7jnz1m2rij615jaj1"); // do {if (p == pend) return REG_EEND; c = (unsigned char) *p++; if (translate) c = (unsigned char) translate[c]; } while (0);
-UNSUPPORTED("2v7ai112w6nt2xgs1gbzo22oe"); // }
-UNSUPPORTED("7yy5bnz36zs5pyi05n1qbbyfx"); // if (c != '}')
-UNSUPPORTED("3trws9zymzc11hz9w8m2b4fl9"); // {
-UNSUPPORTED("cbdohhh0bm6q3vbmnwn4e1vyq"); // if (syntax & ((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("ckqpiwbyjnqn5cpwu2kw8rzbb"); // goto unfetch_interval;
-UNSUPPORTED("61qf7b2jxc7j3knm5ts69f0b6"); // else
-UNSUPPORTED("dncd6ntkh4fds08gm3c4f7y7z"); // return (free (compile_stack.stack), REG_BADBR);
-UNSUPPORTED("2v7ai112w6nt2xgs1gbzo22oe"); // }
-UNSUPPORTED("5wvp3nau0n8tyg9q5a45z6lyw"); // /* We just parsed a valid interval. */
-UNSUPPORTED("8abj2dxygzm4q2t6cik367htu"); // /* If it's invalid to have no preceding re. */
-UNSUPPORTED("7jmcihqsic23w36x8uyw6rgq0"); // if (!laststart)
-UNSUPPORTED("3trws9zymzc11hz9w8m2b4fl9"); // {
-UNSUPPORTED("dhcq2d5ztdbu4o4zvyapxw6nh"); // if (syntax & (((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("1m9o7j67m70ez7l1kcm89n5hu"); // return (free (compile_stack.stack), REG_BADRPT);
-UNSUPPORTED("cd9am2nn7ebpy7n4jg9h1ufr4"); // else if (syntax & ((((((unsigned long int) 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("9bhpbnocq89hcx0yaaav9o55q"); // laststart = b;
-UNSUPPORTED("61qf7b2jxc7j3knm5ts69f0b6"); // else
-UNSUPPORTED("ckqpiwbyjnqn5cpwu2kw8rzbb"); // goto unfetch_interval;
-UNSUPPORTED("2v7ai112w6nt2xgs1gbzo22oe"); // }
-UNSUPPORTED("4gb3yehghg1r4z81pfpjdfvgt"); // /* If the upper bound is zero, don't want to succeed at
-UNSUPPORTED("aatlwtk51r4vhf2pwijmg9mp2"); // all; jump from `laststart' to `b + 3', which will be
-UNSUPPORTED("5qe2o1vhmd60525scpziso3qd"); // the end of the buffer after we insert the jump. */
-UNSUPPORTED("7mu4hmjs37m7lx095ek5vdxxv"); // if (upper_bound == 0)
-UNSUPPORTED("3trws9zymzc11hz9w8m2b4fl9"); // {
-UNSUPPORTED("a881bhs9uyxvv8hkudjh48ded"); // while ((unsigned long) (b - bufp->buffer + (3)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0);
-UNSUPPORTED("1iszfmgzsydg6wplo0b3rdscs"); // insert_op1 (jump, laststart, (int) ((b + 3) - (laststart) - 3), b);
-UNSUPPORTED("ef7wtmbarkb4uc7wd67hvt8vg"); // b += 3;
-UNSUPPORTED("2v7ai112w6nt2xgs1gbzo22oe"); // }
-UNSUPPORTED("er56h1ofqtaixpmzkkaco2esj"); // /* Otherwise, we have a nontrivial interval. When
-UNSUPPORTED("as06jnzy16oy1d2k8yrsmnzce"); // we're all done, the pattern will look like:
-UNSUPPORTED("2sy9ixs1qds1ov6cizjv2ekst"); // set_number_at <jump count> <upper bound>
-UNSUPPORTED("57q8h3cnrxlq45gvr3k5coz5l"); // set_number_at <succeed_n count> <lower bound>
-UNSUPPORTED("9nr6blw8qubgah89xl4e7nkc9"); // succeed_n <after jump addr> <succeed_n count>
-UNSUPPORTED("3jejf324x7ol07x2qsz7dal9u"); // <body of loop>
-UNSUPPORTED("91gylqgyabjgru87d2uf6v0sb"); // jump_n <succeed_n addr> <jump count>
-UNSUPPORTED("3ef68fn6o1w25y5pabsc3ly4g"); // (The upper bound and `jump_n' are omitted if
-UNSUPPORTED("bk78ox2ujcbxp08sj3dypdu4d"); // `upper_bound' is 1, though.) */
-UNSUPPORTED("a4hbs6luulhltmygux2zimbcc"); // else
-UNSUPPORTED("efpf0x8clufa77cutrnkx4lcj"); // { /* If the upper bound is > 1, we need to insert
-UNSUPPORTED("dzt6navygpg7km0wu0um9ly47"); // more at the end of the loop. */
-UNSUPPORTED("bj2zq9uzbacy1f5scg45mc8o7"); // unsigned nbytes = 10 + (upper_bound > 1) * 10;
-UNSUPPORTED("a3dj4ob1sccvwmhsasm69xe72"); // while ((unsigned long) (b - bufp->buffer + (nbytes)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0);
-UNSUPPORTED("1su4wz7ud8htx57ifpl7dvcjb"); // /* Initialize lower bound of the `succeed_n', even
-UNSUPPORTED("9j79ov5k583ecforn4p7uyj07"); // though it will be set during matching by its
-UNSUPPORTED("8e98bgll3zoiy6g3o125b3q2f"); // attendant `set_number_at' (inserted next),
-UNSUPPORTED("53ep471y7ys6dzp9yufebyily"); // because `re_compile_fastmap' needs to know.
-UNSUPPORTED("14vynt5c8wnonl64olb8ttvtd"); // Jump to the `jump_n' we might insert below. */
-UNSUPPORTED("70iuvqfyzlre4zcn83hksrxn8"); // insert_op2 (succeed_n, laststart, (int) ((
-UNSUPPORTED("5pma6876qpamutcafga5yib97"); // b + 5 +(upper_bound > 1) * 5) - (laststart) - 3),
-UNSUPPORTED("6vch8eo9jutmcjre2de6d9gbd"); // lower_bound, b);
-UNSUPPORTED("43kr4g9sdi8c4jh0s5i56vuom"); // b += 5;
-UNSUPPORTED("9wq1ll164vusxqbxnhcmfglr2"); // /* Code to initialize the lower bound. Insert
-UNSUPPORTED("8pvo9br1w68oucw65nlm51oyr"); // before the `succeed_n'. The `5' is the last two
-UNSUPPORTED("a0wkdu3a33nzfqwoi97ucrydd"); // bytes of this `set_number_at', plus 3 bytes of
-UNSUPPORTED("3f5d3pqpnky1yym79bby1sz14"); // the following `succeed_n'. */
-UNSUPPORTED("6tnprwkxn86sjk70t31xuoner"); // insert_op2 (set_number_at, laststart, 5, lower_bound, b);
-UNSUPPORTED("43kr4g9sdi8c4jh0s5i56vuom"); // b += 5;
-UNSUPPORTED("oi58bgxgyehr7fep6gg7b30i"); // if (upper_bound > 1)
-UNSUPPORTED("8k5l99ygyd8csogbu2fv5zo"); // { /* More than one repetition is allowed, so
-UNSUPPORTED("dfqu908jf8ce7624rr03va1d4"); // append a backward jump to the `succeed_n'
-UNSUPPORTED("3bwv4hhwkxq1dxz91v6urcgft"); // that starts this interval.
-UNSUPPORTED("9d1i5cmg65d2yqlnnwhhgb10d"); // When we've reached this during matching,
-UNSUPPORTED("a4w172v3cp6ffpdtc6uecy35z"); // we'll have matched the interval once, so
-UNSUPPORTED("ek50qyp6pxt5f0d13fhqk7gb3"); // jump back only `upper_bound - 1' times. */
-UNSUPPORTED("cw1t4ts9rzslpfolcfywhn3qn"); // store_op2 (jump_n, b, (int) ((laststart + 5) - (b) - 3),
-UNSUPPORTED("3bkogjbp2zrhl1e57w52wgtur"); // upper_bound - 1);
-UNSUPPORTED("e4xjnlgh2lwxl5rgrsy1t0lzp"); // b += 5;
-UNSUPPORTED("9eb4sjjix0zbs0m5165ieamk0"); // /* The location we want to set is the second
-UNSUPPORTED("5y1422w9b3ttxiq7uxejd8dl7"); // parameter of the `jump_n'; that is `b-2' as
-UNSUPPORTED("7pbl00qw1iwl2shqi1boj4s0o"); // an absolute address. `laststart' will be
-UNSUPPORTED("8nzimsq57reptkqovcwmi5is2"); // the `set_number_at' we're about to insert;
-UNSUPPORTED("8zphslv1mlv2s77w43gkoi1ul"); // `laststart+3' the number to set, the source
-UNSUPPORTED("d2f41o7p6x4ikqydu4firrznx"); // for the relative address. But we are
-UNSUPPORTED("ykrtets348ms6o03g441goo7"); // inserting into the middle of the pattern --
-UNSUPPORTED("8wbqzkcrlw3e1ea51h8blhurv"); // so everything is getting moved up by 5.
-UNSUPPORTED("a3f2u6qy5p003dtis6m0fpvl1"); // Conclusion: (b - 2) - (laststart + 3) + 5,
-UNSUPPORTED("5emb5r1kvteh6n0qces39m5f2"); // i.e., b - laststart.
-UNSUPPORTED("3zbu3199lym6vc2u1vakclmn6"); // We insert this at the beginning of the loop
-UNSUPPORTED("csmu8b2er6ytie5e9nt8t4ii4"); // so that if we fail during matching, we'll
-UNSUPPORTED("6i50gsk8v7o3h2xgwwmiiftk6"); // reinitialize the bounds. */
-UNSUPPORTED("87vlmr3dcbomq11myh4sw1fl6"); // insert_op2 (set_number_at, laststart, b - laststart,
-UNSUPPORTED("9qs8k9xnugrbv80hqanlzsj0k"); // upper_bound - 1, b);
-UNSUPPORTED("e4xjnlgh2lwxl5rgrsy1t0lzp"); // b += 5;
-UNSUPPORTED("b5m0ttlk23avgs4i47o8lbzg1"); // }
-UNSUPPORTED("2v7ai112w6nt2xgs1gbzo22oe"); // }
-UNSUPPORTED("47qf9noup192j3ixvbaqfafxw"); // pending_exact = 0;
-UNSUPPORTED("5bsb6g154mdvmrq2r8pg7c57z"); // beg_interval = (void *)0;
-UNSUPPORTED("13jcwbk3vyfh9xrmwi5hbe7so"); // }
-UNSUPPORTED("7mosouhqcis2k8sbg88g9wol8"); // break;
-UNSUPPORTED("4g8id4otqpbtngfcwz2lvm1dj"); // unfetch_interval:
-UNSUPPORTED("2uaon9lzacwcq3uk6um6vhs5b"); // /* If an invalid interval, match the characters as literals. */
-UNSUPPORTED("e4kt1tmmevqvy3cbyk6xnznck"); // ;
-UNSUPPORTED("del20sog75q2qfuqvkporgtm0"); // p = beg_interval;
-UNSUPPORTED("34xptp017sapmiseov6178cf4"); // beg_interval = (void *)0;
-UNSUPPORTED("biznyjdfohe9yytw4pz3d8dox"); // /* normal_char and normal_backslash need `c'. */
-UNSUPPORTED("criokqqji74yuk47n1jhnpq75"); // do {if (p == pend) return REG_EEND; c = (unsigned char) *p++; if (translate) c = (unsigned char) translate[c]; } while (0);
-UNSUPPORTED("axdhegkjispkpmlj1rwmr7893"); // if (!(syntax & ((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)))
-UNSUPPORTED("4hzaau620c4rh7xorkrmxfut7"); // {
-UNSUPPORTED("szfu82l2yyl4abpqquds47zb"); // if (p > pattern && p[-1] == '\\')
-UNSUPPORTED("4pgdoo1pi0fajdrnqd2gl86zc"); // goto normal_backslash;
-UNSUPPORTED("2tfish0jog6m8uhlhaokmzvm3"); // }
-UNSUPPORTED("dxpbgmfj2w220xy1q99fxje94"); // goto normal_char;
-UNSUPPORTED("28ro2br1t858h9e64b2eclvsh"); // case 'w':
-UNSUPPORTED("f3s47ztvpkb3579t2leyzyw26"); // if (re_syntax_options & (((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("ck4wdxm4o1ub3048vodmtvy6s"); // goto normal_char;
-UNSUPPORTED("bzlbs3vmfi1kf0101kec4qyco"); // laststart = b;
-UNSUPPORTED("br0jt3hvd6j06mrnfv1j1du2c"); // do { while ((unsigned long) (b - bufp->buffer + (1)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0); *b++ = (unsigned char) (wordchar); } while (0);
-UNSUPPORTED("7mosouhqcis2k8sbg88g9wol8"); // break;
-UNSUPPORTED("cgixiaqx7fff7w14lfzv9un9b"); // case 'W':
-UNSUPPORTED("f3s47ztvpkb3579t2leyzyw26"); // if (re_syntax_options & (((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("ck4wdxm4o1ub3048vodmtvy6s"); // goto normal_char;
-UNSUPPORTED("bzlbs3vmfi1kf0101kec4qyco"); // laststart = b;
-UNSUPPORTED("csd38b3d31jeqlokfvq1k1w8f"); // do { while ((unsigned long) (b - bufp->buffer + (1)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0); *b++ = (unsigned char) (notwordchar); } while (0);
-UNSUPPORTED("7mosouhqcis2k8sbg88g9wol8"); // break;
-UNSUPPORTED("56yutn3bw63gli62ao6byqpz6"); // case '<':
-UNSUPPORTED("f3s47ztvpkb3579t2leyzyw26"); // if (re_syntax_options & (((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("ck4wdxm4o1ub3048vodmtvy6s"); // goto normal_char;
-UNSUPPORTED("bvnndrb6xvkus381wvq683jko"); // do { while ((unsigned long) (b - bufp->buffer + (1)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0); *b++ = (unsigned char) (wordbeg); } while (0);
-UNSUPPORTED("7mosouhqcis2k8sbg88g9wol8"); // break;
-UNSUPPORTED("b27z9bdaut5nhut2j9qtvrc6x"); // case '>':
-UNSUPPORTED("f3s47ztvpkb3579t2leyzyw26"); // if (re_syntax_options & (((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("ck4wdxm4o1ub3048vodmtvy6s"); // goto normal_char;
-UNSUPPORTED("9x7h5ccf7d8cb7d008zc3fvnn"); // do { while ((unsigned long) (b - bufp->buffer + (1)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0); *b++ = (unsigned char) (wordend); } while (0);
-UNSUPPORTED("7mosouhqcis2k8sbg88g9wol8"); // break;
-UNSUPPORTED("1lgl6j1beved5wkn8lbc9pj9v"); // case 'b':
-UNSUPPORTED("f3s47ztvpkb3579t2leyzyw26"); // if (re_syntax_options & (((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("ck4wdxm4o1ub3048vodmtvy6s"); // goto normal_char;
-UNSUPPORTED("ee4emtgp2qmp2if03ztroprzx"); // do { while ((unsigned long) (b - bufp->buffer + (1)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0); *b++ = (unsigned char) (wordbound); } while (0);
-UNSUPPORTED("7mosouhqcis2k8sbg88g9wol8"); // break;
-UNSUPPORTED("1rh1jh861iaq6ptkgabcumr89"); // case 'B':
-UNSUPPORTED("f3s47ztvpkb3579t2leyzyw26"); // if (re_syntax_options & (((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("ck4wdxm4o1ub3048vodmtvy6s"); // goto normal_char;
-UNSUPPORTED("f1o6i9gjd99gwklmvn8viskl6"); // do { while ((unsigned long) (b - bufp->buffer + (1)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0); *b++ = (unsigned char) (notwordbound); } while (0);
-UNSUPPORTED("7mosouhqcis2k8sbg88g9wol8"); // break;
-UNSUPPORTED("59swrjh32j9w6w9fnlmqjwqhm"); // case '`':
-UNSUPPORTED("f3s47ztvpkb3579t2leyzyw26"); // if (re_syntax_options & (((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("ck4wdxm4o1ub3048vodmtvy6s"); // goto normal_char;
-UNSUPPORTED("21zy7115epyqb00qfyrak2wlh"); // do { while ((unsigned long) (b - bufp->buffer + (1)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0); *b++ = (unsigned char) (begbuf); } while (0);
-UNSUPPORTED("7mosouhqcis2k8sbg88g9wol8"); // break;
-UNSUPPORTED("enp735bu0pvi1g2slk3f3xjlt"); // case '\'':
-UNSUPPORTED("f3s47ztvpkb3579t2leyzyw26"); // if (re_syntax_options & (((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("ck4wdxm4o1ub3048vodmtvy6s"); // goto normal_char;
-UNSUPPORTED("efz3fdd9mbv7nl371w3u6ezhv"); // do { while ((unsigned long) (b - bufp->buffer + (1)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0); *b++ = (unsigned char) (endbuf); } while (0);
-UNSUPPORTED("7mosouhqcis2k8sbg88g9wol8"); // break;
-UNSUPPORTED("5p5kyaam049yzq965bmdz6nnh"); // case '1': case '2': case '3': case '4': case '5':
-UNSUPPORTED("9hv7da8hbwl3dpaoiieu3rdte"); // case '6': case '7': case '8': case '9':
-UNSUPPORTED("8x9ia20e11qngbvg3030t63ib"); // if (syntax & ((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("ck4wdxm4o1ub3048vodmtvy6s"); // goto normal_char;
-UNSUPPORTED("984azd04wqga97vlg77nqw3hl"); // c1 = c - '0';
-UNSUPPORTED("2j8gb2lyb8b45sk2yf69wj6rw"); // if (c1 > regnum)
-UNSUPPORTED("3t049zz47oarl9dkg8euljouk"); // return (free (compile_stack.stack), REG_ESUBREG);
-UNSUPPORTED("b52s0xefwdzq23ebdsm2l635g"); // /* Can't back reference to a subexpression if inside of it. */
-UNSUPPORTED("289fpytgoqtnz6sbd26j596ma"); // if (group_in_compile_stack (compile_stack, (regnum_t) c1))
-UNSUPPORTED("ck4wdxm4o1ub3048vodmtvy6s"); // goto normal_char;
-UNSUPPORTED("bzlbs3vmfi1kf0101kec4qyco"); // laststart = b;
-UNSUPPORTED("ayh7963cwi35nzazymns2xr4j"); // do { while ((unsigned long) (b - bufp->buffer + (2)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0); *b++ = (unsigned char) (duplicate); *b++ = (unsigned char) (c1); } while (0);
-UNSUPPORTED("7mosouhqcis2k8sbg88g9wol8"); // break;
-UNSUPPORTED("10rhhnvrykevpmqtifs3vfsbn"); // case '+':
-UNSUPPORTED("5d03wz66bdkv7mubtsqfqptwh"); // case '?':
-UNSUPPORTED("cmtz225wrrfrtyrfnva1w0xyx"); // if (syntax & (((unsigned long int) 1) << 1))
-UNSUPPORTED("1e36xo9vcfmetpl665flebmxr"); // goto handle_plus;
-UNSUPPORTED("ex6jbb36b02x7vzl22fq0yh2l"); // else
-UNSUPPORTED("duzsz5s9lw56m1on7ajxgk9o2"); // goto normal_backslash;
-UNSUPPORTED("623zujkdt9es8v0w13jz9jw8x"); // default:
-UNSUPPORTED("beo8prktwmjyif35z778zfw1g"); // normal_backslash:
-UNSUPPORTED("d6o76edxq0225kqke2hja81jl"); // /* You might think it would be useful for \ to mean
-UNSUPPORTED("3ifiyvf5lf26yw26enbob7qmu"); // not to translate; but if we don't translate it
-UNSUPPORTED("ecuhc5c6wpoj7vpzvjyv5x62r"); // it will never match anything. */
-UNSUPPORTED("1nghju7haq80s0kj7x01pojis"); // c = (translate ? (char) translate[(unsigned char) (c)] : (c));
-UNSUPPORTED("dxpbgmfj2w220xy1q99fxje94"); // goto normal_char;
-UNSUPPORTED("b86ovw6olwwo6gnqlt1wqqzb4"); // }
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("comxch6w0lbi64ejq9m4p0u7o"); // default:
-UNSUPPORTED("egnm0qedqx5klxttjvckp1nh0"); // /* Expects the character in `c'. */
-UNSUPPORTED("4qeb36tm7edhyh2kuighgnt3l"); // normal_char:
-UNSUPPORTED("1fk2r6llu2tyc89u61aqedfcu"); // /* If no exactn currently being built. */
-UNSUPPORTED("dvgbrbk801umnqbk21dcl1jqt"); // if (!pending_exact
-UNSUPPORTED("4sk1dp6gncxrc6q5vqax6q1ff"); // /* If last exactn not at current position. */
-UNSUPPORTED("8ta654rp3f80109ds7wainnbo"); // || pending_exact + *pending_exact + 1 != b
-UNSUPPORTED("77sazmv1hkm382fcbfgk2amhz"); // /* We have only one byte following the exactn for the count. */
-UNSUPPORTED("195b1d4l8t8zfx7373dninfqs"); // || *pending_exact == (1 << 8) - 1
-UNSUPPORTED("dfhnk487nvojvngpft8d1m5m6"); // /* If followed by a repetition operator. */
-UNSUPPORTED("3ub8lclci64fyijvq4kh6b7wv"); // || *p == '*' || *p == '^'
-UNSUPPORTED("eus82vo98skwtodf1ct43m3j2"); // || ((syntax & (((unsigned long int) 1) << 1))
-UNSUPPORTED("c35rzowssstcdv8ruusljr55b"); // ? *p == '\\' && (p[1] == '+' || p[1] == '?')
-UNSUPPORTED("an9wblbb8w5ryyrzneu7n5ko8"); // : (*p == '+' || *p == '?'))
-UNSUPPORTED("9fpdj9n2jjcr421s2g9z3r4i5"); // || ((syntax & (((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("doucnd8aksv0c0n2qke841f3d"); // && ((syntax & ((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("3d5qlx6ctgmlvlyvps6mliwz5"); // ? *p == '{'
-UNSUPPORTED("5g4kw7ayxlcp3eufwirvf96oj"); // : (p[0] == '\\' && p[1] == '{'))))
-UNSUPPORTED("5k2digv672hnrndhc9ktw0oii"); // {
-UNSUPPORTED("nbxskwykyxkuuturxjw7zviw"); // /* Start building a new exactn. */
-UNSUPPORTED("bzlbs3vmfi1kf0101kec4qyco"); // laststart = b;
-UNSUPPORTED("ejmhwadfnfrzhgtdtjhon9thk"); // do { while ((unsigned long) (b - bufp->buffer + (2)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0); *b++ = (unsigned char) (exactn); *b++ = (unsigned char) (0); } while (0);
-UNSUPPORTED("3d84yn9kh97rpe3bpdhnhbnpc"); // pending_exact = b - 1;
-UNSUPPORTED("b86ovw6olwwo6gnqlt1wqqzb4"); // }
-UNSUPPORTED("2k7zblp37vmofrhji8gga03t0"); // do { while ((unsigned long) (b - bufp->buffer + (1)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0); *b++ = (unsigned char) (c); } while (0);
-UNSUPPORTED("cib3f9ag6ywox7sedgbxkkmzk"); // (*pending_exact)++;
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("61b5pg30vl032ddas1lgz7fom"); // } /* switch (c) */
-UNSUPPORTED("9758gpbrep7p4gr36dhunt05n"); // } /* while p != pend */
-UNSUPPORTED("93p2q85dy4ac5kim9nivyn79p"); // /* Through the pattern now. */
-UNSUPPORTED("1owvoxb3fhlen2k6t0r5ai42z"); // if (fixup_alt_jump)
-UNSUPPORTED("13s484p9xd2bw2xbz1wlvdo2i"); // store_op1 (jump_past_alt, fixup_alt_jump, (int) ((b) - (fixup_alt_jump) - 3));
-UNSUPPORTED("aprj6xezpwmu3a179m5g8vbya"); // if (!(compile_stack.avail == 0))
-UNSUPPORTED("3qkjmx7dwj6otc7vge7e62fak"); // return (free (compile_stack.stack), REG_EPAREN);
-UNSUPPORTED("bif9tomfcf0bfh8yujmms4e00"); // /* If we don't want backtracking, force success
-UNSUPPORTED("6in6drehljv4k3imbk7ay9paw"); // the first time we reach the end of the compiled pattern. */
-UNSUPPORTED("65u4ochrazrfxoz1im3b6cxt5"); // if (syntax & ((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))
-UNSUPPORTED("2gp9v2s1qkxulysls2k1go519"); // do { while ((unsigned long) (b - bufp->buffer + (1)) > bufp->allocated) do { unsigned char *old_buffer = bufp->buffer; if (bufp->allocated == (1L << 16)) return REG_ESIZE; bufp->allocated <<= 1; if (bufp->allocated > (1L << 16)) bufp->allocated = (1L << 16); bufp->buffer = (unsigned char *) realloc ((bufp->buffer), (bufp->allocated)); if (bufp->buffer == (void *)0) return REG_ESPACE; if (old_buffer != bufp->buffer) { b = (b - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } } while (0); *b++ = (unsigned char) (succeed); } while (0);
-UNSUPPORTED("cvaeac7ysy55222mdduh1aku9"); // free (compile_stack.stack);
-UNSUPPORTED("588061fcmtocd9luhfsdk74at"); // /* We have succeeded; set the length of the buffer. */
-UNSUPPORTED("7at4a9mth8j1h0n9mhg91s816"); // bufp->used = b - bufp->buffer;
-UNSUPPORTED("cwwrkrko9fc4redgkt1b13h6d"); // return REG_NOERROR;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 1a5b1tkqolinqh3eydzvc550l
-// static void store_op1 (re_opcode_t op, unsigned char *loc, int arg)
-public static Object store_op1(Object... arg) {
-UNSUPPORTED("e2z2o5ybnr5tgpkt8ty7hwan1"); // static void
-UNSUPPORTED("eili3inuq1bw9eshdmskywxtg"); // store_op1 (re_opcode_t op,
-UNSUPPORTED("eqn95cpnpj01ulxvedlp62t24"); // unsigned char *loc,
-UNSUPPORTED("4bho2a0suqymuq2e9rqlexiq3"); // int arg)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("1hzyviac306vd3ph2a79xocx7"); // *loc = (unsigned char) op;
-UNSUPPORTED("bmuizeo6n9t1qzeegovoyri2g"); // do { (loc + 1)[0] = (arg) & 0377; (loc + 1)[1] = (arg) >> 8; } while (0);
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 1dmpl1eqm04oq44hm3nqojfqi
-// static void store_op2(re_opcode_t op, unsigned char *loc, int arg1, int arg2)
-public static Object store_op2(Object... arg) {
-UNSUPPORTED("e2z2o5ybnr5tgpkt8ty7hwan1"); // static void
-UNSUPPORTED("3uuxvmysdrpmrqq4esv6u5jvy"); // store_op2(re_opcode_t op,
-UNSUPPORTED("a8vol3cdyfu7j1q063xc83pt0"); // unsigned char *loc,
-UNSUPPORTED("dk2zk2gteycj6jwc1rcuw4jot"); // int arg1,
-UNSUPPORTED("afi4spwfrmjjgwzrd48g2eu1g"); // int arg2)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("1hzyviac306vd3ph2a79xocx7"); // *loc = (unsigned char) op;
-UNSUPPORTED("6ula40dcnni5p95iedvl6iz0p"); // do { (loc + 1)[0] = (arg1) & 0377; (loc + 1)[1] = (arg1) >> 8; } while (0);
-UNSUPPORTED("692n1w538qervykzhu59yxbnn"); // do { (loc + 3)[0] = (arg2) & 0377; (loc + 3)[1] = (arg2) >> 8; } while (0);
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 4oawjz5vt9t86ibo8qr5a5ot7
-// static void insert_op1(re_opcode_t op, unsigned char *loc, int arg, unsigned char *end)
-public static Object insert_op1(Object... arg) {
-UNSUPPORTED("e2z2o5ybnr5tgpkt8ty7hwan1"); // static void
-UNSUPPORTED("9kqafhtvgqir3019lsqbgnaik"); // insert_op1(re_opcode_t op,
-UNSUPPORTED("eqn95cpnpj01ulxvedlp62t24"); // unsigned char *loc,
-UNSUPPORTED("epz3wdlgykwaxdrfpx2zq4v1l"); // int arg,
-UNSUPPORTED("ebratu77atbhul7tuupzmelvf"); // unsigned char *end)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("169hmon34dm6xedl4afpa0i1j"); // register unsigned char *pfrom = end;
-UNSUPPORTED("45zeyp0r8qs22j0ji3pvdf6z6"); // register unsigned char *pto = end + 3;
-UNSUPPORTED("3022v7vf3t5s8s2dsxql29xo4"); // while (pfrom != loc)
-UNSUPPORTED("648ldcfu6yydgsxc2w4dn9lep"); // *--pto = *--pfrom;
-UNSUPPORTED("a9874mjpfiitct058pp2hkjid"); // store_op1 (op, loc, arg);
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 v4p3krro14wk7jqs0uz06n05
-// static void insert_op2(re_opcode_t op, unsigned char *loc, int arg1, int arg2, unsigned char *end)
-public static Object insert_op2(Object... arg) {
-UNSUPPORTED("e2z2o5ybnr5tgpkt8ty7hwan1"); // static void
-UNSUPPORTED("2udn0ng3gbc8cd8v2x946r2ss"); // insert_op2(re_opcode_t op,
-UNSUPPORTED("eqn95cpnpj01ulxvedlp62t24"); // unsigned char *loc,
-UNSUPPORTED("9nlhn9pgj5kcxamj9gw78b0qw"); // int arg1,
-UNSUPPORTED("e6ty8yiwetqhvokp26upcjwjt"); // int arg2,
-UNSUPPORTED("ebratu77atbhul7tuupzmelvf"); // unsigned char *end)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("169hmon34dm6xedl4afpa0i1j"); // register unsigned char *pfrom = end;
-UNSUPPORTED("b1q68dlnzwnkjo4hd7zcri3hx"); // register unsigned char *pto = end + 5;
-UNSUPPORTED("3022v7vf3t5s8s2dsxql29xo4"); // while (pfrom != loc)
-UNSUPPORTED("648ldcfu6yydgsxc2w4dn9lep"); // *--pto = *--pfrom;
-UNSUPPORTED("cd1n16p68qnglebcy01f0qn6l"); // store_op2 (op, loc, arg1, arg2);
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 e4latxw6wysh73m40r7m5x3jb
-// static boolean at_begline_loc_p(const char *pattern, const char *p, reg_syntax_t syntax)
-public static Object at_begline_loc_p(Object... arg) {
-UNSUPPORTED("etarlz3ybg3wdofiesiw8dwbq"); // static boolean
-UNSUPPORTED("dvoumivore2yi3vu64r9o17rz"); // at_begline_loc_p(const char *pattern,
-UNSUPPORTED("1ysotgxi8uwyxakudbb9firnu"); // const char *p,
-UNSUPPORTED("3yknuo3jrjif745axkby3960n"); // reg_syntax_t syntax)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("8jnr30ihhlcqx0p7qembtdxv2"); // const char *prev = p - 2;
-UNSUPPORTED("7v8vzv9bs9dhey9spvhvxxgyp"); // boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
-UNSUPPORTED("ef16816hd7el6q6461fnw6p1l"); // return
-UNSUPPORTED("dumav0wvej216wv8szi4x00s7"); // /* After a subexpression? */
-UNSUPPORTED("3ki59spy9w7z11gtdahfx1ew3"); // (*prev == '(' && (syntax & (((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) || prev_prev_backslash))
-UNSUPPORTED("ck5g71shir4kf9n8pbhvzz9ti"); // /* After an alternative? */
-UNSUPPORTED("6zvsscasxk7x2dzo9s2jr9okc"); // || (*prev == '|' && (syntax & (((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) || prev_prev_backslash));
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 1c0buhtq2gms7qzzw7ql4drl1
-// static boolean at_endline_loc_p(const char *p, const char *pend, reg_syntax_t syntax)
-public static Object at_endline_loc_p(Object... arg) {
-UNSUPPORTED("etarlz3ybg3wdofiesiw8dwbq"); // static boolean
-UNSUPPORTED("8w70icoej05avtfcbstpra0d"); // at_endline_loc_p(const char *p,
-UNSUPPORTED("eououd67tewr9lfimix16skdn"); // const char *pend,
-UNSUPPORTED("3yknuo3jrjif745axkby3960n"); // reg_syntax_t syntax)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("eh8pwbqqa4049a7x1lhsxtsc1"); // const char *next = p;
-UNSUPPORTED("4wxnm7brzem3ywa9ptyl6m3he"); // boolean next_backslash = *next == '\\';
-UNSUPPORTED("6yvr1bnbn14453b6eonom0ubu"); // const char *next_next = p + 1 < pend ? p + 1 : 0;
-UNSUPPORTED("ef16816hd7el6q6461fnw6p1l"); // return
-UNSUPPORTED("5zilqqenoq1qg4oaqhst16iny"); // /* Before a subexpression? */
-UNSUPPORTED("bt1ckpmadq6m2rwsptz7rdax4"); // (syntax & (((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) ? *next == ')'
-UNSUPPORTED("ch55eypsczed6pggvuky7qg54"); // : next_backslash && next_next && *next_next == ')')
-UNSUPPORTED("cguaa6op9dr0opeabtp5b3ucn"); // /* Before an alternative? */
-UNSUPPORTED("8fq9j881kguwbavolyyz6299l"); // || (syntax & (((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) ? *next == '|'
-UNSUPPORTED("84irf5dgp7xptskletavd7lcl"); // : next_backslash && next_next && *next_next == '|');
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 35rs0qiyjwppzg2ck5atwxnul
-// static boolean group_in_compile_stack(compile_stack_type compile_stack, regnum_t regnum)
-public static Object group_in_compile_stack(Object... arg) {
-UNSUPPORTED("etarlz3ybg3wdofiesiw8dwbq"); // static boolean
-UNSUPPORTED("aja1fo6z3x54rgftvbds69e"); // group_in_compile_stack(compile_stack_type compile_stack,
-UNSUPPORTED("ddun09npytwyxleyy5nr14lky"); // regnum_t regnum)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("dfroqi0gdjuzge2bbdy5jzym0"); // int this_element;
-UNSUPPORTED("cf73uwdus915lin6frmrap08w"); // for (this_element = compile_stack.avail - 1;
-UNSUPPORTED("d8j8jtpe5iq1esx7uzvbvm14l"); // this_element >= 0;
-UNSUPPORTED("1xpv8yktiv0jzqarajl3v79zc"); // this_element--)
-UNSUPPORTED("bq2imq1log4s4jzgs1z1rv2lj"); // if (compile_stack.stack[this_element].regnum == regnum)
-UNSUPPORTED("8qe9dt2l8vdfqmmg989im37zb"); // return 1;
-UNSUPPORTED("5oxhd3fvp0gfmrmz12vndnjt"); // return 0;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 b8zwgtmxpoyrzfdfecydtrxda
-// static reg_errcode_t compile_range(const char **p_ptr, const char *pend, char * translate, reg_syntax_t syntax, unsigned char *b)
-public static Object compile_range(Object... arg) {
-UNSUPPORTED("9aerjmw5n52ektwk47t1r9bh0"); // static reg_errcode_t
-UNSUPPORTED("banxmfbwacgp17kgyqg9m8x68"); // compile_range(const char **p_ptr,
-UNSUPPORTED("ejc17tabtd2x12qzehf5o0sdm"); // const char *pend,
-UNSUPPORTED("cgokv0yhej0pe8aib1t4cxlz2"); // char * translate,
-UNSUPPORTED("1em1aqal71wcsn34n49xy07nb"); // reg_syntax_t syntax,
-UNSUPPORTED("3n1ptb0viq6trnbcy4c86udvu"); // unsigned char *b)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("1m07wmw0rmjh2kja0xep3mall"); // unsigned this_char;
-UNSUPPORTED("yjjwp976mzzqbaq4la5vjvo"); // const char *p = *p_ptr;
-UNSUPPORTED("77gsk1nkdba3ni503f93jkxhi"); // unsigned int range_start, range_end;
-UNSUPPORTED("d8twi4xwvpjc0n8mumv8b1ht6"); // if (p == pend)
-UNSUPPORTED("94ycrvh63vkb1re4zpw8hjmuq"); // return REG_ERANGE;
-UNSUPPORTED("9fsyho4e2hiebyqb8qkinfir7"); // /* Even though the pattern is a signed `char *', we need to fetch
-UNSUPPORTED("3pyxw5ydi3c4tot9rd8kfdojm"); // with unsigned char *'s; if the high bit of the pattern character
-UNSUPPORTED("4cd58zz07lkzfj8p5blv29zy6"); // is set, the range endpoints will be negative if we fetch using a
-UNSUPPORTED("5loab6k7g2in3add2emwojqiz"); // signed char *.
-UNSUPPORTED("ktiibovpw3rzck0paixyi46"); // We also want to fetch the endpoints without translating them; the
-UNSUPPORTED("44ikyyh3eyhoi57l6n4hpq24u"); // appropriate translation is done in the bit-setting loop below. */
-UNSUPPORTED("234jza0nhkmiwh04ymakixz0n"); // /* The SVR4 compiler on the 3B2 had trouble with unsigned const char *. */
-UNSUPPORTED("bakbcowbgzdyup9hjat04heth"); // range_start = ((const unsigned char *) p)[-2];
-UNSUPPORTED("6thno4r8eqqdp5ffdk4l4xs3o"); // range_end = ((const unsigned char *) p)[0];
-UNSUPPORTED("eyt8946jvpa0gtrnsnyalwh7j"); // /* Have to increment the pointer into the pattern string, so the
-UNSUPPORTED("3xddmz8ld8kco5vdujzs1mda5"); // caller isn't still at the ending character. */
-UNSUPPORTED("3fa4923s6t6yycjm4mwp7vra6"); // (*p_ptr)++;
-UNSUPPORTED("deim4fwtozk7jqq58t4co6tpz"); // /* If the start is after the end, the range is empty. */
-UNSUPPORTED("a8txh7awa0h63gqw46mc6cesc"); // if (range_start > range_end)
-UNSUPPORTED("4heoi1bxvv6q4nbsuw4o3n2up"); // return syntax & ((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) ? REG_ERANGE : REG_NOERROR;
-UNSUPPORTED("c04gtbipb7crea92dxobvfr2o"); // /* Here we see why `this_char' has to be larger than an `unsigned
-UNSUPPORTED("1ylkxbvyuwl7mimub9q6r3fad"); // char' -- the range is inclusive, so if `range_end' == 0xff
-UNSUPPORTED("1sabxy9r3dw93krw4s4a7jvs5"); // (assuming 8-bit characters), we would otherwise go into an infinite
-UNSUPPORTED("akcgy517agwm89djtay996rlu"); // loop, since all characters <= 0xff. */
-UNSUPPORTED("8ascd4lg2uczakrabmoc2tbxc"); // for (this_char = range_start; this_char <= range_end; this_char++)
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("96hzw7fz10m1eg84p3h8xw6md"); // (b[((unsigned char) ((translate ? (char) translate[(unsigned char) (this_char)] : (this_char)))) / 8] |= 1 << (((unsigned char) (translate ? (char) translate[(unsigned char) (this_char)] : (this_char))) % 8));
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("cwwrkrko9fc4redgkt1b13h6d"); // return REG_NOERROR;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 2w5dx8i20qj29gqbasz6ieo34
-// int re_compile_fastmap(struct re_pattern_buffer *bufp)
-public static Object re_compile_fastmap(Object... arg) {
-UNSUPPORTED("etrjsq5w49uo9jq5pzifohkqw"); // int
-UNSUPPORTED("bq6qjjl5z4ymj67dzg1sxznk"); // re_compile_fastmap(struct re_pattern_buffer *bufp)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("9e6bnowy6jfhnib5uev3scpsu"); // int j, k;
-UNSUPPORTED("5dndxq85ri0pdc1zsswjws66p"); // fail_stack_type fail_stack;
-UNSUPPORTED("5vwwchpo0x2nq1kweizvzpx7r"); // char *destination;
-UNSUPPORTED("4hjgjnhp72gq4oozv5vrn8v10"); // register char *fastmap = bufp->fastmap;
-UNSUPPORTED("1j52put1dns981rqf534qs3le"); // unsigned char *pattern = bufp->buffer;
-UNSUPPORTED("1jmcmh4kbvfcpijmdwn6jc3nj"); // unsigned char *p = pattern;
-UNSUPPORTED("b53ls4akw5mhgh7jwfepoi7vo"); // register unsigned char *pend = pattern + bufp->used;
-UNSUPPORTED("cs2p9nwy2lugscf16o02dzs8e"); // /* Assume that each path through the pattern can be null until
-UNSUPPORTED("9dmmpbml2ftmau9q3col8nnct"); // proven otherwise. We set this false at the bottom of switch
-UNSUPPORTED("b68s3vc4td13a333tqb4omf2a"); // statement, to which we get only if a particular path doesn't
-UNSUPPORTED("et7h2ks857zgdavpz3yc5qe44"); // match the empty string. */
-UNSUPPORTED("51ynrqjxzi49qavh1cav2tkft"); // boolean path_can_be_null = 1;
-UNSUPPORTED("1gbvpj2yj85p505am5rilkj6r"); // /* We aren't doing a `succeed_n' to begin with. */
-UNSUPPORTED("5xxc75r9op15sgdu02o4lgxav"); // boolean succeed_n_p = 0;
-UNSUPPORTED("5i0sddp616zsw63jk38od62l4"); // ;
-UNSUPPORTED("bbul77ox50tuvngn3t4agr5uo"); // do { fail_stack.stack = (fail_stack_elt_t *) alloca (5 * sizeof (fail_stack_elt_t)); if (fail_stack.stack == (void *)0) return -2; fail_stack.size = 5; fail_stack.avail = 0; } while (0);
-UNSUPPORTED("bzen69xwi5iake0fs9avj7zyk"); // bzero (fastmap, 1 << 8); /* Assume nothing's valid. */
-UNSUPPORTED("5t1sb7m6db0rmhvndw9dbiev3"); // bufp->fastmap_accurate = 1; /* It will be when we're done. */
-UNSUPPORTED("6jtlz1qyfqnlyp421hyq8of6x"); // bufp->can_be_null = 0;
-UNSUPPORTED("epinmskuv2cgr5ahv1yieh4wx"); // while (1)
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("d9novosz5eiozbi3d0qtrp39a"); // if (p == pend || *p == succeed)
-UNSUPPORTED("9ua540u2gx5jpu302s81qfxhi"); // {
-UNSUPPORTED("6kmea0xiqrfcm0nj8n7td2oex"); // /* We have reached the (effective) end of pattern. */
-UNSUPPORTED("m3xwmrnky21zpg13i5rj47jr"); // if (!(fail_stack.avail == 0))
-UNSUPPORTED("5k2digv672hnrndhc9ktw0oii"); // {
-UNSUPPORTED("44fedf1x4d76z1qso6huhgzfg"); // bufp->can_be_null |= path_can_be_null;
-UNSUPPORTED("dr8ubpktswy9oks8vqmi0x94x"); // /* Reset for next path. */
-UNSUPPORTED("cqqk40u5ykr4up1khyq0hdreu"); // path_can_be_null = 1;
-UNSUPPORTED("701062lrplwck0vemijk6tqcn"); // p = fail_stack.stack[--fail_stack.avail].pointer;
-UNSUPPORTED("9rd1yahrea8hsebjyzzz61sl3"); // continue;
-UNSUPPORTED("b86ovw6olwwo6gnqlt1wqqzb4"); // }
-UNSUPPORTED("cunk7vpvzj28y1x4gn62gxpce"); // else
-UNSUPPORTED("605r8o1isen77125aqrohs6ac"); // break;
-UNSUPPORTED("7nxu74undh30brb8laojud3f9"); // }
-UNSUPPORTED("a9id4zq8rzlovc4blpl12mdrm"); // /* We should never be about to go beyond the end of the pattern. */
-UNSUPPORTED("cf8srqrmhz47tb7zdgoe9ufhv"); // ;
-UNSUPPORTED("3d9jhchhw3lu8yajca4mi058b"); // switch (((re_opcode_t) *p++))
-UNSUPPORTED("9ua540u2gx5jpu302s81qfxhi"); // {
-UNSUPPORTED("6y2d5u8u0sy9seg0d2wbqhh5e"); // /* I guess the idea here is to simply not bother with a fastmap
-UNSUPPORTED("mj34lm9e61u2qvfpqzkhd5io"); // if a backreference is used, since it's too hard to figure out
-UNSUPPORTED("9citude1apedkbhbg4qz50zt8"); // the fastmap for the corresponding group. Setting
-UNSUPPORTED("a0ktcb92qa12q41u9ncckmzua"); // `can_be_null' stops `re_search_2' from using the fastmap, so
-UNSUPPORTED("4rjoi86n2xfyhdheaakalexzv"); // that is all we do. */
-UNSUPPORTED("9zkejga7r0tbainhrb6zuw9os"); // case duplicate:
-UNSUPPORTED("crvpgpa1og37lio7o6tvycmsg"); // bufp->can_be_null = 1;
-UNSUPPORTED("7s6msojra17ajwq7l7wrmhhbx"); // goto done;
-UNSUPPORTED("cr9angfhvv1ykkzaoo7x91pyz"); // /* Following are the cases which match a character. These end
-UNSUPPORTED("5u9igxod775u9rmzhdtoj0uux"); // with `break'. */
-UNSUPPORTED("cw984demptqbnja38a25p2xi1"); // case exactn:
-UNSUPPORTED("99pcdhcif67xm8lp80laisjza"); // fastmap[p[1]] = 1;
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("2ro4nzmlhhrmitxu9446arhlo"); // case charset:
-UNSUPPORTED("d5oxjemm2desl63l2fbifejay"); // for (j = *p++ * 8 - 1; j >= 0; j--)
-UNSUPPORTED("34lg6n1mkddxpy07uf61o2pq1"); // if (p[j / 8] & (1 << (j % 8)))
-UNSUPPORTED("ac5wgoqadttw9m0eqkmq93vpu"); // fastmap[j] = 1;
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("2zj0t91dpl66cu75cb0h2j1hu"); // case charset_not:
-UNSUPPORTED("cagpd8yl8h3c4v8e4gh3f0z2w"); // /* Chars beyond end of map must be allowed. */
-UNSUPPORTED("7zzkrrvc3sqjxvhrr4s309imh"); // for (j = *p * 8; j < (1 << 8); j++)
-UNSUPPORTED("b1s3rgvbln9pwub90llybu41x"); // fastmap[j] = 1;
-UNSUPPORTED("d5oxjemm2desl63l2fbifejay"); // for (j = *p++ * 8 - 1; j >= 0; j--)
-UNSUPPORTED("a9l035zjjirwoyk53mqv16l5n"); // if (!(p[j / 8] & (1 << (j % 8))))
-UNSUPPORTED("ac5wgoqadttw9m0eqkmq93vpu"); // fastmap[j] = 1;
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("buxp1030z7swkjl42wovj9hxd"); // case wordchar:
-UNSUPPORTED("erc7fe209pzd8kqxh3h4huo03"); // for (j = 0; j < (1 << 8); j++)
-UNSUPPORTED("e6f90hjwdfaen2gl195u9sabh"); // if (re_syntax_table[j] == 1)
-UNSUPPORTED("ac5wgoqadttw9m0eqkmq93vpu"); // fastmap[j] = 1;
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("7frlpnfuvuphd3bzoulwg4vsr"); // case notwordchar:
-UNSUPPORTED("erc7fe209pzd8kqxh3h4huo03"); // for (j = 0; j < (1 << 8); j++)
-UNSUPPORTED("d6si8hs1n9s2q5b16vyt9ka5x"); // if (re_syntax_table[j] != 1)
-UNSUPPORTED("ac5wgoqadttw9m0eqkmq93vpu"); // fastmap[j] = 1;
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("1bv8e740f9rna5i036bo292wc"); // case anychar:
-UNSUPPORTED("4vdjxw5o61xlsk38ouw1wsypc"); // {
-UNSUPPORTED("czlnu0hbyndj2sl7bud8algx4"); // int fastmap_newline = fastmap['\n'];
-UNSUPPORTED("2q6r1vdt5x04pt3p41rzto4yl"); // /* `.' matches anything ... */
-UNSUPPORTED("5ftk445qjdfu62ddixb4p6q0i"); // for (j = 0; j < (1 << 8); j++)
-UNSUPPORTED("ac5wgoqadttw9m0eqkmq93vpu"); // fastmap[j] = 1;
-UNSUPPORTED("93vg14cvrax6ffdlubqre52zy"); // /* ... except perhaps newline. */
-UNSUPPORTED("53qidfpnvywpfz8jbsitg0hk2"); // if (!(bufp->syntax & ((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1)))
-UNSUPPORTED("9wuk4mwn83ls1g7lick6497yp"); // fastmap['\n'] = fastmap_newline;
-UNSUPPORTED("e47uuia66ybg7wem8m4h8zf1m"); // /* Return if we have already set `can_be_null'; if we have,
-UNSUPPORTED("5o7fl6yjw81x2g5sww79aih3s"); // then the fastmap is irrelevant. Something's wrong here. */
-UNSUPPORTED("3750ces0c2deqeyn6w33ndhis"); // else if (bufp->can_be_null)
-UNSUPPORTED("380tmjmsc0f2y0m6vckz8g0ox"); // goto done;
-UNSUPPORTED("4nfkkkamxp2xfq2r2eg5c5880"); // /* Otherwise, have to check alternative paths. */
-UNSUPPORTED("605r8o1isen77125aqrohs6ac"); // break;
-UNSUPPORTED("3e08x1y395304nd0y3uwffvim"); // }
-UNSUPPORTED("anhhi3sf756j0lcm11sy9nyfc"); // case no_op:
-UNSUPPORTED("7zj5ggx1l6hln4ude6h5p4hgw"); // case begline:
-UNSUPPORTED("8pqai98vstdak51ot078dn1ut"); // case endline:
-UNSUPPORTED("889sq08u5lsi3c6y2z7adu8ex"); // case begbuf:
-UNSUPPORTED("cx4ezn3s02koh0pq7idm2xvxc"); // case endbuf:
-UNSUPPORTED("a8jtmsnmpa4937exo9nhopyyb"); // case wordbound:
-UNSUPPORTED("2jqqzr491mztwr9h8hvs55ja1"); // case notwordbound:
-UNSUPPORTED("991vlwoc47i8p67jyv2qapdhy"); // case wordbeg:
-UNSUPPORTED("65os7te2jc1i6uacyszvy5spd"); // case wordend:
-UNSUPPORTED("9446ac5zvkn7r9yqkh2brh10l"); // case push_dummy_failure:
-UNSUPPORTED("ci4p4wle87mwq773w72esmnae"); // continue;
-UNSUPPORTED("f41u8fntqiy246yy3btlg6w1v"); // case jump_n:
-UNSUPPORTED("6coluo8cd7scxlqwnbvt3jqs5"); // case pop_failure_jump:
-UNSUPPORTED("d7ziafib9p2sa0rqh34hv3hwj"); // case maybe_pop_jump:
-UNSUPPORTED("9a1qj2mhg3oh4ehsjpp4d81on"); // case jump:
-UNSUPPORTED("7ifq76or69643hqib3roiq9f4"); // case jump_past_alt:
-UNSUPPORTED("ejqzfph0mmtiqin1hmi981bzm"); // case dummy_failure_jump:
-UNSUPPORTED("ddwq2jxcrhkxhe1dqkaf3heul"); // do { do { (j) = *(p) & 0377; (j) += ((((unsigned char) (*((p) + 1))) ^ 128) - 128) << 8; } while (0); (p) += 2; } while (0);
-UNSUPPORTED("3s98ctay3wrlwmgbs6jycommh"); // p += j;
-UNSUPPORTED("4aknhsfjvky2yxmkba43w40on"); // if (j > 0)
-UNSUPPORTED("6ux57x1tcbm5aung2xa8i26f1"); // continue;
-UNSUPPORTED("1gcc9mlki3vcqxqcamgw15psl"); // /* Jump backward implies we just went through the body of a
-UNSUPPORTED("dhbf21he6r14900wxjfhl23n8"); // loop and matched nothing. Opcode jumped to should be
-UNSUPPORTED("b1z48ihpqy8w68mtnyaogzkre"); // `on_failure_jump' or `succeed_n'. Just treat it like an
-UNSUPPORTED("8sudhkuaiqtvp0rzeztrzphwa"); // ordinary jump. For a * loop, it has pushed its failure
-UNSUPPORTED("14e2cgrthjy5xos3c84nxu3b8"); // point already; if so, discard that as redundant. */
-UNSUPPORTED("eq8dnm5llhgszut0h62teamny"); // if ((re_opcode_t) *p != on_failure_jump
-UNSUPPORTED("8sbpd0r7b4u37kj9inzim8nty"); // && (re_opcode_t) *p != succeed_n)
-UNSUPPORTED("6ux57x1tcbm5aung2xa8i26f1"); // continue;
-UNSUPPORTED("4s6jr3tssbvzb5ee96md1ncoi"); // p++;
-UNSUPPORTED("ddwq2jxcrhkxhe1dqkaf3heul"); // do { do { (j) = *(p) & 0377; (j) += ((((unsigned char) (*((p) + 1))) ^ 128) - 128) << 8; } while (0); (p) += 2; } while (0);
-UNSUPPORTED("3s98ctay3wrlwmgbs6jycommh"); // p += j;
-UNSUPPORTED("7s373wkpewfatxsumkd67pyu7"); // /* If what's on the stack is where we are now, pop it. */
-UNSUPPORTED("80wyvh0vjsiujqym2stjdj4wh"); // if (!(fail_stack.avail == 0)
-UNSUPPORTED("a3ueg01xdmhuq0grmerpgbvbb"); // && fail_stack.stack[fail_stack.avail - 1].pointer == p)
-UNSUPPORTED("3s1nxe7g3rfik4tqx98en3cd8"); // fail_stack.avail--;
-UNSUPPORTED("ci4p4wle87mwq773w72esmnae"); // continue;
-UNSUPPORTED("992rmruvdtrxnk46307iiqyjo"); // case on_failure_jump:
-UNSUPPORTED("753el6ua6knou432p32d1kbcc"); // case on_failure_keep_string_jump:
-UNSUPPORTED("ceceofttw3ld7litzqabu648u"); // handle_on_failure_jump:
-UNSUPPORTED("665sufie9pj8i06aycoqewann"); // do { do { (j) = *(p) & 0377; (j) += ((((unsigned char) (*((p) + 1))) ^ 128) - 128) << 8; } while (0); (p) += 2; } while (0);
-UNSUPPORTED("dc5yaeh41cb0brsq1pv7799eq"); // /* For some patterns, e.g., `(a?)?', `p+j' here points to the
-UNSUPPORTED("2t3hud6hrminx80odtyp1iwa7"); // end of the pattern. We don't want to push such a point,
-UNSUPPORTED("547mpa99j3jp91cc97q8bgppy"); // since when we restore it above, entering the switch will
-UNSUPPORTED("d41nubecflssie5s3le3qh9ij"); // increment `p' past the end of the pattern. We don't need
-UNSUPPORTED("2a6fei9v5xjokdzwz2ib426kh"); // to push such a point since we obviously won't find any more
-UNSUPPORTED("9kvyfd4vo7d8i4eapffyigb8w"); // fastmap entries beyond `pend'. Such a pattern can match
-UNSUPPORTED("921h84ug24r379ndj6u4ti857"); // the null string, though. */
-UNSUPPORTED("a3exq030sp29tpsjuxvbncjka"); // if (p + j < pend)
-UNSUPPORTED("4vdjxw5o61xlsk38ouw1wsypc"); // {
-UNSUPPORTED("6actr5ig2vfyitfzjmpn5gcvs"); // if (!(((fail_stack.avail == fail_stack.size) && !((fail_stack).size > (unsigned) (re_max_failures * (5 * 3 + 4)) ? 0 : ((fail_stack).stack = (fail_stack_elt_t *) (destination = (char *) alloca (((fail_stack).size << 1) * sizeof(fail_stack_elt_t)), bcopy ((fail_stack).stack, destination, (fail_stack).size * sizeof(fail_stack_elt_t)), destination), (fail_stack).stack == (void *)0 ? 0 : ((fail_stack).size <<= 1, 1)))) ? 0 : ((fail_stack).stack[(fail_stack).avail++].pointer = p + j, 1)))
-UNSUPPORTED("9aq2ft2quyeattze0cwemwweo"); // {
-UNSUPPORTED("9fy78dg2q1uu4c2t1zsyaestf"); // ;
-UNSUPPORTED("cyqv0odsj3l93ykpf16zgxlh5"); // return -2;
-UNSUPPORTED("13jcwbk3vyfh9xrmwi5hbe7so"); // }
-UNSUPPORTED("3e08x1y395304nd0y3uwffvim"); // }
-UNSUPPORTED("c0op0grmjt3kp22s10twqy66r"); // else
-UNSUPPORTED("crvpgpa1og37lio7o6tvycmsg"); // bufp->can_be_null = 1;
-UNSUPPORTED("3rb9irs4dl9mnesxjmb9f42vt"); // if (succeed_n_p)
-UNSUPPORTED("4vdjxw5o61xlsk38ouw1wsypc"); // {
-UNSUPPORTED("vdcz3hf29s758qnvg2tdn3vc"); // do { do { (k) = *(p) & 0377; (k) += ((((unsigned char) (*((p) + 1))) ^ 128) - 128) << 8; } while (0); (p) += 2; } while (0); /* Skip the n. */
-UNSUPPORTED("501xoe7qse6xea1u7i29ck0mi"); // succeed_n_p = 0;
-UNSUPPORTED("3e08x1y395304nd0y3uwffvim"); // }
-UNSUPPORTED("bam1am28aekae7y6j816hx07n"); // continue;
-UNSUPPORTED("bdrmz6krrbsihqbsklz1j7d7a"); // case succeed_n:
-UNSUPPORTED("3gsxz3wc6v485diavavhdc980"); // /* Get to the number of times to succeed. */
-UNSUPPORTED("8mazj3o2k4ts6oo83xpc0clf6"); // p += 2;
-UNSUPPORTED("8o2myd39fg1ragrtinpt906a8"); // /* Increment p past the n for when k != 0. */
-UNSUPPORTED("4chyl5sa2aguucbi2603y1r7c"); // do { do { (k) = *(p) & 0377; (k) += ((((unsigned char) (*((p) + 1))) ^ 128) - 128) << 8; } while (0); (p) += 2; } while (0);
-UNSUPPORTED("6zxjfjfmip0xaqdemcjjztblg"); // if (k == 0)
-UNSUPPORTED("5k2digv672hnrndhc9ktw0oii"); // {
-UNSUPPORTED("b4wfmlrv6zbxvwrfouk2eo7kw"); // p -= 4;
-UNSUPPORTED("909biyv92rbqo3ayb2nd8yidv"); // succeed_n_p = 1; /* Spaghetti code alert. */
-UNSUPPORTED("1ubpxbj2kbf7554qirpm1k0mw"); // goto handle_on_failure_jump;
-UNSUPPORTED("b86ovw6olwwo6gnqlt1wqqzb4"); // }
-UNSUPPORTED("ci4p4wle87mwq773w72esmnae"); // continue;
-UNSUPPORTED("dmqxgjrlj5ddxj88dw919ujoj"); // case set_number_at:
-UNSUPPORTED("9stirsnvehglwumsosptm8ngk"); // p += 4;
-UNSUPPORTED("ci4p4wle87mwq773w72esmnae"); // continue;
-UNSUPPORTED("6c0ei34e676sv2kl1dxfzm5lm"); // case start_memory:
-UNSUPPORTED("3q89uw4g68y7kyiitvliyykpb"); // case stop_memory:
-UNSUPPORTED("8mazj3o2k4ts6oo83xpc0clf6"); // p += 2;
-UNSUPPORTED("ci4p4wle87mwq773w72esmnae"); // continue;
-UNSUPPORTED("comxch6w0lbi64ejq9m4p0u7o"); // default:
-UNSUPPORTED("55kbrxcqu6yyh19ldzw88t99r"); // abort (); /* We have listed all the cases. */
-UNSUPPORTED("88ufjis6u0ijo8dyph0trsd9f"); // } /* switch *p++ */
-UNSUPPORTED("cwq7qsz40n4bhj5dg5eym4pub"); // /* Getting here means we have found the possible starting
-UNSUPPORTED("9cuw6gsavq5jezett5z0kqhtr"); // characters for one path of the pattern -- and that the empty
-UNSUPPORTED("1nuw25jxiky0vsokzstwqjshg"); // string does not match. We need not follow this path further.
-UNSUPPORTED("ir1qnihuj9d2pchsx533wqak"); // Instead, look at the next alternative (remembered on the
-UNSUPPORTED("2yh8to75n640o6rt44ql2gpr1"); // stack), or quit if no more. The test at the top of the loop
-UNSUPPORTED("48eepx7kyfmje1rnq1bcr79sq"); // does these things. */
-UNSUPPORTED("7b7dtwbvg82guicn1qbjlrm0i"); // path_can_be_null = 0;
-UNSUPPORTED("9iqvxxuyvmn0bkipb04jv1fp2"); // p = pend;
-UNSUPPORTED("8qk14yz36d7vk72ifwa7qiujq"); // } /* while p */
-UNSUPPORTED("fe2n2uj632yqtenyvepbd4on"); // /* Set `can_be_null' for the last path (also the first path, if the
-UNSUPPORTED("eoc9k5utu0yxlarln062f7ebo"); // pattern is empty). */
-UNSUPPORTED("3uys3oae24dxx6zj9f9r0b80z"); // bufp->can_be_null |= path_can_be_null;
-UNSUPPORTED("c1mu8v1bx1gc9xwu0pmd4wrmg"); // done:
-UNSUPPORTED("5i0sddp616zsw63jk38od62l4"); // ;
-UNSUPPORTED("5oxhd3fvp0gfmrmz12vndnjt"); // return 0;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 aql5ifimwt0liaidklmsf048e
-// void re_set_registers(struct re_pattern_buffer *bufp, struct re_registers *regs, unsigned num_regs, regoff_t *starts, regoff_t *ends)
-public static Object re_set_registers(Object... arg) {
-UNSUPPORTED("c01vxogao855zs8fe94tpim9g"); // void
-UNSUPPORTED("4aeowny9csghzgfhys3rxd4bb"); // re_set_registers(struct re_pattern_buffer *bufp,
-UNSUPPORTED("v08al94r6tf851td77qv1lrw"); // struct re_registers *regs,
-UNSUPPORTED("cws3mkdihiuxfnp7ty29mle8p"); // unsigned num_regs,
-UNSUPPORTED("3bn37bfn6icqtacq0lj8zj9cg"); // regoff_t *starts,
-UNSUPPORTED("aqc83ygcz30vhx0fxtyw3a3gc"); // regoff_t *ends)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("d3ztzcne2cr4fi3m42q2opwfy"); // if (num_regs)
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("9z36hkw7bkc2nch28htx6k0sp"); // bufp->regs_allocated = 1;
-UNSUPPORTED("atb5wuee0ohtv7w4cswzrtdfh"); // regs->num_regs = num_regs;
-UNSUPPORTED("6xqxd9992s4jjhafwdu58y4w3"); // regs->start = starts;
-UNSUPPORTED("1dplqbibwb9py7ly7iqtemaka"); // regs->end = ends;
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("div10atae09n36x269sl208r1"); // else
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("5err36958fxwo1a5uvi85wj9r"); // bufp->regs_allocated = 0;
-UNSUPPORTED("3jgm69kgp5moxxlzgyht3brgv"); // regs->num_regs = 0;
-UNSUPPORTED("1b975m061jnwz38mhlafj6a72"); // regs->start = regs->end = (regoff_t *) 0;
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 8wxth458oyuuwe1d7zeibvlq3
-// int re_search(struct re_pattern_buffer *bufp, const char *string, int size, int startpos, int range, struct re_registers *regs)
-public static Object re_search(Object... arg) {
-UNSUPPORTED("etrjsq5w49uo9jq5pzifohkqw"); // int
-UNSUPPORTED("5punk3p7482f96e5oexdvqbus"); // re_search(struct re_pattern_buffer *bufp,
-UNSUPPORTED("bagvrj9iq4kkqcdgysmduv9t1"); // const char *string,
-UNSUPPORTED("1xy13yd3ws9kwbjft9qc97kcx"); // int size,
-UNSUPPORTED("9ohmanngcm89n339btr8asvfv"); // int startpos,
-UNSUPPORTED("23b7j6n4wp3b1b28bigxtgmnl"); // int range,
-UNSUPPORTED("erz9qq7ug4oj13nqxxy6jbbsy"); // struct re_registers *regs)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("5eefi20lbvtfppz7qla7ovjwv"); // return re_search_2 (bufp, (void *)0, 0, string, size, startpos, range,
-UNSUPPORTED("et83rvt66i87q8ub41vrx6w5v"); // regs, size);
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 6aljedusbc3m5z49o0khre2m2
-// int re_search_2(struct re_pattern_buffer *bufp, const char *string1, int size1, const char *string2, int size2, int startpos, int range, struct re_registers *regs, int stop)
-public static Object re_search_2(Object... arg) {
-UNSUPPORTED("etrjsq5w49uo9jq5pzifohkqw"); // int
-UNSUPPORTED("5usfyqpnmi7csbuxwbxofoyw7"); // re_search_2(struct re_pattern_buffer *bufp,
-UNSUPPORTED("74m54b0hvpnb34rks2y7z9363"); // const char *string1,
-UNSUPPORTED("8nls60axvgy7utfkk3mgzdwb2"); // int size1,
-UNSUPPORTED("1iaduxc33uthqae9ewpgmxil1"); // const char *string2,
-UNSUPPORTED("dqei6asi26pdc31aztct1a8je"); // int size2,
-UNSUPPORTED("3w9t84zdf75a4tulh53r5von1"); // int startpos,
-UNSUPPORTED("5u62quyw1qekgwt8o4pnjcc5l"); // int range,
-UNSUPPORTED("5f39e12vpxsielezt5ujbqvho"); // struct re_registers *regs,
-UNSUPPORTED("7bd44vcdrb5ytkbgi2jb4dl2s"); // int stop)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("3z4qqbm5080y3sn2lfr6rs0nk"); // int val;
-UNSUPPORTED("4hjgjnhp72gq4oozv5vrn8v10"); // register char *fastmap = bufp->fastmap;
-UNSUPPORTED("e2n10ohqvssxiromz1ghi94lp"); // register char * translate = bufp->translate;
-UNSUPPORTED("iaij8d98sbsjgborym38smlw"); // int total_size = size1 + size2;
-UNSUPPORTED("cjv924qhstzo4k8fa23nn3y5t"); // int endpos = startpos + range;
-UNSUPPORTED("7etis36i9hk8smvitf2zjrk21"); // /* Check for out-of-range STARTPOS. */
-UNSUPPORTED("dtj4vp5xpp6ux07kkppwzg5ao"); // if (startpos < 0 || startpos > total_size)
-UNSUPPORTED("f3a98gxettwtewduvje9y3524"); // return -1;
-UNSUPPORTED("abu2iwp6rjr8ppylnna5u9yqs"); // /* Fix up RANGE if it might eventually take us outside
-UNSUPPORTED("9hmt2lbj7vhejhpf2d95tq14f"); // the virtual concatenation of STRING1 and STRING2.
-UNSUPPORTED("d3ccdgft2wzndli7yy75yesc6"); // Make sure we won't move STARTPOS below 0 or above TOTAL_SIZE. */
-UNSUPPORTED("7ynt8jnrj8clotz4nfyn2ysy9"); // if (endpos < 0)
-UNSUPPORTED("5ra97p6qdpo5phvpk9fwd2h3j"); // range = 0 - startpos;
-UNSUPPORTED("9w57i1mbsaq0ywxj3y6q7577v"); // else if (endpos > total_size)
-UNSUPPORTED("6boq6ulbdze7abapaemgg7svh"); // range = total_size - startpos;
-UNSUPPORTED("ds4p5oizcxuw4xycv8l0vcqdv"); // /* If the search isn't to be a backwards one, don't waste time in a
-UNSUPPORTED("djej1eoe004hvk7gffedre39u"); // search for a pattern that must be anchored. */
-UNSUPPORTED("cvy0dazfbe38ki1z0hsl3dn1l"); // if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == begbuf && range > 0)
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("bpeukjf6wgkfxtlskf398co2v"); // if (startpos > 0)
-UNSUPPORTED("1bjpmpr3p20x2b029ko5zgklx"); // return -1;
-UNSUPPORTED("1knjyao8ci3w18zqqcnmnitir"); // else
-UNSUPPORTED("ad8lfo0w7g7423hbhmk3ljtia"); // range = 1;
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("86solugecvztzl7zf0cnd6cvd"); // /* Update the fastmap now if not correct already. */
-UNSUPPORTED("1d8z3kbyyw3rdl2mysjgwzxjl"); // if (fastmap && !bufp->fastmap_accurate)
-UNSUPPORTED("ckj45nonmakbapzpe7kn1d15x"); // if (re_compile_fastmap (bufp) == -2)
-UNSUPPORTED("kh5ykxeb4qomvs3j2wfbfj0v"); // return -2;
-UNSUPPORTED("78edqutsfw99a52tozy5vek1b"); // /* Loop through the string, looking for a place to start matching. */
-UNSUPPORTED("3s761dh42eu37yg4q6j6rw0kx"); // for (;;)
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("4sxzib864bpin10halp8eff8a"); // /* If a fastmap is supplied, skip quickly over characters that
-UNSUPPORTED("d5j6rsa3cqak3dmcpdugforyy"); // cannot be the start of a match. If the pattern can match the
-UNSUPPORTED("bwce0xep6mggs5v11uftrozcs"); // null string, however, we don't need to skip characters; we want
-UNSUPPORTED("12gdm8hdukh6bx7z396xe3zzf"); // the first null string. */
-UNSUPPORTED("cj0pagb4mphhjuy0gimrygb50"); // if (fastmap && startpos < total_size && !bufp->can_be_null)
-UNSUPPORTED("9ua540u2gx5jpu302s81qfxhi"); // {
-UNSUPPORTED("6ofes2gdk56aoc5qpr3f4zr4a"); // if (range > 0) /* Searching forwards. */
-UNSUPPORTED("5k2digv672hnrndhc9ktw0oii"); // {
-UNSUPPORTED("67v7cteuwrvbevvug4l85mak"); // register const char *d;
-UNSUPPORTED("25rc040ywtpg6wfpwl19bnpyo"); // register int lim = 0;
-UNSUPPORTED("9qdwkju7e5sftfnsb8qapaizw"); // int irange = range;
-UNSUPPORTED("1wkzshwijxvvgs068kb4ducku"); // if (startpos < size1 && startpos + range >= size1)
-UNSUPPORTED("eiy4fhjr94xbrb2h7bvte577b"); // lim = range - (size1 - startpos);
-UNSUPPORTED("eu28a1ugba5e46l0ni4uhl4a"); // d = (startpos >= size1 ? string2 - size1 : string1) + startpos;
-UNSUPPORTED("cvmf6f97q523j1gxuc06p4zaw"); // /* Written out as an if-else to avoid testing `translate'
-UNSUPPORTED("42arvib5v1138qds1m4gq8ifq"); // inside the loop. */
-UNSUPPORTED("c1esipwvnh5vdk2nuoqprrzy9"); // if (translate)
-UNSUPPORTED("99bsp1v6500gcigrncj819bmz"); // while (range > lim
-UNSUPPORTED("7dwf7n5ce54ua4203lrcvsgyi"); // && !fastmap[(unsigned char)
-UNSUPPORTED("7fd297npapod0yzvmotp0ad6j"); // translate[(unsigned char) *d++]])
-UNSUPPORTED("ede1n2qkk5dq4dchoitn0ij36"); // range--;
-UNSUPPORTED("ex6jbb36b02x7vzl22fq0yh2l"); // else
-UNSUPPORTED("d6y3y331fli9a7o5dfc8fwn41"); // while (range > lim && !fastmap[(unsigned char) *d++])
-UNSUPPORTED("ede1n2qkk5dq4dchoitn0ij36"); // range--;
-UNSUPPORTED("7ov5wkldv7ip6gr3qqe7r9fwz"); // startpos += irange - range;
-UNSUPPORTED("b86ovw6olwwo6gnqlt1wqqzb4"); // }
-UNSUPPORTED("bvrbbagbquje7me47zpel7bq4"); // else /* Searching backwards. */
-UNSUPPORTED("5k2digv672hnrndhc9ktw0oii"); // {
-UNSUPPORTED("84cdrx9bovy6vauwg0lqjqewy"); // register char c = (size1 == 0 || startpos >= size1
-UNSUPPORTED("4e056gfwhytvjg4a7elynhkew"); // ? string2[startpos - size1]
-UNSUPPORTED("8xrw0w684a0sbx04150wtf94o"); // : string1[startpos]);
-UNSUPPORTED("37wt6pwingk4yq2cmuffily2s"); // if (!fastmap[(unsigned char) (translate ? (char) translate[(unsigned char) (c)] : (c))])
-UNSUPPORTED("8vj5bzh7lvr4w2s7svhv0kgxc"); // goto advance;
-UNSUPPORTED("b86ovw6olwwo6gnqlt1wqqzb4"); // }
-UNSUPPORTED("7nxu74undh30brb8laojud3f9"); // }
-UNSUPPORTED("cgimbkjo920x6t1512vxlx8ko"); // /* If can't match the null string, and that's all we have left, fail. */
-UNSUPPORTED("445mlipz9ii8giv4yb08sv90e"); // if (range >= 0 && startpos == total_size && fastmap
-UNSUPPORTED("10kowgvu386ep80mmzt22sc9v"); // && !bufp->can_be_null)
-UNSUPPORTED("1bjpmpr3p20x2b029ko5zgklx"); // return -1;
-UNSUPPORTED("5ry8yqv40slwqwx0mofc5x95i"); // val = re_match_2_internal (bufp, string1, size1, string2, size2,
-UNSUPPORTED("3cfs2qe5fkkt6t09tbm9q025r"); // startpos, regs, stop);
-UNSUPPORTED("2djilouwt96a4942a9xk0bq2j"); // if (val >= 0)
-UNSUPPORTED("4bosd0hhkhi65o9tz6w39sd4r"); // return startpos;
-UNSUPPORTED("7mnsrrb2kz0jaysx2jmdwxxhs"); // if (val == -2)
-UNSUPPORTED("9hr24f7mnlogxg6ehbtrhe9ys"); // return -2;
-UNSUPPORTED("5ztyn3js8nuvtozugmyim7k2"); // advance:
-UNSUPPORTED("48h8uf83j8j6i9dl6uwpnxoai"); // if (!range)
-UNSUPPORTED("d1pumbibe8xz2i7gr1wj6zdak"); // break;
-UNSUPPORTED("9qvrpsi6e30j6d028sbxm75m8"); // else if (range > 0)
-UNSUPPORTED("9ua540u2gx5jpu302s81qfxhi"); // {
-UNSUPPORTED("9tfu9zglyv6ato7noi8by9cx7"); // range--;
-UNSUPPORTED("bpejet1xdfpyxq7gb5gygl6c6"); // startpos++;
-UNSUPPORTED("7nxu74undh30brb8laojud3f9"); // }
-UNSUPPORTED("1knjyao8ci3w18zqqcnmnitir"); // else
-UNSUPPORTED("9ua540u2gx5jpu302s81qfxhi"); // {
-UNSUPPORTED("c1l5bq4p029ozyiuq76a11c6c"); // range++;
-UNSUPPORTED("1fnqbyp4904zoq2u6a0h2xo1u"); // startpos--;
-UNSUPPORTED("7nxu74undh30brb8laojud3f9"); // }
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("8azkpi8o0wzdufa90lw8hpt6q"); // return -1;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 cese97kukrkyoho0nl5aeefuf
-// int re_match(struct re_pattern_buffer *bufp, const char *string, int size, int pos, struct re_registers *regs)
-public static Object re_match(Object... arg) {
-UNSUPPORTED("etrjsq5w49uo9jq5pzifohkqw"); // int
-UNSUPPORTED("dv1reldaciy8oglpt3lvrj467"); // re_match(struct re_pattern_buffer *bufp,
-UNSUPPORTED("c9d38ul1z2b760kkkwbmup6aq"); // const char *string,
-UNSUPPORTED("8ax0ba4mtdwcwwg0ygxfl2hyx"); // int size,
-UNSUPPORTED("5wdd1vovm572huu99r72nr8kp"); // int pos,
-UNSUPPORTED("ly5zx6ikzskn7s3qibi5tipo"); // struct re_registers *regs)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("f3va2gee7dhwlha1g39azqlfa"); // int result = re_match_2_internal (bufp, (void *)0, 0, string, size,
-UNSUPPORTED("ea7wwobss2bdmnj8fhllcq46k"); // pos, regs, size);
-UNSUPPORTED("e73y2609z2557xahrcvzmcb8e"); // return result;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 4bis6vnixbumphbwvjkcy4c2n
-// int re_match_2(struct re_pattern_buffer *bufp, const char *string1, int size1, const char *string2, int size2, int pos, struct re_registers *regs, int stop)
-public static Object re_match_2(Object... arg) {
-UNSUPPORTED("etrjsq5w49uo9jq5pzifohkqw"); // int
-UNSUPPORTED("bo3qvsxgxy71pt7n5tjlfpl7q"); // re_match_2(struct re_pattern_buffer *bufp,
-UNSUPPORTED("8xwssdsckjeb1q0lmxlu07pk5"); // const char *string1,
-UNSUPPORTED("chena2gcw8p49mjvwjotj1ue5"); // int size1,
-UNSUPPORTED("7kll64nft07fqgencnx9f2u3h"); // const char *string2,
-UNSUPPORTED("12hpd55p7b671svle7njxpr6c"); // int size2,
-UNSUPPORTED("eyuz74k3yno3lawo6tmqeahqh"); // int pos,
-UNSUPPORTED("5du4j7mghegymbd75ui1ml4fw"); // struct re_registers *regs,
-UNSUPPORTED("2hcygji7llu5b02n114djuqj0"); // int stop)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("a2u8v8zl4azq1kujf4s4cuii1"); // int result = re_match_2_internal (bufp, string1, size1, string2, size2,
-UNSUPPORTED("7l7rv6dwb5eaxilwku2m9z8we"); // pos, regs, stop);
-UNSUPPORTED("e73y2609z2557xahrcvzmcb8e"); // return result;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 2xc3iz0d568vx4ken91tl6gyt
-// static int re_match_2_internal(struct re_pattern_buffer *bufp, const char *string1, int size1, const char *string2, int size2, int pos, struct re_registers *regs, int stop)
-public static Object re_match_2_internal(Object... arg) {
-UNSUPPORTED("eyp5xkiyummcoc88ul2b6tkeg"); // static int
-UNSUPPORTED("6pa1vmha3pyewzpq2e2wsz00n"); // re_match_2_internal(struct re_pattern_buffer *bufp,
-UNSUPPORTED("4itq0umd8n4zaefp01c54wxac"); // const char *string1,
-UNSUPPORTED("2da6uko1m9uyu226zvu3kgswo"); // int size1,
-UNSUPPORTED("62ljq7ee0r8hkx89qdr6zrcj1"); // const char *string2,
-UNSUPPORTED("eu49m9ze4ikwzobpj8jmx8zjf"); // int size2,
-UNSUPPORTED("fsoirv97r4lbqxpez1e1kh6l"); // int pos,
-UNSUPPORTED("5das77r3z9spuajdb6a5zoqcg"); // struct re_registers *regs,
-UNSUPPORTED("9byy70s4d1i719ix6yy7okfe0"); // int stop)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("n8hlkyr29gxgnkj4x75w0pbu"); // /* General temporaries. */
-UNSUPPORTED("5rwd4tuvikkbfw1s56awbwtbe"); // int mcnt;
-UNSUPPORTED("7ijkchsbw8xrlcbwdzkzy7sg5"); // unsigned char *p1;
-UNSUPPORTED("6wjea7744xso80td4x9ur7whp"); // /* Just past the end of the corresponding string. */
-UNSUPPORTED("1fqaa6ix61rs3yld0danksdzt"); // const char *end1, *end2;
-UNSUPPORTED("4qjvhq2dmvddcpe2sq02ul57e"); // /* Pointers into string1 and string2, just past the last characters in
-UNSUPPORTED("e2o1kagsjdr4x6alq0db0ex6"); // each to consider matching. */
-UNSUPPORTED("3lcnzq2ymn1yaonefakdi2gf9"); // const char *end_match_1, *end_match_2;
-UNSUPPORTED("2x1qwx7dh9vq9oyh9l2ffuhki"); // /* Where we are in the data, and the end of the current string. */
-UNSUPPORTED("44aamau4r9tm9tp5eks2hjeeg"); // const char *d, *dend;
-UNSUPPORTED("1v5unbhjqcfvkvfh3bwyzig4m"); // /* Where we are in the pattern, and the end of the pattern. */
-UNSUPPORTED("7juswz68hsy9xygg4vwwp1dk4"); // unsigned char *p = bufp->buffer;
-UNSUPPORTED("egc1gcrry7bqm2rmed1tbm4p7"); // register unsigned char *pend = p + bufp->used;
-UNSUPPORTED("e8rkyc240i479ffdjn5bis1o6"); // /* Mark the opcode just after a start_memory, so we can test for an
-UNSUPPORTED("asrb0rht6g8nqkxfrpbqqwhji"); // empty subpattern when we get to the stop_memory. */
-UNSUPPORTED("1xod1essveohmbzqsm3chxtaa"); // unsigned char *just_past_start_mem = 0;
-UNSUPPORTED("5cqk44skhero82pev2rwsxqod"); // /* We use this to map every character in the string. */
-UNSUPPORTED("b6qhkmvrybk31a74eyxl9sf73"); // char * translate = bufp->translate;
-UNSUPPORTED("clib1bwajaiu950opbz65380n"); // /* Failure point stack. Each place that can handle a failure further
-UNSUPPORTED("3lyfugbo3isunzbvdm5i0o4cj"); // down the line pushes a failure point on this stack. It consists of
-UNSUPPORTED("1w6peyhoigpqgnv3qujk00vnp"); // restart, regend, and reg_info for all registers corresponding to
-UNSUPPORTED("8qdk2kexk0h3w8v82dc1gi8fc"); // the subexpressions we're currently inside, plus the number of such
-UNSUPPORTED("c464idhhkc8aqmfjb0s7zn2jq"); // registers, and, finally, two char *'s. The first char * is where
-UNSUPPORTED("d39bcwihp0jxqnlaq775160n0"); // to resume scanning the pattern; the second one is where to resume
-UNSUPPORTED("bt7bl5ufgmqudglf331090q99"); // scanning the strings. If the latter is zero, the failure point is
-UNSUPPORTED("dxhf42bpkithht6k5midiilvm"); // a ``dummy''; if a failure happens and the failure point is a dummy,
-UNSUPPORTED("7k01qsxjsxh1mzfj3zkxymge4"); // it gets discarded and the next next one is tried. */
-UNSUPPORTED("5dndxq85ri0pdc1zsswjws66p"); // fail_stack_type fail_stack;
-UNSUPPORTED("3ussoc6j234lhv666usd1ujlb"); // /* We fill all the registers internally, independent of what we
-UNSUPPORTED("7hukvye8ngqw8xf4c86mq7ksb"); // return, for use in backreferences. The number here includes
-UNSUPPORTED("800kciibxx8zzy7gqlip12chx"); // an element for register zero. */
-UNSUPPORTED("9te8xao6v2wvrtemmbarxo8r7"); // size_t num_regs = bufp->re_nsub + 1;
-UNSUPPORTED("69fqftzbp36nb88gj0hyzt7n5"); // /* The currently active registers. */
-UNSUPPORTED("210a4lsg6g1jyyakcj1y0z9co"); // active_reg_t lowest_active_reg = ((1 << 8) + 1);
-UNSUPPORTED("cav7rdafkpj7lnazs9bzo4f01"); // active_reg_t highest_active_reg = (1 << 8);
-UNSUPPORTED("9lffam35cw7ao19j9sq1na2kz"); // /* Information on the contents of registers. These are pointers into
-UNSUPPORTED("ezs9s06ouogq0bo54g0m18dwg"); // the input strings; they record just what was matched (on this
-UNSUPPORTED("cnjuuaptdt6ott2ct87p0obeb"); // attempt) by a subexpression part of the pattern, that is, the
-UNSUPPORTED("74e8guuvf2ep3sm5wuwk3pvak"); // regnum-th regstart pointer points to where in the pattern we began
-UNSUPPORTED("3bvo1nxt2ti5kli33880w0y4f"); // matching and the regnum-th regend points to right after where we
-UNSUPPORTED("btmswfvhn3ofbmow8ypu5e13p"); // stopped matching the regnum-th subexpression. (The zeroth register
-UNSUPPORTED("1kngd0q79bcbooydkquebsoaf"); // keeps track of what the whole pattern matches.) */
-UNSUPPORTED("3bagrvj67tgg2hcld2oq7uq12"); // const char **regstart, **regend;
-UNSUPPORTED("cj6z5o1u5gz9fj1ldc50421nu"); // /* If a group that's operated upon by a repetition operator fails to
-UNSUPPORTED("9h8hefhboxbyq3lbhmtfl4dbe"); // match anything, then the register for its start will need to be
-UNSUPPORTED("269993sksx5a7dxx2skmjmuv0"); // restored because it will have been set to wherever in the string we
-UNSUPPORTED("8sl9yewrsty5lu2b0b5210k4l"); // are when we last see its open-group operator. Similarly for a
-UNSUPPORTED("64mro6c1shytou2fsehv14t6e"); // register's end. */
-UNSUPPORTED("dzseh4slrayug3iyhvd08tt7k"); // const char **old_regstart, **old_regend;
-UNSUPPORTED("60rk8kklgq8pft794dlh37glr"); // /* The is_active field of reg_info helps us keep track of which (possibly
-UNSUPPORTED("bavzn3th9ptlj1baje3pfbu2r"); // nested) subexpressions we are currently in. The matched_something
-UNSUPPORTED("3wklpcvgm1mxc3ncudzv3u7er"); // field of reg_info[reg_num] helps us tell whether or not we have
-UNSUPPORTED("9owj5d6jjiwrr65xe8b66ynmg"); // matched any of the pattern so far this time through the reg_num-th
-UNSUPPORTED("5o4rfc4vl6f2f4i6gl8zb2c12"); // subexpression. These two fields get reset each time through any
-UNSUPPORTED("jainf18l355wvb9svfolzfyu"); // loop their register is in. */
-UNSUPPORTED("cldhi92ebvv3qkzk7hcp1acpx"); // register_info_type *reg_info;
-UNSUPPORTED("3tm9df4zwjcbf5wzasl5vbo41"); // /* The following record the register info as found in the above
-UNSUPPORTED("62fw4aryj1l9mpyzofxartoaf"); // variables when we find a match better than any we've seen before.
-UNSUPPORTED("3yswh3sslq5jxfw5qiqyposlu"); // This happens as we backtrack through the failure points, which in
-UNSUPPORTED("7fwl7a78gtt9lpholdubg8h20"); // turn happens only if we have not yet matched the entire string. */
-UNSUPPORTED("bv3kpg4ykugxqsd55m9yhp5af"); // unsigned best_regs_set = 0;
-UNSUPPORTED("boct5aaty3lmh8421fbwe811s"); // const char **best_regstart, **best_regend;
-UNSUPPORTED("4rxhejgld2fxwm1gablnrag3j"); // /* Logically, this is `best_regend[0]'. But we don't want to have to
-UNSUPPORTED("7qi1q2tujh3qj95sucmglupqv"); // allocate space for that if we're not allocating space for anything
-UNSUPPORTED("awo7q2rkwc6jlfdsam4my1k84"); // else (see below). Also, we never need info about register 0 for
-UNSUPPORTED("2f9d4yn8chlunlz3lckbg2mw0"); // any of the other register vectors, and it seems rather a kludge to
-UNSUPPORTED("dixl88kjwfhphwh4xmk51px61"); // treat `best_regend' differently than the rest. So we keep track of
-UNSUPPORTED("lthy8n6i428ea9wqx66x5syo"); // the end of the best match so far in a separate variable. We
-UNSUPPORTED("1g3sl9fbv6pwfi9bysp5k62i"); // initialize this to NULL so that when we backtrack the first time
-UNSUPPORTED("ek5k7ui0tsvl05jargwtlh04g"); // and need to test it, it's not garbage. */
-UNSUPPORTED("274v72hhp6qzltud0qx3natuw"); // const char *match_end = (void *)0;
-UNSUPPORTED("ce5dox5nl3mnb89gapdwnz2co"); // /* This helps SET_REGS_MATCHED avoid doing redundant work. */
-UNSUPPORTED("7rtu9eogaexvklmhbd0nvi8rq"); // int set_regs_matched_done = 0;
-UNSUPPORTED("6f52yhx59atis4v6w50r78tpr"); // /* Used when we pop values we don't care about. */
-UNSUPPORTED("cuer8lfpvninqja7rr37wv7vr"); // const char **reg_dummy;
-UNSUPPORTED("1tfv2eq96tkv3dnxi9htt3ogy"); // register_info_type *reg_info_dummy;
-UNSUPPORTED("5i0sddp616zsw63jk38od62l4"); // ;
-UNSUPPORTED("bbul77ox50tuvngn3t4agr5uo"); // do { fail_stack.stack = (fail_stack_elt_t *) alloca (5 * sizeof (fail_stack_elt_t)); if (fail_stack.stack == (void *)0) return -2; fail_stack.size = 5; fail_stack.avail = 0; } while (0);
-UNSUPPORTED("f2odxckhb2j0jb0skzptkj1li"); // /* Do not bother to initialize all the register variables if there are
-UNSUPPORTED("7rdujqxkgmrsifkkjc8uc4uf8"); // no groups in the pattern, as it takes a fair amount of time. If
-UNSUPPORTED("a8btab3qm6qk1ruzu54espdbw"); // there are groups, we include space for register 0 (the whole
-UNSUPPORTED("2fkpn3ylgs86igj0rin9q175c"); // pattern), even though we never use it, since it simplifies the
-UNSUPPORTED("a82pq8o4xe5vl6izykmrmv80p"); // array indexing. We should fix this. */
-UNSUPPORTED("3b6nyivy298vtrccdf2yz5zfy"); // if (bufp->re_nsub)
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("3s4x1dwphpxvwftzx6myntwof"); // regstart = ((const char * *) alloca ((num_regs) * sizeof (const char *)));
-UNSUPPORTED("2q4zpv4cg2m1hlu19z7n20v0i"); // regend = ((const char * *) alloca ((num_regs) * sizeof (const char *)));
-UNSUPPORTED("dncg8rhgtq841coamkzozn70f"); // old_regstart = ((const char * *) alloca ((num_regs) * sizeof (const char *)));
-UNSUPPORTED("dyvpshht388f50j2qsprkqq31"); // old_regend = ((const char * *) alloca ((num_regs) * sizeof (const char *)));
-UNSUPPORTED("dprck6oszi2zdnvn8ranbm5ax"); // best_regstart = ((const char * *) alloca ((num_regs) * sizeof (const char *)));
-UNSUPPORTED("3dm3mock6ighuyjpbnckimggr"); // best_regend = ((const char * *) alloca ((num_regs) * sizeof (const char *)));
-UNSUPPORTED("5732hglv8omqh0obbstzw9ovr"); // reg_info = ((register_info_type *) alloca ((num_regs) * sizeof (register_info_type)));
-UNSUPPORTED("4itgi9p0hm10q9gc8ligcmjw9"); // reg_dummy = ((const char * *) alloca ((num_regs) * sizeof (const char *)));
-UNSUPPORTED("2w784gfhj47yvqr5bkl3rnvb1"); // reg_info_dummy = ((register_info_type *) alloca ((num_regs) * sizeof (register_info_type)));
-UNSUPPORTED("bknt92c4iiz2fki0ya4b4zu9l"); // if (!(regstart && regend && old_regstart && old_regend && reg_info
-UNSUPPORTED("bvpk762fja9xad61rr2ecsbun"); // && best_regstart && best_regend && reg_dummy && reg_info_dummy))
-UNSUPPORTED("9ua540u2gx5jpu302s81qfxhi"); // {
-UNSUPPORTED("8f1nfq1jn2ejt7ub9midgshrh"); // do { ; if ((void*) regstart) ((void)0); (void*) regstart = (void *)0; if ((void*) regend) ((void)0); (void*) regend = (void *)0; if ((void*) old_regstart) ((void)0); (void*) old_regstart = (void *)0; if ((void*) old_regend) ((void)0); (void*) old_regend = (void *)0; if ((void*) best_regstart) ((void)0); (void*) best_regstart = (void *)0; if ((void*) best_regend) ((void)0); (void*) best_regend = (void *)0; if ((void*) reg_info) ((void)0); (void*) reg_info = (void *)0; if ((void*) reg_dummy) ((void)0); (void*) reg_dummy = (void *)0; if ((void*) reg_info_dummy) ((void)0); (void*) reg_info_dummy = (void *)0; } while (0);
-UNSUPPORTED("7ivse5do9752etnc6lpwep4id"); // return -2;
-UNSUPPORTED("7nxu74undh30brb8laojud3f9"); // }
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("div10atae09n36x269sl208r1"); // else
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("9hkjvu3lvnwrjs0wre7judo3c"); // /* We must initialize all our variables to NULL, so that
-UNSUPPORTED("45j98q6y8yuy75ls6dsgx1k64"); // `FREE_VARIABLES' doesn't try to free them. */
-UNSUPPORTED("2lkorxvitynsptmav1g59ixmb"); // regstart = regend = old_regstart = old_regend = best_regstart
-UNSUPPORTED("bzn1un5rdvzm7al9b58svbna4"); // = best_regend = reg_dummy = (void *)0;
-UNSUPPORTED("d9o9396ai0y6hfmg0mj1ebkq3"); // reg_info = reg_info_dummy = (register_info_type *) (void *)0;
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("8w78v1mfbuuwhx2hypx8jcldw"); // /* The starting position is bogus. */
-UNSUPPORTED("a4wmr8zj9xfpfbqugg1rwnak2"); // if (pos < 0 || pos > size1 + size2)
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("7sq147wjkuyi93ra9jbzwkvbf"); // do { ; if ((void*) regstart) ((void)0); (void*) regstart = (void *)0; if ((void*) regend) ((void)0); (void*) regend = (void *)0; if ((void*) old_regstart) ((void)0); (void*) old_regstart = (void *)0; if ((void*) old_regend) ((void)0); (void*) old_regend = (void *)0; if ((void*) best_regstart) ((void)0); (void*) best_regstart = (void *)0; if ((void*) best_regend) ((void)0); (void*) best_regend = (void *)0; if ((void*) reg_info) ((void)0); (void*) reg_info = (void *)0; if ((void*) reg_dummy) ((void)0); (void*) reg_dummy = (void *)0; if ((void*) reg_info_dummy) ((void)0); (void*) reg_info_dummy = (void *)0; } while (0);
-UNSUPPORTED("62ko03w39aomt1h9y758mag0k"); // return -1;
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("cqf83jwvi6ehnlngujy4qchdu"); // /* Initialize subexpression text positions to -1 to mark ones that no
-UNSUPPORTED("57srgq1s42r2qebxntv9z4v5k"); // start_memory/stop_memory has been seen for. Also initialize the
-UNSUPPORTED("1ow37crla9qcqw19bbyb805t9"); // register information struct. */
-UNSUPPORTED("9ydw7k6i7j7x2k6zngd59rojt"); // for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++)
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("2kyhfd6kl7ms8bwg1wlvfqwap"); // regstart[mcnt] = regend[mcnt]
-UNSUPPORTED("2kl8ke0fnk9nauyk9zokcxkoj"); // = old_regstart[mcnt] = old_regend[mcnt] = (&reg_unset_dummy);
-UNSUPPORTED("91q00i6munm3i7qie7rj8jfei"); // ((reg_info[mcnt]).bits.match_null_string_p) = 3;
-UNSUPPORTED("afk8kaqsmcxqe0q6zubefocrn"); // ((reg_info[mcnt]).bits.is_active) = 0;
-UNSUPPORTED("df366kaag3ynqzmm60vrmh0vx"); // ((reg_info[mcnt]).bits.matched_something) = 0;
-UNSUPPORTED("5mtz90agac60yikyx4k2p0tcy"); // ((reg_info[mcnt]).bits.ever_matched_something) = 0;
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("j5sjexwvtormmkwlvyyw0j3m"); // /* We move `string1' into `string2' if the latter's empty -- but not if
-UNSUPPORTED("22snitog4zamx1t4ccq83m95r"); // `string1' is null. */
-UNSUPPORTED("e5i3kugt3ww6rnm9voflfgawq"); // if (size2 == 0 && string1 != (void *)0)
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("e42qfjjyl84hogtxnpbthj5rz"); // string2 = string1;
-UNSUPPORTED("crben3jjw8pci91x5lvrk4w8q"); // size2 = size1;
-UNSUPPORTED("f01lcid5mzfewcivqnd332urs"); // string1 = 0;
-UNSUPPORTED("5c8judheb0ofzkgdnwqnml8z0"); // size1 = 0;
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("e172015pwzssq7c0vo2tq5aq1"); // end1 = string1 + size1;
-UNSUPPORTED("4m5wyc9k9qkl4sfiwwyvvla1h"); // end2 = string2 + size2;
-UNSUPPORTED("92k1xad7xyoitcixjggddz2xx"); // /* Compute where to stop matching, within the two strings. */
-UNSUPPORTED("6gdkxgosf1sannyt40j9kmngq"); // if (stop <= size1)
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("6cypxpgmpeoi6emdah5s9k61u"); // end_match_1 = string1 + stop;
-UNSUPPORTED("14iyugw7zeo04abwg6k9mz77r"); // end_match_2 = string2;
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("div10atae09n36x269sl208r1"); // else
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("ubox1xzc7tf43rh7nzqo0y2w"); // end_match_1 = end1;
-UNSUPPORTED("g15ad7lvemt1j3tfd3b2wy5n"); // end_match_2 = string2 + stop - size1;
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("b72xjrsh15ceq6n0mp9o3dr3b"); // /* `p' scans through the pattern as `d' scans through the data.
-UNSUPPORTED("ee8kj3n0j7z3zgw3x29pr4iwg"); // `dend' is the end of the input string that `d' points within. `d'
-UNSUPPORTED("9ht9fo2bvlr07alij7ev6sc64"); // is advanced into the following input string whenever necessary, but
-UNSUPPORTED("delvy2rsoiwhe79dztx86nhlo"); // this happens before fetching; therefore, at the beginning of the
-UNSUPPORTED("4fil0e4w6u5hnt1i6cgmhslcj"); // loop, `d' can be pointing at the end of a string, but it cannot
-UNSUPPORTED("3m773nmhi0vb3kvwhk5zj1fvx"); // equal `string2'. */
-UNSUPPORTED("1sztmr22bzx9qg638iuxf0qcf"); // if (size1 > 0 && pos <= size1)
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("effnp1jm0qoqpcub7rcliiklk"); // d = string1 + pos;
-UNSUPPORTED("a3z31vmcwv4izh4gaf0zzu63f"); // dend = end_match_1;
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("div10atae09n36x269sl208r1"); // else
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("a6h3karx5gb77i5icjwtr70s"); // d = string2 + pos - size1;
-UNSUPPORTED("2mh3yoyin5cy0p7onls0cxs88"); // dend = end_match_2;
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("5i0sddp616zsw63jk38od62l4"); // ;
-UNSUPPORTED("5i0sddp616zsw63jk38od62l4"); // ;
-UNSUPPORTED("5i0sddp616zsw63jk38od62l4"); // ;
-UNSUPPORTED("5i0sddp616zsw63jk38od62l4"); // ;
-UNSUPPORTED("5i0sddp616zsw63jk38od62l4"); // ;
-UNSUPPORTED("99zhv2pwx2q8a48j197pw6xt4"); // /* This loops over pattern commands. It exits by returning from the
-UNSUPPORTED("7e60h1pt63bigon94i6v0grl5"); // function if the match is complete, or it drops through if the match
-UNSUPPORTED("b3n3kmzfara10ikrekjiv0woz"); // fails at this starting point in the input data. */
-UNSUPPORTED("3s761dh42eu37yg4q6j6rw0kx"); // for (;;)
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("cf8srqrmhz47tb7zdgoe9ufhv"); // ;
-UNSUPPORTED("coqe9flw9y84q7eb1xt2wxm8v"); // if (p == pend)
-UNSUPPORTED("a41002aq4p23pyz97pvq70zys"); // { /* End of pattern means we might have succeeded. */
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("c3on5mrar07ygte8kqbl2hntc"); // /* If we haven't matched the entire string, and we want the
-UNSUPPORTED("apgoqswuwqwo0jdc88f1g6zjk"); // longest match, try backtracking. */
-UNSUPPORTED("6quev9lqtkd3rm2zf8o08q0d4"); // if (d != end_match_2)
-UNSUPPORTED("5k2digv672hnrndhc9ktw0oii"); // {
-UNSUPPORTED("84ttk9zo6qwdugyag6bsfijsa"); // /* 1 if this match ends in the same string (string1 or string2)
-UNSUPPORTED("3d7aa3i6sz2b5v1rdku8mfkve"); // as the best previous match. */
-UNSUPPORTED("99rxk6hqfc6820y8brqyzr1ix"); // boolean same_str_p = ((size1 && string1 <= (match_end) && (match_end) <= string1 + size1)
-UNSUPPORTED("5h23tai9w26g9uu3555t1s2ko"); // == (dend == end_match_1));
-UNSUPPORTED("a9j7f142ppbm4bfda6vllbzkt"); // /* 1 if this match is the best seen so far. */
-UNSUPPORTED("7ssv33yt0mo7z7naegb53acst"); // boolean best_match_p;
-UNSUPPORTED("406ocol9hh6qa1tg01aqw4fm4"); // /* AIX compiler got confused when this was combined
-UNSUPPORTED("doec2mp5fgho754yj67fiufk6"); // with the previous declaration. */
-UNSUPPORTED("3olytwmx4gzy8yajx9lv0w470"); // if (same_str_p)
-UNSUPPORTED("b8puesm16uljvnmkyguxlpjz2"); // best_match_p = d > match_end;
-UNSUPPORTED("ex6jbb36b02x7vzl22fq0yh2l"); // else
-UNSUPPORTED("8g5axzy7uh94mclmd8107jt4r"); // best_match_p = !(dend == end_match_1);
-UNSUPPORTED("e4kt1tmmevqvy3cbyk6xnznck"); // ;
-UNSUPPORTED("61g695v6madw50govi0fpaymy"); // if (!(fail_stack.avail == 0))
-UNSUPPORTED("c5mtgdtcl0w9vn5m7roo5mclf"); // { /* More failure points to try. */
-UNSUPPORTED("6k0fj673itx4y90om89cfw4au"); // /* If exceeds best match so far, save it. */
-UNSUPPORTED("8lvy2hc2kk7wk0osmu4kt3b46"); // if (!best_regs_set || best_match_p)
-UNSUPPORTED("bho20rvti5y7pi0voz7il3e40"); // {
-UNSUPPORTED("c1z8tnsgrw2hio3750gukv093"); // best_regs_set = 1;
-UNSUPPORTED("6cvml1s44f1rz7ut1p9732o24"); // match_end = d;
-UNSUPPORTED("a6r7lto035pp3gvk1bdixang2"); // ;
-UNSUPPORTED("5lgbvvnv5vugg8j3y9jm7tmto"); // for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++)
-UNSUPPORTED("1fi5w21ki1vo1jwyr4xwgm27n"); // {
-UNSUPPORTED("36h25f46gwl1bjkvlv2hi12al"); // best_regstart[mcnt] = regstart[mcnt];
-UNSUPPORTED("38u63aln2507yexeleac5i5f6"); // best_regend[mcnt] = regend[mcnt];
-UNSUPPORTED("bf03xtomlwkahoqno8ua4cbpc"); // }
-UNSUPPORTED("ad3bk4xnx8bgy7plhun3c0mvv"); // }
-UNSUPPORTED("3cl1in74qmmbb26vs4qw3mcuv"); // goto fail;
-UNSUPPORTED("2tfish0jog6m8uhlhaokmzvm3"); // }
-UNSUPPORTED("9608e8vynn7blihqg1sa5x6hm"); // /* If no failure points, don't restore garbage. And if
-UNSUPPORTED("cvm5ogwjizby9vpz4bh4t4kmf"); // last match is real best match, don't restore second
-UNSUPPORTED("5019dps6elcptg07efvg8ytlp"); // best one. */
-UNSUPPORTED("31h7b1f1py5xliuo37yr49j0e"); // else if (best_regs_set && !best_match_p)
-UNSUPPORTED("4hzaau620c4rh7xorkrmxfut7"); // {
-UNSUPPORTED("51sj2rq6npgedmtb80qyu24n8"); // restore_best_regs:
-UNSUPPORTED("eassx3c83qc4vxc85c75b9qjl"); // /* Restore best match. It may happen that `dend ==
-UNSUPPORTED("5pm2irkm5dt0s4qwuwz8u3q1h"); // end_match_1' while the restored d is in string2.
-UNSUPPORTED("bc82mepahwmg9x3r4zc1uhtn2"); // For example, the pattern `x.*y.*z' against the
-UNSUPPORTED("dux3vuywslng2dhkfnnw5vg60"); // strings `x-' and `y-z-', if the two strings are
-UNSUPPORTED("8xrw6nr4f038b5khvfblfbvnn"); // not consecutive in memory. */
-UNSUPPORTED("c6tldeu5ffnykyfto7hi9ixau"); // ;
-UNSUPPORTED("20z1s97l71qromoe39rg38hm2"); // d = match_end;
-UNSUPPORTED("3ue7lk6sdffqfud3cceri8m8b"); // dend = ((d >= string1 && d <= end1)
-UNSUPPORTED("67n43dsreslafvliflcrjntcd"); // ? end_match_1 : end_match_2);
-UNSUPPORTED("7f2q0145iwgp8w2wsim63zj7m"); // for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++)
-UNSUPPORTED("bho20rvti5y7pi0voz7il3e40"); // {
-UNSUPPORTED("f2o08vllkyap6mdqirtbkpmpk"); // regstart[mcnt] = best_regstart[mcnt];
-UNSUPPORTED("3pqb99yerpeb7fyy71o36q7nc"); // regend[mcnt] = best_regend[mcnt];
-UNSUPPORTED("ad3bk4xnx8bgy7plhun3c0mvv"); // }
-UNSUPPORTED("2tfish0jog6m8uhlhaokmzvm3"); // }
-UNSUPPORTED("7qpxyrpi9p8bv5o56myo9c2dh"); // } /* d != end_match_2 */
-UNSUPPORTED("eo36u7f29du5zdvcxohew6ccd"); // succeed_label:
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("ch5rhljwem9e6yq0bvid9b9dj"); // /* If caller wants register contents data back, do it. */
-UNSUPPORTED("1yp4u3stmh22ubjzoa5psbbuy"); // if (regs && !bufp->no_sub)
-UNSUPPORTED("5k2digv672hnrndhc9ktw0oii"); // {
-UNSUPPORTED("3kol441pj0oa248vzhp3vv7ls"); // /* Have the register data arrays been allocated? */
-UNSUPPORTED("1gzi6m8z4rjss7i9b9wcz0nhw"); // if (bufp->regs_allocated == 0)
-UNSUPPORTED("bfr9pjr2qri3sxl2k6brn5xer"); // { /* No. So allocate them with malloc. We need one
-UNSUPPORTED("eo5lmm6txjqzwpnc51q2rr86p"); // extra element beyond `num_regs' for the `-1' marker
-UNSUPPORTED("1qr602sxafqljujgz9tt6qcf9"); // GNU code uses. */
-UNSUPPORTED("w1tdx38yyrw1sowe6ghaj2nk"); // regs->num_regs = ((30) > (num_regs + 1) ? (30) : (num_regs + 1));
-UNSUPPORTED("be8i44ggcohl9z9hz4rhqk56n"); // regs->start = ((regoff_t *) malloc ((regs->num_regs) * sizeof (regoff_t)));
-UNSUPPORTED("cyfi6zngbv1dslzcl7x1sr152"); // regs->end = ((regoff_t *) malloc ((regs->num_regs) * sizeof (regoff_t)));
-UNSUPPORTED("cxow73omypjzg053jt8epepo8"); // if (regs->start == (void *)0 || regs->end == (void *)0)
-UNSUPPORTED("bho20rvti5y7pi0voz7il3e40"); // {
-UNSUPPORTED("eb9qndp4gf1s242vxc2lh5maj"); // do { ; if ((void*) regstart) ((void)0); (void*) regstart = (void *)0; if ((void*) regend) ((void)0); (void*) regend = (void *)0; if ((void*) old_regstart) ((void)0); (void*) old_regstart = (void *)0; if ((void*) old_regend) ((void)0); (void*) old_regend = (void *)0; if ((void*) best_regstart) ((void)0); (void*) best_regstart = (void *)0; if ((void*) best_regend) ((void)0); (void*) best_regend = (void *)0; if ((void*) reg_info) ((void)0); (void*) reg_info = (void *)0; if ((void*) reg_dummy) ((void)0); (void*) reg_dummy = (void *)0; if ((void*) reg_info_dummy) ((void)0); (void*) reg_info_dummy = (void *)0; } while (0);
-UNSUPPORTED("dqq88wul2lqxsx8tregfubikv"); // return -2;
-UNSUPPORTED("ad3bk4xnx8bgy7plhun3c0mvv"); // }
-UNSUPPORTED("i0ztbbhawtrpj2duc3ya6kdq"); // bufp->regs_allocated = 1;
-UNSUPPORTED("2tfish0jog6m8uhlhaokmzvm3"); // }
-UNSUPPORTED("6c4alibipwc6an6jcy479a3m"); // else if (bufp->regs_allocated == 1)
-UNSUPPORTED("73h0ws2srjiuc9g7nvfsil3p7"); // { /* Yes. If we need more elements than were already
-UNSUPPORTED("3k4931vs4niesagz1oxg57nbg"); // allocated, reallocate them. If we need fewer, just
-UNSUPPORTED("e6dbjm0iyzngr68xmg81z2z0m"); // leave it alone. */
-UNSUPPORTED("djowzzvskdbwjag9m9fnha4jh"); // if (regs->num_regs < num_regs + 1)
-UNSUPPORTED("bho20rvti5y7pi0voz7il3e40"); // {
-UNSUPPORTED("9xesw41tb2u8ao5widm29kiyp"); // regs->num_regs = num_regs + 1;
-UNSUPPORTED("87dmzxu9te8vokzvs3irtuxov"); // ((regs->start) = (regoff_t *) realloc (regs->start, (regs->num_regs) * sizeof (regoff_t)));
-UNSUPPORTED("6e6qfl2iibo9mkatufr410gra"); // ((regs->end) = (regoff_t *) realloc (regs->end, (regs->num_regs) * sizeof (regoff_t)));
-UNSUPPORTED("1vrn0xsco7imnquwgs11osuf6"); // if (regs->start == (void *)0 || regs->end == (void *)0)
-UNSUPPORTED("1fi5w21ki1vo1jwyr4xwgm27n"); // {
-UNSUPPORTED("93c8iop6pb7zwgnohfyvit0s"); // do { ; if ((void*) regstart) ((void)0); (void*) regstart = (void *)0; if ((void*) regend) ((void)0); (void*) regend = (void *)0; if ((void*) old_regstart) ((void)0); (void*) old_regstart = (void *)0; if ((void*) old_regend) ((void)0); (void*) old_regend = (void *)0; if ((void*) best_regstart) ((void)0); (void*) best_regstart = (void *)0; if ((void*) best_regend) ((void)0); (void*) best_regend = (void *)0; if ((void*) reg_info) ((void)0); (void*) reg_info = (void *)0; if ((void*) reg_dummy) ((void)0); (void*) reg_dummy = (void *)0; if ((void*) reg_info_dummy) ((void)0); (void*) reg_info_dummy = (void *)0; } while (0);
-UNSUPPORTED("7l01rs860ssm9kixuhgx9hdbq"); // return -2;
-UNSUPPORTED("bf03xtomlwkahoqno8ua4cbpc"); // }
-UNSUPPORTED("ad3bk4xnx8bgy7plhun3c0mvv"); // }
-UNSUPPORTED("2tfish0jog6m8uhlhaokmzvm3"); // }
-UNSUPPORTED("ex6jbb36b02x7vzl22fq0yh2l"); // else
-UNSUPPORTED("4hzaau620c4rh7xorkrmxfut7"); // {
-UNSUPPORTED("3fvt2dndjzd64gdhzxvql5d8b"); // /* These braces fend off a "empty body in an else-statement"
-UNSUPPORTED("2luomnvf5pqa41oaxy8f8r9or"); // warning under GCC when assert expands to nothing. */
-UNSUPPORTED("c6tldeu5ffnykyfto7hi9ixau"); // ;
-UNSUPPORTED("2tfish0jog6m8uhlhaokmzvm3"); // }
-UNSUPPORTED("87z47ijxyqp3enbpawsz2ln6c"); // /* Convert the pointer data in `regstart' and `regend' to
-UNSUPPORTED("2au9uvntej9ho5mvvkamw1j5w"); // indices. Register zero has to be set differently,
-UNSUPPORTED("7hnlk3p3u0dhyz803a3lfbxnj"); // since we haven't kept track of any info for it. */
-UNSUPPORTED("35mb19qsz9130m513vyoka7y0"); // if (regs->num_regs > 0)
-UNSUPPORTED("4hzaau620c4rh7xorkrmxfut7"); // {
-UNSUPPORTED("9009sy5tyjmheeqydo5wo4kwq"); // regs->start[0] = pos;
-UNSUPPORTED("edxcovxefspqos0b0zuq6z7ha"); // regs->end[0] = ((dend == end_match_1)
-UNSUPPORTED("99qit228aypztxnllw89nwokv"); // ? ((regoff_t) (d - string1))
-UNSUPPORTED("4aa9l4flk3x9zqpcce1dwt1ta"); // : ((regoff_t) (d - string2 + size1)));
-UNSUPPORTED("2tfish0jog6m8uhlhaokmzvm3"); // }
-UNSUPPORTED("egg8arm7ozeve9mx29jgkz7bs"); // /* Go through the first `min (num_regs, regs->num_regs)'
-UNSUPPORTED("9c1fouoack9c0oqkqs0d1tbyn"); // registers, since that is all we initialized. */
-UNSUPPORTED("76y0zjrbtva0kjq7q5c1wths1"); // for (mcnt = 1; (unsigned) mcnt < ((num_regs) < (regs->num_regs) ? (num_regs) : (regs->num_regs));
-UNSUPPORTED("1eh3h1x9wgjp35deszyvz3o6e"); // mcnt++)
-UNSUPPORTED("4hzaau620c4rh7xorkrmxfut7"); // {
-UNSUPPORTED("b0l8ghi3p5kmv8ns6tw59wvuu"); // if (((regstart[mcnt]) == (&reg_unset_dummy)) || ((regend[mcnt]) == (&reg_unset_dummy)))
-UNSUPPORTED("nmubntmt76n8354k37ekf09c"); // regs->start[mcnt] = regs->end[mcnt] = -1;
-UNSUPPORTED("ecas48ylhxx9t2hquqr1nnwzj"); // else
-UNSUPPORTED("bho20rvti5y7pi0voz7il3e40"); // {
-UNSUPPORTED("elvx8lxakvbaqd1oax9ecwh6w"); // regs->start[mcnt]
-UNSUPPORTED("2ftoc2pu10jb5p4scmxq2z1j2"); // = (regoff_t) ((size1 && string1 <= (regstart[mcnt]) && (regstart[mcnt]) <= string1 + size1) ? ((regoff_t) ((regstart[mcnt]) - string1)) : ((regoff_t) ((regstart[mcnt]) - string2 + size1)));
-UNSUPPORTED("eblc8kac69cvh0xmx81t3z7qw"); // regs->end[mcnt]
-UNSUPPORTED("7lahjjs9zz1e6q38t501ceam8"); // = (regoff_t) ((size1 && string1 <= (regend[mcnt]) && (regend[mcnt]) <= string1 + size1) ? ((regoff_t) ((regend[mcnt]) - string1)) : ((regoff_t) ((regend[mcnt]) - string2 + size1)));
-UNSUPPORTED("ad3bk4xnx8bgy7plhun3c0mvv"); // }
-UNSUPPORTED("2tfish0jog6m8uhlhaokmzvm3"); // }
-UNSUPPORTED("dud4yeckicq4pijwz9m705cmx"); // /* If the regs structure we return has more elements than
-UNSUPPORTED("dg2liz6izarfhgllr7c0lvfzx"); // were in the pattern, set the extra elements to -1. If
-UNSUPPORTED("bgul1odz2k47e5yo08ifpsxux"); // we (re)allocated the registers, this is the case,
-UNSUPPORTED("8pq9l6jwi4wy8aly679isfqnx"); // because we always allocate enough to have at least one
-UNSUPPORTED("ccbog2f5misacunpi5lovnpm0"); // -1 at the end. */
-UNSUPPORTED("3rm0qbtrqgfau6g7gecmhdspm"); // for (mcnt = num_regs; (unsigned) mcnt < regs->num_regs; mcnt++)
-UNSUPPORTED("129q7ylakhk2gu6j7p4jpz372"); // regs->start[mcnt] = regs->end[mcnt] = -1;
-UNSUPPORTED("93qdoi4cltvsoa26wtattpcrj"); // } /* regs && !bufp->no_sub */
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("4wc9t8vouh3w18pod77gkuoaz"); // mcnt = d - pos - ((dend == end_match_1)
-UNSUPPORTED("48tr2aou1bn895ggwv1qgo056"); // ? string1
-UNSUPPORTED("e9wr9ptogadx1o3labo85tlgf"); // : string2 - size1);
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("8f1nfq1jn2ejt7ub9midgshrh"); // do { ; if ((void*) regstart) ((void)0); (void*) regstart = (void *)0; if ((void*) regend) ((void)0); (void*) regend = (void *)0; if ((void*) old_regstart) ((void)0); (void*) old_regstart = (void *)0; if ((void*) old_regend) ((void)0); (void*) old_regend = (void *)0; if ((void*) best_regstart) ((void)0); (void*) best_regstart = (void *)0; if ((void*) best_regend) ((void)0); (void*) best_regend = (void *)0; if ((void*) reg_info) ((void)0); (void*) reg_info = (void *)0; if ((void*) reg_dummy) ((void)0); (void*) reg_dummy = (void *)0; if ((void*) reg_info_dummy) ((void)0); (void*) reg_info_dummy = (void *)0; } while (0);
-UNSUPPORTED("c0a9sr78bshk0e2ijyxlzxg7h"); // return mcnt;
-UNSUPPORTED("7nxu74undh30brb8laojud3f9"); // }
-UNSUPPORTED("b0kkxy3zkf3f430688gewaj4w"); // /* Otherwise match next pattern command. */
-UNSUPPORTED("3d9jhchhw3lu8yajca4mi058b"); // switch (((re_opcode_t) *p++))
-UNSUPPORTED("9ua540u2gx5jpu302s81qfxhi"); // {
-UNSUPPORTED("1cr7m9kscv8emiq2bhdx0l21"); // /* Ignore these. Used to ignore the n of succeed_n's which
-UNSUPPORTED("4p7fiu2s102akmzhjtzxqkrdi"); // currently have n == 0. */
-UNSUPPORTED("anhhi3sf756j0lcm11sy9nyfc"); // case no_op:
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("8xm4dpngfjaadz6e2suqjuja7"); // case succeed:
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("97sc3afg030x5rva8s655k37e"); // goto succeed_label;
-UNSUPPORTED("bsqnanqt8sp33wb2pm6xt6ulq"); // /* Match the next n pattern characters exactly. The following
-UNSUPPORTED("4hpiyumzwmrkzpbtwhyro0nin"); // byte in the pattern defines n, and the n bytes after that
-UNSUPPORTED("126jkfju6a6kncm4twhsy8b50"); // are the characters to match. */
-UNSUPPORTED("cw984demptqbnja38a25p2xi1"); // case exactn:
-UNSUPPORTED("e299xchgd28m8kehs3yk4j0m0"); // mcnt = *p++;
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("bh28o7qdz7h0u89in1fxom93a"); // /* This is written out as an if-else so we don't waste time
-UNSUPPORTED("87zph5xuncm4m58n4ggl0buj8"); // testing `translate' inside the loop. */
-UNSUPPORTED("7jj6ay2afdj7lpspqsgwusj6m"); // if (translate)
-UNSUPPORTED("5k2digv672hnrndhc9ktw0oii"); // {
-UNSUPPORTED("af97jdpx3vxfjkevna4yd8iu3"); // do
-UNSUPPORTED("4hzaau620c4rh7xorkrmxfut7"); // {
-UNSUPPORTED("664ue5cxfdx7fkvvgla8dw3ko"); // while (d == dend) { if (dend == end_match_2) goto fail; d = string2; dend = end_match_2; };
-UNSUPPORTED("4nbfd88egqevnftfub4el1t0p"); // if ((unsigned char) translate[(unsigned char) *d++]
-UNSUPPORTED("c44weohee2ybnj7w12bc184r0"); // != (unsigned char) *p++)
-UNSUPPORTED("bkcykqhkoe9lpop9i2qgzu9yp"); // goto fail;
-UNSUPPORTED("2tfish0jog6m8uhlhaokmzvm3"); // }
-UNSUPPORTED("74t2bggypeoowelqm6xtisx30"); // while (--mcnt);
-UNSUPPORTED("b86ovw6olwwo6gnqlt1wqqzb4"); // }
-UNSUPPORTED("cunk7vpvzj28y1x4gn62gxpce"); // else
-UNSUPPORTED("5k2digv672hnrndhc9ktw0oii"); // {
-UNSUPPORTED("af97jdpx3vxfjkevna4yd8iu3"); // do
-UNSUPPORTED("4hzaau620c4rh7xorkrmxfut7"); // {
-UNSUPPORTED("664ue5cxfdx7fkvvgla8dw3ko"); // while (d == dend) { if (dend == end_match_2) goto fail; d = string2; dend = end_match_2; };
-UNSUPPORTED("aozx58qal2txvazcjwrwyio1g"); // if (*d++ != (char) *p++) goto fail;
-UNSUPPORTED("2tfish0jog6m8uhlhaokmzvm3"); // }
-UNSUPPORTED("74t2bggypeoowelqm6xtisx30"); // while (--mcnt);
-UNSUPPORTED("b86ovw6olwwo6gnqlt1wqqzb4"); // }
-UNSUPPORTED("2o2dzkzmcvnlj1d5ychre7cqo"); // do { if (!set_regs_matched_done) { active_reg_t r; set_regs_matched_done = 1; for (r = lowest_active_reg; r <= highest_active_reg; r++) { ((reg_info[r]).bits.matched_something) = ((reg_info[r]).bits.ever_matched_something) = 1; } } } while (0);
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("7tks8jmj7cqrcj4nyqm3djfno"); // /* Match any character except possibly a newline or a null. */
-UNSUPPORTED("1bv8e740f9rna5i036bo292wc"); // case anychar:
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("6l2kf5tzbvscsr8vy2bos6ng7"); // while (d == dend) { if (dend == end_match_2) goto fail; d = string2; dend = end_match_2; };
-UNSUPPORTED("avzqzqv7s0tr2npgctz1b2ana"); // if ((!(bufp->syntax & ((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1)) && (translate ? (char) translate[(unsigned char) (*d)] : (*d)) == '\n')
-UNSUPPORTED("83t3ma7nbx7fiz0zawdo05ob2"); // || (bufp->syntax & (((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) && (translate ? (char) translate[(unsigned char) (*d)] : (*d)) == '\000'))
-UNSUPPORTED("etjodgz127fwk1r4166wqxg7n"); // goto fail;
-UNSUPPORTED("2o2dzkzmcvnlj1d5ychre7cqo"); // do { if (!set_regs_matched_done) { active_reg_t r; set_regs_matched_done = 1; for (r = lowest_active_reg; r <= highest_active_reg; r++) { ((reg_info[r]).bits.matched_something) = ((reg_info[r]).bits.ever_matched_something) = 1; } } } while (0);
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("p26x5fh4zcf5ddyi146lh558"); // d++;
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("2ro4nzmlhhrmitxu9446arhlo"); // case charset:
-UNSUPPORTED("2zj0t91dpl66cu75cb0h2j1hu"); // case charset_not:
-UNSUPPORTED("4vdjxw5o61xlsk38ouw1wsypc"); // {
-UNSUPPORTED("8n4s0kz2yj50t5rvnitti5hyl"); // register unsigned char c;
-UNSUPPORTED("deppcas7zridwg11cevwayois"); // boolean not = (re_opcode_t) *(p - 1) == charset_not;
-UNSUPPORTED("6mnx06fa3p4n9bhd9htqjy0il"); // ;
-UNSUPPORTED("6mf4c0e1oxwfped5hh8u7fz2n"); // while (d == dend) { if (dend == end_match_2) goto fail; d = string2; dend = end_match_2; };
-UNSUPPORTED("9aaydk7f3la99u6jfo9kyxp5i"); // c = (translate ? (char) translate[(unsigned char) (*d)] : (*d)); /* The character to match. */
-UNSUPPORTED("cc3v2ndt3kmkt0r26mvu8ftfi"); // /* Cast to `unsigned' instead of `unsigned char' in case the
-UNSUPPORTED("2szsk231obr0m7gvx69h0jje"); // bit list is a full 32 bytes long. */
-UNSUPPORTED("2bmmfw3dqxl0rnfrjgzxlk2gw"); // if (c < (unsigned) (*p * 8)
-UNSUPPORTED("721an1atvtz1g2jzxegur68o9"); // && p[1 + c / 8] & (1 << (c % 8)))
-UNSUPPORTED("16fenxsijr0vmtxzyb8psvofo"); // not = !not;
-UNSUPPORTED("9pg86i2witmji2iwfc6jhm9j8"); // p += 1 + *p;
-UNSUPPORTED("6rkrjn87jai9lq2d129w2h7g8"); // if (!not) goto fail;
-UNSUPPORTED("632iqprva0k4cq9az0mwgy0ua"); // do { if (!set_regs_matched_done) { active_reg_t r; set_regs_matched_done = 1; for (r = lowest_active_reg; r <= highest_active_reg; r++) { ((reg_info[r]).bits.matched_something) = ((reg_info[r]).bits.ever_matched_something) = 1; } } } while (0);
-UNSUPPORTED("2ddfcenepkfjkw5qk64bs5pjs"); // d++;
-UNSUPPORTED("605r8o1isen77125aqrohs6ac"); // break;
-UNSUPPORTED("3e08x1y395304nd0y3uwffvim"); // }
-UNSUPPORTED("ax93bd9x56qib5q0g9wvm2qcy"); // /* The beginning of a group is represented by start_memory.
-UNSUPPORTED("e38f63tkhbflv1p396hknxdwy"); // The arguments are the register number in the next byte, and the
-UNSUPPORTED("c64u5xem18b4mqy79877eqfcs"); // number of groups inner to this one in the next. The text
-UNSUPPORTED("dbdk515uk79zg5hip4kru378u"); // matched within the group is recorded (in the internal
-UNSUPPORTED("8j4ek9641uur5fxjgkizkb06i"); // registers data structure) under the register number. */
-UNSUPPORTED("6c0ei34e676sv2kl1dxfzm5lm"); // case start_memory:
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("dus38gizylomi1jon9xa9a9gi"); // /* Find out if this group can match the empty string. */
-UNSUPPORTED("1e0kjdjtknuzgjuge4nu2rvvv"); // p1 = p; /* To send to group_match_null_string_p. */
-UNSUPPORTED("1lvbl8fbh2kfnyp76ial3wyge"); // if (((reg_info[*p]).bits.match_null_string_p) == 3)
-UNSUPPORTED("1yvuh3ye9g4wks9vy2jwlla11"); // ((reg_info[*p]).bits.match_null_string_p)
-UNSUPPORTED("crq9r37sdaimjd51v7rr5rifz"); // = group_match_null_string_p (&p1, pend, reg_info);
-UNSUPPORTED("ea7tbs2n5vp5hwe31r9ym79d1"); // /* Save the position in the string where we were the last time
-UNSUPPORTED("b64kvidnxk3y1txigfo1pl99t"); // we were at this open-group operator in case the group is
-UNSUPPORTED("6w4zb5o8illk23kubyigl5wig"); // operated upon by a repetition operator, e.g., with `(a*)*b'
-UNSUPPORTED("9d7meouvzhwtqek5lj1q19d3n"); // against `ab'; then we want to ignore where we are now in
-UNSUPPORTED("elzx65ahdc47yfgprdxj1sjl1"); // the string in case this attempt to match fails. */
-UNSUPPORTED("1qsu4c7bkuq3vofwjjijw1e3k"); // old_regstart[*p] = ((reg_info[*p]).bits.match_null_string_p)
-UNSUPPORTED("6fd5qfd27ra7djj22yvjcis5j"); // ? ((regstart[*p]) == (&reg_unset_dummy)) ? d : regstart[*p]
-UNSUPPORTED("eg76mx8hl74su6aktlwej5s9l"); // : regstart[*p];
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("837i1cwpv2l0eyw1m5ly72e5q"); // regstart[*p] = d;
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("1pjvhqen01q14gt1u2ipmfn78"); // ((reg_info[*p]).bits.is_active) = 1;
-UNSUPPORTED("7yf870aytlplqgsdoktbv23o8"); // ((reg_info[*p]).bits.matched_something) = 0;
-UNSUPPORTED("5qe9dgngpf1z0x2gaouwzuh33"); // /* Clear this whenever we change the register activity status. */
-UNSUPPORTED("dckkxudermmywleu21wcsh6wk"); // set_regs_matched_done = 0;
-UNSUPPORTED("4v5t4lf3m98srbm2dhq6otf2z"); // /* This is the new highest active register. */
-UNSUPPORTED("3z1903inbnuh0u7jl2xrmgjwy"); // highest_active_reg = *p;
-UNSUPPORTED("c5um95y8m6g52hnhowkayvp2f"); // /* If nothing was active before, this is the new lowest active
-UNSUPPORTED("33rqqd71rbnr2br416p5pko3h"); // register. */
-UNSUPPORTED("bbhu9dtas1n5xtephxw36fi5o"); // if (lowest_active_reg == ((1 << 8) + 1))
-UNSUPPORTED("2zewvmpnwbg7dwzrf032pngut"); // lowest_active_reg = *p;
-UNSUPPORTED("247xejwk6ewf4ot2xglm0foep"); // /* Move past the register number and inner group count. */
-UNSUPPORTED("8mazj3o2k4ts6oo83xpc0clf6"); // p += 2;
-UNSUPPORTED("9h673b93wmz9abfvqdehryv9v"); // just_past_start_mem = p;
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("958t8ufjo5g39llb7x2vk8gey"); // /* The stop_memory opcode represents the end of a group. Its
-UNSUPPORTED("3diz7dyrj8z41hkn0gv0u90nj"); // arguments are the same as start_memory's: the register
-UNSUPPORTED("ancmrtd12048bir4um1a42lk2"); // number, and the number of inner groups. */
-UNSUPPORTED("3q89uw4g68y7kyiitvliyykpb"); // case stop_memory:
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("6myxkco5k76etfo4hu8yr5wbc"); // /* We need to save the string position the last time we were at
-UNSUPPORTED("79ss3fgfp7q2srolhcfv565wc"); // this close-group operator in case the group is operated
-UNSUPPORTED("4g7o1h1hqyb3ed7o7xoukat2e"); // upon by a repetition operator, e.g., with `((a*)*(b*)*)*'
-UNSUPPORTED("7ya5jxfxzzwl6gbtsm5gp06kq"); // against `aba'; then we want to ignore where we are now in
-UNSUPPORTED("elzx65ahdc47yfgprdxj1sjl1"); // the string in case this attempt to match fails. */
-UNSUPPORTED("6tbn6td0l64kefdcsz4l5v4aq"); // old_regend[*p] = ((reg_info[*p]).bits.match_null_string_p)
-UNSUPPORTED("6ei747c3h9zuuwuuoeuutcbvc"); // ? ((regend[*p]) == (&reg_unset_dummy)) ? d : regend[*p]
-UNSUPPORTED("8mmdpk59qqy95iwnf47y5p6dl"); // : regend[*p];
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("1g18yrcifqxtxpfho7si6eeta"); // regend[*p] = d;
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("7vycocnhdpq8h26dxroqf6qv3"); // /* This register isn't active anymore. */
-UNSUPPORTED("7ntazk8yalx2z9fbvgnqmgjyj"); // ((reg_info[*p]).bits.is_active) = 0;
-UNSUPPORTED("5qe9dgngpf1z0x2gaouwzuh33"); // /* Clear this whenever we change the register activity status. */
-UNSUPPORTED("dckkxudermmywleu21wcsh6wk"); // set_regs_matched_done = 0;
-UNSUPPORTED("42clmiwrmzlsyiozfpc5z4nc9"); // /* If this was the only register active, nothing is active
-UNSUPPORTED("1ujxcs2n921afe94v57lwlhbh"); // anymore. */
-UNSUPPORTED("63r84tgp0e98zrp5vtjft0j7v"); // if (lowest_active_reg == highest_active_reg)
-UNSUPPORTED("5k2digv672hnrndhc9ktw0oii"); // {
-UNSUPPORTED("8kmp96mmwzp28qyx61vh0flaz"); // lowest_active_reg = ((1 << 8) + 1);
-UNSUPPORTED("7x2sqxkjont50piw66yo0dtpp"); // highest_active_reg = (1 << 8);
-UNSUPPORTED("b86ovw6olwwo6gnqlt1wqqzb4"); // }
-UNSUPPORTED("cunk7vpvzj28y1x4gn62gxpce"); // else
-UNSUPPORTED("c1jewz2a8ue76qm3v9zzr62p2"); // { /* We must scan for the new highest active register, since
-UNSUPPORTED("decsayupwmti5a04jbhouqvoo"); // it isn't necessarily one less than now: consider
-UNSUPPORTED("2xmzbvq25xm2umlpe67f0xxcl"); // (a(b)c(d(e)f)g). When group 3 ends, after the f), the
-UNSUPPORTED("epks85v9quym7a8m6zf2fqi3"); // new highest active register is 1. */
-UNSUPPORTED("2txbhcyz9wjvsf90upkqlpnc2"); // unsigned char r = *p - 1;
-UNSUPPORTED("5734gbg5fpueutgkx1nymooqp"); // while (r > 0 && !((reg_info[r]).bits.is_active))
-UNSUPPORTED("bdia7d21cgyoa54eec4z33p89"); // r--;
-UNSUPPORTED("8n4iy0kw6ecl8rffe6zhoim7f"); // /* If we end up at register zero, that means that we saved
-UNSUPPORTED("euyoh0d7li8ww59zhb7bcmwss"); // the registers as the result of an `on_failure_jump', not
-UNSUPPORTED("9b4zvqn8u6k8s7opuitogjuop"); // a `start_memory', and we jumped to past the innermost
-UNSUPPORTED("2qdslp2g91aru02gnj2jzfngo"); // `stop_memory'. For example, in ((.)*) we save
-UNSUPPORTED("c49yz0o5hen5lvybntd5j2fns"); // registers 1 and 2 as a result of the *, but when we pop
-UNSUPPORTED("eqfql6meyzhinquampkweqzy6"); // back to the second ), we are at the stop_memory 1.
-UNSUPPORTED("3y5zlgk5fpwzvouq2l6ssxmd1"); // Thus, nothing is active. */
-UNSUPPORTED("34eseuqzde8opwrs60ycvdlou"); // if (r == 0)
-UNSUPPORTED("4hzaau620c4rh7xorkrmxfut7"); // {
-UNSUPPORTED("6sxj2komvl2u668mxzv7uw1bk"); // lowest_active_reg = ((1 << 8) + 1);
-UNSUPPORTED("4wvntivmvrdiicobd01fuopc1"); // highest_active_reg = (1 << 8);
-UNSUPPORTED("2tfish0jog6m8uhlhaokmzvm3"); // }
-UNSUPPORTED("ex6jbb36b02x7vzl22fq0yh2l"); // else
-UNSUPPORTED("2gpimcvwuqcsn5m8kxgtrur9s"); // highest_active_reg = r;
-UNSUPPORTED("b86ovw6olwwo6gnqlt1wqqzb4"); // }
-UNSUPPORTED("6tnujp0ji1y0x3qf7nnoewlwi"); // /* If just failed to match something this time around with a
-UNSUPPORTED("c2a0wegxd9akp346q7kd756xk"); // group that's operated on by a repetition operator, try to
-UNSUPPORTED("5sojth3d9jro95jciohpo41gv"); // force exit from the ``loop'', and restore the register
-UNSUPPORTED("6y1gydjqgpmctcds7f5sg7r7a"); // information for this group that we had before trying this
-UNSUPPORTED("7k609wk6ordqikf4gj9wim2mb"); // last match. */
-UNSUPPORTED("drsdlw7kcvkqlu9vl2ekb5pva"); // if ((!((reg_info[*p]).bits.matched_something)
-UNSUPPORTED("djhystklzfwsz99ch5tg2mdul"); // || just_past_start_mem == p - 1)
-UNSUPPORTED("73puidl4bjed2y05glwuha2tr"); // && (p + 2) < pend)
-UNSUPPORTED("5k2digv672hnrndhc9ktw0oii"); // {
-UNSUPPORTED("5bmgzdh5rp0tqqvuep6upitw5"); // boolean is_a_jump_n = 0;
-UNSUPPORTED("6i6e11jwv13din36enbo5swaa"); // p1 = p + 2;
-UNSUPPORTED("wr9bhelppzmwslf6sw3zxs9m"); // mcnt = 0;
-UNSUPPORTED("8y47wte4d9uar38b22v7dqq3g"); // switch ((re_opcode_t) *p1++)
-UNSUPPORTED("4hzaau620c4rh7xorkrmxfut7"); // {
-UNSUPPORTED("bok1esp1zekmbuklmyk3rk5rx"); // case jump_n:
-UNSUPPORTED("38gwuf75sc2x4fup5mqsis4x6"); // is_a_jump_n = 1;
-UNSUPPORTED("a8ugqe6z5croeioatypl4otaw"); // case pop_failure_jump:
-UNSUPPORTED("75n3w229uzeshyir5i61r1043"); // case maybe_pop_jump:
-UNSUPPORTED("6l3m2qx4riktyve4e2l0wh9fe"); // case jump:
-UNSUPPORTED("dnliw06x9ef4nef4vszyc6y2o"); // case dummy_failure_jump:
-UNSUPPORTED("4sq4b65a0bh8lf919g64pqica"); // do { do { (mcnt) = *(p1) & 0377; (mcnt) += ((((unsigned char) (*((p1) + 1))) ^ 128) - 128) << 8; } while (0); (p1) += 2; } while (0);
-UNSUPPORTED("c286v7bq7t229rlti3rgsn6i4"); // if (is_a_jump_n)
-UNSUPPORTED("70d9iq4l9znncby73z47xsgqd"); // p1 += 2;
-UNSUPPORTED("1fg4xctmq8acy7m0oob45guaz"); // break;
-UNSUPPORTED("cyzkq50b2b248lxpi6lj66jqs"); // default:
-UNSUPPORTED("2oxjzlotqn0ba3akkxgs9h02q"); // /* do nothing */ ;
-UNSUPPORTED("2tfish0jog6m8uhlhaokmzvm3"); // }
-UNSUPPORTED("8yasklhrgy6q7ca1rahwnp80l"); // p1 += mcnt;
-UNSUPPORTED("efql51mwt6tl2tkzt0wc69svs"); // /* If the next operation is a jump backwards in the pattern
-UNSUPPORTED("b1jwyhb9r9kdtn75700ivpm08"); // to an on_failure_jump right before the start_memory
-UNSUPPORTED("32ioduqtcldpe0p955ukfx3zq"); // corresponding to this stop_memory, exit from the loop
-UNSUPPORTED("7u1pbravuknawsh6n44eiljij"); // by forcing a failure after pushing on the stack the
-UNSUPPORTED("1rtxd5d0unekapkzuv0h8bfs9"); // on_failure_jump's jump in the pattern, and d. */
-UNSUPPORTED("49ilcm43sqxuhnrflxjzpkyrz"); // if (mcnt < 0 && (re_opcode_t) *p1 == on_failure_jump
-UNSUPPORTED("bbntf9gewbymuo5dr9q61l4ad"); // && (re_opcode_t) p1[3] == start_memory && p1[4] == *p)
-UNSUPPORTED("4hzaau620c4rh7xorkrmxfut7"); // {
-UNSUPPORTED("82lu6y87gmwdhb71nwh4nyhlo"); // /* If this group ever matched anything, then restore
-UNSUPPORTED("2hafp02wsznqsqyi5m15pval5"); // what its registers were before trying this last
-UNSUPPORTED("d7lxjfsfhmoewr3xbgu83ccq6"); // failed match, e.g., with `(a*)*b' against `ab' for
-UNSUPPORTED("2a1hjbfps60tel0gx3rexgyr7"); // regstart[1], and, e.g., with `((a*)*(b*)*)*'
-UNSUPPORTED("c9ye99yclkdsse5qxjva6xyqv"); // against `aba' for regend[3].
-UNSUPPORTED("dwcg6me58csfjm6h83aoldo1o"); // Also restore the registers for inner groups for,
-UNSUPPORTED("ainjqejclhkthdqm7hwkfddil"); // e.g., `((a*)(b*))*' against `aba' (register 3 would
-UNSUPPORTED("8je91go3933r1lpui4r55qp19"); // otherwise get trashed). */
-UNSUPPORTED("1eohn7q2w1elvkijli82m25w4"); // if (((reg_info[*p]).bits.ever_matched_something))
-UNSUPPORTED("bho20rvti5y7pi0voz7il3e40"); // {
-UNSUPPORTED("bah7hcsvx8y54udzheryy1hzy"); // unsigned r;
-UNSUPPORTED("8akg97mqbnr924ugno750b17t"); // ((reg_info[*p]).bits.ever_matched_something) = 0;
-UNSUPPORTED("7m9djhctqynaualhx1nqdnjc0"); // /* Restore this and inner groups' (if any) registers. */
-UNSUPPORTED("7js4crblmtp6bs951tlz5pibu"); // for (r = *p; r < (unsigned) *p + (unsigned) *(p + 1);
-UNSUPPORTED("41t6k9ezn45tjk4rj4o95hvw7"); // r++)
-UNSUPPORTED("1fi5w21ki1vo1jwyr4xwgm27n"); // {
-UNSUPPORTED("89r32r5193oexr1uoui24rp55"); // regstart[r] = old_regstart[r];
-UNSUPPORTED("ie5lviszvuyotv6i5dfa0pe5"); // /* xx why this test? */
-UNSUPPORTED("caayksps71ouk9rtbgpk336bb"); // if (old_regend[r] >= regstart[r])
-UNSUPPORTED("13lqnupq8b5xodzv3xff3oze1"); // regend[r] = old_regend[r];
-UNSUPPORTED("bf03xtomlwkahoqno8ua4cbpc"); // }
-UNSUPPORTED("ad3bk4xnx8bgy7plhun3c0mvv"); // }
-UNSUPPORTED("3aju47l7l855mt7l00l7xg11q"); // p1++;
-UNSUPPORTED("4sq4b65a0bh8lf919g64pqica"); // do { do { (mcnt) = *(p1) & 0377; (mcnt) += ((((unsigned char) (*((p1) + 1))) ^ 128) - 128) << 8; } while (0); (p1) += 2; } while (0);
-UNSUPPORTED("a9p5b9oxka3gxpe3wgzvhfj4b"); // do { char *destination; s_reg_t this_reg; ; ; ; ; ; ; ; while (((fail_stack).size - (fail_stack).avail) < (((0 ? 0 : highest_active_reg - lowest_active_reg + 1) * 3) + 4)) { if (!((fail_stack).size > (unsigned) (re_max_failures * (5 * 3 + 4)) ? 0 : ((fail_stack).stack = (fail_stack_elt_t *) (destination = (char *) alloca (((fail_stack).size << 1) * sizeof(fail_stack_elt_t)), bcopy ((fail_stack).stack, destination, (fail_stack).size * sizeof(fail_stack_elt_t)), destination), (fail_stack).stack == (void *)0 ? 0 : ((fail_stack).size <<= 1, 1)))) return -2; ; ; } ; if (1) for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; this_reg++) { ; ; ; fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (regstart[this_reg]); ; fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (regend[this_reg]); ; ; ; ; ; ; fail_stack.stack[fail_stack.avail++] = (reg_info[this_reg].word); } ; fail_stack.stack[fail_stack.avail++].integer = (lowest_active_reg); ; fail_stack.stack[fail_stack.avail++].integer = (highest_active_reg); ; ; fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (p1 + mcnt); ; ; ; fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (d); ; ; } while (0);
-UNSUPPORTED("3cl1in74qmmbb26vs4qw3mcuv"); // goto fail;
-UNSUPPORTED("2tfish0jog6m8uhlhaokmzvm3"); // }
-UNSUPPORTED("b86ovw6olwwo6gnqlt1wqqzb4"); // }
-UNSUPPORTED("2wofa1c2dglau2ufwmcabib0n"); // /* Move past the register number and the inner group count. */
-UNSUPPORTED("8mazj3o2k4ts6oo83xpc0clf6"); // p += 2;
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("7ckwgnb7aasatvtyteljdqc2k"); // /* \<digit> has been turned into a `duplicate' command which is
-UNSUPPORTED("dmy8z2x1ttnsvz6kx6l9j4rtv"); // followed by the numeric value of <digit> as the register number. */
-UNSUPPORTED("9zkejga7r0tbainhrb6zuw9os"); // case duplicate:
-UNSUPPORTED("4vdjxw5o61xlsk38ouw1wsypc"); // {
-UNSUPPORTED("27u228yvq9k655bp1tq40v02i"); // register const char *d2, *dend2;
-UNSUPPORTED("bq38n54ifn0fjxun9mtdpyxkj"); // int regno = *p++; /* Get which register to match against. */
-UNSUPPORTED("6mnx06fa3p4n9bhd9htqjy0il"); // ;
-UNSUPPORTED("91m4oa28hi3m5f5icw5pumfab"); // /* Can't back reference a group which we've never matched. */
-UNSUPPORTED("9r6debcfgkrh9r4029g0p2tsz"); // if (((regstart[regno]) == (&reg_unset_dummy)) || ((regend[regno]) == (&reg_unset_dummy)))
-UNSUPPORTED("1k6xdu198jqq8v2oj3209y50s"); // goto fail;
-UNSUPPORTED("dng36k157gcr0rr6l2hysesr7"); // /* Where in input to try to start matching. */
-UNSUPPORTED("209civ9l0k19m94b62pp4080r"); // d2 = regstart[regno];
-UNSUPPORTED("eexsdzuwnhjynwkc8g0u6hnwm"); // /* Where to stop matching; if both the place to start and
-UNSUPPORTED("bup7nhzrolgesclm7ac7j3pke"); // the place to stop matching are in the same string, then
-UNSUPPORTED("8kg60w180bvkgrv4dgbrd491u"); // set to the place to stop, otherwise, for now have to use
-UNSUPPORTED("9tumayloc0nncf60m1sfzkjhl"); // the end of the first string. */
-UNSUPPORTED("9dfy4gfwxkdnc83mqwy6mg4hw"); // dend2 = (((size1 && string1 <= (regstart[regno]) && (regstart[regno]) <= string1 + size1)
-UNSUPPORTED("c0t5y6icuv24moevxaqu2h4zx"); // == (size1 && string1 <= (regend[regno]) && (regend[regno]) <= string1 + size1))
-UNSUPPORTED("ebo6m6ze117x4ioed7wvc6omz"); // ? regend[regno] : end_match_1);
-UNSUPPORTED("1nx31c51hb376ceydwsae35jq"); // for (;;)
-UNSUPPORTED("9aq2ft2quyeattze0cwemwweo"); // {
-UNSUPPORTED("6bj5pjn8kja9qic9u7at0g4va"); // /* If necessary, advance to next segment in register
-UNSUPPORTED("8qcz04tc3rbrg7kjuf9xezhks"); // contents. */
-UNSUPPORTED("braae8dlluapap8zd5o6ihc1u"); // while (d2 == dend2)
-UNSUPPORTED("3trws9zymzc11hz9w8m2b4fl9"); // {
-UNSUPPORTED("47ijn5xqcu6vix8sa88nyj6g3"); // if (dend2 == end_match_2) break;
-UNSUPPORTED("5wcf12qydzz346az1zp6sbphr"); // if (dend2 == regend[regno]) break;
-UNSUPPORTED("36wliwq9pfherfng9wg1z2930"); // /* End of string1 => advance to string2. */
-UNSUPPORTED("97sxan60njmrt6lx6dhy0t35a"); // d2 = string2;
-UNSUPPORTED("yedssw060ohvbc7klzkqa7ky"); // dend2 = regend[regno];
-UNSUPPORTED("2v7ai112w6nt2xgs1gbzo22oe"); // }
-UNSUPPORTED("a3i8zhtb0tt9m1ilvwxr0yry6"); // /* At end of register contents => success */
-UNSUPPORTED("9zvbjhvrz5uc7k4zmhbwdfvr6"); // if (d2 == dend2) break;
-UNSUPPORTED("afb4xzyk6gdokmo985hyfw8c9"); // /* If necessary, advance to next segment in data. */
-UNSUPPORTED("ey839udf98rupfliazw91iwf4"); // while (d == dend) { if (dend == end_match_2) goto fail; d = string2; dend = end_match_2; };
-UNSUPPORTED("ecd7rg6163cvfm8v1rtt0jtpb"); // /* How many characters left in this segment to match. */
-UNSUPPORTED("az6v71e6bfrxdlm5zelm70aji"); // mcnt = dend - d;
-UNSUPPORTED("96v7a28oxrisen4iasx18f02h"); // /* Want how many consecutive characters we can match in
-UNSUPPORTED("1iug3sdumn7i4romdq11ea8gc"); // one shot, so, if necessary, adjust the count. */
-UNSUPPORTED("k5cjd1jaihwrz80htbwhcz1k"); // if (mcnt > dend2 - d2)
-UNSUPPORTED("8sygn6fz8wegxhzaxpof9nfdy"); // mcnt = dend2 - d2;
-UNSUPPORTED("cq9zkdhm0s7gm3of2ojllwxev"); // /* Compare that many; failure if mismatch, else move
-UNSUPPORTED("cwb3st7nyauiej3bt6si7nk"); // past them. */
-UNSUPPORTED("8yrz36iknz8u14syi843ya22w"); // if (translate
-UNSUPPORTED("1csum7liyqa4kjt5vzjgwl055"); // ? bcmp_translate (d, d2, mcnt, translate)
-UNSUPPORTED("2mfklscfw9ja01nrbw8irsd34"); // : bcmp (d, d2, mcnt))
-UNSUPPORTED("3cl1in74qmmbb26vs4qw3mcuv"); // goto fail;
-UNSUPPORTED("ejde9u9b01jxuvulwaibu252x"); // d += mcnt, d2 += mcnt;
-UNSUPPORTED("egy6z5e2fbinnxr0gts3znpv4"); // /* Do this because we've match some characters. */
-UNSUPPORTED("b1re2muw6n42ivurg658dizzz"); // do { if (!set_regs_matched_done) { active_reg_t r; set_regs_matched_done = 1; for (r = lowest_active_reg; r <= highest_active_reg; r++) { ((reg_info[r]).bits.matched_something) = ((reg_info[r]).bits.ever_matched_something) = 1; } } } while (0);
-UNSUPPORTED("13jcwbk3vyfh9xrmwi5hbe7so"); // }
-UNSUPPORTED("3e08x1y395304nd0y3uwffvim"); // }
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("if344u3tlfkgjfkh9bwgpq8a"); // /* begline matches the empty string at the beginning of the string
-UNSUPPORTED("ezwcv5j2ponvqm9xcbipsht8u"); // (unless `not_bol' is set in `bufp'), and, if
-UNSUPPORTED("5elzkvlxjqh3r6z34t1j5y21o"); // `newline_anchor' is set, after newlines. */
-UNSUPPORTED("7zj5ggx1l6hln4ude6h5p4hgw"); // case begline:
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("9vfz6wya8x71wz4tl74mnon03"); // if (((d) == (size1 ? string1 : string2) || !size2))
-UNSUPPORTED("5k2digv672hnrndhc9ktw0oii"); // {
-UNSUPPORTED("5xiy4c6bz8y6xryzgmegy61lb"); // if (!bufp->not_bol) break;
-UNSUPPORTED("b86ovw6olwwo6gnqlt1wqqzb4"); // }
-UNSUPPORTED("5vfekfkt5mncyuqxnse5u327k"); // else if (d[-1] == '\n' && bufp->newline_anchor)
-UNSUPPORTED("5k2digv672hnrndhc9ktw0oii"); // {
-UNSUPPORTED("7mosouhqcis2k8sbg88g9wol8"); // break;
-UNSUPPORTED("b86ovw6olwwo6gnqlt1wqqzb4"); // }
-UNSUPPORTED("cmda966opn67h0f3cl7lk5oaa"); // /* In all other cases, we fail. */
-UNSUPPORTED("9s7xl8jyc2iazjidoga852mei"); // goto fail;
-UNSUPPORTED("6ab5d4s6v9zc6g10652lkpfxb"); // /* endline is the dual of begline. */
-UNSUPPORTED("8pqai98vstdak51ot078dn1ut"); // case endline:
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("ruaqj050rr07ll8b70yjadcf"); // if (((d) == end2))
-UNSUPPORTED("5k2digv672hnrndhc9ktw0oii"); // {
-UNSUPPORTED("3zg6eo8m095cishibd0umbzff"); // if (!bufp->not_eol) break;
-UNSUPPORTED("b86ovw6olwwo6gnqlt1wqqzb4"); // }
-UNSUPPORTED("1n7gdt1mnk1dwyec8i0pk3vkx"); // /* We have to ``prefetch'' the next character. */
-UNSUPPORTED("67ozwfkze7vtbzog58zzkcvh7"); // else if ((d == end1 ? *string2 : *d) == '\n'
-UNSUPPORTED("8whjciz1pz1blross2jpqly5f"); // && bufp->newline_anchor)
-UNSUPPORTED("5k2digv672hnrndhc9ktw0oii"); // {
-UNSUPPORTED("7mosouhqcis2k8sbg88g9wol8"); // break;
-UNSUPPORTED("b86ovw6olwwo6gnqlt1wqqzb4"); // }
-UNSUPPORTED("9s7xl8jyc2iazjidoga852mei"); // goto fail;
-UNSUPPORTED("1aa2xpr66utsdr273h0vay7rp"); // /* Match at the very beginning of the data. */
-UNSUPPORTED("889sq08u5lsi3c6y2z7adu8ex"); // case begbuf:
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("9vfz6wya8x71wz4tl74mnon03"); // if (((d) == (size1 ? string1 : string2) || !size2))
-UNSUPPORTED("605r8o1isen77125aqrohs6ac"); // break;
-UNSUPPORTED("9s7xl8jyc2iazjidoga852mei"); // goto fail;
-UNSUPPORTED("4z8rppnva31fi9mwshpp8kxvw"); // /* Match at the very end of the data. */
-UNSUPPORTED("cx4ezn3s02koh0pq7idm2xvxc"); // case endbuf:
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("ruaqj050rr07ll8b70yjadcf"); // if (((d) == end2))
-UNSUPPORTED("605r8o1isen77125aqrohs6ac"); // break;
-UNSUPPORTED("9s7xl8jyc2iazjidoga852mei"); // goto fail;
-UNSUPPORTED("3wki3bf5yoz1vc1fprg2lncya"); // /* on_failure_keep_string_jump is used to optimize `.*\n'. It
-UNSUPPORTED("pql30urhclx8h7lod7pnj4ip"); // pushes NULL as the value for the string on the stack. Then
-UNSUPPORTED("dzwsld9trwycslc5k99jr9muh"); // `pop_failure_point' will keep the current value for the
-UNSUPPORTED("3xl98pouep4b4iwcgj8vvabvc"); // string, instead of restoring it. To see why, consider
-UNSUPPORTED("8wxp3mbfp1jdn6hlq6djbv5gj"); // matching `foo\nbar' against `.*\n'. The .* matches the foo;
-UNSUPPORTED("djf7x62cv5c4kahfoqaehjrk9"); // then the . fails against the \n. But the next thing we want
-UNSUPPORTED("4n6sotfrko2ssux5cwdwroytq"); // to do is match the \n against the \n; if we restored the
-UNSUPPORTED("9gm1fhuma2g5732wasioh293h"); // string value, we would be back at the foo.
-UNSUPPORTED("9pocj5oo194wevmdb2pun171k"); // Because this is used only in specific cases, we don't need to
-UNSUPPORTED("22xw129jbwcohdom5on8mruf1"); // check all the things that `on_failure_jump' does, to make
-UNSUPPORTED("ov1lrnfw4f23mi84a3odmle4"); // sure the right things get saved on the stack. Hence we don't
-UNSUPPORTED("8xgl4y5ygq098dtwrbuwey6gq"); // share its code. The only reason to push anything on the
-UNSUPPORTED("by06u3v9h2tr9d1hfpggutrts"); // stack at all is that otherwise we would have to change
-UNSUPPORTED("cd2otw100j4q2pgbijt7jkkzt"); // `anychar's code to do something besides goto fail in this
-UNSUPPORTED("32dqefvhlxi1u35k3ewta7mrl"); // case; that seems worse than this. */
-UNSUPPORTED("753el6ua6knou432p32d1kbcc"); // case on_failure_keep_string_jump:
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("cxpumlm6doboe0ubkx51bqcx1"); // do { do { (mcnt) = *(p) & 0377; (mcnt) += ((((unsigned char) (*((p) + 1))) ^ 128) - 128) << 8; } while (0); (p) += 2; } while (0);
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("4l5nbs7foacbvjtuv07q72uuo"); // do { char *destination; s_reg_t this_reg; ; ; ; ; ; ; ; while (((fail_stack).size - (fail_stack).avail) < (((0 ? 0 : highest_active_reg - lowest_active_reg + 1) * 3) + 4)) { if (!((fail_stack).size > (unsigned) (re_max_failures * (5 * 3 + 4)) ? 0 : ((fail_stack).stack = (fail_stack_elt_t *) (destination = (char *) alloca (((fail_stack).size << 1) * sizeof(fail_stack_elt_t)), bcopy ((fail_stack).stack, destination, (fail_stack).size * sizeof(fail_stack_elt_t)), destination), (fail_stack).stack == (void *)0 ? 0 : ((fail_stack).size <<= 1, 1)))) return -2; ; ; } ; if (1) for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; this_reg++) { ; ; ; fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (regstart[this_reg]); ; fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (regend[this_reg]); ; ; ; ; ; ; fail_stack.stack[fail_stack.avail++] = (reg_info[this_reg].word); } ; fail_stack.stack[fail_stack.avail++].integer = (lowest_active_reg); ; fail_stack.stack[fail_stack.avail++].integer = (highest_active_reg); ; ; fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (p + mcnt); ; ; ; fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) ((void *)0); ; ; } while (0);
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("18mowhc7dokjwwbpjm3c0jjz3"); // /* Uses of on_failure_jump:
-UNSUPPORTED("6hohd1mhntprbr29uarcgbh63"); // Each alternative starts with an on_failure_jump that points
-UNSUPPORTED("9ltnucad533b0qouy73o7txqh"); // to the beginning of the next alternative. Each alternative
-UNSUPPORTED("56exr10nxswdfl6el06yzn1kl"); // except the last ends with a jump that in effect jumps past
-UNSUPPORTED("7mx68jjud7wzo6avh55bb818j"); // the rest of the alternatives. (They really jump to the
-UNSUPPORTED("9nytxeg7tfysw0cho7phep44z"); // ending jump of the following alternative, because tensioning
-UNSUPPORTED("ax1r80aorhdnf7k83i580xkrd"); // these jumps is a hassle.)
-UNSUPPORTED("b3w92k7mmdeshyrsyx5j12h3g"); // Repeats start with an on_failure_jump that points past both
-UNSUPPORTED("aef21o4yg56obwkotdy9xg0ho"); // the repetition text and either the following jump or
-UNSUPPORTED("3wjc6x34irsiejqg1kbgn3iyt"); // pop_failure_jump back to this on_failure_jump. */
-UNSUPPORTED("992rmruvdtrxnk46307iiqyjo"); // case on_failure_jump:
-UNSUPPORTED("c776gsd8agjizu0u6zgrf49u3"); // on_failure:
-UNSUPPORTED("7xijz1d7skix4nbsjyzbkawyz"); // ;
-UNSUPPORTED("6rhr1dl5qu710655mp1bqo0i6"); // do { do { (mcnt) = *(p) & 0377; (mcnt) += ((((unsigned char) (*((p) + 1))) ^ 128) - 128) << 8; } while (0); (p) += 2; } while (0);
-UNSUPPORTED("7xijz1d7skix4nbsjyzbkawyz"); // ;
-UNSUPPORTED("f46w21fc8pt03jhpnaepq03um"); // /* If this on_failure_jump comes right before a group (i.e.,
-UNSUPPORTED("4osoy23qvwvclpht018wy5fe"); // the original * applied to a group), save the information
-UNSUPPORTED("bfbi4c30km7bjt8vdpfguqx3b"); // for that group and all inner ones, so that if we fail back
-UNSUPPORTED("1ra232qtft0mi461dabhedxp4"); // to this point, the group's information will be correct.
-UNSUPPORTED("b2mqhhpsbx6j245sm4leiu3dn"); // For example, in \(a*\)*\1, we need the preceding group,
-UNSUPPORTED("6do6go4hsy6lmqykgor4s9ygv"); // and in \(zz\(a*\)b*\)\2, we need the inner group. */
-UNSUPPORTED("enwxe23t405zzw5yadk743a5r"); // /* We can't use `p' to check ahead because we push
-UNSUPPORTED("6yxbydq88le4or0xwwq5siqmw"); // a failure point to `p + mcnt' after we do this. */
-UNSUPPORTED("di4spe1yrvg37sczy634usb7k"); // p1 = p;
-UNSUPPORTED("816d2v18z6b4clqeuef1am657"); // /* We need to skip no_op's before we look for the
-UNSUPPORTED("ch11lyve93ighowv1prcy2j8k"); // start_memory in case this on_failure_jump is happening as
-UNSUPPORTED("6qg7rlv2r0m6k4j5x75pimlaa"); // the result of a completed succeed_n, as in \(a\)\{1,3\}b\1
-UNSUPPORTED("978ibng6ccfuidf65t6s6mgq0"); // against aba. */
-UNSUPPORTED("ajcmgk4q2zko19taooby9ydhf"); // while (p1 < pend && (re_opcode_t) *p1 == no_op)
-UNSUPPORTED("4hemvstzejy8d3hmd82kukj7v"); // p1++;
-UNSUPPORTED("6srqj3lww8szsp64bd64yus7k"); // if (p1 < pend && (re_opcode_t) *p1 == start_memory)
-UNSUPPORTED("4vdjxw5o61xlsk38ouw1wsypc"); // {
-UNSUPPORTED("54s4csu4aujalr4c0swqowr5k"); // /* We have a new highest active register now. This will
-UNSUPPORTED("4ig8j5bvaq59fsf9hfdn1q5ys"); // get reset at the start_memory we are about to get to,
-UNSUPPORTED("6aatr095mst5lfh4soia9qpg2"); // but we will have saved all the registers relevant to
-UNSUPPORTED("2a6e61mk8qy9pwnls9zifuok6"); // this repetition op, as described above. */
-UNSUPPORTED("50t6ewzx8ghn8hjs3qg8z17sc"); // highest_active_reg = *(p1 + 1) + *(p1 + 2);
-UNSUPPORTED("bxlrtrilu12d2jxucjuex0vfp"); // if (lowest_active_reg == ((1 << 8) + 1))
-UNSUPPORTED("6li0h0b9p3vauo9vgyypu8fux"); // lowest_active_reg = *(p1 + 1);
-UNSUPPORTED("3e08x1y395304nd0y3uwffvim"); // }
-UNSUPPORTED("7xijz1d7skix4nbsjyzbkawyz"); // ;
-UNSUPPORTED("4637n0f945d4uznxowpb1ha4i"); // do { char *destination; s_reg_t this_reg; ; ; ; ; ; ; ; while (((fail_stack).size - (fail_stack).avail) < (((0 ? 0 : highest_active_reg - lowest_active_reg + 1) * 3) + 4)) { if (!((fail_stack).size > (unsigned) (re_max_failures * (5 * 3 + 4)) ? 0 : ((fail_stack).stack = (fail_stack_elt_t *) (destination = (char *) alloca (((fail_stack).size << 1) * sizeof(fail_stack_elt_t)), bcopy ((fail_stack).stack, destination, (fail_stack).size * sizeof(fail_stack_elt_t)), destination), (fail_stack).stack == (void *)0 ? 0 : ((fail_stack).size <<= 1, 1)))) return -2; ; ; } ; if (1) for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; this_reg++) { ; ; ; fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (regstart[this_reg]); ; fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (regend[this_reg]); ; ; ; ; ; ; fail_stack.stack[fail_stack.avail++] = (reg_info[this_reg].word); } ; fail_stack.stack[fail_stack.avail++].integer = (lowest_active_reg); ; fail_stack.stack[fail_stack.avail++].integer = (highest_active_reg); ; ; fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (p + mcnt); ; ; ; fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (d); ; ; } while (0);
-UNSUPPORTED("d1pumbibe8xz2i7gr1wj6zdak"); // break;
-UNSUPPORTED("ezli68qam5jhg7sd2n0z30pa1"); // /* A smart repeat ends with `maybe_pop_jump'.
-UNSUPPORTED("5d7n4fkgg5a38sjzmkhaoa8hl"); // We change it to either `pop_failure_jump' or `jump'. */
-UNSUPPORTED("d7ziafib9p2sa0rqh34hv3hwj"); // case maybe_pop_jump:
-UNSUPPORTED("cxpumlm6doboe0ubkx51bqcx1"); // do { do { (mcnt) = *(p) & 0377; (mcnt) += ((((unsigned char) (*((p) + 1))) ^ 128) - 128) << 8; } while (0); (p) += 2; } while (0);
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("4vdjxw5o61xlsk38ouw1wsypc"); // {
-UNSUPPORTED("4i49ynnzyaszs2krb0aw4uqa0"); // register unsigned char *p2 = p;
-UNSUPPORTED("8b4raalmwo7274mwsk0kcdlbp"); // /* Compare the beginning of the repeat with what in the
-UNSUPPORTED("6ox8v5j7jznz10vsvok39lx6h"); // pattern follows its end. If we can establish that there
-UNSUPPORTED("1qm38p3f1vojknhw7v973ela0"); // is nothing that they would both match, i.e., that we
-UNSUPPORTED("2wnj0iemov40iryz5lsfp3zi5"); // would have to backtrack because of (as in, e.g., `a*a')
-UNSUPPORTED("9zp4vdc61w9qqpto61p74x8x0"); // then we can change to pop_failure_jump, because we'll
-UNSUPPORTED("cdtoaohseagznp9y8u81kbpru"); // never have to backtrack.
-UNSUPPORTED("63w8z2r32mq0x6xowpwds9vjb"); // This is not true in the case of alternatives: in
-UNSUPPORTED("a98qcnnc9pzff1gk8kfj32f1i"); // `(a|ab)*' we do need to backtrack to the `ab' alternative
-UNSUPPORTED("errex35giie09vkvn4e9fe4zk"); // (e.g., if the string was `ab'). But instead of trying to
-UNSUPPORTED("1147ja0a6sr58jg8z4hjs19ji"); // detect that here, the alternative has put on a dummy
-UNSUPPORTED("64mr7nyur7w7m85zrdx15fqli"); // failure point which is what we will end up popping. */
-UNSUPPORTED("amvyb0hgs5zfdebpexntlvwfd"); // /* Skip over open/close-group commands.
-UNSUPPORTED("2lx4i6yu241papyqk442d7gf1"); // If what follows this loop is a ...+ construct,
-UNSUPPORTED("1pvxwmxmctfoyisu33wn2tgym"); // look at what begins its body, since we will have to
-UNSUPPORTED("8tbga6r8dqnryesfg5bmccsge"); // match at least one of that. */
-UNSUPPORTED("9nuuiq5ff5vu3ehueiarndup8"); // while (1)
-UNSUPPORTED("9aq2ft2quyeattze0cwemwweo"); // {
-UNSUPPORTED("2dak6ikzsj12jm54tispfishb"); // if (p2 + 2 < pend
-UNSUPPORTED("7yw7v0svrd5pmn1jcqlc4e3u1"); // && ((re_opcode_t) *p2 == stop_memory
-UNSUPPORTED("2yx468hmjjmhvuzxlu2jyltzc"); // || (re_opcode_t) *p2 == start_memory))
-UNSUPPORTED("4hgr2e6ls0cizy5kicpo9i13a"); // p2 += 3;
-UNSUPPORTED("1yuf55oz0qpsj5aqp5h5fpr42"); // else if (p2 + 6 < pend
-UNSUPPORTED("bw2og6j9w6s47jv3rzusqgra5"); // && (re_opcode_t) *p2 == dummy_failure_jump)
-UNSUPPORTED("6ennx95kxfn7n27tkdpz2xiun"); // p2 += 6;
-UNSUPPORTED("a4hbs6luulhltmygux2zimbcc"); // else
-UNSUPPORTED("1fg4xctmq8acy7m0oob45guaz"); // break;
-UNSUPPORTED("13jcwbk3vyfh9xrmwi5hbe7so"); // }
-UNSUPPORTED("d2fh23u27kss8fzwuwtp0p6sf"); // p1 = p + mcnt;
-UNSUPPORTED("90n7ynf24mp5fmsi2nznee8aj"); // /* p1[0] ... p1[2] are the `on_failure_jump' corresponding
-UNSUPPORTED("4vso45anytez4cjlpkfnzk1ul"); // to the `maybe_finalize_jump' of this case. Examine what
-UNSUPPORTED("b0juiqz00zb3viboquom9nj05"); // follows. */
-UNSUPPORTED("66jpg0e4bmb6ltcah5ku9m5wf"); // /* If we're at the end of the pattern, we can change. */
-UNSUPPORTED("5xkeog52k82g0w44z3mfurqp7"); // if (p2 == pend)
-UNSUPPORTED("9aq2ft2quyeattze0cwemwweo"); // {
-UNSUPPORTED("e25zbxyj1st10oslj3hfvjw9a"); // /* Consider what happens when matching ":\(.*\)"
-UNSUPPORTED("1qa8sj8fsagixe1jkmm9j7s4u"); // against ":/". I don't really understand this code
-UNSUPPORTED("bawpwuc0i5d4c4v2365l038h3"); // yet. */
-UNSUPPORTED("5zj568kdmyc87wog3sgbfzsd2"); // p[-3] = (unsigned char) pop_failure_jump;
-UNSUPPORTED("9fy78dg2q1uu4c2t1zsyaestf"); // ;
-UNSUPPORTED("13jcwbk3vyfh9xrmwi5hbe7so"); // }
-UNSUPPORTED("2wredhzqyuxjyd1qy0vxr02p6"); // else if ((re_opcode_t) *p2 == exactn
-UNSUPPORTED("5439ysolyacwtm0iroxxof9ja"); // || (bufp->newline_anchor && (re_opcode_t) *p2 == endline))
-UNSUPPORTED("9aq2ft2quyeattze0cwemwweo"); // {
-UNSUPPORTED("6ailij025yibbye551dmh9is0"); // register unsigned char c
-UNSUPPORTED("68vch1mgcskmseij0qhms2rl9"); // = *p2 == (unsigned char) endline ? '\n' : p2[2];
-UNSUPPORTED("1yo80wyjqsiw1t17we6c8a6gr"); // if ((re_opcode_t) p1[3] == exactn && p1[5] != c)
-UNSUPPORTED("3trws9zymzc11hz9w8m2b4fl9"); // {
-UNSUPPORTED("agl6h59gsalgrbxzq7fk4n0vn"); // p[-3] = (unsigned char) pop_failure_jump;
-UNSUPPORTED("czvlqjtrpajrtul735yf6cmfz"); // ;
-UNSUPPORTED("2v7ai112w6nt2xgs1gbzo22oe"); // }
-UNSUPPORTED("exal5xqo67c7zaxk3gaoj3n0i"); // else if ((re_opcode_t) p1[3] == charset
-UNSUPPORTED("e0kae24mabhgjjynwkmainteq"); // || (re_opcode_t) p1[3] == charset_not)
-UNSUPPORTED("3trws9zymzc11hz9w8m2b4fl9"); // {
-UNSUPPORTED("do2ngnlega9hi7rlbi6pwnera"); // int not = (re_opcode_t) p1[3] == charset_not;
-UNSUPPORTED("5f33xcwhul4d1gb3t7lj27aam"); // if (c < (unsigned char) (p1[4] * 8)
-UNSUPPORTED("78cradlgzgss8hx6xr31uun4d"); // && p1[5 + c / 8] & (1 << (c % 8)))
-UNSUPPORTED("7n22hwonng6xigiqxvbruxroo"); // not = !not;
-UNSUPPORTED("dpe5oc4fbt7r8mffvrkacad7a"); // /* `not' is equal to 1 if c would match, which means
-UNSUPPORTED("bqyj06a9kascwc6t354y5gh61"); // that we can't change to pop_failure_jump. */
-UNSUPPORTED("z5vz9r2m8zndo9aeyvz3w07z"); // if (!not)
-UNSUPPORTED("el767oi7fhlc4apdbx8dsvnk6"); // {
-UNSUPPORTED("6aq9gjy2dwkpua80yonp1njtn"); // p[-3] = (unsigned char) pop_failure_jump;
-UNSUPPORTED("4eruune9bfskm05zy5ipimp2s"); // ;
-UNSUPPORTED("b5m0ttlk23avgs4i47o8lbzg1"); // }
-UNSUPPORTED("2v7ai112w6nt2xgs1gbzo22oe"); // }
-UNSUPPORTED("13jcwbk3vyfh9xrmwi5hbe7so"); // }
-UNSUPPORTED("3ra1229golg94oou1y8zbvkkp"); // else if ((re_opcode_t) *p2 == charset)
-UNSUPPORTED("9aq2ft2quyeattze0cwemwweo"); // {
-UNSUPPORTED("auubej4lkmydm7wamwki5zgyp"); // if ((re_opcode_t) p1[3] == exactn
-UNSUPPORTED("6zebpplfmgrbk07lmll1yrrsi"); // && ! ((int) p2[1] * 8 > (int) p1[4]
-UNSUPPORTED("9wp8kzivj0sustlx4ftn0l36h"); // && (p2[2 + p1[4] / 8]
-UNSUPPORTED("eyu63dq7uwiiwzvudc2gopty4"); // & (1 << (p1[4] % 8)))))
-UNSUPPORTED("bho20rvti5y7pi0voz7il3e40"); // {
-UNSUPPORTED("8azfcbpc7h84lhyicbrd2yjqp"); // p[-3] = (unsigned char) pop_failure_jump;
-UNSUPPORTED("a6r7lto035pp3gvk1bdixang2"); // ;
-UNSUPPORTED("ad3bk4xnx8bgy7plhun3c0mvv"); // }
-UNSUPPORTED("dcwjh55x5f2wjp4ezmipdxn2b"); // else if ((re_opcode_t) p1[3] == charset_not)
-UNSUPPORTED("bho20rvti5y7pi0voz7il3e40"); // {
-UNSUPPORTED("7gajjg3j6bbfnu7tfpv8vd1he"); // int idx;
-UNSUPPORTED("dxd6z46rfort3j8amp5v1n0wb"); // /* We win if the charset_not inside the loop
-UNSUPPORTED("5r3347hzknz05fu925j2m38f9"); // lists every character listed in the charset after. */
-UNSUPPORTED("drl6mtwfmrng8pxbu6xzqfb18"); // for (idx = 0; idx < (int) p2[1]; idx++)
-UNSUPPORTED("9gmmtilb47lw5pq4j4sejrbj"); // if (! (p2[2 + idx] == 0
-UNSUPPORTED("74zwa83c3pcunsiarfams873p"); // || (idx < (int) p1[4]
-UNSUPPORTED("3ytcwj384elha7evsxusun8r2"); // && ((p2[2 + idx] & ~ p1[5 + idx]) == 0))))
-UNSUPPORTED("1lzsscwayr2ygeagix6ouorzi"); // break;
-UNSUPPORTED("etst8xjhq076idz2ki2lkc3kl"); // if (idx == p2[1])
-UNSUPPORTED("1fi5w21ki1vo1jwyr4xwgm27n"); // {
-UNSUPPORTED("gi02bd0hnoko53b18tp6muxp"); // p[-3] = (unsigned char) pop_failure_jump;
-UNSUPPORTED("7ia8gpv947o65avjiwl96gln5"); // ;
-UNSUPPORTED("bf03xtomlwkahoqno8ua4cbpc"); // }
-UNSUPPORTED("ad3bk4xnx8bgy7plhun3c0mvv"); // }
-UNSUPPORTED("bfp6jy3jhgcx1qlqs2ugtk84o"); // else if ((re_opcode_t) p1[3] == charset)
-UNSUPPORTED("bho20rvti5y7pi0voz7il3e40"); // {
-UNSUPPORTED("7gajjg3j6bbfnu7tfpv8vd1he"); // int idx;
-UNSUPPORTED("3gf62oi7ics60q83j50ht4j54"); // /* We win if the charset inside the loop
-UNSUPPORTED("axtgnnoh8n7p39m9fbbxipnxm"); // has no overlap with the one after the loop. */
-UNSUPPORTED("6fsyvlzx4skvg5xqoif9n2bli"); // for (idx = 0;
-UNSUPPORTED("6d7whyux0667vbtt3aoh8j8mc"); // idx < (int) p2[1] && idx < (int) p1[4];
-UNSUPPORTED("d4o8f5f71ai8ygtqvrs77062h"); // idx++)
-UNSUPPORTED("b029onao79pzr7fwgf9oboalu"); // if ((p2[2 + idx] & p1[5 + idx]) != 0)
-UNSUPPORTED("1lzsscwayr2ygeagix6ouorzi"); // break;
-UNSUPPORTED("6whqfrc9hpkwoqoqk2cpgstzz"); // if (idx == p2[1] || idx == p1[4])
-UNSUPPORTED("1fi5w21ki1vo1jwyr4xwgm27n"); // {
-UNSUPPORTED("gi02bd0hnoko53b18tp6muxp"); // p[-3] = (unsigned char) pop_failure_jump;
-UNSUPPORTED("7ia8gpv947o65avjiwl96gln5"); // ;
-UNSUPPORTED("bf03xtomlwkahoqno8ua4cbpc"); // }
-UNSUPPORTED("ad3bk4xnx8bgy7plhun3c0mvv"); // }
-UNSUPPORTED("13jcwbk3vyfh9xrmwi5hbe7so"); // }
-UNSUPPORTED("3e08x1y395304nd0y3uwffvim"); // }
-UNSUPPORTED("dtbtyud0b7t5ily0nm0qkjrov"); // p -= 2; /* Point at relative address again. */
-UNSUPPORTED("9hexwrt0gnjztdabmcy13w96a"); // if ((re_opcode_t) p[-1] != pop_failure_jump)
-UNSUPPORTED("5k2digv672hnrndhc9ktw0oii"); // {
-UNSUPPORTED("ca1ptlw6k6dixmzbwm3a4iusp"); // p[-1] = (unsigned char) jump;
-UNSUPPORTED("e4kt1tmmevqvy3cbyk6xnznck"); // ;
-UNSUPPORTED("578iyred8hniiy6kj99i6zcx7"); // goto unconditional_jump;
-UNSUPPORTED("b86ovw6olwwo6gnqlt1wqqzb4"); // }
-UNSUPPORTED("et4hfzxq1ccol7oenwuqop34c"); // /* Note fall through. */
-UNSUPPORTED("evkl6mpyrcnjwer6edp6j9emc"); // /* The end of a simple repeat has a pop_failure_jump back to
-UNSUPPORTED("2jcckuegby5tkaf50t6wemnmz"); // its matching on_failure_jump, where the latter will push a
-UNSUPPORTED("5971g2j40ktdkl0khlo1gpoy6"); // failure point. The pop_failure_jump takes off failure
-UNSUPPORTED("byi3j1ugndbk3u7yo028ikqz3"); // points put on by this pop_failure_jump's matching
-UNSUPPORTED("48etkzu6pax8j2rcmbcbd2s1k"); // on_failure_jump; we got through the pattern to here from the
-UNSUPPORTED("8f9as95a103nww8jbbn2vx61n"); // matching on_failure_jump, so didn't fail. */
-UNSUPPORTED("6coluo8cd7scxlqwnbvt3jqs5"); // case pop_failure_jump:
-UNSUPPORTED("4vdjxw5o61xlsk38ouw1wsypc"); // {
-UNSUPPORTED("aaykmyayp7k026o2rgh0xnxtt"); // /* We need to pass separate storage for the lowest and
-UNSUPPORTED("3w39tfh3tm57hhf0ob12sj5yk"); // highest registers, even though we don't care about the
-UNSUPPORTED("angsr7u35nqld9m876d6dx7xq"); // actual values. Otherwise, we will restore only one
-UNSUPPORTED("4ixesek08pb5l67pi00fqsriy"); // register from the stack, since lowest will == highest in
-UNSUPPORTED("1rzihep5lcgvrl52235a9a2uy"); // `pop_failure_point'. */
-UNSUPPORTED("9m9v5kmsap0mtdznppskik3k"); // active_reg_t dummy_low_reg, dummy_high_reg;
-UNSUPPORTED("5z662sre8crmvzwkqdm96nybf"); // unsigned char *pdummy;
-UNSUPPORTED("35v2cyfyscndlz7rd41acza4q"); // const char *sdummy;
-UNSUPPORTED("6mnx06fa3p4n9bhd9htqjy0il"); // ;
-UNSUPPORTED("3g97rrgu1b7a7ep0xjxi3013b"); // { s_reg_t this_reg; const unsigned char *string_temp; ; ; ; ; ; ; ; string_temp = fail_stack.stack[--fail_stack.avail].pointer; if (string_temp != (void *)0) sdummy = (const char *) string_temp; ; ; ; pdummy = (unsigned char *) fail_stack.stack[--fail_stack.avail].pointer; ; ; dummy_high_reg = (active_reg_t) fail_stack.stack[--fail_stack.avail].integer; ;
-UNSUPPORTED("1zjxjg81gnrzmbjfvorezv23b"); // dummy_low_reg = (active_reg_t) fail_stack.stack[--fail_stack.avail].integer; ; if (1) for (this_reg = dummy_high_reg; this_reg >=
-UNSUPPORTED("5y05eeb8zcu1hnp1r7u72wea0"); // dummy_low_reg; this_reg--) { ; reg_info_dummy[this_reg].word = fail_stack.stack[--fail_stack.avail]; ; reg_dummy[this_reg] = (const char *) fail_stack.stack[--fail_stack.avail].pointer; ;
-UNSUPPORTED("170qj0cyzc65li5h2h8nibj1a"); // reg_dummy[this_reg] = (const char *) fail_stack.stack[--fail_stack.avail].pointer; ; } else { for (this_reg = highest_active_reg; this_reg > dummy_high_reg; this_reg--) { reg_info_dummy[this_reg].word.integer = 0; reg_dummy[this_reg] = 0;
-UNSUPPORTED("o5cb1sy4lw7ahxhb9ir34ywe"); // reg_dummy[this_reg] = 0; } highest_active_reg = dummy_high_reg; } set_regs_matched_done = 0; ; };
-UNSUPPORTED("3e08x1y395304nd0y3uwffvim"); // }
-UNSUPPORTED("et4hfzxq1ccol7oenwuqop34c"); // /* Note fall through. */
-UNSUPPORTED("7jzfafc0e4ysay5587d498v0g"); // unconditional_jump:
-UNSUPPORTED("7xijz1d7skix4nbsjyzbkawyz"); // ;
-UNSUPPORTED("lbfv20cb4iwb8ilhovngktwp"); // /* Note fall through. */
-UNSUPPORTED("6d0r5m74qtbvaned81fau8l5f"); // /* Unconditionally jump (without popping any failure points). */
-UNSUPPORTED("9a1qj2mhg3oh4ehsjpp4d81on"); // case jump:
-UNSUPPORTED("39nxr5mia7bkm0tyl5uoxm1i0"); // do { do { (mcnt) = *(p) & 0377; (mcnt) += ((((unsigned char) (*((p) + 1))) ^ 128) - 128) << 8; } while (0); (p) += 2; } while (0); /* Get the amount to jump. */
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("ard612jdkjyh07vvh6p7xec5q"); // p += mcnt; /* Do the jump. */
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("6eoc6h9g64ctzuyv0zhwzsp88"); // /* We need this opcode so we can detect where alternatives end
-UNSUPPORTED("6m0nust2xxmwf4b1plaq3zle2"); // in `group_match_null_string_p' et al. */
-UNSUPPORTED("7ifq76or69643hqib3roiq9f4"); // case jump_past_alt:
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("8efvwfkzonjvc0xgk7ss31fh2"); // goto unconditional_jump;
-UNSUPPORTED("eiucbu410s7gabqq4tu08bg8c"); // /* Normally, the on_failure_jump pushes a failure point, which
-UNSUPPORTED("ctsxylfj3puoijkz434hjg4jg"); // then gets popped at pop_failure_jump. We will end up at
-UNSUPPORTED("7ociskstxycbbkh41vyojlnby"); // pop_failure_jump, also, and with a pattern of, say, `a+', we
-UNSUPPORTED("7n2w2rey1jvho9kvlfgz2mero"); // are skipping over the on_failure_jump, so we have to push
-UNSUPPORTED("ciwekfad3iz5mqjje8hiorvda"); // something meaningless for pop_failure_jump to pop. */
-UNSUPPORTED("ejqzfph0mmtiqin1hmi981bzm"); // case dummy_failure_jump:
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("csbowj5rzwk0s0pqd3urbka91"); // /* It doesn't matter what we push for the string here. What
-UNSUPPORTED("4qwf1zf8lyqii172mcx2gdsms"); // the code at `fail' tests is the value for the pattern. */
-UNSUPPORTED("359ip48et2ofltl9170r6hayz"); // do { char *destination; s_reg_t this_reg; ; ; ; ; ; ; ; while (((fail_stack).size - (fail_stack).avail) < (((0 ? 0 : highest_active_reg - lowest_active_reg + 1) * 3) + 4)) { if (!((fail_stack).size > (unsigned) (re_max_failures * (5 * 3 + 4)) ? 0 : ((fail_stack).stack = (fail_stack_elt_t *) (destination = (char *) alloca (((fail_stack).size << 1) * sizeof(fail_stack_elt_t)), bcopy ((fail_stack).stack, destination, (fail_stack).size * sizeof(fail_stack_elt_t)), destination), (fail_stack).stack == (void *)0 ? 0 : ((fail_stack).size <<= 1, 1)))) return -2; ; ; } ; if (1) for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; this_reg++) { ; ; ; fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (regstart[this_reg]); ; fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (regend[this_reg]); ; ; ; ; ; ; fail_stack.stack[fail_stack.avail++] = (reg_info[this_reg].word); } ; fail_stack.stack[fail_stack.avail++].integer = (lowest_active_reg); ; fail_stack.stack[fail_stack.avail++].integer = (highest_active_reg); ; ; fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (0); ; ; ; fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (0); ; ; } while (0);
-UNSUPPORTED("8efvwfkzonjvc0xgk7ss31fh2"); // goto unconditional_jump;
-UNSUPPORTED("9mevu5auyy39j4yiw0b2j9h2o"); // /* At the end of an alternative, we need to push a dummy failure
-UNSUPPORTED("d2uf5y4x1b2hmxla6j6tlr1rb"); // point in case we are followed by a `pop_failure_jump', because
-UNSUPPORTED("rnnvhhghy5jgw4jg1fhty1td"); // we don't want the failure point for the alternative to be
-UNSUPPORTED("dkubbc7oql3ppqcdkgq9qelbn"); // popped. For example, matching `(a|ab)*' against `aab'
-UNSUPPORTED("8eoqcy9m0jjec5bxgkzbvg1c7"); // requires that we match the `ab' alternative. */
-UNSUPPORTED("9446ac5zvkn7r9yqkh2brh10l"); // case push_dummy_failure:
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("c992qnyh0yle1kop18y31trwb"); // /* See comments just above at `dummy_failure_jump' about the
-UNSUPPORTED("5synfaxsw4ed7tb33m3un4m4s"); // two zeroes. */
-UNSUPPORTED("359ip48et2ofltl9170r6hayz"); // do { char *destination; s_reg_t this_reg; ; ; ; ; ; ; ; while (((fail_stack).size - (fail_stack).avail) < (((0 ? 0 : highest_active_reg - lowest_active_reg + 1) * 3) + 4)) { if (!((fail_stack).size > (unsigned) (re_max_failures * (5 * 3 + 4)) ? 0 : ((fail_stack).stack = (fail_stack_elt_t *) (destination = (char *) alloca (((fail_stack).size << 1) * sizeof(fail_stack_elt_t)), bcopy ((fail_stack).stack, destination, (fail_stack).size * sizeof(fail_stack_elt_t)), destination), (fail_stack).stack == (void *)0 ? 0 : ((fail_stack).size <<= 1, 1)))) return -2; ; ; } ; if (1) for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; this_reg++) { ; ; ; fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (regstart[this_reg]); ; fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (regend[this_reg]); ; ; ; ; ; ; fail_stack.stack[fail_stack.avail++] = (reg_info[this_reg].word); } ; fail_stack.stack[fail_stack.avail++].integer = (lowest_active_reg); ; fail_stack.stack[fail_stack.avail++].integer = (highest_active_reg); ; ; fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (0); ; ; ; fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (0); ; ; } while (0);
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("cch41i8kiaadul49ef19omdn3"); // /* Have to succeed matching what follows at least n times.
-UNSUPPORTED("8nb8fa32tplp2rqeqbr6hbn7m"); // After that, handle like `on_failure_jump'. */
-UNSUPPORTED("bdrmz6krrbsihqbsklz1j7d7a"); // case succeed_n:
-UNSUPPORTED("84ijqow5jif2ajlhwgtdm91f7"); // do { (mcnt) = *(p + 2) & 0377; (mcnt) += ((((unsigned char) (*((p + 2) + 1))) ^ 128) - 128) << 8; } while (0);
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("bgjxyv37kr5myctgyhh94vsi6"); // /* Originally, this is how many times we HAVE to succeed. */
-UNSUPPORTED("4hf4aztjmayqr0tjd70d8mo5l"); // if (mcnt > 0)
-UNSUPPORTED("5k2digv672hnrndhc9ktw0oii"); // {
-UNSUPPORTED("e8xmciie2t26hwi49v7e64msh"); // mcnt--;
-UNSUPPORTED("f0uzigopn4c90eyozalab8dsx"); // p += 2;
-UNSUPPORTED("3trn8e2hbd5q9a392rlo55y4x"); // do { do { (p)[0] = (mcnt) & 0377; (p)[1] = (mcnt) >> 8; } while (0); (p) += 2; } while (0);
-UNSUPPORTED("e4kt1tmmevqvy3cbyk6xnznck"); // ;
-UNSUPPORTED("b86ovw6olwwo6gnqlt1wqqzb4"); // }
-UNSUPPORTED("ach1i5r2ivzzx0xwwovmzz94b"); // else if (mcnt == 0)
-UNSUPPORTED("5k2digv672hnrndhc9ktw0oii"); // {
-UNSUPPORTED("e4kt1tmmevqvy3cbyk6xnznck"); // ;
-UNSUPPORTED("8kebz7kyb83b0vya08j7g1h0s"); // p[2] = (unsigned char) no_op;
-UNSUPPORTED("7naalvvwte5koasfwykgk8jy7"); // p[3] = (unsigned char) no_op;
-UNSUPPORTED("evigqo62udorsulmaru504u73"); // goto on_failure;
-UNSUPPORTED("b86ovw6olwwo6gnqlt1wqqzb4"); // }
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("f41u8fntqiy246yy3btlg6w1v"); // case jump_n:
-UNSUPPORTED("84ijqow5jif2ajlhwgtdm91f7"); // do { (mcnt) = *(p + 2) & 0377; (mcnt) += ((((unsigned char) (*((p + 2) + 1))) ^ 128) - 128) << 8; } while (0);
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("45q1dm5e8czy7dfyydg2p0qre"); // /* Originally, this is how many times we CAN jump. */
-UNSUPPORTED("c925pgmxvmas9boqu5ovt7bwp"); // if (mcnt)
-UNSUPPORTED("5k2digv672hnrndhc9ktw0oii"); // {
-UNSUPPORTED("e8xmciie2t26hwi49v7e64msh"); // mcnt--;
-UNSUPPORTED("bj0025yphmeva1dnjc83w2d82"); // do { (p + 2)[0] = (mcnt) & 0377; (p + 2)[1] = (mcnt) >> 8; } while (0);
-UNSUPPORTED("e4kt1tmmevqvy3cbyk6xnznck"); // ;
-UNSUPPORTED("578iyred8hniiy6kj99i6zcx7"); // goto unconditional_jump;
-UNSUPPORTED("b86ovw6olwwo6gnqlt1wqqzb4"); // }
-UNSUPPORTED("6xb6uhe949e197w3856eykp9b"); // /* If don't have to jump any more, skip over the rest of command. */
-UNSUPPORTED("cunk7vpvzj28y1x4gn62gxpce"); // else
-UNSUPPORTED("4g9g5t2dqwtbpe7orh2oew0y9"); // p += 4;
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("dmqxgjrlj5ddxj88dw919ujoj"); // case set_number_at:
-UNSUPPORTED("4vdjxw5o61xlsk38ouw1wsypc"); // {
-UNSUPPORTED("6mnx06fa3p4n9bhd9htqjy0il"); // ;
-UNSUPPORTED("5pj3hnv50h51ji8ogyd48xedj"); // do { do { (mcnt) = *(p) & 0377; (mcnt) += ((((unsigned char) (*((p) + 1))) ^ 128) - 128) << 8; } while (0); (p) += 2; } while (0);
-UNSUPPORTED("d2fh23u27kss8fzwuwtp0p6sf"); // p1 = p + mcnt;
-UNSUPPORTED("5pj3hnv50h51ji8ogyd48xedj"); // do { do { (mcnt) = *(p) & 0377; (mcnt) += ((((unsigned char) (*((p) + 1))) ^ 128) - 128) << 8; } while (0); (p) += 2; } while (0);
-UNSUPPORTED("6mnx06fa3p4n9bhd9htqjy0il"); // ;
-UNSUPPORTED("7iin6qwm1f2j9sjclecva957u"); // do { (p1)[0] = (mcnt) & 0377; (p1)[1] = (mcnt) >> 8; } while (0);
-UNSUPPORTED("605r8o1isen77125aqrohs6ac"); // break;
-UNSUPPORTED("3e08x1y395304nd0y3uwffvim"); // }
-UNSUPPORTED("a8jtmsnmpa4937exo9nhopyyb"); // case wordbound:
-UNSUPPORTED("4vdjxw5o61xlsk38ouw1wsypc"); // {
-UNSUPPORTED("1q5kvi9ggao878ze57ikl6vuk"); // boolean prevchar, thischar;
-UNSUPPORTED("6mnx06fa3p4n9bhd9htqjy0il"); // ;
-UNSUPPORTED("dugr1bul8t32joy65do0a7h6d"); // if (((d) == (size1 ? string1 : string2) || !size2) || ((d) == end2))
-UNSUPPORTED("7mosouhqcis2k8sbg88g9wol8"); // break;
-UNSUPPORTED("8ijy2sdya91ygss8ru67qxx66"); // prevchar = (re_syntax_table[(d - 1) == end1 ? *string2 :(d - 1) == string2 - 1 ? *(end1 - 1) : *(d - 1)] == 1);
-UNSUPPORTED("33zxkfaori9emq7m5ssmpr1rd"); // thischar = (re_syntax_table[(d) == end1 ? *string2 :(d) == string2 - 1 ? *(end1 - 1) : *(d)] == 1);
-UNSUPPORTED("79ooz7jacd1z2sfddoakjbcze"); // if (prevchar != thischar)
-UNSUPPORTED("7mosouhqcis2k8sbg88g9wol8"); // break;
-UNSUPPORTED("etjodgz127fwk1r4166wqxg7n"); // goto fail;
-UNSUPPORTED("3e08x1y395304nd0y3uwffvim"); // }
-UNSUPPORTED("2jqqzr491mztwr9h8hvs55ja1"); // case notwordbound:
-UNSUPPORTED("4vdjxw5o61xlsk38ouw1wsypc"); // {
-UNSUPPORTED("1q5kvi9ggao878ze57ikl6vuk"); // boolean prevchar, thischar;
-UNSUPPORTED("6mnx06fa3p4n9bhd9htqjy0il"); // ;
-UNSUPPORTED("dugr1bul8t32joy65do0a7h6d"); // if (((d) == (size1 ? string1 : string2) || !size2) || ((d) == end2))
-UNSUPPORTED("1k6xdu198jqq8v2oj3209y50s"); // goto fail;
-UNSUPPORTED("8ijy2sdya91ygss8ru67qxx66"); // prevchar = (re_syntax_table[(d - 1) == end1 ? *string2 :(d - 1) == string2 - 1 ? *(end1 - 1) : *(d - 1)] == 1);
-UNSUPPORTED("33zxkfaori9emq7m5ssmpr1rd"); // thischar = (re_syntax_table[(d) == end1 ? *string2 :(d) == string2 - 1 ? *(end1 - 1) : *(d)] == 1);
-UNSUPPORTED("79ooz7jacd1z2sfddoakjbcze"); // if (prevchar != thischar)
-UNSUPPORTED("1k6xdu198jqq8v2oj3209y50s"); // goto fail;
-UNSUPPORTED("605r8o1isen77125aqrohs6ac"); // break;
-UNSUPPORTED("3e08x1y395304nd0y3uwffvim"); // }
-UNSUPPORTED("991vlwoc47i8p67jyv2qapdhy"); // case wordbeg:
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("721tzo9yoqf86tjgrubhs6lcg"); // if ((re_syntax_table[(d) == end1 ? *string2 :(d) == string2 - 1 ? *(end1 - 1) : *(d)] == 1) && (((d) == (size1 ? string1 : string2) || !size2) || !(re_syntax_table[(d - 1) == end1 ? *string2 :(d - 1) == string2 - 1 ? *(end1 - 1) : *(d - 1)] == 1)))
-UNSUPPORTED("605r8o1isen77125aqrohs6ac"); // break;
-UNSUPPORTED("9s7xl8jyc2iazjidoga852mei"); // goto fail;
-UNSUPPORTED("65os7te2jc1i6uacyszvy5spd"); // case wordend:
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("88nu0py5i2vups7wk3tj8wcf4"); // if (!((d) == (size1 ? string1 : string2) || !size2) && (re_syntax_table[(d - 1) == end1 ? *string2 :(d - 1) == string2 - 1 ? *(end1 - 1) : *(d - 1)] == 1)
-UNSUPPORTED("1a0r7hi8r1po69cu5fxqrw4u8"); // && (!(re_syntax_table[(d) == end1 ? *string2 :(d) == string2 - 1 ? *(end1 - 1) : *(d)] == 1) || ((d) == end2)))
-UNSUPPORTED("605r8o1isen77125aqrohs6ac"); // break;
-UNSUPPORTED("9s7xl8jyc2iazjidoga852mei"); // goto fail;
-UNSUPPORTED("buxp1030z7swkjl42wovj9hxd"); // case wordchar:
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("6l2kf5tzbvscsr8vy2bos6ng7"); // while (d == dend) { if (dend == end_match_2) goto fail; d = string2; dend = end_match_2; };
-UNSUPPORTED("7qor4v3lsqk2266u914165c3w"); // if (!(re_syntax_table[(d) == end1 ? *string2 :(d) == string2 - 1 ? *(end1 - 1) : *(d)] == 1))
-UNSUPPORTED("etjodgz127fwk1r4166wqxg7n"); // goto fail;
-UNSUPPORTED("2o2dzkzmcvnlj1d5ychre7cqo"); // do { if (!set_regs_matched_done) { active_reg_t r; set_regs_matched_done = 1; for (r = lowest_active_reg; r <= highest_active_reg; r++) { ((reg_info[r]).bits.matched_something) = ((reg_info[r]).bits.ever_matched_something) = 1; } } } while (0);
-UNSUPPORTED("p26x5fh4zcf5ddyi146lh558"); // d++;
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("7frlpnfuvuphd3bzoulwg4vsr"); // case notwordchar:
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("6l2kf5tzbvscsr8vy2bos6ng7"); // while (d == dend) { if (dend == end_match_2) goto fail; d = string2; dend = end_match_2; };
-UNSUPPORTED("7efqv32ta2jk6dolelm1jju58"); // if ((re_syntax_table[(d) == end1 ? *string2 :(d) == string2 - 1 ? *(end1 - 1) : *(d)] == 1))
-UNSUPPORTED("etjodgz127fwk1r4166wqxg7n"); // goto fail;
-UNSUPPORTED("2o2dzkzmcvnlj1d5ychre7cqo"); // do { if (!set_regs_matched_done) { active_reg_t r; set_regs_matched_done = 1; for (r = lowest_active_reg; r <= highest_active_reg; r++) { ((reg_info[r]).bits.matched_something) = ((reg_info[r]).bits.ever_matched_something) = 1; } } } while (0);
-UNSUPPORTED("p26x5fh4zcf5ddyi146lh558"); // d++;
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("comxch6w0lbi64ejq9m4p0u7o"); // default:
-UNSUPPORTED("4ga2fk86no0o6rms0bh0zuh4t"); // abort ();
-UNSUPPORTED("7nxu74undh30brb8laojud3f9"); // }
-UNSUPPORTED("9vmmpq61luc1cbbupgqomzlw5"); // continue; /* Successfully executed one pattern command; keep going. */
-UNSUPPORTED("9ndw6vvwoffc31wvgwvgra578"); // /* We goto here if a matching operation fails. */
-UNSUPPORTED("1x3juxkh7bw5pjqp84ugtlmce"); // fail:
-UNSUPPORTED("6j68ym8upocfb9ipivxd80ark"); // if (!(fail_stack.avail == 0))
-UNSUPPORTED("92q1l5zz5c3sr57dyzmui3e99"); // { /* A restart point is known. Restore to that state. */
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("ayzf7vhhjnbynnstdi6n454f4"); // { s_reg_t this_reg; const unsigned char *string_temp; ; ; ; ; ; ; ; string_temp = fail_stack.stack[--fail_stack.avail].pointer; if (string_temp != (void *)0) d = (const char *) string_temp; ; ; ; p = (unsigned char *) fail_stack.stack[--fail_stack.avail].pointer; ; ; highest_active_reg = (active_reg_t) fail_stack.stack[--fail_stack.avail].integer; ;
-UNSUPPORTED("cb1z2qn566ao3l0dqcxiow6dp"); // lowest_active_reg = (active_reg_t) fail_stack.stack[--fail_stack.avail].integer; ; if (1) for (this_reg = highest_active_reg; this_reg >=
-UNSUPPORTED("2g0zjfujimxzkr97d2g902f35"); // lowest_active_reg; this_reg--) { ; reg_info[this_reg].word = fail_stack.stack[--fail_stack.avail]; ; regend[this_reg] = (const char *) fail_stack.stack[--fail_stack.avail].pointer; ;
-UNSUPPORTED("2qadsytv032wa95wodwip6p4p"); // regstart[this_reg] = (const char *) fail_stack.stack[--fail_stack.avail].pointer; ; } else { for (this_reg = highest_active_reg; this_reg > highest_active_reg; this_reg--) { reg_info[this_reg].word.integer = 0; regend[this_reg] = 0;
-UNSUPPORTED("1sgt5yrkh4wqtk60f39qhmqyh"); // regstart[this_reg] = 0; } highest_active_reg = highest_active_reg; } set_regs_matched_done = 0; ; };
-UNSUPPORTED("a59azprq7sley0l2fkpr8iplf"); // /* If this failure point is a dummy, try the next one. */
-UNSUPPORTED("27dzlpjb6otkjse11xs60aoen"); // if (!p)
-UNSUPPORTED("etjodgz127fwk1r4166wqxg7n"); // goto fail;
-UNSUPPORTED("5ezd84f3c0gvxbdr48go3nu9d"); // /* If we failed to the end of the pattern, don't examine *p. */
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("enro4gwm81mrbyp937vtdmluy"); // if (p < pend)
-UNSUPPORTED("5k2digv672hnrndhc9ktw0oii"); // {
-UNSUPPORTED("5bmgzdh5rp0tqqvuep6upitw5"); // boolean is_a_jump_n = 0;
-UNSUPPORTED("6rryel9f7nixy5bn6j0bu5pim"); // /* If failed to a backwards jump that's part of a repetition
-UNSUPPORTED("6lkiil4jkazqh0sr2kuzl2a6n"); // loop, need to pop this failure point and use the next one. */
-UNSUPPORTED("3ov8y2d12vzh7q5i3tuyoelxe"); // switch ((re_opcode_t) *p)
-UNSUPPORTED("4hzaau620c4rh7xorkrmxfut7"); // {
-UNSUPPORTED("bok1esp1zekmbuklmyk3rk5rx"); // case jump_n:
-UNSUPPORTED("38gwuf75sc2x4fup5mqsis4x6"); // is_a_jump_n = 1;
-UNSUPPORTED("75n3w229uzeshyir5i61r1043"); // case maybe_pop_jump:
-UNSUPPORTED("a8ugqe6z5croeioatypl4otaw"); // case pop_failure_jump:
-UNSUPPORTED("6l3m2qx4riktyve4e2l0wh9fe"); // case jump:
-UNSUPPORTED("84b1pj26tamclxb0mw5nrxg5g"); // p1 = p + 1;
-UNSUPPORTED("4sq4b65a0bh8lf919g64pqica"); // do { do { (mcnt) = *(p1) & 0377; (mcnt) += ((((unsigned char) (*((p1) + 1))) ^ 128) - 128) << 8; } while (0); (p1) += 2; } while (0);
-UNSUPPORTED("8ocr60qo89yr0vtq5dj8v1owo"); // p1 += mcnt;
-UNSUPPORTED("6cxswairiyne2bjb1dmz6d26z"); // if ((is_a_jump_n && (re_opcode_t) *p1 == succeed_n)
-UNSUPPORTED("ekvd2x03u6gf8ylhhxyq7h336"); // || (!is_a_jump_n
-UNSUPPORTED("cw8zksvsbjm3lb2eh5chm46x2"); // && (re_opcode_t) *p1 == on_failure_jump))
-UNSUPPORTED("bkcykqhkoe9lpop9i2qgzu9yp"); // goto fail;
-UNSUPPORTED("1fg4xctmq8acy7m0oob45guaz"); // break;
-UNSUPPORTED("cyzkq50b2b248lxpi6lj66jqs"); // default:
-UNSUPPORTED("2oxjzlotqn0ba3akkxgs9h02q"); // /* do nothing */ ;
-UNSUPPORTED("2tfish0jog6m8uhlhaokmzvm3"); // }
-UNSUPPORTED("b86ovw6olwwo6gnqlt1wqqzb4"); // }
-UNSUPPORTED("9g1qr2dsx4ng98gqf2c94flil"); // if (d >= string1 && d <= end1)
-UNSUPPORTED("eb6uc0689wgv8mqsvkm38mu5z"); // dend = end_match_1;
-UNSUPPORTED("7nxu74undh30brb8laojud3f9"); // }
-UNSUPPORTED("1knjyao8ci3w18zqqcnmnitir"); // else
-UNSUPPORTED("8dc5stfweb0p9s0z2aqvucjp7"); // break; /* Matching at this starting point really fails. */
-UNSUPPORTED("7mfls4p0ojvjkaotqvjflu5ht"); // } /* for (;;) */
-UNSUPPORTED("78m9mze1ip3qflmasmayufoml"); // if (best_regs_set)
-UNSUPPORTED("2mqxvuzj0ksk0m6oea72s11bm"); // goto restore_best_regs;
-UNSUPPORTED("d7ubx9odh5b3nkaac1zt1epbl"); // do { ; if ((void*) regstart) ((void)0); (void*) regstart = (void *)0; if ((void*) regend) ((void)0); (void*) regend = (void *)0; if ((void*) old_regstart) ((void)0); (void*) old_regstart = (void *)0; if ((void*) old_regend) ((void)0); (void*) old_regend = (void *)0; if ((void*) best_regstart) ((void)0); (void*) best_regstart = (void *)0; if ((void*) best_regend) ((void)0); (void*) best_regend = (void *)0; if ((void*) reg_info) ((void)0); (void*) reg_info = (void *)0; if ((void*) reg_dummy) ((void)0); (void*) reg_dummy = (void *)0; if ((void*) reg_info_dummy) ((void)0); (void*) reg_info_dummy = (void *)0; } while (0);
-UNSUPPORTED("2k1latznr3ux22xinn931zwue"); // return -1; /* Failure to match. */
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 cq5u8rqlecamd29odxfaybq58
-// static boolean group_match_null_string_p(unsigned char **p, unsigned char *end, register_info_type *reg_info)
-public static Object group_match_null_string_p(Object... arg) {
-UNSUPPORTED("etarlz3ybg3wdofiesiw8dwbq"); // static boolean
-UNSUPPORTED("7fmzghcqs81ua3tkzybmg2t5u"); // group_match_null_string_p(unsigned char **p,
-UNSUPPORTED("2800cclhjee5reqodgs0uz6jp"); // unsigned char *end,
-UNSUPPORTED("1zudh11exsdumrcui0azslboo"); // register_info_type *reg_info)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("5rwd4tuvikkbfw1s56awbwtbe"); // int mcnt;
-UNSUPPORTED("dbm120px96ap42fmbuxy5yrj5"); // /* Point to after the args to the start_memory. */
-UNSUPPORTED("bjzqlm993x9boruj0kyeol53l"); // unsigned char *p1 = *p + 2;
-UNSUPPORTED("azfsm7rfz2u17du52a0mrfyoq"); // while (p1 < end)
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("23a56718i3eh15dzfmbft7w8p"); // /* Skip over opcodes that can match nothing, and return true or
-UNSUPPORTED("bbrge68fsb7cmb7ocyo176sox"); // false, as appropriate, when we get to one that can't, or to the
-UNSUPPORTED("9nn48i9apg1r7w3mm0yftr0gb"); // matching stop_memory. */
-UNSUPPORTED("3kakimebymsdj9dnon7o0iz9v"); // switch ((re_opcode_t) *p1)
-UNSUPPORTED("9ua540u2gx5jpu302s81qfxhi"); // {
-UNSUPPORTED("dpdkpfbea8z9xx4m3qriv0ks"); // /* Could be either a loop or a series of alternatives. */
-UNSUPPORTED("992rmruvdtrxnk46307iiqyjo"); // case on_failure_jump:
-UNSUPPORTED("4hemvstzejy8d3hmd82kukj7v"); // p1++;
-UNSUPPORTED("18pz18zbmozo48uq20alb8ok5"); // do { do { (mcnt) = *(p1) & 0377; (mcnt) += ((((unsigned char) (*((p1) + 1))) ^ 128) - 128) << 8; } while (0); (p1) += 2; } while (0);
-UNSUPPORTED("7ysd5uwx66rnhuasuke0gw17h"); // /* If the next operation is not a jump backwards in the
-UNSUPPORTED("chqkvvtqui6nji6p4nqjnxnc0"); // pattern. */
-UNSUPPORTED("clp8uz1ldh06ksh93asr2xtu6"); // if (mcnt >= 0)
-UNSUPPORTED("5k2digv672hnrndhc9ktw0oii"); // {
-UNSUPPORTED("9vuq76qui8wedzsb144fnx8dd"); // /* Go through the on_failure_jumps of the alternatives,
-UNSUPPORTED("4k14n5k0mqv0fovwitf4alxzx"); // seeing if any of the alternatives cannot match nothing.
-UNSUPPORTED("clkpepohs7tguzyn8ncluhakf"); // The last alternative starts with only a jump,
-UNSUPPORTED("49dbeehco6191jqwdivzoevhh"); // whereas the rest start with on_failure_jump and end
-UNSUPPORTED("6h3f5m3yjc34la8qgzsbzbcsv"); // with a jump, e.g., here is the pattern for `a|b|c':
-UNSUPPORTED("9m5jtr9332etcn1h5ctckidp4"); // /on_failure_jump/0/6/exactn/1/a/jump_past_alt/0/6
-UNSUPPORTED("ck48ad3kd04evjrca6aqzw2g"); // /on_failure_jump/0/6/exactn/1/b/jump_past_alt/0/3
-UNSUPPORTED("6vxw9gryj1dxtxoycbews4j87"); // /exactn/1/c
-UNSUPPORTED("3p6xfpp9zbgix9sb10dz2cfhd"); // So, we have to first go through the first (n-1)
-UNSUPPORTED("cp25hojwgralgldniw273kdj3"); // alternatives and then deal with the last one separately. */
-UNSUPPORTED("9a0det71z82exleln86167ddq"); // /* Deal with the first (n-1) alternatives, which start
-UNSUPPORTED("az6wcsp2m1rn4g8e9nkvxomfi"); // with an on_failure_jump (see above) that jumps to right
-UNSUPPORTED("cip7j7cjuis96j2g1tyo2fogf"); // past a jump_past_alt. */
-UNSUPPORTED("am40qiyqgt5i95zqw8gmfb43f"); // while ((re_opcode_t) p1[mcnt-3] == jump_past_alt)
-UNSUPPORTED("4hzaau620c4rh7xorkrmxfut7"); // {
-UNSUPPORTED("2lhz8ag4lccpzb4fzqq8rviyo"); // /* `mcnt' holds how many bytes long the alternative
-UNSUPPORTED("bu59ahle478dwgxifr5a81zrn"); // is, including the ending `jump_past_alt' and
-UNSUPPORTED("4xvr333ml76572j0cidzpewwy"); // its number. */
-UNSUPPORTED("6tqlvyqvppynpnuuf3j8ebtlu"); // if (!alt_match_null_string_p (p1, p1 + mcnt - 3,
-UNSUPPORTED("3cqjfljoigoe1s3yctsmb49io"); // reg_info))
-UNSUPPORTED("5eqwqroxusaik54ze9ykumu4w"); // return 0;
-UNSUPPORTED("1nweigx3aj1nu16la9727cgek"); // /* Move to right after this alternative, including the
-UNSUPPORTED("9wjlfe40zk6mcnijph9zw3skr"); // jump_past_alt. */
-UNSUPPORTED("8ocr60qo89yr0vtq5dj8v1owo"); // p1 += mcnt;
-UNSUPPORTED("7me1al3m500othjustdgp25s8"); // /* Break if it's the beginning of an n-th alternative
-UNSUPPORTED("bsa0fgfj9n2wksuh9f164m03i"); // that doesn't begin with an on_failure_jump. */
-UNSUPPORTED("dxkrs3xxv5uhishofpjt2j6mb"); // if ((re_opcode_t) *p1 != on_failure_jump)
-UNSUPPORTED("7vckzntfuo1ibi8r53gsfg8al"); // break;
-UNSUPPORTED("dcrlv6lsj26x00kq7h5mb1tft"); // /* Still have to check that it's not an n-th
-UNSUPPORTED("ehy9rg3hrcurcpp2ofykuu16t"); // alternative that starts with an on_failure_jump. */
-UNSUPPORTED("3aju47l7l855mt7l00l7xg11q"); // p1++;
-UNSUPPORTED("4sq4b65a0bh8lf919g64pqica"); // do { do { (mcnt) = *(p1) & 0377; (mcnt) += ((((unsigned char) (*((p1) + 1))) ^ 128) - 128) << 8; } while (0); (p1) += 2; } while (0);
-UNSUPPORTED("7i4x97abeu0pj34gwgukjoe00"); // if ((re_opcode_t) p1[mcnt-3] != jump_past_alt)
-UNSUPPORTED("bho20rvti5y7pi0voz7il3e40"); // {
-UNSUPPORTED("7v0khgzw96aytjvy24azi9yi3"); // /* Get to the beginning of the n-th alternative. */
-UNSUPPORTED("d58xf2hqair572yx3r8pofa0e"); // p1 -= 3;
-UNSUPPORTED("b4o9itamiw6ccgnlojl73v2fx"); // break;
-UNSUPPORTED("ad3bk4xnx8bgy7plhun3c0mvv"); // }
-UNSUPPORTED("2tfish0jog6m8uhlhaokmzvm3"); // }
-UNSUPPORTED("j8cvgeroqesrtqchx5ejvs06"); // /* Deal with the last alternative: go back and get number
-UNSUPPORTED("b74m2a2e9cgu2v8i8t1u5b2x1"); // of the `jump_past_alt' just before it. `mcnt' contains
-UNSUPPORTED("cu400hxya6t1qs6iquuqabq0s"); // the length of the alternative. */
-UNSUPPORTED("26bdoghsw938ft3sgehp275kx"); // do { (mcnt) = *(p1 - 2) & 0377; (mcnt) += ((((unsigned char) (*((p1 - 2) + 1))) ^ 128) - 128) << 8; } while (0);
-UNSUPPORTED("3xtanhdz88xahyfe15omt5obd"); // if (!alt_match_null_string_p (p1, p1 + mcnt, reg_info))
-UNSUPPORTED("4h8qa3kxqmv2m8g445wmasnl"); // return 0;
-UNSUPPORTED("f53vent58m68zyw39fxmgqbr0"); // p1 += mcnt; /* Get past the n-th alternative. */
-UNSUPPORTED("9euvgwd19qm3deiwc663wdzb0"); // } /* if mcnt > 0 */
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("3q89uw4g68y7kyiitvliyykpb"); // case stop_memory:
-UNSUPPORTED("1qe3sa29ntp5400stzdrrbgdg"); // ;
-UNSUPPORTED("8jfkppp2w8v4t5gyqcelvinb4"); // *p = p1 + 2;
-UNSUPPORTED("15lnhn427yvuetx9312e81jrg"); // return 1;
-UNSUPPORTED("comxch6w0lbi64ejq9m4p0u7o"); // default:
-UNSUPPORTED("ir4atstqu8v5sqigzqbwdop4"); // if (!common_op_match_null_string_p (&p1, end, reg_info))
-UNSUPPORTED("bwb5ofkxp13uiyvgbvx70039w"); // return 0;
-UNSUPPORTED("7nxu74undh30brb8laojud3f9"); // }
-UNSUPPORTED("55ht7a89z8ua4oqsrrwpapvpg"); // } /* while p1 < end */
-UNSUPPORTED("5oxhd3fvp0gfmrmz12vndnjt"); // return 0;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 azrkydvahepcjvkkru2gdwg0m
-// static boolean alt_match_null_string_p(unsigned char *p, unsigned char *end, register_info_type *reg_info)
-public static Object alt_match_null_string_p(Object... arg) {
-UNSUPPORTED("etarlz3ybg3wdofiesiw8dwbq"); // static boolean
-UNSUPPORTED("7z4yu5m5t5mwjca6t6wpfajrj"); // alt_match_null_string_p(unsigned char *p,
-UNSUPPORTED("91jh331pn45y9rnhwhm4fiavm"); // unsigned char *end,
-UNSUPPORTED("ereoaeyy0phqbbu5cnhfb78ew"); // register_info_type *reg_info)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("5rwd4tuvikkbfw1s56awbwtbe"); // int mcnt;
-UNSUPPORTED("15ytldlmpb2i6cvtxquvhjs2m"); // unsigned char *p1 = p;
-UNSUPPORTED("azfsm7rfz2u17du52a0mrfyoq"); // while (p1 < end)
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("3e0wppcum116c0gyks4koglo6"); // /* Skip over opcodes that can match nothing, and break when we get
-UNSUPPORTED("ei8lrs2smmn3h63q7rpj9sd0o"); // to one that can't. */
-UNSUPPORTED("3kakimebymsdj9dnon7o0iz9v"); // switch ((re_opcode_t) *p1)
-UNSUPPORTED("9ua540u2gx5jpu302s81qfxhi"); // {
-UNSUPPORTED("5n9m839emxb8of9xbq805onsd"); // /* It's a loop. */
-UNSUPPORTED("992rmruvdtrxnk46307iiqyjo"); // case on_failure_jump:
-UNSUPPORTED("4hemvstzejy8d3hmd82kukj7v"); // p1++;
-UNSUPPORTED("18pz18zbmozo48uq20alb8ok5"); // do { do { (mcnt) = *(p1) & 0377; (mcnt) += ((((unsigned char) (*((p1) + 1))) ^ 128) - 128) << 8; } while (0); (p1) += 2; } while (0);
-UNSUPPORTED("28bkn6qebb96emlyztm3kg6wt"); // p1 += mcnt;
-UNSUPPORTED("ctqmerohp1f69mb1v1t20jx33"); // break;
-UNSUPPORTED("comxch6w0lbi64ejq9m4p0u7o"); // default:
-UNSUPPORTED("ir4atstqu8v5sqigzqbwdop4"); // if (!common_op_match_null_string_p (&p1, end, reg_info))
-UNSUPPORTED("bwb5ofkxp13uiyvgbvx70039w"); // return 0;
-UNSUPPORTED("7nxu74undh30brb8laojud3f9"); // }
-UNSUPPORTED("eixc7qyme2j14k5zjjghyiexn"); // } /* while p1 < end */
-UNSUPPORTED("3tcgz4dupb6kw5tdk7n3pca2l"); // return 1;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 7hv0wkt4lrkp5whfzuke2qytb
-// static boolean common_op_match_null_string_p(unsigned char **p, unsigned char *end, register_info_type *reg_info)
-public static Object common_op_match_null_string_p(Object... arg) {
-UNSUPPORTED("etarlz3ybg3wdofiesiw8dwbq"); // static boolean
-UNSUPPORTED("8k0shz76dhg3w8h6nz5pjbbu2"); // common_op_match_null_string_p(unsigned char **p,
-UNSUPPORTED("28yc2ksklc2vvzt1s5ynbtv0f"); // unsigned char *end,
-UNSUPPORTED("6qhd2068gir26rtqc477pm6m1"); // register_info_type *reg_info)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("5rwd4tuvikkbfw1s56awbwtbe"); // int mcnt;
-UNSUPPORTED("7n9r83dkya7i0zuq00imgrukd"); // boolean ret;
-UNSUPPORTED("7ju59c3dbukl0mz5vgjdoozn5"); // int reg_no;
-UNSUPPORTED("87zyg7fzbf21hmhh461pn9zf9"); // unsigned char *p1 = *p;
-UNSUPPORTED("qr7u5j2ref5m7rf6d3wqgmps"); // switch ((re_opcode_t) *p1++)
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("cf4augtxav7j1ap91bbu3vwy1"); // case no_op:
-UNSUPPORTED("30ts9llmyexduvfuq7fczrer8"); // case begline:
-UNSUPPORTED("db3lgui4636z7pglgbzpqe54h"); // case endline:
-UNSUPPORTED("8fekxuxe035cl7l6pccwsy7fh"); // case begbuf:
-UNSUPPORTED("16msnj7hxrfentkv031ct5vc3"); // case endbuf:
-UNSUPPORTED("bcaajfoyi3jhpmdxhguo7iofc"); // case wordbeg:
-UNSUPPORTED("bkapw3yogqx0sw1ngisv3mb5d"); // case wordend:
-UNSUPPORTED("9pqp8vzoeyor0e1x4eqhthk8m"); // case wordbound:
-UNSUPPORTED("7hyd3tgheqr4untlslak7uheb"); // case notwordbound:
-UNSUPPORTED("dtx9szdvwh3uhziubh9zvgbk5"); // break;
-UNSUPPORTED("1olrmh5xaxc4lppwfnwemvaej"); // case start_memory:
-UNSUPPORTED("4rjnecf4q32xuk4ie6vozpkfh"); // reg_no = *p1;
-UNSUPPORTED("cf8srqrmhz47tb7zdgoe9ufhv"); // ;
-UNSUPPORTED("eluoqmhl3j8dyk8hyv680sy72"); // ret = group_match_null_string_p (&p1, end, reg_info);
-UNSUPPORTED("8hm5umlf6osua8zn0w4y735nh"); // /* Have to set this here in case we're checking a group which
-UNSUPPORTED("8xeab9le3ct3b2q7y6ly9yrhh"); // contains a group and a back reference to it. */
-UNSUPPORTED("5kozscfkat4mdav2anbiib5hw"); // if (((reg_info[reg_no]).bits.match_null_string_p) == 3)
-UNSUPPORTED("7qym75wzdha4x8u9v6fik2mwy"); // ((reg_info[reg_no]).bits.match_null_string_p) = ret;
-UNSUPPORTED("4cj58wdjt8jr4gsngmucb56o0"); // if (!ret)
-UNSUPPORTED("9co1titw8ibive55ugr6yfqa4"); // return 0;
-UNSUPPORTED("dtx9szdvwh3uhziubh9zvgbk5"); // break;
-UNSUPPORTED("608rfpgf7ytuxs7hkgnig1by5"); // /* If this is an optimized succeed_n for zero times, make the jump. */
-UNSUPPORTED("9agy5bj4opmh2vksf6lpzm8cd"); // case jump:
-UNSUPPORTED("9ngggpjqcpnq88nnkxr6y7vpq"); // do { do { (mcnt) = *(p1) & 0377; (mcnt) += ((((unsigned char) (*((p1) + 1))) ^ 128) - 128) << 8; } while (0); (p1) += 2; } while (0);
-UNSUPPORTED("1fxhzdbiknha03fye9yen0bje"); // if (mcnt >= 0)
-UNSUPPORTED("blqj2uomfewkrosqhn5f7bu73"); // p1 += mcnt;
-UNSUPPORTED("1knjyao8ci3w18zqqcnmnitir"); // else
-UNSUPPORTED("9co1titw8ibive55ugr6yfqa4"); // return 0;
-UNSUPPORTED("dtx9szdvwh3uhziubh9zvgbk5"); // break;
-UNSUPPORTED("e7ahhsjjo9f2hw3bbtucupqlw"); // case succeed_n:
-UNSUPPORTED("9gimh1u1p2gmf0q5weiqpbbop"); // /* Get to the number of times to succeed. */
-UNSUPPORTED("1xi9qxsoaehueyjhabvspqapk"); // p1 += 2;
-UNSUPPORTED("9ngggpjqcpnq88nnkxr6y7vpq"); // do { do { (mcnt) = *(p1) & 0377; (mcnt) += ((((unsigned char) (*((p1) + 1))) ^ 128) - 128) << 8; } while (0); (p1) += 2; } while (0);
-UNSUPPORTED("1ju62vxdlb0sw55v80s2h9p8i"); // if (mcnt == 0)
-UNSUPPORTED("9ua540u2gx5jpu302s81qfxhi"); // {
-UNSUPPORTED("9o2tf6im70km8pb1v0mz4tbhc"); // p1 -= 4;
-UNSUPPORTED("18pz18zbmozo48uq20alb8ok5"); // do { do { (mcnt) = *(p1) & 0377; (mcnt) += ((((unsigned char) (*((p1) + 1))) ^ 128) - 128) << 8; } while (0); (p1) += 2; } while (0);
-UNSUPPORTED("28bkn6qebb96emlyztm3kg6wt"); // p1 += mcnt;
-UNSUPPORTED("7nxu74undh30brb8laojud3f9"); // }
-UNSUPPORTED("1knjyao8ci3w18zqqcnmnitir"); // else
-UNSUPPORTED("9co1titw8ibive55ugr6yfqa4"); // return 0;
-UNSUPPORTED("dtx9szdvwh3uhziubh9zvgbk5"); // break;
-UNSUPPORTED("8qjtjs80wrz4f6y4td1b7mvma"); // case duplicate:
-UNSUPPORTED("asaad7roragv1dquu2i7eek6v"); // if (!((reg_info[*p1]).bits.match_null_string_p))
-UNSUPPORTED("9co1titw8ibive55ugr6yfqa4"); // return 0;
-UNSUPPORTED("dtx9szdvwh3uhziubh9zvgbk5"); // break;
-UNSUPPORTED("75h4k3rjfi85b2x98vw0ydipc"); // case set_number_at:
-UNSUPPORTED("4n2daij5pdw7lao7n4sjeg0jt"); // p1 += 4;
-UNSUPPORTED("p0mt8wznalavjdm44ot4ykl7"); // default:
-UNSUPPORTED("7clvngmkw0ra8af8a3iq45vx"); // /* All other opcodes mean we cannot match the empty string. */
-UNSUPPORTED("7opo20y2y6rg5i89ocvk6qi3c"); // return 0;
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("7aoui9hygj5j6kdd0rxq44xxu"); // *p = p1;
-UNSUPPORTED("3tcgz4dupb6kw5tdk7n3pca2l"); // return 1;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 bmn9h3qza6i9e7dqjjfrybinz
-// static int bcmp_translate(const char *s1, const char *s2, register int len, char * translate)
-public static Object bcmp_translate(Object... arg) {
-UNSUPPORTED("eyp5xkiyummcoc88ul2b6tkeg"); // static int
-UNSUPPORTED("49tjvn2d5kzof9i3764qd8gth"); // bcmp_translate(const char *s1,
-UNSUPPORTED("5uinwhadus9kwopd7lyrqnv1a"); // const char *s2,
-UNSUPPORTED("cmbl8wi47y4b1fybqcgqp3cad"); // register int len,
-UNSUPPORTED("buglwifdxboeujcjzksjh6swn"); // char * translate)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("1ugbvzngjn5o1kzerkwa4adyp"); // register const unsigned char *p1 = (const unsigned char *) s1;
-UNSUPPORTED("180lhbq291ugus1sv6zq5b3l5"); // register const unsigned char *p2 = (const unsigned char *) s2;
-UNSUPPORTED("6wkqjlkf1iustuo36c77rrlrr"); // while (len)
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("ezhykxoqbj0p9ighugfp2pi29"); // if (translate[*p1++] != translate[*p2++]) return 1;
-UNSUPPORTED("bzd5vvu7ht1mg1wbv21csikm0"); // len--;
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("5oxhd3fvp0gfmrmz12vndnjt"); // return 0;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 34ah0o8fvtlfnsffbxiyqyidp
-// const char * re_compile_pattern(const char *pattern, size_t length, struct re_pattern_buffer *bufp)
-public static Object re_compile_pattern(Object... arg) {
-UNSUPPORTED("6j2ty6zxx5788lqe504lttmv9"); // const char *
-UNSUPPORTED("840rb5ffowq19aqwebzlrs0ix"); // re_compile_pattern(const char *pattern,
-UNSUPPORTED("dl8tq4y4w9kpglxq4nad9nbg9"); // size_t length,
-UNSUPPORTED("aoahpx5nic1p28er7zbeilibx"); // struct re_pattern_buffer *bufp)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("3e5irvh3tz7ehf2px38xbca06"); // reg_errcode_t ret;
-UNSUPPORTED("5e5qu4o19kt10axby5ksjp1wz"); // /* GNU code is written to assume at least RE_NREGS registers will be set
-UNSUPPORTED("aj16ee11rx90k6v260pcrptdx"); // (and at least one extra will be -1). */
-UNSUPPORTED("45osi16xhss2jxm7u3qpsz7c8"); // bufp->regs_allocated = 0;
-UNSUPPORTED("1s5igzhlf8kjprjkw59u0qgie"); // /* And GNU code determines whether or not to get register information
-UNSUPPORTED("4guz1aey6odyu4c6y9tmn7zks"); // by passing null for the REGS argument to re_match, etc., not by
-UNSUPPORTED("52atj9kiaa2ty4xp5v9tsxd36"); // setting no_sub. */
-UNSUPPORTED("bbp8v34kk2eq5jyypmrxegzfj"); // bufp->no_sub = 0;
-UNSUPPORTED("9zh94yub2h9x6jb5ygl7zj9j3"); // /* Match anchors at newline. */
-UNSUPPORTED("e5hvlkcul9024me3za5w0z09"); // bufp->newline_anchor = 1;
-UNSUPPORTED("f3zeg0ozvbzdxvagvz40uveju"); // ret = regex_compile (pattern, length, re_syntax_options, bufp);
-UNSUPPORTED("2ymc69pz5pg0nhr5joxv3v743"); // if (!ret)
-UNSUPPORTED("4mszslwsjcaxojerluqjpsu2v"); // return (void *)0;
-UNSUPPORTED("d6waz7r04hy6vrqylyux3566y"); // return (re_error_msgid[(int) ret]);
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 ark6qnryn24fu1bsbt5806lp
-// int regcomp(regex_t *preg, const char *pattern, int cflags)
-public static Object regcomp(Object... arg) {
-UNSUPPORTED("etrjsq5w49uo9jq5pzifohkqw"); // int
-UNSUPPORTED("blyavrrspx8u7mmx6skbsrpuy"); // regcomp(regex_t *preg,
-UNSUPPORTED("ez93viyirx32wiwx9ilmwnk2u"); // const char *pattern,
-UNSUPPORTED("s47pwvnf26eqviz0566rtafr"); // int cflags)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("3e5irvh3tz7ehf2px38xbca06"); // reg_errcode_t ret;
-UNSUPPORTED("arhekyz17wtkt6jcym8vpwl49"); // reg_syntax_t syntax
-UNSUPPORTED("cbdjhw8vkpou2zuaqsu38y9nq"); // = (cflags & 1) ?
-UNSUPPORTED("79wzspap1pncga08fi5fl45p3"); // ((((((unsigned long int) 1) << 1) << 1) | ((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) | (((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) | (((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) | ((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) | (((((unsigned long int) 1) << 1) << 1) << 1) | ((((((unsigned long int) 1) << 1) << 1) << 1) << 1) | ((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) | (((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) | (((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) | (((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) : ((((((unsigned long int) 1) << 1) << 1) | ((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) | (((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) | (((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) | ((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) | (((unsigned long int) 1) << 1));
-UNSUPPORTED("2c2dfk6a0ejxysnnaajue8m3p"); // /* regex_compile will allocate the space for the compiled pattern. */
-UNSUPPORTED("ciyvseirt32x5s8n7w8wi9s8b"); // preg->buffer = 0;
-UNSUPPORTED("b766kips3z6tm9tifbomnvtmy"); // preg->allocated = 0;
-UNSUPPORTED("2ne52scg87du6fvmgx4iz1ysx"); // preg->used = 0;
-UNSUPPORTED("dxwa3e8lqasfevebnvit8vz60"); // /* Don't bother to use a fastmap when searching. This simplifies the
-UNSUPPORTED("d5umtgupwg9d4iorhfyjyv8h5"); // REG_NEWLINE case: if we used a fastmap, we'd have to put all the
-UNSUPPORTED("ci8pjdo3b21gzu9zuu8df58su"); // characters after newlines into the fastmap. This way, we just try
-UNSUPPORTED("b5ux13ie7uoiwgtxbhqxccoi6"); // every character. */
-UNSUPPORTED("57t8as5xu3zastwhuvl9x5qvx"); // preg->fastmap = 0;
-UNSUPPORTED("enpzhkdq6ocdhen3xvl8ye5na"); // if (cflags & (1 << 1))
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("nujvj3hueebzfkhe2zarvfil"); // unsigned i;
-UNSUPPORTED("1pg69zbhom0cik7h8kn6t7y3g"); // preg->translate
-UNSUPPORTED("4nsrzyk2btcgmsdqjm2ar3vro"); // = (char *) malloc (256
-UNSUPPORTED("121bcje0610pzlltu9346d7c4"); // * sizeof (*(char *)0));
-UNSUPPORTED("bg80cnygjx78pa8v3kgmb63z4"); // if (preg->translate == (void *)0)
-UNSUPPORTED("ez6fz5kzz38v9ggr3wcumi254"); // return (int) REG_ESPACE;
-UNSUPPORTED("1vzdm7mgve5oi32ohhuqg8i00"); // /* Map uppercase characters to corresponding lowercase ones. */
-UNSUPPORTED("d532lt7aisdb9o1mkdskq134t"); // for (i = 0; i < 256; i++)
-UNSUPPORTED("aty2mttvyracw7p9x8sls4efr"); // preg->translate[i] = (1 && isupper (i)) ? tolower (i) : i;
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("div10atae09n36x269sl208r1"); // else
-UNSUPPORTED("c74ru7c24sev3knmidtcsy39e"); // preg->translate = (void *)0;
-UNSUPPORTED("a5kyad26nzmqkixgei1o847n"); // /* If REG_NEWLINE is set, newlines are treated differently. */
-UNSUPPORTED("db72pzje2ov1p3o5omyykyi7e"); // if (cflags & ((1 << 1) << 1))
-UNSUPPORTED("bpj2wmqxauupj14jn3tkadfjh"); // { /* REG_NEWLINE implies neither . nor [^...] match newline. */
-UNSUPPORTED("359fgbemkmx8zzoobn2anh8hi"); // syntax &= ~((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1);
-UNSUPPORTED("6g64qw2xiqubh3y7z9htmuzh5"); // syntax |= ((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1);
-UNSUPPORTED("ciyi7qvu3im41264ljmdkdzcl"); // /* It also changes the matching behavior. */
-UNSUPPORTED("8qz1elzfwgfxjvri21nioniys"); // preg->newline_anchor = 1;
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("div10atae09n36x269sl208r1"); // else
-UNSUPPORTED("2vftf31ujo45k9qv67n4ycbkv"); // preg->newline_anchor = 0;
-UNSUPPORTED("cx4zfp27tpwfh8xisrvqqbgks"); // preg->no_sub = !!(cflags & (((1 << 1) << 1) << 1));
-UNSUPPORTED("2x159h0yz24rnjci2cq7y1ntz"); // /* POSIX says a null character in the pattern terminates it, so we
-UNSUPPORTED("d66drlhc8quicmkt8miicu0ea"); // can use strlen here in compiling the pattern. */
-UNSUPPORTED("d0cg1xygicxugayg5yya59guo"); // ret = regex_compile (pattern, strlen (pattern), syntax, preg);
-UNSUPPORTED("erkyjok9d0k2psk0sb56f6vvz"); // /* POSIX doesn't distinguish between an unmatched open-group and an
-UNSUPPORTED("1u6sohla9epfpyet1i7nzcgad"); // unmatched close-group: both are REG_EPAREN. */
-UNSUPPORTED("3e5v05pv5yk1o9jdj6bh0zg5w"); // if (ret == REG_ERPAREN) ret = REG_EPAREN;
-UNSUPPORTED("7ancqvxv19g9moyznhw9my8xj"); // // printf("done with regcomp\n");
-UNSUPPORTED("f3hb5xwlfzeslhmq4ytwr8pgd"); // return (int) ret;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 9wdgvv1gwc1o7f0w05768p2i3
-// int regexec(const regex_t *preg, const char *string, size_t nmatch, regmatch_t pmatch[], int eflags)
-public static Object regexec(Object... arg) {
-UNSUPPORTED("etrjsq5w49uo9jq5pzifohkqw"); // int
-UNSUPPORTED("2v3o1uaqb2zp3puxfw779kms2"); // regexec(const regex_t *preg,
-UNSUPPORTED("ekpgp0iac0e6o9udtd55uiuly"); // const char *string,
-UNSUPPORTED("dvlw3353jood9rlb0w1geec5z"); // size_t nmatch,
-UNSUPPORTED("2864eyed7whs62o97tq2npado"); // regmatch_t pmatch[],
-UNSUPPORTED("3i4rg5r8fnniwlx6ybr4n906a"); // int eflags)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("7p7i4cv4qt10ow22vl9znw72j"); // int ret;
-UNSUPPORTED("82u0gsptykltdsomlyhj9rk19"); // struct re_registers regs;
-UNSUPPORTED("9z47qt0zii8jvt2jglo0lgszf"); // regex_t private_preg;
-UNSUPPORTED("6tsm0ylmo6ex2b24vcrr2cim7"); // int len = strlen (string);
-UNSUPPORTED("17kwuhblkqgc3mdapwyc395sz"); // boolean want_reg_info = !preg->no_sub && nmatch > 0;
-UNSUPPORTED("agwedmhzs0prdnnlk9jnsfg9c"); // private_preg = *preg;
-UNSUPPORTED("13e7wtxa8hlobsw8k2nqqg3r3"); // private_preg.not_bol = !!(eflags & 1);
-UNSUPPORTED("57scmexrxxrwf0l9nzr1szrpt"); // private_preg.not_eol = !!(eflags & (1 << 1));
-UNSUPPORTED("mql47hhdnpgkjou517m3726f"); // /* The user has told us exactly how many registers to return
-UNSUPPORTED("cqy8u5p4xwvs8y4q6w7fce3xv"); // information about, via `nmatch'. We have to pass that on to the
-UNSUPPORTED("3rosx96qxeg0kqk0uxh7l1cl8"); // matching routines. */
-UNSUPPORTED("c013ob9fi1fg0vxd1oam5865g"); // private_preg.regs_allocated = 2;
-UNSUPPORTED("9rkeiv1fdp19eb173sjfltu2t"); // if (want_reg_info)
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("8a02jnbpnzttrw1ayq7w5mj62"); // regs.num_regs = nmatch;
-UNSUPPORTED("aoe6tbrgjwbzymn65261rgcum"); // regs.start = ((regoff_t *) malloc ((nmatch) * sizeof (regoff_t)));
-UNSUPPORTED("3hfltfy7wmk9a24vq9wzlmq9v"); // regs.end = ((regoff_t *) malloc ((nmatch) * sizeof (regoff_t)));
-UNSUPPORTED("7njv4u89envwukxkawqtq0oto"); // if (regs.start == (void *)0 || regs.end == (void *)0)
-UNSUPPORTED("873f3rccmawjgt3m3uqo8p3ci"); // return (int) REG_NOMATCH;
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("a8yuopeuk07ow83nm5njscoxn"); // /* Perform the searching operation. */
-UNSUPPORTED("cwamuwhai30lyfbzzvibn401x"); // ret = re_search (&private_preg, string, len,
-UNSUPPORTED("6jnlnbkqqmvrtbxyne0meo7jt"); // /* start: */ 0, /* range: */ len,
-UNSUPPORTED("1xnfnhd8hk3tln4va3uu7f2wm"); // want_reg_info ? &regs : (struct re_registers *) 0);
-UNSUPPORTED("86oesm7mqi9hv2n08zwleh73m"); // /* Copy the register information to the POSIX structure. */
-UNSUPPORTED("9rkeiv1fdp19eb173sjfltu2t"); // if (want_reg_info)
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("ce73wb0bbrngqy808tp6ppsrq"); // if (ret >= 0)
-UNSUPPORTED("9ua540u2gx5jpu302s81qfxhi"); // {
-UNSUPPORTED("bxs4m6oognafzhor2ww93b692"); // unsigned r;
-UNSUPPORTED("8soywsau32kjtl93ct4sxxyma"); // for (r = 0; r < nmatch; r++)
-UNSUPPORTED("5k2digv672hnrndhc9ktw0oii"); // {
-UNSUPPORTED("cfq91dne0qag57cuzkcw5mxcg"); // pmatch[r].rm_so = regs.start[r];
-UNSUPPORTED("gibau4k00r5dzlvk4kcbwb56"); // pmatch[r].rm_eo = regs.end[r];
-UNSUPPORTED("b86ovw6olwwo6gnqlt1wqqzb4"); // }
-UNSUPPORTED("7nxu74undh30brb8laojud3f9"); // }
-UNSUPPORTED("c0xnifbhwrr011t5ogyy7sxk4"); // /* If we needed the temporary register info, free the space now. */
-UNSUPPORTED("ec72z8dmt4gcwsz42a7ubbvgx"); // free (regs.start);
-UNSUPPORTED("8gandm25f5zvbvckszq77jha"); // free (regs.end);
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("7dob0tgisyvw4rk6jg4viupyw"); // /* We want zero return to mean success, unlike `re_search'. */
-UNSUPPORTED("246hp3joht768z00rf97n4yvo"); // return ret >= 0 ? (int) REG_NOERROR : (int) REG_NOMATCH;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 6u3voe6b7jao3ubd49rpvpmmx
-// size_t regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)
-public static Object regerror(Object... arg) {
-UNSUPPORTED("4hv4edbckfpx53agqilues063"); // size_t
-UNSUPPORTED("72xsdxwxd93qf4oxx4jyhdo8z"); // regerror(int errcode,
-UNSUPPORTED("asif8gxw337t4n3r3vlc5nfry"); // const regex_t *preg,
-UNSUPPORTED("7k1ct0qwx3daob1tp19njd6q0"); // char *errbuf,
-UNSUPPORTED("dx6x6qmmym6uzf7roqbw9kvt"); // size_t errbuf_size)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("91x25pzkmtzqo9hslez13lges"); // const char *msg;
-UNSUPPORTED("6m38jprvakqd3ls3jeotcz1xg"); // size_t msg_size;
-UNSUPPORTED("adpjyd1odey6jlw7vkjk429xt"); // if (errcode < 0
-UNSUPPORTED("8ybd3hnsngs38rh8ddk8q0w26"); // || errcode >= (int) (sizeof (re_error_msgid)
-UNSUPPORTED("c9vfuy341wx3rri8wvq9sua5s"); // / sizeof (re_error_msgid[0])))
-UNSUPPORTED("7u1uewk6wx5joexwehp38vlng"); // /* Only error codes returned by the rest of the code should be passed
-UNSUPPORTED("6hlmqhjzj6vqjlpwwklal6m89"); // to this routine. If we are given anything else, or if other regex
-UNSUPPORTED("cbs38fwyo0gkko91u7cenjci"); // code generates an invalid error code, then the program has a bug.
-UNSUPPORTED("8or7291qatc4r8j81dj07fgb4"); // Dump core so we can fix it. */
-UNSUPPORTED("68wdgoila4oldpk4gdc6i6uc3"); // abort ();
-UNSUPPORTED("4yci96v8pzj722abptwqxdkso"); // msg = (re_error_msgid[errcode]);
-UNSUPPORTED("dujj3eb9b3zvr0euc5s4itcj"); // msg_size = strlen (msg) + 1; /* Includes the null. */
-UNSUPPORTED("6oho364pztumj8yc7uc6bsusm"); // if (errbuf_size != 0)
-UNSUPPORTED("6pjalxixg8dnhbhc46pm6e6ay"); // {
-UNSUPPORTED("4oxtwxt5zv8auje423kp2f05r"); // if (msg_size > errbuf_size)
-UNSUPPORTED("9ua540u2gx5jpu302s81qfxhi"); // {
-UNSUPPORTED("3cof3rq3oujwsp8nrbb9snh96"); // strncpy (errbuf, msg, errbuf_size - 1);
-UNSUPPORTED("17sh1j757ozjg8a39nvcnmean"); // errbuf[errbuf_size - 1] = 0;
-UNSUPPORTED("7nxu74undh30brb8laojud3f9"); // }
-UNSUPPORTED("1knjyao8ci3w18zqqcnmnitir"); // else
-UNSUPPORTED("6ru8c1linplme96gzmn6v9ezn"); // strcpy (errbuf, msg);
-UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
-UNSUPPORTED("ban7kvxs6qguwfg0cz79w2fqe"); // return msg_size;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-
-
-//3 1ydg62ufhooqvgftuuovy004y
-// void regfree(regex_t *preg)
-public static Object regfree(Object... arg) {
-UNSUPPORTED("c01vxogao855zs8fe94tpim9g"); // void
-UNSUPPORTED("yxtwt5xf8mgfwucdzaq8xg0"); // regfree(regex_t *preg)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("axv8f27k41wevzbd8jorfk8em"); // if (preg->buffer != (void *)0)
-UNSUPPORTED("4krgfpqw59bwla8p73a5potcs"); // free (preg->buffer);
-UNSUPPORTED("duswsbmztnkjw8nmmpoanyq0l"); // preg->buffer = (void *)0;
-UNSUPPORTED("b766kips3z6tm9tifbomnvtmy"); // preg->allocated = 0;
-UNSUPPORTED("2ne52scg87du6fvmgx4iz1ysx"); // preg->used = 0;
-UNSUPPORTED("ac48j1opcvu8p6bmkvhdmubhe"); // if (preg->fastmap != (void *)0)
-UNSUPPORTED("43aaw7li7lbfcd1lewzzyp7to"); // free (preg->fastmap);
-UNSUPPORTED("4lv04h2kcmrw99yqy6i26w8g4"); // preg->fastmap = (void *)0;
-UNSUPPORTED("5e92vh1r7ol7emrm0ijcg45a9"); // preg->fastmap_accurate = 0;
-UNSUPPORTED("e4iva4m5k6n7oj8enuvyimttj"); // if (preg->translate != (void *)0)
-UNSUPPORTED("4mliivt4jjgt9njb860f17323"); // free (preg->translate);
-UNSUPPORTED("7c5ulxpurhe3moa5q2eu01tom"); // preg->translate = (void *)0;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
-}
-
-
-}
diff --git a/src/gen/lib/label/index__c.java b/src/gen/lib/label/index__c.java
index 6276c7f..d2221e5 100644
--- a/src/gen/lib/label/index__c.java
+++ b/src/gen/lib/label/index__c.java
@@ -44,7 +44,13 @@
*
*/
package gen.lib.label;
+import static gen.lib.label.node__c.*;
+import static gen.lib.common.memory__c.zmalloc;
+import static smetana.core.JUtils.sizeof;
import static smetana.core.Macro.UNSUPPORTED;
+import h.RTree;
+import h._Node_t___;
+import smetana.core.__ptr__;
public class index__c {
@@ -105,6 +111,140 @@ UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
+///* Allocate space for a node in the list used in DeletRect to
+// * store Nodes that are too empty.
+// */
+//static struct ListNode *RTreeNewListNode(void)
+//{
+// return (struct ListNode*)zmalloc(sizeof(struct ListNode));
+//}
+//
+///* Add a node to the reinsertion list. All its branches will later
+// * be reinserted into the index structure.
+// */
+//static int RTreeReInsert(RTree_t * rtp, Node_t * n, struct ListNode **ee)
+//{
+// register struct ListNode *l;
+//
+// if (!(l = RTreeNewListNode()))
+// return -1;
+// l->node = n;
+// l->next = *ee;
+// *ee = l;
+// return 0;
+//}
+//
+//RTree_t *RTreeOpen()
+public static __ptr__ RTreeOpen() {
+ RTree rtp;
+ rtp = (RTree) zmalloc(sizeof(RTree.class));
+ if (rtp!=null)
+ rtp.setPtr("root", RTreeNewIndex(rtp));
+ return rtp;
+}
+
+///* Make a new index, empty. Consists of a single node. */
+//Node_t *RTreeNewIndex(RTree_t * rtp)
+public static _Node_t___ RTreeNewIndex(RTree rtp) {
+ _Node_t___ x;
+ x = RTreeNewNode(rtp);
+// x->level = 0; /* leaf */
+// rtp->LeafCount++;
+// return x;
+//}
+ throw new UnsupportedOperationException();
+}
+//
+//static int RTreeClose2(RTree_t * rtp, Node_t * n)
+//{
+// int i;
+//
+// if (n->level > 0) {
+// for (i = 0; i < 64; i++) {
+// if (!n->branch[i].child)
+// continue;
+// if (!RTreeClose2(rtp, n->branch[i].child)) {
+// free(n->branch[i].child);
+// DisconBranch(n, i);
+// rtp->EntryCount--;
+// if (rtp->StatFlag)
+// rtp->ElimCount++;
+// }
+// }
+// } else {
+// for (i = 0; i < 64; i++) {
+// if (!n->branch[i].child)
+// continue;
+// // free(n->branch[i].child);
+// DisconBranch(n, i);
+// rtp->EntryCount--;
+// if (rtp->StatFlag)
+// rtp->ElimCount++;
+// }
+// //free(n);
+// }
+// return 0;
+//}
+//
+//int RTreeClose(RTree_t * rtp)
+//{
+// RTreeClose2(rtp, rtp->root);
+// free(rtp->root);
+// free(rtp);
+// return 0;
+//}
+//
+//
+///* RTreeSearch in an index tree or subtree for all data retangles that
+//** overlap the argument rectangle.
+//** Returns the number of qualifying data rects.
+//*/
+//LeafList_t *RTreeSearch(RTree_t * rtp, Node_t * n, Rect_t * r)
+//{
+// register int i;
+// LeafList_t *llp = 0;
+//
+// assert(n);
+// assert(n->level >= 0);
+// assert(r);
+//
+// rtp->SeTouchCount++;
+//
+// if (n->level > 0) { /* this is an internal node in the tree */
+// for (i = 0; i < 64; i++)
+// if (n->branch[i].child && Overlap(r, &n->branch[i].rect)) {
+// LeafList_t *tlp = RTreeSearch(rtp, n->branch[i].child, r);
+// if (llp) {
+// LeafList_t *xlp = llp;
+// while (xlp->next)
+// xlp = xlp->next;
+// xlp->next = tlp;
+// } else
+// llp = tlp;
+// }
+// } else { /* this is a leaf node */
+// for (i = 0; i < 64; i++) {
+// if (n->branch[i].child && Overlap(r, &n->branch[i].rect)) {
+// llp = RTreeLeafListAdd(llp, (Leaf_t *) & n->branch[i]);
+//
+//
+//
+// }
+// }
+// }
+// return llp;
+//}
+//
+///* Insert a data rectangle into an index structure.
+//** RTreeInsert provides for splitting the root;
+//** returns 1 if root was split, 0 if it was not.
+//** The level argument specifies the number of steps up from the leaf
+//** level to insert; e.g. a data rectangle goes in at level = 0.
+//** RTreeInsert2 does the recursion.
+//*/
+//static int RTreeInsert2(RTree_t *, Rect_t *, void *, Node_t *, Node_t **,
+// int);
+///*static int RTreeInsert2(RTree_t*, Rect_t*, int, Node_t*, Node_t**, int); */
diff --git a/src/gen/lib/label/node__c.java b/src/gen/lib/label/node__c.java
index 03e7a85..e6e26b3 100644
--- a/src/gen/lib/label/node__c.java
+++ b/src/gen/lib/label/node__c.java
@@ -45,18 +45,19 @@
*/
package gen.lib.label;
import static smetana.core.Macro.UNSUPPORTED;
+import h.RTree;
+import h._Node_t___;
+import smetana.core.Memory;
public class node__c {
//3 9uj7ni1m6q6drtoh56w82d6m4
// Node_t *RTreeNewNode(RTree_t * rtp)
-public static Object RTreeNewNode(Object... arg) {
-UNSUPPORTED("6r87cuk0qgu4wqagr86fr5tts"); // Node_t *RTreeNewNode(RTree_t * rtp)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("7wl3hkaktfhqdqsm6ubxboo1q"); // register Node_t *n;
-UNSUPPORTED("4bwg40kiiowl2obspxcr4saa2"); // rtp->NodeCount++;
-UNSUPPORTED("azoy4bfuupxwp4mi8hfbfb78g"); // n = (Node_t *) malloc(sizeof(Node_t));
+public static _Node_t___ RTreeNewNode(RTree rtp) {
+ _Node_t___ n;
+ rtp.setInt("NodeCount", rtp.getInt("NodeCount") + 1);
+ n = (_Node_t___) Memory.malloc(_Node_t___.class);
UNSUPPORTED("a4ey5uckjqallol1ktyqe35bv"); // InitNode(n);
UNSUPPORTED("69hc24ic55i66g8tf2ne42327"); // return n;
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
diff --git a/src/gen/lib/label/xlabels__c.java b/src/gen/lib/label/xlabels__c.java
index f5c9c45..8cb299f 100644
--- a/src/gen/lib/label/xlabels__c.java
+++ b/src/gen/lib/label/xlabels__c.java
@@ -44,7 +44,19 @@
*
*/
package gen.lib.label;
+import static gen.lib.cdt.dtopen__c.dtopen;
+import static gen.lib.common.memory__c.zmalloc;
+import static gen.lib.label.index__c.RTreeOpen;
+import static smetana.core.JUtils.sizeof;
+import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
+import h.BestPos_t;
+import h.XLabels_t;
+import h._dt_s;
+import h._dtdisc_s;
+import h.label_params_t;
+import smetana.core.Z;
+import smetana.core.__ptr__;
public class xlabels__c {
//1 9k44uhd5foylaeoekf3llonjq
@@ -123,8 +135,7 @@ public class xlabels__c {
//3 5p3ac8qk4gnne5hj1dc21ysi
// static int icompare(Dt_t * dt, void * v1, void * v2, Dtdisc_t * disc)
-public static Object icompare(Object... arg) {
-UNSUPPORTED("bpbhsdw4fe10xdxxfuegnvqt2"); // static int icompare(Dt_t * dt, void * v1, void * v2, Dtdisc_t * disc)
+public static int icompare(_dt_s dt, __ptr__ v1, __ptr__ v2, _dtdisc_s disc) {
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("ehks25fxahyjbjd4lm6ryh9su"); // int k1 = *((int *) v1), k2 = *((int *) v2);
UNSUPPORTED("6in30ubiocmaih693f0arymgc"); // return k1 - k2;
@@ -138,24 +149,22 @@ throw new UnsupportedOperationException();
//3 88mbfm305igsr7cew5qx6yldp
// static XLabels_t *xlnew(object_t * objs, int n_objs, xlabel_t * lbls, int n_lbls, label_params_t * params)
-public static Object xlnew(Object... arg) {
-UNSUPPORTED("3le94zdf67vws2boexolzlx7k"); // static XLabels_t *xlnew(object_t * objs, int n_objs,
-UNSUPPORTED("cb2wq8p902q5tlc1mh5hikgi2"); // xlabel_t * lbls, int n_lbls,
-UNSUPPORTED("bz8hxsdu70exdmt52dnayj0c7"); // label_params_t * params)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("bkrrqfyt0mc9r9usgj4c7t9zs"); // XLabels_t *xlp;
-UNSUPPORTED("5tfjcsm3vbxebkz2ev3uqptnx"); // xlp = (XLabels_t*)zmalloc(sizeof(XLabels_t));
-UNSUPPORTED("evg8rhuwggcno9jwcrub0i4y4"); // /* used to load the rtree in hilbert space filling curve order */
-UNSUPPORTED("8yj6rj5llf2mw5pp8tt355a7o"); // if (!(xlp->hdx = dtopen(&Hdisc, Dtobag))) {
+public static XLabels_t xlnew(__ptr__ objs, int n_objs, __ptr__ lbls, int n_lbls, label_params_t params) {
+__ptr__ xlp;
+xlp = zmalloc(sizeof(XLabels_t.class));
+/* used to load the rtree in hilbert space filling curve order */
+xlp.setPtr("hdx", dtopen(Z.z().Hdisc.amp(), Z.z().Dtobag));
+if (N(xlp.getPtr("hdx"))) {
UNSUPPORTED("4t1y5iinm4310lkpvbal1spve"); // fprintf(stderr, "out of memory\n");
UNSUPPORTED("3m406diamp5s5kwcqtwo4pshf"); // goto bad;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("1bzq9uxiqzj7l6llb7e6gti7e"); // /* for querying intersection candidates */
+}
+/* for querying intersection candidates */
+xlp.setPtr("spdx", RTreeOpen());
UNSUPPORTED("7elrkgy2129t2ut4mi03dhf75"); // if (!(xlp->spdx = RTreeOpen())) {
UNSUPPORTED("4t1y5iinm4310lkpvbal1spve"); // fprintf(stderr, "out of memory\n");
UNSUPPORTED("3m406diamp5s5kwcqtwo4pshf"); // goto bad;
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("85lb5m2umu5izyudq40of0dgi"); // /* save arg pointers in the handle */
+/* save arg pointers in the handle */
UNSUPPORTED("ava6c0wrmq2d6j1i4j7bd1lpp"); // xlp->objs = objs;
UNSUPPORTED("85sh2ov52z31nsy9mk5su9p5p"); // xlp->n_objs = n_objs;
UNSUPPORTED("3et8g76wlkf60sgxrmi3z1vom"); // xlp->lbls = lbls;
@@ -804,14 +813,10 @@ throw new UnsupportedOperationException();
//3 brqgbskh3z4ah8infjompibvu
// int placeLabels(object_t * objs, int n_objs, xlabel_t * lbls, int n_lbls, label_params_t * params)
-public static Object placeLabels(Object... arg) {
-UNSUPPORTED("etrjsq5w49uo9jq5pzifohkqw"); // int
-UNSUPPORTED("ec68cktfb4yv5ddz6c3prlrlz"); // placeLabels(object_t * objs, int n_objs,
-UNSUPPORTED("5ldon0a05p5rangda7ft97vpf"); // xlabel_t * lbls, int n_lbls, label_params_t * params)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("ch9su7givqwexp175hzif4dga"); // int r, i;
-UNSUPPORTED("ac14qcqjljksbh1ulqbhsnrnb"); // BestPos_t bp;
-UNSUPPORTED("as2y5lue6yv2statqso3a65vn"); // XLabels_t *xlp = xlnew(objs, n_objs, lbls, n_lbls, params);
+public static int placeLabels(__ptr__ objs, int n_objs, __ptr__ lbls, int n_lbls, label_params_t params) {
+int r, i;
+BestPos_t bp;
+XLabels_t xlp = xlnew(objs, n_objs, lbls, n_lbls, params);
UNSUPPORTED("dm5w2lmehr2rv6b2yi2v83i3g"); // if ((r = xlinitialize(xlp)) < 0)
UNSUPPORTED("bt8wt6mqb316pv7egiekltb74"); // return r;
UNSUPPORTED("8izrf1sxed8y2dmpz5ju27b6h"); // /* Place xlabel_t* lp near lp->obj so that the rectangle whose lower-left
diff --git a/src/gen/lib/pathplan/route__c.java b/src/gen/lib/pathplan/route__c.java
index b141968..c598f53 100644
--- a/src/gen/lib/pathplan/route__c.java
+++ b/src/gen/lib/pathplan/route__c.java
@@ -60,6 +60,7 @@ import smetana.core.JUtils;
import smetana.core.Memory;
import smetana.core.Z;
import smetana.core.__array_of_struct__;
+import smetana.core.__array_of_struct_impl__;
import smetana.core.__ptr__;
import smetana.core.__struct__;
import smetana.core.jmp_buf;
@@ -271,7 +272,7 @@ return splinefits_w_(edges, edgen, pa.copy(), va.copy(), pb.copy(), vb.copy(), i
private static int splinefits_w_(__ptr__ edges, int edgen, final __struct__<pointf> pa, final __struct__<pointf> va, final __struct__<pointf> pb, final __struct__<pointf> vb, __ptr__ inps, int inpn) {
ENTERING("987ednrgu5qo9dzhpiox47mhb","splinefits");
try {
- final __array_of_struct__ sps = __array_of_struct__.malloc(pointf.class, 4);
+ final __array_of_struct__ sps = __array_of_struct_impl__.malloc(pointf.class, 4);
double a, b;
int pi;
int forceflag;
@@ -344,7 +345,7 @@ try {
double roots[] = new double[4];
int rooti, rootn;
int ei;
- final __array_of_struct__ lps = __array_of_struct__.malloc(pointf.class, 2);
+ final __array_of_struct__ lps = __array_of_struct_impl__.malloc(pointf.class, 2);
final __struct__<pointf> ip = JUtils.from(pointf.class);
double t, ta, tb, tc, td;
for (ei = 0; ei < edgen; ei++) {
diff --git a/src/gen/lib/pathplan/shortest__c.java b/src/gen/lib/pathplan/shortest__c.java
index 79337e9..e620742 100644
--- a/src/gen/lib/pathplan/shortest__c.java
+++ b/src/gen/lib/pathplan/shortest__c.java
@@ -63,6 +63,7 @@ import smetana.core.JUtils;
import smetana.core.Memory;
import smetana.core.Z;
import smetana.core.__array_of_struct__;
+import smetana.core.__array_of_struct_impl__;
import smetana.core.__ptr__;
import smetana.core.__struct__;
import smetana.core.jmp_buf;
@@ -121,7 +122,7 @@ try {
final __struct__<pointf> p1 = JUtils.from(pointf.class), p2 = JUtils.from(pointf.class), p3 = JUtils.from(pointf.class);
int trii, trij, ftrii, ltrii;
int ei;
- final __array_of_struct__ epnls = __array_of_struct__.malloc(pointnlink_t.class, 2);
+ final __array_of_struct__ epnls = __array_of_struct_impl__.malloc(pointnlink_t.class, 2);
pointnlink_t lpnlp=null, rpnlp=null, pnlp=null;
triangle_t trip;
int splitindex;
diff --git a/src/h/STArray.java b/src/h/STArray.java
new file mode 100644
index 0000000..b09ece6
--- /dev/null
+++ b/src/h/STArray.java
@@ -0,0 +1,156 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import smetana.core.UnsupportedArrayOfPtr;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__array_of_ptr__;
+import smetana.core.__ptr__;
+import smetana.core.__struct__;
+import smetana.core.size_t;
+import smetana.core.amiga.Area;
+import smetana.core.amiga.StarArrayOfPtr;
+
+public class STArray<O extends UnsupportedStructAndPtr> extends UnsupportedArrayOfPtr {
+
+ private final int pos;
+ private final List<O> list;
+ private final Class clazz;
+
+ public STArray(int pos, List<O> list, Class clazz) {
+ this.pos = pos;
+ this.list = list;
+ this.clazz = clazz;
+ }
+
+ @Override
+ public int comparePointerInternal(__array_of_ptr__ other) {
+ STArray<O> other2 = (STArray<O>) other;
+ if (this.list != other2.list) {
+ throw new IllegalArgumentException();
+ }
+ return this.pos - other2.pos;
+ }
+
+ public STArray(int size, int pos, Class clazz) {
+ this.pos = pos;
+ this.list = new ArrayList<O>();
+ this.clazz = clazz;
+ for (int i = 0; i < size; i++) {
+ try {
+ this.list.add((O) clazz.newInstance());
+ } catch (Exception e) {
+ throw new IllegalStateException(e.toString());
+ }
+ }
+ }
+
+ @Override
+ public void realloc(size_t nb) {
+ realloc(nb.getInternalNb());
+ }
+
+ @Override
+ public void realloc(int nb) {
+ while (list.size() < nb) {
+ try {
+ this.list.add((O) clazz.newInstance());
+ } catch (Exception e) {
+ throw new IllegalStateException(e.toString());
+ }
+ }
+ }
+
+ @Override
+ public __array_of_ptr__ plus(int delta) {
+ return new STArray(pos + delta, this.list, clazz);
+ }
+
+ @Override
+ public __array_of_ptr__ move(int delta) {
+ return new STArray(pos + delta, this.list, clazz);
+ }
+
+ @Override
+ public void setStruct(__struct__ value) {
+ list.get(pos).setStruct(value);
+ }
+
+ @Override
+ public __struct__ getStruct() {
+ return list.get(pos).getStruct();
+ // return list.get(pos);
+ }
+
+ @Override
+ public __struct__ getStruct(String fieldName) {
+ return list.get(pos).getStruct(fieldName);
+ }
+
+ @Override
+ public __ptr__ getPtr() {
+ return list.get(pos).amp();
+ }
+
+ @Override
+ public __ptr__ asPtr() {
+ return new StarArrayOfPtr(this);
+ }
+
+ @Override
+ public void setPtr(__ptr__ value) {
+ list.set(pos, (O) value.getStruct());
+ }
+
+ @Override
+ public Area getInternal(final int idx) {
+ return list.get(pos + idx);
+ }
+
+}
diff --git a/src/h/STStarArrayOfPointer.java b/src/h/STStarArrayOfPointer.java
new file mode 100644
index 0000000..7025548
--- /dev/null
+++ b/src/h/STStarArrayOfPointer.java
@@ -0,0 +1,117 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import smetana.core.UnsupportedC;
+import smetana.core.__array_of_integer__;
+import smetana.core.__ptr__;
+import smetana.core.amiga.Area;
+
+public class STStarArrayOfPointer extends UnsupportedC {
+
+ private final int pos;
+ private final List<__ptr__> data;
+
+ public void realloc(int nb) {
+ while (data.size() < nb) {
+ data.add(null);
+ }
+ }
+
+ public static STStarArrayOfPointer malloc(int size) {
+ List<__ptr__> data = new ArrayList<__ptr__>();
+ for (int i = 0; i < size; i++) {
+ data.add(null);
+ }
+ return new STStarArrayOfPointer(0, data);
+ }
+
+ private STStarArrayOfPointer(int pos, List<__ptr__> data) {
+ this.pos = pos;
+ this.data = data;
+ }
+
+ @Override
+ public int comparePointer(__ptr__ other) {
+ final STStarArrayOfPointer this2 = (STStarArrayOfPointer) other;
+ if (this.data != this2.data) {
+ throw new IllegalArgumentException();
+ }
+ return this.pos - this2.pos;
+ }
+
+ @Override
+ public __ptr__ plus(int pointerMove) {
+ return new STStarArrayOfPointer(pos + pointerMove, data);
+ }
+
+ @Override
+ public void setPtr(__ptr__ value) {
+ data.set(pos, value);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ return data.get(pos).getPtr(fieldName);
+ }
+
+ @Override
+ public __ptr__ getPtr() {
+ return data.get(pos);
+ }
+
+ public void swap(int i, int j) {
+ __ptr__ e1 = data.get(i);
+ __ptr__ e2 = data.get(j);
+ data.set(i, e2);
+ data.set(j, e1);
+
+ }
+
+}
diff --git a/src/h/ST_Agattr_s.java b/src/h/ST_Agattr_s.java
new file mode 100644
index 0000000..31e3214
--- /dev/null
+++ b/src/h/ST_Agattr_s.java
@@ -0,0 +1,125 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__array_of_cstring__;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarArrayOfCString;
+import smetana.core.amiga.StarStruct;
+
+public class ST_Agattr_s extends UnsupportedStructAndPtr {
+
+ private final ST_Agrec_s h = new ST_Agrec_s(this); /* common data header */
+ public ST_dt_s dict; /* shared dict to interpret attr field */
+ public StarArrayOfCString str; /* the attribute string values */
+
+ private final StarStruct parent;
+
+ public ST_Agattr_s() {
+ this(null);
+ }
+
+ public ST_Agattr_s(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ public StarStruct getParent() {
+ return parent;
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("dict")) {
+ return dict;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("dict")) {
+ this.dict = (ST_dt_s) newData;
+ return dict;
+ }
+ if (fieldName.equals("str")) {
+ this.str = (StarArrayOfCString) newData;
+ return str;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __array_of_cstring__ getArrayOfCString(String fieldName) {
+ if (fieldName.equals("str")) {
+ return str.getInternalArray();
+ }
+ return super.getArrayOfCString(fieldName);
+ }
+
+ @Override
+ public __ptr__ castTo(Class dest) {
+ if (dest == Agrec_s.class) {
+ return h;
+ // return h.amp();
+ }
+ return super.castTo(dest);
+ }
+
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "struct Agattr_s",
+ // "{",
+ // "Agrec_t h",
+ // "Dict_t *dict",
+ // "char **str",
+ // "}");
+}
+
+// struct Agattr_s { /* dynamic string attributes */
+// Agrec_t h; /* common data header */
+// Dict_t *dict; /* shared dict to interpret attr field */
+// char **str; /* the attribute string values */
+// }; \ No newline at end of file
diff --git a/src/h/ST_Agcbstack_s.java b/src/h/ST_Agcbstack_s.java
new file mode 100644
index 0000000..213fd48
--- /dev/null
+++ b/src/h/ST_Agcbstack_s.java
@@ -0,0 +1,80 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.amiga.StarStruct;
+
+public class ST_Agcbstack_s extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_Agcbstack_s() {
+ this(null);
+ }
+
+ public ST_Agcbstack_s(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ public StarStruct getParent() {
+ return parent;
+ }
+
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "struct Agcbstack_s",
+ // "{",
+ // "Agcbdisc_t *f",
+ // "void *state",
+ // "Agcbstack_t *prev",
+ // "}");
+}
+
+// struct Agcbstack_s { /* object event callbacks */
+// Agcbdisc_t *f; /* methods */
+// void *state; /* closure */
+// Agcbstack_t *prev; /* kept in a stack, unlike other disciplines */
+// }; \ No newline at end of file
diff --git a/src/h/ST_Agclos_s.java b/src/h/ST_Agclos_s.java
new file mode 100644
index 0000000..6b93fd4
--- /dev/null
+++ b/src/h/ST_Agclos_s.java
@@ -0,0 +1,203 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import smetana.core.ArrayOfInteger;
+import smetana.core.UnsupportedArrayOfPtr;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__array_of_integer__;
+import smetana.core.__array_of_ptr__;
+import smetana.core.__ptr__;
+import smetana.core.__struct__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_Agclos_s extends UnsupportedStructAndPtr {
+ public final ST_Agdisc_s disc = new ST_Agdisc_s(this); /* resource discipline functions */
+ public final ST_Agdstate_s state = new ST_Agdstate_s(this); /* resource closures */
+ public ST_dt_s strdict;
+ private final int[] seq = new int[3];
+ // "unsigned long seq[3]",
+ public ST_Agcbstack_s cb;
+ public boolean callbacks_enabled; /* issue user callbacks or hold them? */
+
+ // "Dict_t *lookup_by_name[3]",
+ // "Dict_t *lookup_by_id[3]",
+ private final ArrayOfThreePtrDict_t lookup_by_id = new ArrayOfThreePtrDict_t();
+
+ static class ArrayOfThreePtrDict_t extends UnsupportedArrayOfPtr implements __array_of_ptr__ {
+ private final List<Dict_t> list;
+ private final int pos;
+
+ private ArrayOfThreePtrDict_t(List<Dict_t> list, int pos) {
+ this.list = list;
+ this.pos = pos;
+ }
+
+ ArrayOfThreePtrDict_t() {
+ this(new ArrayList<Dict_t>(), 0);
+ for (int i = 0; i < 3; i++) {
+ list.add(null);
+ }
+ }
+
+ @Override
+ public __array_of_ptr__ plus(int delta) {
+ return new ArrayOfThreePtrDict_t(list, pos + delta);
+ }
+
+ @Override
+ public __ptr__ getPtr() {
+ return list.get(0);
+ }
+
+ }
+
+ private final StarStruct parent;
+
+ public ST_Agclos_s() {
+ this(null);
+ }
+
+ public ST_Agclos_s(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ public StarStruct getParent() {
+ return parent;
+ }
+
+ @Override
+ public boolean getBoolean(String fieldName) {
+ if (fieldName.equals("callbacks_enabled")) {
+ return callbacks_enabled;
+ }
+ return super.getBoolean(fieldName);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("strdict")) {
+ return strdict;
+ }
+ if (fieldName.equals("cb")) {
+ return cb;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("strdict")) {
+ this.strdict = (ST_dt_s) newData;
+ return strdict;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __struct__ getStruct(String fieldName) {
+ if (fieldName.equals("disc")) {
+ return disc;
+ }
+ if (fieldName.equals("state")) {
+ return state;
+ }
+ return super.getStruct(fieldName);
+ }
+
+ @Override
+ public void setBoolean(String fieldName, boolean data) {
+ if (fieldName.equals("callbacks_enabled")) {
+ this.callbacks_enabled = data;
+ return;
+ }
+ super.setBoolean(fieldName, data);
+ }
+
+ @Override
+ public __array_of_integer__ getArrayOfInteger(String fieldName) {
+ if (fieldName.equals("seq")) {
+ return new ArrayOfInteger(seq, 0);
+ }
+ return super.getArrayOfInteger(fieldName);
+ }
+
+ @Override
+ public __array_of_ptr__ getArrayOfPtr(String fieldName) {
+ if (fieldName.equals("lookup_by_id")) {
+ return lookup_by_id;
+ }
+ return super.getArrayOfPtr(fieldName);
+ }
+
+ // public interface ST_Agclos_s extends __ptr__ {
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "struct Agclos_s",
+ // "{",
+ // "Agdisc_t disc",
+ // "Agdstate_t state",
+ // "Dict_t *strdict",
+ // "unsigned long seq[3]",
+ // "Agcbstack_t *cb",
+ // "unsigned char callbacks_enabled",
+ // "Dict_t *lookup_by_name[3]",
+ // "Dict_t *lookup_by_id[3]",
+ // "}");
+}
+
+// struct Agclos_s {
+// Agdisc_t disc; /* resource discipline functions */
+// Agdstate_t state; /* resource closures */
+// Dict_t *strdict; /* shared string dict */
+// unsigned long seq[3]; /* local object sequence number counter */
+// Agcbstack_t *cb; /* user and system callback function stacks */
+// unsigned char callbacks_enabled; /* issue user callbacks or hold them? */
+// Dict_t *lookup_by_name[3];
+// Dict_t *lookup_by_id[3];
+// }; \ No newline at end of file
diff --git a/src/h/ST_Agdatadict_s.java b/src/h/ST_Agdatadict_s.java
new file mode 100644
index 0000000..bb015e2
--- /dev/null
+++ b/src/h/ST_Agdatadict_s.java
@@ -0,0 +1,139 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_Agdatadict_s extends UnsupportedStructAndPtr {
+
+ private final ST_Agrec_s h = new ST_Agrec_s(this); /* installed in list of graph recs */
+ public ST_dt_s n;
+ public ST_dt_s e;
+ public ST_dt_s g;
+
+ private final StarStruct parent;
+
+ public ST_Agdatadict_s() {
+ this(null);
+ }
+
+ public ST_Agdatadict_s(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ public StarStruct getParent() {
+ return parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("dict.n")) {
+ this.n = (ST_dt_s) newData;
+ return n;
+ }
+ if (fieldName.equals("dict.e")) {
+ this.e = (ST_dt_s) newData;
+ return e;
+ }
+ if (fieldName.equals("dict.g")) {
+ this.g = (ST_dt_s) newData;
+ return g;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("dict.n")) {
+ return n;
+ }
+ if (fieldName.equals("dict.e")) {
+ return e;
+ }
+ if (fieldName.equals("dict.g")) {
+ return g;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public __ptr__ castTo(Class dest) {
+ if (dest == Agrec_s.class) {
+ return h.amp();
+ }
+ return super.castTo(dest);
+ }
+
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "struct Agdatadict_s",
+ // "{",
+ // "Agrec_t h",
+ // "struct",
+ // "{",
+ // "Dict_t *n, *e, *g",
+ // "}",
+ // "dict",
+ // "}");
+}
+
+// struct Agdatadict_s { /* set of dictionaries per graph */
+// Agrec_t h; /* installed in list of graph recs */
+// struct {
+// Dict_t *n, *e, *g;
+// } dict;
+// }; \ No newline at end of file
diff --git a/src/h/ST_Agdesc_s.java b/src/h/ST_Agdesc_s.java
index f0f9da7..fa75501 100644
--- a/src/h/ST_Agdesc_s.java
+++ b/src/h/ST_Agdesc_s.java
@@ -47,7 +47,6 @@ package h;
import smetana.core.HardcodedStruct;
import smetana.core.UnsupportedStarStruct;
-import smetana.core.UnsupportedStruct;
import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__struct__;
import smetana.core.amiga.Area;
diff --git a/src/h/ST_Agdisc_s.java b/src/h/ST_Agdisc_s.java
new file mode 100644
index 0000000..76a7bd2
--- /dev/null
+++ b/src/h/ST_Agdisc_s.java
@@ -0,0 +1,113 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_Agdisc_s extends UnsupportedStructAndPtr {
+
+ public ST_Agmemdisc_s.Amp mem;
+ public ST_Agiddisc_s.Amp id;
+ public ST_Agiodisc_s.Amp io;
+
+ private final StarStruct parent;
+
+ public ST_Agdisc_s() {
+ this(null);
+ }
+
+ public ST_Agdisc_s(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ public StarStruct getParent() {
+ return parent;
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("mem")) {
+ this.mem = (ST_Agmemdisc_s.Amp) newData;
+ return mem;
+ }
+ if (fieldName.equals("id")) {
+ this.id = (ST_Agiddisc_s.Amp) newData;
+ return id;
+ }
+ // if (fieldName.equals("io")) {
+ // this.io = (ST_Agiodisc_s.Amp) newData;
+ // return io;
+ // }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("mem")) {
+ return mem;
+ }
+ if (fieldName.equals("id")) {
+ return id;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "struct Agdisc_s",
+ // "{",
+ // "Agmemdisc_t *mem",
+ // "Agiddisc_t *id",
+ // "Agiodisc_t *io",
+ // "}");
+}
+
+// struct Agdisc_s { /* user's discipline */
+// Agmemdisc_t *mem;
+// Agiddisc_t *id;
+// Agiodisc_t *io;
+// }; \ No newline at end of file
diff --git a/src/h/ST_Agdstate_s.java b/src/h/ST_Agdstate_s.java
new file mode 100644
index 0000000..9ca0179
--- /dev/null
+++ b/src/h/ST_Agdstate_s.java
@@ -0,0 +1,108 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_Agdstate_s extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public __ptr__ mem;
+ public __ptr__ id;
+
+ public ST_Agdstate_s() {
+ this(null);
+ }
+
+ public ST_Agdstate_s(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ public StarStruct getParent() {
+ return parent;
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("mem")) {
+ this.mem = newData;
+ return mem;
+ }
+ if (fieldName.equals("id")) {
+ this.id = newData;
+ return id;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("mem")) {
+ return mem;
+ }
+ if (fieldName.equals("id")) {
+ return id;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "struct Agdstate_s",
+ // "{",
+ // "void *mem",
+ // "void *id",
+ // "}");
+}
+
+// struct Agdstate_s {
+// void *mem;
+// void *id;
+// /* IO must be initialized and finalized outside Cgraph,
+// * and channels (FILES) are passed as void* arguments. */
+// }; \ No newline at end of file
diff --git a/src/h/ST_Agedge_s.java b/src/h/ST_Agedge_s.java
new file mode 100644
index 0000000..b67debd
--- /dev/null
+++ b/src/h/ST_Agedge_s.java
@@ -0,0 +1,315 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import h.ST_Agrec_s.Amp;
+import smetana.core.HardcodedStruct;
+import smetana.core.OFFSET;
+import smetana.core.UnsupportedSize_t;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.__struct__;
+import smetana.core.size_t;
+import smetana.core.amiga.StarArrayOfPtr;
+import smetana.core.amiga.StarStruct;
+
+public class ST_Agedge_s extends UnsupportedStructAndPtr implements HardcodedStruct {
+
+ private final ST_Agobj_s base = new ST_Agobj_s(this);
+ private final ST_dtlink_s id_link = new ST_dtlink_s(this);
+ private final ST_dtlink_s seq_link = new ST_dtlink_s(this);
+ private ST_Agnode_s node;
+
+ @Override
+ public void copyDataFrom(__ptr__ arg) {
+ if (arg instanceof Amp) {
+ arg = ((Amp) arg).getObject();
+ }
+ ST_Agedge_s this2 = (ST_Agedge_s) arg;
+ this.base.copyDataFrom((__struct__) this2.base);
+ this.id_link.copyDataFrom((__struct__) this2.id_link);
+ this.seq_link.copyDataFrom((__struct__) this2.seq_link);
+ this.node = this2.node;
+ }
+
+ private final StarStruct parent;
+
+ public ST_Agedge_s() {
+ this(null);
+ }
+
+ public ST_Agedge_s(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public boolean isSameThan(StarStruct other) {
+ if (other instanceof Amp) {
+ Amp other2 = (Amp) other;
+ return this == other2.me;
+ }
+ ST_Agedge_s other2 = (ST_Agedge_s) other;
+ return this == other2;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp(this);
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ private final ST_Agedge_s me;
+
+ public Amp(ST_Agedge_s me) {
+ this.me = me;
+ }
+
+ public ST_Agedge_s getObject() {
+ return me;
+ }
+
+ @Override
+ public boolean isSameThan(StarStruct other) {
+ if (other instanceof ST_Agedge_s) {
+ ST_Agedge_s other2 = (ST_Agedge_s) other;
+ return this.me == other2;
+ }
+ Amp other2 = (Amp) other;
+ return this.me == other2.me;
+ }
+
+ @Override
+ public __ptr__ castTo(Class dest) {
+ return ST_Agedge_s.this.castTo(dest);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ return ST_Agedge_s.this.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public void copyDataFrom(__struct__ other) {
+ ST_Agedge_s.this.copyDataFrom(other);
+ }
+
+ @Override
+ public void copyDataFrom(__ptr__ other) {
+ ST_Agedge_s.this.copyDataFrom(other);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ return ST_Agedge_s.this.getPtr(fieldName);
+ }
+
+ @Override
+ public __struct__ getStruct(String fieldName) {
+ return ST_Agedge_s.this.getStruct(fieldName);
+ }
+
+ @Override
+ public __ptr__ plus(int pointerMove) {
+ ST_Agedgepair_s pair = (ST_Agedgepair_s) me.parent;
+ // Order=out, in
+ if (pair.out == me && pointerMove == 1) {
+ return pair.in;
+ }
+ if (pair.in == me && pointerMove == -1) {
+ return pair.out;
+ }
+ return super.plus(pointerMove);
+ }
+
+ @Override
+ public Object addVirtualBytes(int virtualBytes) {
+ if (virtualBytes == 0) {
+ return this;
+ }
+ OFFSET offset = OFFSET.fromInt(virtualBytes);
+ if (offset.toString().equals("h.Agedge_s::seq_link")) {
+ return seq_link;
+ }
+ if (offset.toString().equals("h.Agedge_s::id_link")) {
+ return id_link;
+ }
+ System.err.println("offset1=" + offset);
+ return super.addVirtualBytes(virtualBytes);
+ }
+
+ }
+
+ @Override
+ public Object addVirtualBytes(int virtualBytes) {
+ if (virtualBytes == 0) {
+ return this;
+ }
+ OFFSET offset = OFFSET.fromInt(virtualBytes);
+ if (offset.toString().equals("h.Agedge_s::seq_link")) {
+ return seq_link;
+ }
+ if (offset.toString().equals("h.Agedge_s::id_link")) {
+ return id_link;
+ }
+ System.err.println("offset2=" + offset);
+ return super.addVirtualBytes(virtualBytes);
+ }
+
+ @Override
+ public __ptr__ plus(int pointerMove) {
+ ST_Agedgepair_s pair = (ST_Agedgepair_s) parent;
+ // Order=out, in
+ if (pair.out == this && pointerMove == 1) {
+ return pair.in;
+ }
+ if (pair.in == this && pointerMove == -1) {
+ return pair.out;
+ }
+ return super.plus(pointerMove);
+ }
+
+ @Override
+ public __ptr__ castTo(Class dest) {
+ if (dest == Agobj_s.class) {
+ return base;
+ }
+ if (dest == Agedge_s.class) {
+ return this;
+ }
+ return super.castTo(dest);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("node")) {
+ if (newData instanceof ST_Agnode_s.Amp) {
+ this.node = ((ST_Agnode_s.Amp) newData).getObject();
+ } else {
+ this.node = (ST_Agnode_s) newData;
+ }
+ return node;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("node")) {
+ return node;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public __struct__ getStruct(String fieldName) {
+ if (fieldName.equals("base")) {
+ return base;
+ }
+ return super.getStruct(fieldName);
+ }
+
+ public StarStruct from_seq_link(ST_dtlink_s from) {
+ if (from == seq_link) {
+ return amp();
+ }
+ throw new IllegalArgumentException();
+ }
+
+ public StarStruct from_id_link(ST_dtlink_s from) {
+ if (from == id_link) {
+ return amp();
+ }
+ throw new IllegalArgumentException();
+ }
+
+ public static size_t sizeof_starstar_empty(final int nb) {
+ return new UnsupportedSize_t(nb) {
+ @Override
+ public Object malloc() {
+ return STStarArrayOfPointer.malloc(nb);
+ }
+
+ @Override
+ public Object realloc(Object old) {
+ if (old instanceof STStarArrayOfPointer) {
+ STStarArrayOfPointer old2 = (STStarArrayOfPointer) old;
+ old2.realloc(nb);
+ return old2;
+ }
+ // if (old instanceof StarArrayOfPtr) {
+ // StarArrayOfPtr old2 = (StarArrayOfPtr) old;
+ // old2.realloc(nb);
+ // return old2;
+ // }
+ return super.realloc(old);
+ }
+
+ @Override
+ public int getInternalNb() {
+ return nb;
+ }
+ };
+ }
+
+ // public interface ST_Agedge_s extends __ptr__ {
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "struct Agedge_s",
+ // "{",
+ // "Agobj_t base",
+ // "Dtlink_t id_link",
+ // "Dtlink_t seq_link",
+ // "Agnode_t *node",
+ // "}");
+}
+
+// struct Agedge_s {
+// Agobj_t base;
+// Dtlink_t id_link; /* main graph only */
+// Dtlink_t seq_link;
+// Agnode_t *node; /* the endpoint node */
+// }; \ No newline at end of file
diff --git a/src/h/ST_Agedgeinfo_t.java b/src/h/ST_Agedgeinfo_t.java
new file mode 100644
index 0000000..334960b
--- /dev/null
+++ b/src/h/ST_Agedgeinfo_t.java
@@ -0,0 +1,368 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.__struct__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_Agedgeinfo_t extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_Agedgeinfo_t() {
+ this(null);
+ }
+
+ public ST_Agedgeinfo_t(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ private final ST_Agrec_s hdr = new ST_Agrec_s(this);
+
+ private ST_splines spl;
+ private final ST_port tail_port = new ST_port(this), head_port = new ST_port(this);
+ private ST_textlabel_t label, head_label, tail_label, xlabel;
+ private int edge_type;
+ private int adjacent;
+ private boolean label_ontop;
+ // "unsigned char gui_state",
+ private ST_Agedge_s to_orig;
+ // "void *alg",
+ // "double factor",
+ private double dist;
+ // "Ppolyline_t path",
+ private int showboxes;
+ private boolean conc_opp_flag;
+ private int xpenalty;
+ private int weight;
+ private int cutvalue, tree_index;
+ private int count;
+ private int minlen;
+
+ private ST_Agedge_s to_virt;
+
+ @Override
+ public void copyDataFrom(__struct__ other) {
+ ST_Agedgeinfo_t this2 = (ST_Agedgeinfo_t) other;
+ this.hdr.copyDataFrom((__struct__) this2.hdr);
+ this.spl = this2.spl;
+ this.tail_port.copyDataFrom((__struct__) this2.tail_port);
+ this.head_port.copyDataFrom((__struct__) this2.head_port);
+ this.label = this2.label;
+ this.head_label = this2.head_label;
+ this.tail_label = this2.tail_label;
+ this.xlabel = this2.xlabel;
+ this.edge_type = this2.edge_type;
+ this.adjacent = this2.adjacent;
+ this.label_ontop = this2.label_ontop;
+ this.to_orig = this2.to_orig;
+ this.dist = this2.dist;
+ this.showboxes = this2.showboxes;
+ this.conc_opp_flag = this2.conc_opp_flag;
+ this.xpenalty = this2.xpenalty;
+ this.weight = this2.weight;
+ this.cutvalue = this2.cutvalue;
+ this.tree_index = this2.tree_index;
+ this.count = this2.count;
+ this.minlen = this2.minlen;
+ this.to_virt = this2.to_virt;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+ @Override
+ public __ptr__ castTo(Class dest) {
+ return ST_Agedgeinfo_t.this.castTo(dest);
+ }
+
+ }
+
+ @Override
+ public __ptr__ castTo(Class dest) {
+ if (dest == Agrec_s.class) {
+ return hdr;
+ }
+ if (dest == Agedgeinfo_t.class) {
+ return this;
+ }
+ return super.castTo(dest);
+ }
+
+ @Override
+ public void setStruct(String fieldName, __struct__ newData) {
+ if (fieldName.equals("tail_port")) {
+ this.tail_port.copyDataFrom(newData);
+ return;
+ }
+ if (fieldName.equals("head_port")) {
+ this.head_port.copyDataFrom(newData);
+ return;
+ }
+ super.setStruct(fieldName, newData);
+ }
+
+ @Override
+ public void setBoolean(String fieldName, boolean data) {
+ if (fieldName.equals("label_ontop")) {
+ this.label_ontop = data;
+ return;
+ }
+ super.setBoolean(fieldName, data);
+ }
+
+ @Override
+ public void setDouble(String fieldName, double data) {
+ if (fieldName.equals("dist")) {
+ this.dist = data;
+ return;
+ }
+ super.setDouble(fieldName, data);
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("minlen")) {
+ this.minlen = data;
+ return;
+ }
+ if (fieldName.equals("weight")) {
+ this.weight = data;
+ return;
+ }
+ if (fieldName.equals("cutvalue")) {
+ this.cutvalue = data;
+ return;
+ }
+ if (fieldName.equals("tree_index")) {
+ this.tree_index = data;
+ return;
+ }
+ if (fieldName.equals("count")) {
+ this.count = data;
+ return;
+ }
+ if (fieldName.equals("xpenalty")) {
+ this.xpenalty = data;
+ return;
+ }
+ if (fieldName.equals("showboxes")) {
+ this.showboxes = data;
+ return;
+ }
+ if (fieldName.equals("edge_type")) {
+ this.edge_type = data;
+ return;
+ }
+ if (fieldName.equals("adjacent")) {
+ this.adjacent = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+ @Override
+ public double getDouble(String fieldName) {
+ if (fieldName.equals("dist")) {
+ return this.dist;
+ }
+ return super.getDouble(fieldName);
+ }
+
+ @Override
+ public boolean getBoolean(String fieldName) {
+ if (fieldName.equals("conc_opp_flag")) {
+ return this.conc_opp_flag;
+ }
+ if (fieldName.equals("label_ontop")) {
+ return this.label_ontop;
+ }
+ return super.getBoolean(fieldName);
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("minlen")) {
+ return this.minlen;
+ }
+ if (fieldName.equals("weight")) {
+ return this.weight;
+ }
+ if (fieldName.equals("cutvalue")) {
+ return this.cutvalue;
+ }
+ if (fieldName.equals("tree_index")) {
+ return this.tree_index;
+ }
+ if (fieldName.equals("count")) {
+ return this.count;
+ }
+ if (fieldName.equals("xpenalty")) {
+ return this.xpenalty;
+ }
+ if (fieldName.equals("showboxes")) {
+ return this.showboxes;
+ }
+ if (fieldName.equals("edge_type")) {
+ return this.edge_type;
+ }
+ if (fieldName.equals("adjacent")) {
+ return this.adjacent;
+ }
+ return super.getInt(fieldName);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("to_virt")) {
+ return this.to_virt;
+ }
+ if (fieldName.equals("to_orig")) {
+ return this.to_orig;
+ }
+ if (fieldName.equals("label")) {
+ return this.label;
+ }
+ if (fieldName.equals("spl")) {
+ return this.spl;
+ }
+ if (fieldName.equals("xlabel")) {
+ return this.xlabel;
+ }
+ if (fieldName.equals("head_label")) {
+ return this.head_label;
+ }
+ if (fieldName.equals("tail_label")) {
+ return this.tail_label;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public __struct__ getStruct(String fieldName) {
+ if (fieldName.equals("tail_port")) {
+ return this.tail_port;
+ }
+ if (fieldName.equals("head_port")) {
+ return this.head_port;
+ }
+ return super.getStruct(fieldName);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("to_virt")) {
+ if (newData instanceof ST_Agedge_s.Amp) {
+ this.to_virt = ((ST_Agedge_s.Amp) newData).getObject();
+ } else {
+ this.to_virt = (ST_Agedge_s) newData;
+ }
+ return this.to_virt;
+ }
+ if (fieldName.equals("to_orig")) {
+ if (newData instanceof ST_Agedge_s.Amp) {
+ this.to_orig = ((ST_Agedge_s.Amp) newData).getObject();
+ } else {
+ this.to_orig = (ST_Agedge_s) newData;
+ }
+ return this.to_orig;
+ }
+ if (fieldName.equals("spl")) {
+ this.spl = (ST_splines) newData;
+ return this.spl;
+ }
+ if (fieldName.equals("label")) {
+ this.label = (ST_textlabel_t) newData;
+ return this.label;
+ }
+ if (fieldName.equals("head_label")) {
+ this.head_label = (ST_textlabel_t) newData;
+ return this.head_label;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __struct__ getStruct() {
+ return this;
+ }
+
+}
+
+// typedef struct Agedgeinfo_t {
+// Agrec_t hdr;
+// splines *spl;
+// port tail_port, head_port;
+// textlabel_t *label, *head_label, *tail_label, *xlabel;
+// char edge_type;
+// char adjacent; /* true for flat edge with adjacent nodes */
+// char label_ontop;
+// unsigned char gui_state; /* Edge state for GUI ops */
+// edge_t *to_orig; /* for dot's shapes.c */
+// void *alg;
+//
+//
+// double factor;
+// double dist;
+// Ppolyline_t path;
+//
+//
+// unsigned char showboxes;
+// boolean conc_opp_flag;
+// short xpenalty;
+// int weight;
+// int cutvalue, tree_index;
+// short count;
+// unsigned short minlen;
+// edge_t *to_virt;
+//
+// } Agedgeinfo_t; \ No newline at end of file
diff --git a/src/h/ST_Agedgepair_s.java b/src/h/ST_Agedgepair_s.java
new file mode 100644
index 0000000..ed17446
--- /dev/null
+++ b/src/h/ST_Agedgepair_s.java
@@ -0,0 +1,97 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.HardcodedStruct;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__struct__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_Agedgepair_s extends UnsupportedStructAndPtr implements HardcodedStruct {
+
+ public final ST_Agedge_s out = new ST_Agedge_s(this);
+ public final ST_Agedge_s in = new ST_Agedge_s(this);
+
+ private final StarStruct parent;
+
+ public ST_Agedgepair_s() {
+ this(null);
+ }
+
+ public ST_Agedgepair_s(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+ }
+
+ @Override
+ public __struct__ getStruct(String fieldName) {
+ if (fieldName.equals("out")) {
+ return out;
+ }
+ if (fieldName.equals("in")) {
+ return in;
+ }
+ return super.getStruct(fieldName);
+ }
+
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "struct Agedgepair_s",
+ // "{",
+ // "Agedge_t out, in",
+ // "}");
+}
+
+// struct Agedgepair_s {
+// Agedge_t out, in;
+// }; \ No newline at end of file
diff --git a/src/h/ST_Agiddisc_s.java b/src/h/ST_Agiddisc_s.java
index 38e8e09..aac624f 100644
--- a/src/h/ST_Agiddisc_s.java
+++ b/src/h/ST_Agiddisc_s.java
@@ -51,7 +51,6 @@ import smetana.core.UnsupportedStruct;
import smetana.core.__ptr__;
import smetana.core.amiga.StarStruct;
-
public class ST_Agiddisc_s extends UnsupportedStruct {
public CFunction open;
@@ -64,33 +63,34 @@ public class ST_Agiddisc_s extends UnsupportedStruct {
@Override
public StarStruct amp() {
- return new UnsupportedStarStruct() {
- @Override
- public Object call(String fieldName, Object... args) {
- if (fieldName.equals("open")) {
- return open.exe(args);
- }
- if (fieldName.equals("map")) {
- return map.exe(args);
- }
- if (fieldName.equals("idregister")) {
- return idregister.exe(args);
- }
- if (fieldName.equals("print")) {
- return print.exe(args);
- }
- return super.call(fieldName, args);
- }
+ return new Amp();
+ }
- @Override
- public __ptr__ getPtr(String fieldName) {
- if (fieldName.equals("print")) {
- return print;
- }
- return super.getPtr(fieldName);
+ public class Amp extends UnsupportedStarStruct {
+ @Override
+ public Object call(String fieldName, Object... args) {
+ if (fieldName.equals("open")) {
+ return open.exe(args);
+ }
+ if (fieldName.equals("map")) {
+ return map.exe(args);
}
+ if (fieldName.equals("idregister")) {
+ return idregister.exe(args);
+ }
+ if (fieldName.equals("print")) {
+ return print.exe(args);
+ }
+ return super.call(fieldName, args);
+ }
- };
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("print")) {
+ return print;
+ }
+ return super.getPtr(fieldName);
+ }
}
// public static List<String> DEFINITION = Arrays.asList(
diff --git a/src/h/ST_Agiodisc_s.java b/src/h/ST_Agiodisc_s.java
new file mode 100644
index 0000000..084350e
--- /dev/null
+++ b/src/h/ST_Agiodisc_s.java
@@ -0,0 +1,105 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+import smetana.core.CFunction;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStruct;
+import smetana.core.amiga.StarStruct;
+
+public class ST_Agiodisc_s extends UnsupportedStruct {
+
+ public CFunction afread;
+ public CFunction putstr;
+ public CFunction flush;
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+// @Override
+// public Object call(String fieldName, Object... args) {
+// if (fieldName.equals("open")) {
+// return open.exe(args);
+// }
+// if (fieldName.equals("map")) {
+// return map.exe(args);
+// }
+// if (fieldName.equals("idregister")) {
+// return idregister.exe(args);
+// }
+// if (fieldName.equals("print")) {
+// return print.exe(args);
+// }
+// return super.call(fieldName, args);
+// }
+//
+// @Override
+// public __ptr__ getPtr(String fieldName) {
+// if (fieldName.equals("print")) {
+// return print;
+// }
+// return super.getPtr(fieldName);
+// }
+ }
+
+
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "struct Agiodisc_s",
+ // "{",
+ // "int (*afread) (void *chan, char *buf, int bufsize)",
+ // "int (*putstr) (void *chan, const char *str)",
+ // "int (*flush) (void *chan)",
+ // "}");
+}
+
+// struct Agiodisc_s {
+// int (*afread) (void *chan, char *buf, int bufsize);
+// int (*putstr) (void *chan, const char *str);
+// int (*flush) (void *chan); /* sync */
+// /* error messages? */
+// }; \ No newline at end of file
diff --git a/src/h/ST_Agmemdisc_s.java b/src/h/ST_Agmemdisc_s.java
index 8ef1045..989cd7c 100644
--- a/src/h/ST_Agmemdisc_s.java
+++ b/src/h/ST_Agmemdisc_s.java
@@ -60,19 +60,20 @@ public class ST_Agmemdisc_s extends UnsupportedStruct {
@Override
public StarStruct amp() {
- return new UnsupportedStarStruct() {
+ return new Amp();
+ }
- @Override
- public Object call(String fieldName, Object... args) {
- if (fieldName.equals("open")) {
- return open.exe(args);
- }
- if (fieldName.equals("alloc")) {
- return alloc.exe(args);
- }
- return super.call(fieldName, args);
+ public class Amp extends UnsupportedStarStruct {
+ @Override
+ public Object call(String fieldName, Object... args) {
+ if (fieldName.equals("open")) {
+ return open.exe(args);
+ }
+ if (fieldName.equals("alloc")) {
+ return alloc.exe(args);
}
- };
+ return super.call(fieldName, args);
+ }
}
// public static List<String> DEFINITION = Arrays.asList(
diff --git a/src/h/ST_Agnode_s.java b/src/h/ST_Agnode_s.java
new file mode 100644
index 0000000..685df91
--- /dev/null
+++ b/src/h/ST_Agnode_s.java
@@ -0,0 +1,231 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.UnsupportedSize_t;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.__struct__;
+import smetana.core.size_t;
+import smetana.core.amiga.StarArrayOfPtr;
+import smetana.core.amiga.StarStruct;
+
+public class ST_Agnode_s extends UnsupportedStructAndPtr {
+
+ private final ST_Agobj_s base = new ST_Agobj_s(this);
+ private ST_Agraph_s root;
+ private ST_Agsubnode_s mainsub = new ST_Agsubnode_s(this);
+
+ private final StarStruct parent;
+
+ public ST_Agnode_s() {
+ this(null);
+ }
+
+ public ST_Agnode_s(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ public StarStruct getParent() {
+ return parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp(this);
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ private final ST_Agnode_s me;
+
+ public Amp(ST_Agnode_s me) {
+ this.me = me;
+ }
+
+ @Override
+ public __ptr__ castTo(Class dest) {
+ if (dest == Agobj_s.class) {
+ return base.amp();
+ }
+ if (dest == Agnode_s.class) {
+ return me;
+ }
+ return super.castTo(dest);
+ }
+
+ @Override
+ public __struct__ getStruct() {
+ return ST_Agnode_s.this.getStruct();
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ return ST_Agnode_s.this.getPtr(fieldName);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ return ST_Agnode_s.this.setPtr(fieldName, newData);
+ }
+
+ public ST_Agnode_s getObject() {
+ return me;
+ }
+
+ }
+
+ @Override
+ public __ptr__ castTo(Class dest) {
+ if (dest == Agnode_s.class) {
+ return this;
+ }
+ if (dest == Agobj_s.class) {
+ return base;
+ }
+ return super.castTo(dest);
+ }
+
+ @Override
+ public boolean isSameThan(StarStruct other) {
+ if (other instanceof Amp) {
+ Amp other2 = (Amp) other;
+ return this == other2.me;
+ }
+ ST_Agnode_s other2 = (ST_Agnode_s) other;
+ return this == other2;
+ }
+
+ @Override
+ public __struct__ getStruct(String fieldName) {
+ if (fieldName.equals("base")) {
+ return base;
+ }
+ if (fieldName.equals("mainsub")) {
+ return mainsub;
+ }
+ return super.getStruct(fieldName);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("root")) {
+ this.root = (ST_Agraph_s) newData;
+ return root;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("root")) {
+ return root;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public __struct__ getStruct() {
+ return this;
+ }
+
+ public static size_t sizeof_starstar_empty(final int nb) {
+ return new UnsupportedSize_t(nb) {
+ @Override
+ public Object malloc() {
+ return STStarArrayOfPointer.malloc(nb);
+ }
+
+ @Override
+ public int getInternalNb() {
+ return nb;
+ }
+ };
+ }
+
+ public static size_t sizeof(final int nb) {
+ return new UnsupportedSize_t(nb) {
+ @Override
+ public Object malloc() {
+ return new StarArrayOfPtr(new STArray<ST_Agnode_s>(nb, 0, ST_Agnode_s.class));
+ }
+
+ @Override
+ public int getInternalNb() {
+ return nb;
+ }
+
+ @Override
+ public Object realloc(Object old) {
+ if (old instanceof STStarArrayOfPointer) {
+ STStarArrayOfPointer old2 = (STStarArrayOfPointer) old;
+ old2.realloc(nb);
+ return old2;
+ }
+ if (old instanceof StarArrayOfPtr) {
+ StarArrayOfPtr old2 = (StarArrayOfPtr) old;
+ old2.realloc(nb);
+ return old2;
+ }
+ return super.realloc(old);
+ }
+ };
+ }
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "struct Agnode_s",
+ // "{",
+ // "Agobj_t base",
+ // "Agraph_t *root",
+ // "Agsubnode_t mainsub",
+ // "}");
+}
+
+// struct Agnode_s {
+// Agobj_t base;
+// Agraph_t *root;
+// Agsubnode_t mainsub; /* embedded for main graph */
+// }; \ No newline at end of file
diff --git a/src/h/ST_Agnodeinfo_t.java b/src/h/ST_Agnodeinfo_t.java
new file mode 100644
index 0000000..3a7d3bf
--- /dev/null
+++ b/src/h/ST_Agnodeinfo_t.java
@@ -0,0 +1,519 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.__struct__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_Agnodeinfo_t extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_Agnodeinfo_t() {
+ this(null);
+ }
+
+ public ST_Agnodeinfo_t(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ private final ST_Agrec_s hdr = new ST_Agrec_s(this);
+
+ private ST_shape_desc shape;
+ private ST_polygon_t shape_info;
+ private final ST_pointf coord = new ST_pointf(this);
+ private double width, height;
+
+ // "boxf bb",
+ private double ht, lw, rw;
+ private ST_textlabel_t label;
+ private ST_textlabel_t xlabel;
+ // "void *alg",
+ private ST_Agedge_s alg = null;
+ // "char state",
+ // "unsigned char gui_state",
+ // "boolean clustnode",
+ // "unsigned char pinned",
+ private int id, heapindex, hops;
+ // "double *pos, dist",
+ private int showboxes;
+
+ private boolean has_port;
+ // "node_t* rep",
+ // "node_t *set",
+ private int node_type, mark, onstack;
+ private int ranktype, weight_class;
+ private ST_Agnode_s next;
+ private ST_Agnode_s prev;
+ // "elist in, out, flat_out, flat_in, other",
+ private final ST_elist in = new ST_elist(this);
+ private final ST_elist out = new ST_elist(this);
+ private final ST_elist flat_out = new ST_elist(this);
+ private final ST_elist flat_in = new ST_elist(this);
+ private final ST_elist other = new ST_elist(this);
+ private ST_Agraph_s.Amp clust;
+ private int UF_size;
+
+ private ST_Agnode_s UF_parent;
+
+ private ST_Agnode_s inleaf, outleaf;
+ private int rank, order;
+ private double mval;
+ private final ST_elist save_in = new ST_elist(this);
+ private final ST_elist save_out = new ST_elist(this);
+ private final ST_elist tree_in = new ST_elist(this);
+ private final ST_elist tree_out = new ST_elist(this);
+ private ST_Agedge_s par;
+ private int low, lim;
+ private int priority;
+
+ // "double pad[1]",
+ // "}",
+ // "Agnodeinfo_t");
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ }
+
+ @Override
+ public __ptr__ castTo(Class dest) {
+ if (dest == Agrec_s.class) {
+ return hdr;
+ }
+ return super.castTo(dest);
+ }
+
+ @Override
+ public void setDouble(String fieldName, double data) {
+ if (fieldName.equals("width")) {
+ this.width = data;
+ return;
+ }
+ if (fieldName.equals("height")) {
+ this.height = data;
+ return;
+ }
+ if (fieldName.equals("ht")) {
+ this.ht = data;
+ return;
+ }
+ if (fieldName.equals("lw")) {
+ this.lw = data;
+ return;
+ }
+ if (fieldName.equals("rw")) {
+ this.rw = data;
+ return;
+ }
+ if (fieldName.equals("mval")) {
+ this.mval = data;
+ return;
+ }
+ super.setDouble(fieldName, data);
+ }
+
+ @Override
+ public double getDouble(String fieldName) {
+ if (fieldName.equals("width")) {
+ return this.width;
+ }
+ if (fieldName.equals("height")) {
+ return this.height;
+ }
+ if (fieldName.equals("ht")) {
+ return this.ht;
+ }
+ if (fieldName.equals("lw")) {
+ return this.lw;
+ }
+ if (fieldName.equals("rw")) {
+ return this.rw;
+ }
+ if (fieldName.equals("mval")) {
+ return this.mval;
+ }
+ return super.getDouble(fieldName);
+ }
+
+ @Override
+ public void setBoolean(String fieldName, boolean data) {
+ if (fieldName.equals("mark")) {
+ this.mark = data ? 1 : 0;
+ return;
+ }
+ if (fieldName.equals("onstack")) {
+ this.onstack = data ? 1 : 0;
+ return;
+ }
+ super.setBoolean(fieldName, data);
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("showboxes")) {
+ this.showboxes = data;
+ return;
+ }
+ if (fieldName.equals("UF_size")) {
+ this.UF_size = data;
+ return;
+ }
+ if (fieldName.equals("mark")) {
+ this.mark = data;
+ return;
+ }
+ if (fieldName.equals("onstack")) {
+ this.onstack = data;
+ return;
+ }
+ if (fieldName.equals("priority")) {
+ this.priority = data;
+ return;
+ }
+ if (fieldName.equals("node_type")) {
+ this.node_type = data;
+ return;
+ }
+ if (fieldName.equals("rank")) {
+ this.rank = data;
+ return;
+ }
+ if (fieldName.equals("order")) {
+ this.order = data;
+ return;
+ }
+ if (fieldName.equals("ranktype")) {
+ this.ranktype = data;
+ return;
+ }
+ if (fieldName.equals("low")) {
+ this.low = data;
+ return;
+ }
+ if (fieldName.equals("lim")) {
+ this.lim = data;
+ return;
+ }
+ if (fieldName.equals("weight_class")) {
+ this.weight_class = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("UF_size")) {
+ return this.UF_size;
+ }
+ if (fieldName.equals("ranktype")) {
+ return this.ranktype;
+ }
+ if (fieldName.equals("mark")) {
+ return this.mark;
+ }
+ if (fieldName.equals("onstack")) {
+ return this.onstack;
+ }
+ if (fieldName.equals("priority")) {
+ return this.priority;
+ }
+ if (fieldName.equals("node_type")) {
+ return this.node_type;
+ }
+ if (fieldName.equals("rank")) {
+ return this.rank;
+ }
+ if (fieldName.equals("order")) {
+ return this.order;
+ }
+ if (fieldName.equals("ranktype")) {
+ return this.ranktype;
+ }
+ if (fieldName.equals("low")) {
+ return this.low;
+ }
+ if (fieldName.equals("lim")) {
+ return this.lim;
+ }
+ if (fieldName.equals("weight_class")) {
+ return this.weight_class;
+ }
+ if (fieldName.equals("id")) {
+ return this.id;
+ }
+ if (fieldName.equals("heapindex")) {
+ return this.heapindex;
+ }
+ if (fieldName.equals("hops")) {
+ return this.hops;
+ }
+ return super.getInt(fieldName);
+ }
+
+ @Override
+ public boolean getBoolean(String fieldName) {
+ if (fieldName.equals("onstack")) {
+ return this.onstack != 0;
+ }
+ if (fieldName.equals("has_port")) {
+ return this.has_port;
+ }
+ return super.getBoolean(fieldName);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("shape")) {
+ this.shape = (ST_shape_desc) newData;
+ return shape;
+ }
+ if (fieldName.equals("shape_info")) {
+ this.shape_info = (ST_polygon_t) newData;
+ return shape_info;
+ }
+ if (fieldName.equals("label")) {
+ this.label = (ST_textlabel_t) newData;
+ return label;
+ }
+ if (fieldName.equals("clust")) {
+ if (newData instanceof ST_Agraph_s) {
+ this.clust = (h.ST_Agraph_s.Amp) ((ST_Agraph_s) newData).amp();
+ } else {
+ this.clust = (ST_Agraph_s.Amp) newData;
+ }
+ return clust;
+ }
+ if (fieldName.equals("next")) {
+ this.next = (ST_Agnode_s) newData;
+ return next;
+ }
+ if (fieldName.equals("prev")) {
+ if (newData instanceof ST_Agnode_s.Amp) {
+ this.prev = ((ST_Agnode_s.Amp) newData).getObject();
+ } else {
+ this.prev = (ST_Agnode_s) newData;
+ }
+ return prev;
+ }
+ if (fieldName.equals("UF_parent")) {
+ this.UF_parent = (ST_Agnode_s) newData;
+ return UF_parent;
+ }
+ if (fieldName.equals("par")) {
+ if (newData instanceof ST_Agedge_s.Amp) {
+ this.par = ((ST_Agedge_s.Amp) newData).getObject();
+ } else {
+ this.par = (ST_Agedge_s) newData;
+ }
+ return par;
+ }
+ if (fieldName.equals("alg")) {
+ this.alg = (ST_Agedge_s) alg;
+ return alg;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("shape")) {
+ return shape;
+ }
+ if (fieldName.equals("label")) {
+ return label;
+ }
+ if (fieldName.equals("UF_parent")) {
+ return UF_parent;
+ }
+ if (fieldName.equals("next")) {
+ return next;
+ }
+ if (fieldName.equals("prev")) {
+ return prev;
+ }
+ if (fieldName.equals("clust")) {
+ return clust;
+ }
+ if (fieldName.equals("inleaf")) {
+ return inleaf;
+ }
+ if (fieldName.equals("outleaf")) {
+ return outleaf;
+ }
+ if (fieldName.equals("alg")) {
+ return alg;
+ }
+ if (fieldName.equals("par")) {
+ return par;
+ }
+ if (fieldName.equals("xlabel")) {
+ return xlabel;
+ }
+ if (fieldName.equals("shape_info")) {
+ return shape_info;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public __struct__ getStruct(String fieldName) {
+ if (fieldName.equals("in")) {
+ return in;
+ }
+ if (fieldName.equals("out")) {
+ return out;
+ }
+ if (fieldName.equals("flat_out")) {
+ return flat_out;
+ }
+ if (fieldName.equals("flat_in")) {
+ return flat_in;
+ }
+ if (fieldName.equals("other")) {
+ return other;
+ }
+ if (fieldName.equals("save_in")) {
+ return save_in;
+ }
+ if (fieldName.equals("save_out")) {
+ return save_out;
+ }
+ if (fieldName.equals("tree_in")) {
+ return tree_in;
+ }
+ if (fieldName.equals("tree_out")) {
+ return tree_out;
+ }
+ if (fieldName.equals("coord")) {
+ return coord;
+ }
+ return super.getStruct(fieldName);
+ }
+
+ @Override
+ public void setStruct(String fieldName, __struct__ newData) {
+ if (fieldName.equals("save_in")) {
+ save_in.copyDataFrom(newData);
+ return;
+ }
+ if (fieldName.equals("save_out")) {
+ save_out.copyDataFrom(newData);
+ return;
+ }
+ if (fieldName.equals("out")) {
+ out.copyDataFrom(newData);
+ return;
+ }
+ if (fieldName.equals("in")) {
+ in.copyDataFrom(newData);
+ return;
+ }
+ super.setStruct(fieldName, newData);
+ }
+}
+
+// typedef struct Agnodeinfo_t {
+// Agrec_t hdr;
+// shape_desc *shape;
+// void *shape_info;
+// pointf coord;
+// double width, height; /* inches */
+// boxf bb;
+// double ht, lw, rw;
+// textlabel_t *label;
+// textlabel_t *xlabel;
+// void *alg;
+// char state;
+// unsigned char gui_state; /* Node state for GUI ops */
+// boolean clustnode;
+//
+//
+// unsigned char pinned;
+// int id, heapindex, hops;
+// double *pos, dist;
+//
+//
+// unsigned char showboxes;
+// boolean has_port;
+// node_t* rep;
+// node_t *set;
+//
+// /* fast graph */
+// char node_type, mark, onstack;
+// char ranktype, weight_class;
+// node_t *next, *prev;
+// elist in, out, flat_out, flat_in, other;
+// graph_t *clust;
+//
+// /* for union-find and collapsing nodes */
+// int UF_size;
+// node_t *UF_parent;
+// node_t *inleaf, *outleaf;
+//
+// /* for placing nodes */
+// int rank, order; /* initially, order = 1 for ordered edges */
+// double mval;
+// elist save_in, save_out;
+//
+// /* for network-simplex */
+// elist tree_in, tree_out;
+// edge_t *par;
+// int low, lim;
+// int priority;
+//
+// double pad[1];
+//
+//
+// } Agnodeinfo_t; \ No newline at end of file
diff --git a/src/h/ST_Agobj_s.java b/src/h/ST_Agobj_s.java
new file mode 100644
index 0000000..9791440
--- /dev/null
+++ b/src/h/ST_Agobj_s.java
@@ -0,0 +1,187 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.HardcodedStruct;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.__struct__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_Agobj_s extends UnsupportedStructAndPtr implements WithParent, HardcodedStruct {
+
+ public final ST_Agtag_s tag = new ST_Agtag_s(this);
+ public ST_Agrec_s.Amp data;
+
+ @Override
+ public void copyDataFrom(__struct__ other) {
+ ST_Agobj_s this2 = (ST_Agobj_s) other;
+ this.tag.copyDataFrom((__struct__) this2.tag);
+ this.data = this2.data;
+
+ }
+
+ private final StarStruct parent;
+
+ public ST_Agobj_s() {
+ this(null);
+ }
+
+ public ST_Agobj_s(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ @Override
+ public __struct__ getStruct(String fieldName) {
+ return ST_Agobj_s.this.getStruct(fieldName);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ return ST_Agobj_s.this.getPtr(fieldName);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ return ST_Agobj_s.this.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ castTo(Class dest) {
+ return ST_Agobj_s.this.castTo(dest);
+ }
+ }
+
+ @Override
+ public __ptr__ castTo(Class dest) {
+ if (dest == Agobj_s.class) {
+ return this;
+ }
+ if (dest == Agraph_s.class && parent instanceof ST_Agraph_s) {
+ return (ST_Agraph_s) parent;
+ }
+ if (dest == Agnode_s.class && parent instanceof ST_Agnode_s) {
+ return (ST_Agnode_s) parent;
+ }
+ if (dest == Agedge_s.class && parent instanceof ST_Agedge_s) {
+ return (ST_Agedge_s) parent;
+ }
+ return super.castTo(dest);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("data")) {
+ if (newData instanceof ST_Agnodeinfo_t) {
+ ST_Agnodeinfo_t info = (ST_Agnodeinfo_t) newData;
+ newData = (ST_Agrec_s) info.castTo(Agrec_s.class);
+ } else if (newData instanceof ST_Agedgeinfo_t) {
+ ST_Agedgeinfo_t info = (ST_Agedgeinfo_t) newData;
+ newData = (ST_Agrec_s) info.castTo(Agrec_s.class);
+ } else if (newData instanceof ST_Agedgeinfo_t.Amp) {
+ ST_Agedgeinfo_t.Amp info = (ST_Agedgeinfo_t.Amp) newData;
+ newData = (ST_Agrec_s) info.castTo(Agrec_s.class);
+ }
+ if (newData instanceof ST_Agrec_s) {
+ this.data = (ST_Agrec_s.Amp) ((ST_Agrec_s) newData).amp();
+ } else {
+ this.data = (ST_Agrec_s.Amp) newData;
+ }
+ return data;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("data")) {
+ return data;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public __struct__ getStruct(String fieldName) {
+ if (fieldName.equals("tag")) {
+ return tag;
+ }
+ return super.getStruct(fieldName);
+ }
+
+ @Override
+ public void setStruct(String fieldName, __struct__ newData) {
+ if (fieldName.equals("tag")) {
+ this.tag.copyDataFrom(newData);
+ return;
+ }
+ super.setStruct(fieldName, newData);
+ }
+
+ public StarStruct getParent() {
+ return parent;
+ }
+
+ // public interface ST_Agobj_s extends __ptr__ {
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "struct Agobj_s",
+ // "{",
+ // "Agtag_t tag",
+ // "Agrec_t *data",
+ // "}");
+}
+
+// struct Agobj_s {
+// Agtag_t tag;
+// Agrec_t *data;
+// }; \ No newline at end of file
diff --git a/src/h/ST_Agraph_s.java b/src/h/ST_Agraph_s.java
new file mode 100644
index 0000000..e8b312d
--- /dev/null
+++ b/src/h/ST_Agraph_s.java
@@ -0,0 +1,341 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.OFFSET;
+import smetana.core.UnsupportedSize_t;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.__struct__;
+import smetana.core.size_t;
+import smetana.core.amiga.StarArrayOfPtr;
+import smetana.core.amiga.StarStruct;
+
+public class ST_Agraph_s extends UnsupportedStructAndPtr {
+
+ public final ST_Agobj_s base = new ST_Agobj_s(this);
+ public final ST_Agdesc_s desc = new ST_Agdesc_s(this);
+ public final ST_dtlink_s link = new ST_dtlink_s(this);
+
+ public ST_dt_s n_seq; /* the node set in sequence */
+ public ST_dt_s n_id; /* the node set indexed by ID */
+ public ST_dt_s e_seq; /* holders for edge sets */
+ public ST_dt_s e_id; /* holders for edge sets */
+ public ST_dt_s g_dict; /* subgraphs - descendants */
+ public ST_Agraph_s parent; /* subgraphs - ancestors */
+ // Agraph_t *parent, *root; /* subgraphs - ancestors */
+ public ST_Agraph_s root; /* subgraphs - ancestors */
+ public ST_Agclos_s clos; /* shared resources */
+
+ private final StarStruct _parent;
+
+ public ST_Agraph_s() {
+ this(null);
+ }
+
+ public ST_Agraph_s(StarStruct parent) {
+ this._parent = parent;
+ }
+
+ public StarStruct getParent() {
+ return _parent;
+ }
+
+ @Override
+ public __struct__ getStruct() {
+ return this;
+ }
+
+ @Override
+ public void setStruct(String fieldName, __struct__ newData) {
+ if (fieldName.equals("desc")) {
+ desc.copyDataFrom(newData);
+ return;
+ }
+ super.setStruct(fieldName, newData);
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp(this);
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ private final ST_Agraph_s me;
+
+ public Amp(ST_Agraph_s me) {
+ this.me = me;
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ return ST_Agraph_s.this.getPtr(fieldName);
+ }
+
+ @Override
+ public __struct__ getStruct() {
+ return ST_Agraph_s.this.getStruct();
+ }
+
+ @Override
+ public __struct__ getStruct(String fieldName) {
+ return ST_Agraph_s.this.getStruct(fieldName);
+ }
+
+ @Override
+ public boolean isSameThan(StarStruct other) {
+ if (other instanceof Amp) {
+ Amp other2 = (Amp) other;
+ return this.me == other2.me;
+ }
+ if (other instanceof ST_Agraph_s) {
+ ST_Agraph_s other2 = (ST_Agraph_s) other;
+ return this.me == other2;
+ }
+ return super.isSameThan(other);
+ }
+
+ @Override
+ public __ptr__ castTo(Class dest) {
+ if (dest == Agobj_s.class) {
+ return base.amp();
+ }
+ if (dest == Agraph_s.class) {
+ return ST_Agraph_s.this;
+ }
+
+ return super.castTo(dest);
+ }
+
+ @Override
+ public Object addVirtualBytes(int virtualBytes) {
+ if (virtualBytes == 0) {
+ return this;
+ }
+ OFFSET offset = OFFSET.fromInt(virtualBytes);
+ // if (offset.toString().equals("h.Agedge_s::seq_link")) {
+ // return seq_link;
+ // }
+ if (offset.toString().equals("h.Agraph_s::link")) {
+ return link;
+ }
+ System.err.println("offset176=" + offset);
+ return super.addVirtualBytes(virtualBytes);
+ }
+
+ public ST_Agraph_s getObject() {
+ return me;
+ }
+
+ }
+
+ @Override
+ public Object addVirtualBytes(int virtualBytes) {
+ if (virtualBytes == 0) {
+ return this;
+ }
+ OFFSET offset = OFFSET.fromInt(virtualBytes);
+ // if (offset.toString().equals("h.Agedge_s::seq_link")) {
+ // return seq_link;
+ // }
+ if (offset.toString().equals("h.Agraph_s::link")) {
+ return link;
+ }
+ System.err.println("offset156=" + offset);
+ return super.addVirtualBytes(virtualBytes);
+ }
+
+ @Override
+ public __struct__ getStruct(String fieldName) {
+ if (fieldName.equals("desc")) {
+ return desc;
+ }
+ return super.getStruct(fieldName);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("clos")) {
+ this.clos = (ST_Agclos_s) newData;
+ return clos;
+ }
+ if (fieldName.equals("root")) {
+ this.root = (ST_Agraph_s) newData;
+ return root;
+ }
+ if (fieldName.equals("n_seq")) {
+ this.n_seq = (ST_dt_s) newData;
+ return n_seq;
+ }
+ if (fieldName.equals("n_id")) {
+ this.n_id = (ST_dt_s) newData;
+ return n_id;
+ }
+ if (fieldName.equals("e_seq")) {
+ this.e_seq = (ST_dt_s) newData;
+ return e_seq;
+ }
+ if (fieldName.equals("e_id")) {
+ this.e_id = (ST_dt_s) newData;
+ return e_id;
+ }
+ if (fieldName.equals("g_dict")) {
+ this.g_dict = (ST_dt_s) newData;
+ return g_dict;
+ }
+ if (fieldName.equals("parent")) {
+ this.parent = (ST_Agraph_s) newData;
+ return parent;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("clos")) {
+ return clos;
+ }
+ if (fieldName.equals("root")) {
+ return root;
+ }
+ if (fieldName.equals("parent")) {
+ return parent;
+ }
+ if (fieldName.equals("n_id")) {
+ return n_id;
+ }
+ if (fieldName.equals("n_seq")) {
+ return n_seq;
+ }
+ if (fieldName.equals("e_id")) {
+ return e_id;
+ }
+ if (fieldName.equals("e_seq")) {
+ return e_seq;
+ }
+ if (fieldName.equals("g_dict")) {
+ return g_dict;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public __ptr__ castTo(Class dest) {
+ if (dest == Agobj_s.class) {
+ return base;
+ }
+ if (dest == Agraph_s.class) {
+ return this;
+ }
+ return super.castTo(dest);
+ }
+
+ @Override
+ public boolean isSameThan(StarStruct other) {
+ ST_Agraph_s other2 = (ST_Agraph_s) other;
+ return this == other2;
+ }
+
+ public StarStruct from_link(ST_dtlink_s from) {
+ if (from == link) {
+ return amp();
+ }
+ throw new IllegalArgumentException();
+ }
+
+
+ public static size_t sizeof(final int nb) {
+ return new UnsupportedSize_t(nb) {
+ @Override
+ public Object malloc() {
+ return new StarArrayOfPtr(new STArray<ST_Agraph_s>(nb, 0, ST_Agraph_s.class));
+ }
+
+ @Override
+ public int getInternalNb() {
+ return nb;
+ }
+
+ @Override
+ public Object realloc(Object old) {
+ StarArrayOfPtr old2 = (StarArrayOfPtr) old;
+ old2.realloc(nb);
+ return old2;
+ }
+ };
+ }
+
+
+ //
+ // public interface ST_Agraph_s extends __ptr__ {
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "struct Agraph_s",
+ // "{",
+ // "Agobj_t base",
+ // "Agdesc_t desc",
+ // "Dtlink_t link",
+ // "Dict_t *n_seq",
+ // "Dict_t *n_id",
+ // "Dict_t *e_seq, *e_id",
+ // "Dict_t *g_dict",
+ // "Agraph_t *parent, *root",
+ // "Agclos_t *clos",
+ // "}");
+}
+
+// struct Agraph_s {
+// Agobj_t base;
+// Agdesc_t desc;
+// Dtlink_t link;
+// Dict_t *n_seq; /* the node set in sequence */
+// Dict_t *n_id; /* the node set indexed by ID */
+// Dict_t *e_seq, *e_id; /* holders for edge sets */
+// Dict_t *g_dict; /* subgraphs - descendants */
+// Agraph_t *parent, *root; /* subgraphs - ancestors */
+// Agclos_t *clos; /* shared resources */
+// }; \ No newline at end of file
diff --git a/src/h/ST_Agraphinfo_t.java b/src/h/ST_Agraphinfo_t.java
new file mode 100644
index 0000000..cb9c87b
--- /dev/null
+++ b/src/h/ST_Agraphinfo_t.java
@@ -0,0 +1,592 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.CFunction;
+import smetana.core.HardcodedStruct;
+import smetana.core.UnsupportedArrayOfStruct;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__array_of_struct__;
+import smetana.core.__ptr__;
+import smetana.core.__struct__;
+import smetana.core.amiga.StarArrayOfPtr;
+import smetana.core.amiga.StarStruct;
+
+public class ST_Agraphinfo_t extends UnsupportedStructAndPtr implements HardcodedStruct {
+
+ private final ST_Agrec_s hdr = new ST_Agrec_s(this);
+ // /* to generate code */
+ private ST_layout_t drawing;
+ private ST_textlabel_t label; /* if the cluster has a title */
+ private final ST_boxf bb = new ST_boxf(this); /* bounding box */
+ // pointf border[4]; /* sizes of margins for graph labels */
+ private final ST_pointf border[] = new ST_pointf[] { new ST_pointf(), new ST_pointf(), new ST_pointf(),
+ new ST_pointf() };
+ // unsigned char gui_state; /* Graph state for GUI ops */
+ private int has_labels;
+ // boolean has_images;
+ private int charset; /* input character set */
+ private int rankdir;
+ private double ht1, ht2; /* below and above extremal ranks */
+ private int flags;
+ // void *alg;
+ private ST_GVC_s gvc; /* context for "globals" over multiple graphs */
+ private CFunction cleanup;
+ // void (*cleanup) (graph_t * g); /* function to deallocate layout-specific data */
+ //
+ //
+ // /* to place nodes */
+ // node_t **neato_nlist;
+ // int move;
+ // double **dist, **spring, **sum_t, ***t;
+ // unsigned short ndim;
+ // unsigned short odim;
+ //
+ //
+ // /* to have subgraphs */
+ private int n_cluster;
+ // graph_t **clust; /* clusters are in clust[1..n_cluster] !!! */
+ private StarArrayOfPtr clust;
+ private ST_Agraph_s dotroot;
+ private ST_Agnode_s nlist;
+ private StarArrayOfPtr rank;
+ private ST_Agraph_s parent; /* containing cluster (not parent subgraph) */
+ // int level; /* cluster nesting level (not node level!) */
+ // node_t *minrep, *maxrep; /* set leaders for min and max rank */
+ //
+ // /* fast graph node list */
+ private final ST_nlist_t comp = new ST_nlist_t(this);
+ // /* connected components */
+ private ST_Agnode_s minset, maxset; /* set leaders */
+ private int n_nodes;
+ // /* includes virtual */
+ private int minrank, maxrank;
+ //
+ // /* various flags */
+ private int has_flat_edges;
+ // boolean has_sourcerank;
+ // boolean has_sinkrank;
+ private int showboxes;
+ private int fontnames; /* to override mangling in SVG */
+ //
+ private int nodesep, ranksep;
+ private ST_Agnode_s ln, rn; /* left, right nodes of bounding box */
+ //
+ // /* for clusters */
+ // node_t *leader, **rankleader;
+ private ST_Agnode_s leader;
+ private STStarArrayOfPointer rankleader;
+ private boolean expanded;
+ private int installed;
+ // char set_type;
+ private int label_pos;
+ private int exact_ranksep;
+
+ private final StarStruct parent_;
+
+ public ST_Agraphinfo_t() {
+ this(null);
+ }
+
+ public ST_Agraphinfo_t(StarStruct parent) {
+ this.parent_ = parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+ }
+
+ class ArrayOfFour extends UnsupportedArrayOfStruct {
+
+ final private int pos;
+
+ public ArrayOfFour(int pos) {
+ this.pos = pos;
+ }
+
+ @Override
+ public __array_of_struct__ plus(int delta) {
+ return new ArrayOfFour(pos + delta);
+ }
+
+ @Override
+ public __struct__ getStruct() {
+ return border[pos];
+ }
+
+ @Override
+ public void setStruct(__struct__ value) {
+ border[pos].copyDataFrom(value);
+ }
+
+ @Override
+ public double getDouble(String fieldName) {
+ return getStruct().getDouble(fieldName);
+ }
+
+ }
+
+ @Override
+ public __array_of_struct__ getArrayOfStruct(String fieldName) {
+ if (fieldName.equals("border")) {
+ return new ArrayOfFour(0);
+ }
+ return super.getArrayOfStruct(fieldName);
+ }
+
+ @Override
+ public __struct__ getStruct(String fieldName) {
+ if (fieldName.equals("comp")) {
+ return this.comp;
+ }
+ if (fieldName.equals("bb")) {
+ return this.bb;
+ }
+ return super.getStruct(fieldName);
+ }
+
+ @Override
+ public __ptr__ castTo(Class dest) {
+ if (dest == Agrec_s.class) {
+ return hdr.amp();
+ }
+ return super.castTo(dest);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("gvc")) {
+ this.gvc = (ST_GVC_s) newData;
+ return gvc;
+ }
+ if (fieldName.equals("drawing")) {
+ this.drawing = (ST_layout_t) newData;
+ return drawing;
+ }
+ if (fieldName.equals("dotroot")) {
+ this.dotroot = (ST_Agraph_s) newData;
+ return dotroot;
+ }
+ if (fieldName.equals("parent")) {
+ if (newData instanceof ST_Agraph_s.Amp) {
+ this.parent = ((ST_Agraph_s.Amp) newData).getObject();
+ } else {
+ this.parent = (ST_Agraph_s) newData;
+ }
+ return parent;
+ }
+ if (fieldName.equals("clust")) {
+ this.clust = (StarArrayOfPtr) newData;
+ return clust;
+ }
+ if (fieldName.equals("label")) {
+ this.label = (ST_textlabel_t) newData;
+ return label;
+ }
+ if (fieldName.equals("maxset")) {
+ this.maxset = (ST_Agnode_s) newData;
+ return maxset;
+ }
+ if (fieldName.equals("minset")) {
+ this.minset = (ST_Agnode_s) newData;
+ return minset;
+ }
+ if (fieldName.equals("nlist")) {
+ if (newData instanceof ST_Agnode_s.Amp) {
+ this.nlist = ((ST_Agnode_s.Amp) newData).getObject();
+ } else {
+ this.nlist = (ST_Agnode_s) newData;
+ }
+ return nlist;
+ }
+ if (fieldName.equals("leader")) {
+ this.leader = (ST_Agnode_s) newData;
+ return leader;
+ }
+ if (fieldName.equals("rankleader")) {
+ this.rankleader = (STStarArrayOfPointer) newData;
+ return rankleader;
+ }
+ if (fieldName.equals("rank")) {
+ this.rank = (StarArrayOfPtr) newData;
+ return rank;
+ }
+ if (fieldName.equals("ln")) {
+ this.ln = (ST_Agnode_s) newData;
+ return ln;
+ }
+ if (fieldName.equals("rn")) {
+ this.rn = (ST_Agnode_s) newData;
+ return rn;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("drawing")) {
+ return drawing;
+ }
+ if (fieldName.equals("gvc")) {
+ return gvc;
+ }
+ if (fieldName.equals("parent")) {
+ return parent;
+ }
+ if (fieldName.equals("dotroot")) {
+ return dotroot;
+ }
+ if (fieldName.equals("clust")) {
+ return clust;
+ }
+ if (fieldName.equals("label")) {
+ return label;
+ }
+ if (fieldName.equals("maxset")) {
+ return maxset;
+ }
+ if (fieldName.equals("minset")) {
+ return minset;
+ }
+ if (fieldName.equals("nlist")) {
+ return nlist;
+ }
+ if (fieldName.equals("leader")) {
+ return leader;
+ }
+ if (fieldName.equals("rankleader")) {
+ return rankleader;
+ }
+ if (fieldName.equals("rank")) {
+ return rank;
+ }
+ if (fieldName.equals("ln")) {
+ return ln;
+ }
+ if (fieldName.equals("rn")) {
+ return rn;
+ }
+ if (fieldName.equals("cleanup")) {
+ return cleanup;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public void setBoolean(String fieldName, boolean data) {
+ if (fieldName.equals("expanded")) {
+ this.expanded = data;
+ return;
+ }
+ if (fieldName.equals("has_flat_edges")) {
+ this.has_flat_edges = data ? 1 : 0;
+ return;
+ }
+ super.setBoolean(fieldName, data);
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("charset")) {
+ this.charset = data;
+ return;
+ }
+ if (fieldName.equals("rankdir")) {
+ this.rankdir = data;
+ return;
+ }
+ if (fieldName.equals("nodesep")) {
+ this.nodesep = data;
+ return;
+ }
+ if (fieldName.equals("ranksep")) {
+ this.ranksep = data;
+ return;
+ }
+ if (fieldName.equals("showboxes")) {
+ this.showboxes = data;
+ return;
+ }
+ if (fieldName.equals("fontnames")) {
+ this.fontnames = data;
+ return;
+ }
+ if (fieldName.equals("flags")) {
+ this.flags = data;
+ return;
+ }
+ if (fieldName.equals("has_labels")) {
+ this.has_labels = data;
+ return;
+ }
+ if (fieldName.equals("n_cluster")) {
+ this.n_cluster = data;
+ return;
+ }
+ if (fieldName.equals("label_pos")) {
+ this.label_pos = data;
+ return;
+ }
+ if (fieldName.equals("n_nodes")) {
+ this.n_nodes = data;
+ return;
+ }
+ if (fieldName.equals("maxrank")) {
+ this.maxrank = data;
+ return;
+ }
+ if (fieldName.equals("minrank")) {
+ this.minrank = data;
+ return;
+ }
+ if (fieldName.equals("installed")) {
+ this.installed = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+ @Override
+ public boolean getBoolean(String fieldName) {
+ if (fieldName.equals("expanded")) {
+ return expanded;
+ }
+ return super.getBoolean(fieldName);
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("flags")) {
+ return flags;
+ }
+ if (fieldName.equals("charset")) {
+ return charset;
+ }
+ if (fieldName.equals("rankdir")) {
+ return rankdir;
+ }
+ if (fieldName.equals("has_labels")) {
+ return has_labels;
+ }
+ if (fieldName.equals("n_cluster")) {
+ return n_cluster;
+ }
+ if (fieldName.equals("label_pos")) {
+ return label_pos;
+ }
+ if (fieldName.equals("n_nodes")) {
+ return n_nodes;
+ }
+ if (fieldName.equals("maxrank")) {
+ return maxrank;
+ }
+ if (fieldName.equals("minrank")) {
+ return minrank;
+ }
+ if (fieldName.equals("has_flat_edges")) {
+ return has_flat_edges;
+ }
+ if (fieldName.equals("installed")) {
+ return installed;
+ }
+ if (fieldName.equals("exact_ranksep")) {
+ return exact_ranksep;
+ }
+ if (fieldName.equals("nodesep")) {
+ return nodesep;
+ }
+ if (fieldName.equals("ranksep")) {
+ return ranksep;
+ }
+ return super.getInt(fieldName);
+ }
+
+ @Override
+ public double getDouble(String fieldName) {
+ if (fieldName.equals("ht1")) {
+ return ht1;
+ }
+ if (fieldName.equals("ht2")) {
+ return ht2;
+ }
+ return super.getDouble(fieldName);
+ }
+
+ @Override
+ public void setDouble(String fieldName, double data) {
+ if (fieldName.equals("ht1")) {
+ this.ht1 = data;
+ return;
+ }
+ if (fieldName.equals("ht2")) {
+ this.ht2 = data;
+ return;
+ }
+ super.setDouble(fieldName, data);
+ }
+
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "typedef struct Agraphinfo_t",
+ // "{",
+ // "Agrec_t hdr",
+ // "layout_t *drawing",
+ // "textlabel_t *label",
+ // "boxf bb",
+ // "pointf border[4]",
+ // "unsigned char gui_state",
+ // "unsigned char has_labels",
+ // "boolean has_images",
+ // "unsigned char charset",
+ // "int rankdir",
+ // "double ht1, ht2",
+ // "unsigned short flags",
+ // "void *alg",
+ // "GVC_t *gvc",
+ // "void (*cleanup) (graph_t * g)",
+ // "node_t **neato_nlist",
+ // "int move",
+ // "double **dist, **spring, **sum_t, ***t",
+ // "unsigned short ndim",
+ // "unsigned short odim",
+ // "int n_cluster",
+ // "graph_t **clust",
+ // "graph_t *dotroot",
+ // "node_t *nlist",
+ // "rank_t *rank",
+ // "graph_t *parent",
+ // "int level",
+ // "node_t *minrep, *maxrep",
+ // "nlist_t comp",
+ // "node_t *minset, *maxset",
+ // "long n_nodes",
+ // "short minrank, maxrank",
+ // "boolean has_flat_edges",
+ // "boolean has_sourcerank",
+ // "boolean has_sinkrank",
+ // "unsigned char showboxes",
+ // "fontname_kind fontnames",
+ // "int nodesep, ranksep",
+ // "node_t *ln, *rn",
+ // "node_t *leader, **rankleader",
+ // "boolean expanded",
+ // "char installed",
+ // "char set_type",
+ // "char label_pos",
+ // "boolean exact_ranksep",
+ // "}",
+ // "Agraphinfo_t");
+}
+
+// typedef struct Agraphinfo_t {
+// Agrec_t hdr;
+// /* to generate code */
+// layout_t *drawing;
+// textlabel_t *label; /* if the cluster has a title */
+// boxf bb; /* bounding box */
+// pointf border[4]; /* sizes of margins for graph labels */
+// unsigned char gui_state; /* Graph state for GUI ops */
+// unsigned char has_labels;
+// boolean has_images;
+// unsigned char charset; /* input character set */
+// int rankdir;
+// double ht1, ht2; /* below and above extremal ranks */
+// unsigned short flags;
+// void *alg;
+// GVC_t *gvc; /* context for "globals" over multiple graphs */
+// void (*cleanup) (graph_t * g); /* function to deallocate layout-specific data */
+//
+//
+// /* to place nodes */
+// node_t **neato_nlist;
+// int move;
+// double **dist, **spring, **sum_t, ***t;
+// unsigned short ndim;
+// unsigned short odim;
+//
+//
+// /* to have subgraphs */
+// int n_cluster;
+// graph_t **clust; /* clusters are in clust[1..n_cluster] !!! */
+// graph_t *dotroot;
+// node_t *nlist;
+// rank_t *rank;
+// graph_t *parent; /* containing cluster (not parent subgraph) */
+// int level; /* cluster nesting level (not node level!) */
+// node_t *minrep, *maxrep; /* set leaders for min and max rank */
+//
+// /* fast graph node list */
+// nlist_t comp;
+// /* connected components */
+// node_t *minset, *maxset; /* set leaders */
+// long n_nodes;
+// /* includes virtual */
+// short minrank, maxrank;
+//
+// /* various flags */
+// boolean has_flat_edges;
+// boolean has_sourcerank;
+// boolean has_sinkrank;
+// unsigned char showboxes;
+// fontname_kind fontnames; /* to override mangling in SVG */
+//
+// int nodesep, ranksep;
+// node_t *ln, *rn; /* left, right nodes of bounding box */
+//
+// /* for clusters */
+// node_t *leader, **rankleader;
+// boolean expanded;
+// char installed;
+// char set_type;
+// char label_pos;
+// boolean exact_ranksep;
+//
+//
+// } Agraphinfo_t; \ No newline at end of file
diff --git a/src/h/ST_Agrec_s.java b/src/h/ST_Agrec_s.java
new file mode 100644
index 0000000..9f466cc
--- /dev/null
+++ b/src/h/ST_Agrec_s.java
@@ -0,0 +1,197 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.CString;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.__struct__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_Agrec_s extends UnsupportedStructAndPtr implements WithParent {
+
+ public CString name;
+ public ST_Agrec_s.Amp next;
+
+ private final StarStruct parent;
+
+ @Override
+ public void copyDataFrom(__struct__ other) {
+ if (other instanceof ST_Agedgeinfo_t && parent instanceof ST_Agedgeinfo_t) {
+ parent.copyDataFrom(other);
+ return;
+ }
+ ST_Agrec_s this2 = (ST_Agrec_s) other;
+ this.name = this2.name;
+ this.next = this2.next;
+ }
+
+ public ST_Agrec_s() {
+ this(null);
+ }
+
+ public ST_Agrec_s(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ public StarStruct getParent() {
+ return parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp(this);
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ private final ST_Agrec_s me;
+
+ public Amp(ST_Agrec_s me) {
+ this.me = me;
+ }
+
+ @Override
+ public boolean isSameThan(StarStruct other) {
+ Amp other2 = (Amp) other;
+ return this.me == other2.me;
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ return ST_Agrec_s.this.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ return ST_Agrec_s.this.getPtr(fieldName);
+ }
+
+ @Override
+ public __ptr__ castTo(Class dest) {
+ return ST_Agrec_s.this.castTo(dest);
+ }
+
+ @Override
+ public CString getCString(String fieldName) {
+ return ST_Agrec_s.this.getCString(fieldName);
+ }
+
+ @Override
+ public void copyDataFrom(__struct__ other) {
+ ST_Agrec_s.this.copyDataFrom(other);
+ }
+ }
+
+ @Override
+ public CString getCString(String fieldName) {
+ if (fieldName.equals("name")) {
+ return name;
+ }
+ return super.getCString(fieldName);
+ }
+
+ @Override
+ public __ptr__ castTo(Class dest) {
+ if (dest == Agdatadict_s.class && getParent() instanceof ST_Agdatadict_s) {
+ return (ST_Agdatadict_s) getParent();
+ }
+ if (dest == Agattr_s.class && getParent() instanceof ST_Agattr_s) {
+ return (ST_Agattr_s) getParent();
+ }
+ if (dest == Agraphinfo_t.class && getParent() instanceof ST_Agraphinfo_t) {
+ return (ST_Agraphinfo_t) getParent();
+ }
+ if (dest == Agnodeinfo_t.class && getParent() instanceof ST_Agnodeinfo_t) {
+ return (ST_Agnodeinfo_t) getParent();
+ }
+ if (dest == Agedgeinfo_t.class && getParent() instanceof ST_Agedgeinfo_t) {
+ return (ST_Agedgeinfo_t) getParent();
+ }
+ System.err.println("dest=" + dest);
+ System.err.println("getParent=" + getParent().getClass());
+ return super.castTo(dest);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("name")) {
+ this.name = (CString) newData;
+ return name;
+ }
+ if (fieldName.equals("next")) {
+ if (newData instanceof ST_Agrec_s) {
+ this.next = (ST_Agrec_s.Amp) ((ST_Agrec_s) newData).amp();
+ } else {
+ this.next = (ST_Agrec_s.Amp) newData;
+ }
+ return next;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("next")) {
+ return next;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "struct Agrec_s",
+ // "{",
+ // "char *name",
+ // "Agrec_t *next",
+ // "}");
+}
+
+// struct Agrec_s {
+// char *name;
+// Agrec_t *next;
+// /* following this would be any programmer-defined data */
+// }; \ No newline at end of file
diff --git a/src/h/ST_Agsubnode_s.java b/src/h/ST_Agsubnode_s.java
new file mode 100644
index 0000000..0584063
--- /dev/null
+++ b/src/h/ST_Agsubnode_s.java
@@ -0,0 +1,238 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import h.ST_splineInfo.Amp;
+import smetana.core.HardcodedStruct;
+import smetana.core.OFFSET;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_Agsubnode_s extends UnsupportedStructAndPtr implements HardcodedStruct {
+
+ public final ST_dtlink_s seq_link = new ST_dtlink_s(this);
+ public final ST_dtlink_s id_link = new ST_dtlink_s(this);
+ public Agnode_s node;
+ public ST_dtlink_s.Amp in_id;
+ public ST_dtlink_s.Amp out_id;
+ public ST_dtlink_s.Amp in_seq;
+ public ST_dtlink_s.Amp out_seq;
+
+ public ST_Agsubnode_s() {
+ this(null);
+ }
+
+ public ST_Agsubnode_s(StarStruct parent) {
+ }
+
+ public StarStruct from_id_link(ST_dtlink_s from) {
+ if (from == id_link) {
+ return amp();
+ }
+ throw new IllegalArgumentException();
+ }
+
+ public StarStruct from_seq_link(ST_dtlink_s from) {
+ if (from == seq_link) {
+ return amp();
+ }
+ throw new IllegalArgumentException();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ private final ST_Agsubnode_s me;
+
+ public Amp(ST_Agsubnode_s me) {
+ this.me = me;
+ }
+
+ @Override
+ public boolean isSameThan(StarStruct other) {
+ Amp other2 = (Amp) other;
+ return this.me == other2.me;
+ }
+
+ @Override
+ public Object addVirtualBytes(int virtualBytes) {
+ if (virtualBytes == 0) {
+ return this;
+ }
+ final OFFSET offset = OFFSET.fromInt(virtualBytes);
+ if (offset.toString().equals("h.Agsubnode_s::id_link")) {
+ return id_link.amp();
+ }
+ if (offset.toString().equals("h.Agsubnode_s::seq_link")) {
+ return seq_link.amp();
+ }
+ System.err.println("virtualBytes=" + virtualBytes);
+ System.err.println("offset=" + offset);
+ return super.addVirtualBytes(virtualBytes);
+ }
+
+ @Override
+ public __ptr__ castTo(Class dest) {
+ if (dest == Agsubnode_s.class) {
+ return this;
+ }
+ System.err.println("dest=" + dest);
+ return super.castTo(dest);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ return ST_Agsubnode_s.this.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ return ST_Agsubnode_s.this.getPtr(fieldName);
+ }
+ }
+
+ @Override
+ public Object addVirtualBytes(int virtualBytes) {
+ if (virtualBytes == 0) {
+ return this;
+ }
+ final OFFSET offset = OFFSET.fromInt(virtualBytes);
+ if (offset.toString().equals("h.Agsubnode_s::id_link")) {
+ return id_link.amp();
+ }
+ if (offset.toString().equals("h.Agsubnode_s::seq_link")) {
+ return seq_link.amp();
+ }
+ System.err.println("virtualBytes=" + virtualBytes);
+ System.err.println("offset=" + offset);
+ return super.addVirtualBytes(virtualBytes);
+ }
+
+
+ @Override
+ public StarStruct amp() {
+ return new Amp(this);
+ }
+
+ @Override
+ public __ptr__ castTo(Class dest) {
+ if (dest == Agsubnode_s.class) {
+ return this;
+ }
+ System.err.println("dest=" + dest);
+ return super.castTo(dest);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("node")) {
+ this.node = (Agnode_s) newData;
+ return node;
+ }
+ if (fieldName.equals("in_id")) {
+ this.in_id = (h.ST_dtlink_s.Amp) newData;
+ return in_id;
+ }
+ if (fieldName.equals("out_seq")) {
+ this.out_seq = (h.ST_dtlink_s.Amp) newData;
+ return out_seq;
+ }
+ if (fieldName.equals("out_id")) {
+ this.out_id = (h.ST_dtlink_s.Amp) newData;
+ return out_id;
+ }
+ if (fieldName.equals("seq_link")) {
+ this.seq_link.copyDataFrom(newData);
+ return seq_link;
+ }
+ if (fieldName.equals("in_seq")) {
+ this.in_seq = (h.ST_dtlink_s.Amp) newData;
+ return in_seq;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("node")) {
+ return node;
+ }
+ if (fieldName.equals("in_id")) {
+ return in_id;
+ }
+ if (fieldName.equals("out_seq")) {
+ return out_seq;
+ }
+ if (fieldName.equals("out_id")) {
+ return out_id;
+ }
+ if (fieldName.equals("in_seq")) {
+ return in_seq;
+ }
+ return super.getPtr(fieldName);
+ }
+
+
+ // public interface ST_Agsubnode_s extends __ptr__ {
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "struct Agsubnode_s",
+ // "{",
+ // "Dtlink_t seq_link",
+ // "Dtlink_t id_link",
+ // "Agnode_t *node",
+ // "Dtlink_t *in_id, *out_id",
+ // "Dtlink_t *in_seq, *out_seq",
+ // "}");
+}
+
+// struct Agsubnode_s { /* the node-per-graph-or-subgraph record */
+// Dtlink_t seq_link; /* must be first */
+// Dtlink_t id_link;
+// Agnode_t *node; /* the object */
+// Dtlink_t *in_id, *out_id; /* by node/ID for random access */
+// Dtlink_t *in_seq, *out_seq; /* by node/sequence for serial access */
+// }; \ No newline at end of file
diff --git a/src/h/ST_Agsym_s.java b/src/h/ST_Agsym_s.java
new file mode 100644
index 0000000..6e77a15
--- /dev/null
+++ b/src/h/ST_Agsym_s.java
@@ -0,0 +1,218 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.CString;
+import smetana.core.HardcodedStruct;
+import smetana.core.OFFSET;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarStruct;
+
+//2 38c2s12koxcpi2c7vwl72qrsp
+
+public class ST_Agsym_s extends UnsupportedStructAndPtr implements HardcodedStruct {
+ public final ST_dtlink_s link = new ST_dtlink_s(this);
+
+ public CString name; /* attribute's name */
+ public CString defval; /* its default value for initialization */
+
+ public int id; /* its index in attr[] */
+ public int kind; /* referent object type */
+ public int fixed; /* immutable value */
+ public int print; /* always print */
+
+ public ST_Agsym_s(StarStruct parent) {
+ }
+
+ @Override
+ public Object addVirtualBytes(int virtualBytes) {
+ if (virtualBytes == 0) {
+ return this;
+ }
+ final OFFSET offset = OFFSET.fromInt(virtualBytes);
+ if (offset.toString().equals("h.Agsym_s::name")) {
+ return name;
+ }
+ if (offset.toString().equals("h.Agsym_s::link")) {
+ return link;
+ }
+ System.err.println("virtualBytes=" + virtualBytes);
+ System.err.println("offset=" + offset);
+ return super.addVirtualBytes(virtualBytes);
+ }
+
+ public ST_Agsym_s() {
+ this(null);
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ private final ST_Agsym_s me;
+
+ public Amp(ST_Agsym_s me) {
+ this.me = me;
+ }
+
+ @Override
+ public boolean isSameThan(StarStruct other) {
+ Amp other2 = (Amp) other;
+ return this.me == other2.me;
+ }
+
+ @Override
+ public Object addVirtualBytes(int virtualBytes) {
+ if (virtualBytes == 0) {
+ return this;
+ }
+ final OFFSET offset = OFFSET.fromInt(virtualBytes);
+ if (offset.toString().equals("h.Agsym_s::name")) {
+ return name;
+ }
+ System.err.println("virtualBytes=" + virtualBytes);
+ System.err.println("offset=" + offset);
+ return super.addVirtualBytes(virtualBytes);
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ return ST_Agsym_s.this.getInt(fieldName);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ return ST_Agsym_s.this.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public CString getCString(String fieldName) {
+ return ST_Agsym_s.this.getCString(fieldName);
+ }
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp(this);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("name")) {
+ this.name = (CString) newData;
+ return name;
+ }
+ if (fieldName.equals("defval")) {
+ this.defval = (CString) newData;
+ return defval;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("kind")) {
+ this.kind = data;
+ return;
+ }
+ if (fieldName.equals("id")) {
+ this.id = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("kind")) {
+ return kind;
+ }
+ if (fieldName.equals("id")) {
+ return id;
+ }
+ return super.getInt(fieldName);
+ }
+
+ @Override
+ public CString getCString(String fieldName) {
+ if (fieldName.equals("defval")) {
+ return defval;
+ }
+ if (fieldName.equals("name")) {
+ return name;
+ }
+ return super.getCString(fieldName);
+ }
+
+ public StarStruct from_link(ST_dtlink_s from) {
+ if (from == link) {
+ return amp();
+ }
+ throw new IllegalArgumentException();
+ }
+
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "struct Agsym_s",
+ // "{",
+ // "Dtlink_t link",
+ // "char *name",
+ // "char *defval",
+ // "int id",
+ // "unsigned char kind",
+ // "unsigned char fixed",
+ // "unsigned char print",
+ // "}");
+}
+
+// struct Agsym_s { /* symbol in one of the above dictionaries */
+// Dtlink_t link;
+// char *name; /* attribute's name */
+// char *defval; /* its default value for initialization */
+// int id; /* its index in attr[] */
+// unsigned char kind; /* referent object type */
+// unsigned char fixed; /* immutable value */
+// unsigned char print; /* always print */
+// }; \ No newline at end of file
diff --git a/src/h/ST_EMPTY.java b/src/h/ST_EMPTY.java
new file mode 100644
index 0000000..c3329c1
--- /dev/null
+++ b/src/h/ST_EMPTY.java
@@ -0,0 +1,73 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.amiga.StarStruct;
+
+public class ST_EMPTY extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_EMPTY() {
+ this(null);
+ }
+
+ public ST_EMPTY(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ }
+
+}
diff --git a/src/h/ST_GVCOMMON_t.java b/src/h/ST_GVCOMMON_t.java
new file mode 100644
index 0000000..2028d07
--- /dev/null
+++ b/src/h/ST_GVCOMMON_t.java
@@ -0,0 +1,142 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.CFunction;
+import smetana.core.HardcodedStruct;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_GVCOMMON_t extends UnsupportedStructAndPtr implements HardcodedStruct {
+
+ // "typedef struct GVCOMMON_s",
+ // "{",
+ private __ptr__ info;
+ // "char *cmdname",
+ // "int verbose",
+ // "boolean config, auto_outfile_names",
+ // "void (*errorfn) (const char *fmt, ...)",
+ private CFunction errorfn;
+ // "const char **show_boxes",
+ // "const char **lib",
+ // "int viewNum",
+ // "const lt_symlist_t *builtins",
+ private __ptr__ builtins;
+ private boolean demand_loading;
+ // "}",
+ // "GVCOMMON_t");
+
+ private final StarStruct parent;
+
+ public ST_GVCOMMON_t() {
+ this(null);
+ }
+
+ public ST_GVCOMMON_t(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("info")) {
+ this.info = newData;
+ return newData;
+ }
+ if (fieldName.equals("errorfn")) {
+ this.errorfn = (CFunction) newData;
+ return newData;
+ }
+ if (fieldName.equals("builtins")) {
+ this.builtins = newData;
+ return newData;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("builtins") && builtins == null) {
+ return builtins;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public void setBoolean(String fieldName, boolean data) {
+ if (fieldName.equals("demand_loading")) {
+ this.demand_loading = data;
+ return;
+ }
+ super.setBoolean(fieldName, data);
+ }
+
+}
+
+// typedef struct GVCOMMON_s {
+// char **info;
+// char *cmdname;
+// int verbose;
+// boolean config, auto_outfile_names;
+// void (*errorfn) (const char *fmt, ...);
+// const char **show_boxes; /* emit code for correct box coordinates */
+// const char **lib;
+//
+// /* rendering state */
+// int viewNum; /* current view - 1 based count of views,
+// all pages in all layers */
+// const lt_symlist_t *builtins;
+// int demand_loading;
+// } GVCOMMON_t; \ No newline at end of file
diff --git a/src/h/ST_GVC_s.java b/src/h/ST_GVC_s.java
new file mode 100644
index 0000000..6ca8393
--- /dev/null
+++ b/src/h/ST_GVC_s.java
@@ -0,0 +1,212 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.HardcodedStruct;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__struct__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_GVC_s extends UnsupportedStructAndPtr implements HardcodedStruct {
+
+ // "struct GVC_s",
+ // "{",
+ private final ST_GVCOMMON_t common = new ST_GVCOMMON_t(this);
+ // "char *config_path",
+ private int config_found;
+ // "char **input_filenames",
+ // "GVG_t *gvgs",
+ // "GVG_t *gvg",
+ // "gvplugin_available_t *apis[ +1 +1 +1 +1 +1 ]",
+ // "gvplugin_available_t *api[ +1 +1 +1 +1 +1 ]",
+ // "gvplugin_package_t *packages",
+ // "size_t (*write_fn) (GVJ_t *job, const char *s, size_t len)",
+ // "Dtdisc_t textfont_disc",
+ // "Dt_t *textfont_dt",
+ // "gvplugin_active_textlayout_t textlayout",
+ // "GVJ_t *jobs",
+ // "GVJ_t *job",
+ // "graph_t *g",
+ private final ST_gvplugin_active_layout_t layout = new ST_gvplugin_active_layout_t();
+ // "char *graphname",
+ // "GVJ_t *active_jobs",
+ // "char *pagedir",
+ // "pointf margin",
+ // "pointf pad",
+ // "pointf pageSize",
+ // "point pb",
+ // "boxf bb",
+ // "int rotation",
+ // "boolean graph_sets_pad, graph_sets_margin, graph_sets_pageSize, graph_sets_rotation",
+ // "char *layerDelims",
+ // "char *layerListDelims",
+ // "char *layers",
+ // "char **layerIDs",
+ // "int numLayers",
+ // "int *layerlist",
+ // "char *defaultfontname",
+ // "double defaultfontsize",
+ // "char **defaultlinestyle",
+ // "gvcolor_t bgcolor",
+ // "int fontrenaming",
+ // "}");
+
+ private final StarStruct parent;
+
+ public ST_GVC_s() {
+ this(null);
+ }
+
+ public ST_GVC_s(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+ }
+
+ @Override
+ public __struct__ getStruct(String fieldName) {
+ if (fieldName.equals("common")) {
+ return common;
+ }
+ if (fieldName.equals("layout")) {
+ return layout;
+ }
+ return super.getStruct(fieldName);
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("config_found")) {
+ this.config_found = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+}
+
+// struct GVC_s {
+// GVCOMMON_t common;
+//
+// char *config_path;
+// boolean config_found;
+//
+// /* gvParseArgs */
+// char **input_filenames; /* null terminated array of input filenames */
+//
+// /* gvNextInputGraph() */
+// GVG_t *gvgs; /* linked list of graphs */
+// GVG_t *gvg; /* current graph */
+//
+// /* plugins */
+//
+// /* APIS expands to "+1 +1 ... +1" to give the number of APIs */
+// gvplugin_available_t *apis[ +1 +1 +1 +1 +1 ]; /* array of linked-list of plugins per api */
+// gvplugin_available_t *api[ +1 +1 +1 +1 +1 ]; /* array of current plugins per api */
+//
+// gvplugin_package_t *packages; /* list of available packages */
+//
+// /* externally provided write() displine */
+// size_t (*write_fn) (GVJ_t *job, const char *s, size_t len);
+//
+// /* fonts and textlayout */
+// Dtdisc_t textfont_disc;
+// Dt_t *textfont_dt;
+// gvplugin_active_textlayout_t textlayout; /* always use best avail for all jobs */
+// // void (*free_layout) (void *layout); /* function for freeing layouts (mostly used by pango) */
+//
+// /* FIXME - everything below should probably move to GVG_t */
+//
+// /* gvrender_config() */
+// GVJ_t *jobs; /* linked list of jobs */
+// GVJ_t *job; /* current job */
+//
+// graph_t *g; /* current graph */
+//
+// /* gvrender_begin_job() */
+// gvplugin_active_layout_t layout;
+//
+// char *graphname; /* name from graph */
+// GVJ_t *active_jobs; /* linked list of active jobs */
+//
+// /* pagination */
+// char *pagedir; /* pagination order */
+// pointf margin; /* margins in graph units */
+// pointf pad; /* pad in graph units */
+// pointf pageSize; /* pageSize in graph units, not including margins */
+// point pb; /* page size - including margins (inches) */
+// boxf bb; /* graph bb in graph units, not including margins */
+// int rotation; /* rotation - 0 = portrait, 90 = landscape */
+// boolean graph_sets_pad, graph_sets_margin, graph_sets_pageSize, graph_sets_rotation;
+//
+// /* layers */
+// char *layerDelims; /* delimiters in layer names */
+// char *layerListDelims; /* delimiters between layer ranges */
+// char *layers; /* null delimited list of layer names */
+// char **layerIDs; /* array of layer names */
+// int numLayers; /* number of layers */
+// int *layerlist;
+//
+// /* default font */
+// char *defaultfontname;
+// double defaultfontsize;
+//
+// /* default line style */
+// char **defaultlinestyle;
+//
+// /* render defaults set from graph */
+// gvcolor_t bgcolor; /* background color */
+//
+// /* whether to mangle font names (at least in SVG), usually false */
+// int fontrenaming;
+// }; \ No newline at end of file
diff --git a/src/h/ST_HDict_t.java b/src/h/ST_HDict_t.java
new file mode 100644
index 0000000..0c55223
--- /dev/null
+++ b/src/h/ST_HDict_t.java
@@ -0,0 +1,91 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import h.ST_HDict_t.Amp;
+
+import java.util.Arrays;
+import java.util.List;
+
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_HDict_t extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_HDict_t() {
+ this(null);
+ }
+
+ public ST_HDict_t(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ }
+ // "typedef struct obyh",
+ // "{",
+ // "Dtlink_t link",
+ // "int key",
+ // "Leaf_t d",
+ // "}",
+ // "HDict_t");
+}
+
+// typedef struct obyh {
+// Dtlink_t link;
+// int key;
+// Leaf_t d;
+// } HDict_t; \ No newline at end of file
diff --git a/src/h/ST_IMapEntry_t.java b/src/h/ST_IMapEntry_t.java
new file mode 100644
index 0000000..1f6f4de
--- /dev/null
+++ b/src/h/ST_IMapEntry_t.java
@@ -0,0 +1,93 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import h.ST_IMapEntry_t.Amp;
+
+import java.util.Arrays;
+import java.util.List;
+
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_IMapEntry_t extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_IMapEntry_t() {
+ this(null);
+ }
+
+ public ST_IMapEntry_t(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ }
+ // "typedef struct IMapEntry_s",
+ // "{",
+ // "Dtlink_t namedict_link",
+ // "Dtlink_t iddict_link",
+ // "unsigned long id",
+ // "char *str",
+ // "}",
+ // "IMapEntry_t");
+}
+
+// typedef struct IMapEntry_s {
+// Dtlink_t namedict_link;
+// Dtlink_t iddict_link;
+// unsigned long id;
+// char *str;
+// } IMapEntry_t; \ No newline at end of file
diff --git a/src/h/ST_Node_t___.java b/src/h/ST_Node_t___.java
new file mode 100644
index 0000000..3b48a6b
--- /dev/null
+++ b/src/h/ST_Node_t___.java
@@ -0,0 +1,90 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+import h.ST_Node_t___.Amp;
+
+import java.util.Arrays;
+import java.util.List;
+
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_Node_t___ extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_Node_t___() {
+ this(null);
+ }
+
+ public ST_Node_t___(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ }
+//"typedef struct Node",
+//"{",
+//"int count",
+//"int level",
+//"struct Branch branch[64]",
+//"}",
+//"Node_t");
+}
+
+// typedef struct Node {
+// int count;
+// int level; /* 0 is leaf, others positive */
+// struct Branch branch[64];
+// } Node_t; \ No newline at end of file
diff --git a/src/h/ST_Pedge_t.java b/src/h/ST_Pedge_t.java
new file mode 100644
index 0000000..7e4fbe9
--- /dev/null
+++ b/src/h/ST_Pedge_t.java
@@ -0,0 +1,135 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.UnsupportedSize_t;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__struct__;
+import smetana.core.size_t;
+import smetana.core.amiga.StarArrayOfPtr;
+import smetana.core.amiga.StarStruct;
+
+public class ST_Pedge_t extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_Pedge_t() {
+ this(null);
+ }
+
+ public ST_Pedge_t(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ // "typedef struct Pedge_t",
+ // "{",
+ // "Ppoint_t a, b",
+ private final ST_pointf a = new ST_pointf(this);
+ private final ST_pointf b = new ST_pointf(this);
+
+ // "}",
+ // "Pedge_t");
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ }
+
+ @Override
+ public __struct__ getStruct(String fieldName) {
+ if (fieldName.equals("a")) {
+ return a;
+ }
+ if (fieldName.equals("b")) {
+ return b;
+ }
+ return super.getStruct(fieldName);
+ }
+
+ @Override
+ public void setStruct(String fieldName, __struct__ newData) {
+ if (fieldName.equals("a")) {
+ this.a.copyDataFrom(newData);
+ return;
+ }
+ if (fieldName.equals("b")) {
+ this.b.copyDataFrom(newData);
+ return;
+ }
+ super.setStruct(fieldName, newData);
+ }
+
+ public static size_t sizeof(final int nb) {
+ return new UnsupportedSize_t(nb) {
+ @Override
+ public Object malloc() {
+ return new StarArrayOfPtr(new STArray<ST_Pedge_t>(nb, 0, ST_Pedge_t.class));
+ }
+
+ @Override
+ public int getInternalNb() {
+ return nb;
+ }
+
+ @Override
+ public Object realloc(Object old) {
+ StarArrayOfPtr old2 = (StarArrayOfPtr) old;
+ old2.realloc(nb);
+ return old2;
+ }
+ };
+ }
+
+}
+
+// typedef struct Pedge_t {
+// Ppoint_t a, b;
+// } Pedge_t; \ No newline at end of file
diff --git a/src/h/ST_Ppoly_t.java b/src/h/ST_Ppoly_t.java
new file mode 100644
index 0000000..6206be8
--- /dev/null
+++ b/src/h/ST_Ppoly_t.java
@@ -0,0 +1,258 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.HardcodedStruct;
+import smetana.core.UnsupportedArrayOfPtr;
+import smetana.core.UnsupportedArrayOfStruct;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__array_of_ptr__;
+import smetana.core.__array_of_struct__;
+import smetana.core.__ptr__;
+import smetana.core.__struct__;
+import smetana.core.amiga.Area;
+import smetana.core.amiga.StarArrayOfPtr;
+import smetana.core.amiga.StarArrayOfStruct;
+import smetana.core.amiga.StarStruct;
+
+public class ST_Ppoly_t extends UnsupportedStructAndPtr implements HardcodedStruct {
+
+ // public List ps1;
+ public StarArrayOfPtr ps2;
+ public int pn;
+
+ public ST_Ppoly_t() {
+ this(null);
+ }
+
+ public ST_Ppoly_t(StarStruct parent) {
+ }
+
+ @Override
+ public __struct__ copy() {
+ ST_Ppoly_t result = new ST_Ppoly_t();
+ result.ps2 = this.ps2;
+ result.pn = this.pn;
+ return result;
+ }
+
+ class Adaptor extends UnsupportedArrayOfPtr {
+
+ final private StarArrayOfStruct newData2;
+ final private int pos;
+
+ public Adaptor(StarArrayOfStruct newData2, int pos) {
+ this.newData2 = newData2;
+ this.pos = pos;
+ }
+
+ @Override
+ public __array_of_ptr__ move(int delta) {
+ return new Adaptor(newData2, pos + delta);
+ }
+
+ @Override
+ public Area getInternal(int idx) {
+ return newData2.getInternalArray().getInternal(pos + idx);
+ }
+
+ @Override
+ public __ptr__ getPtr() {
+ return newData2.plus(pos).getPtr();
+ }
+
+ @Override
+ public __struct__ getStruct() {
+ return newData2.plus(pos).getStruct();
+ }
+
+ @Override
+ public int comparePointerInternal(__array_of_ptr__ other) {
+ return super.comparePointerInternal(other);
+ }
+
+ }
+
+ class Adaptor2 extends UnsupportedArrayOfStruct {
+
+ final private int pos;
+
+ public Adaptor2(int pos) {
+ this.pos = pos;
+ }
+
+ @Override
+ public __array_of_struct__ plus(int delta) {
+ return new Adaptor2(pos + delta);
+ }
+
+ @Override
+ public __struct__ getStruct() {
+ return ps2.plus(pos).getStruct();
+ }
+
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("ps")) {
+ if (newData instanceof StarArrayOfStruct) {
+ StarArrayOfStruct newData2 = (StarArrayOfStruct) newData;
+ System.err.println("newData2B=" + newData2);
+ this.ps2 = new StarArrayOfPtr(new Adaptor(newData2, 0));
+ return ps2;
+ }
+ this.ps2 = (StarArrayOfPtr) newData;
+ return ps2;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("ps")) {
+ return ps2;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public __array_of_struct__ getArrayOfStruct(String fieldName) {
+ if (fieldName.equals("ps")) {
+ return new Adaptor2(0);
+ // return ps2.getArrayOfStruct("ps");
+ }
+ return super.getArrayOfStruct(fieldName);
+ }
+
+ @Override
+ public __array_of_ptr__ getArrayOfPtr(String fieldName) {
+ if (fieldName.equals("ps")) {
+ return ps2.getInternalArray();
+ }
+ return super.getArrayOfPtr(fieldName);
+ }
+
+ @Override
+ public void memcopyFrom(Area source) {
+ ST_Ppoly_t source2 = (ST_Ppoly_t) source;
+ this.ps2 = source2.ps2;
+ this.pn = source2.pn;
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("pn")) {
+ this.pn = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("pn")) {
+ return pn;
+ }
+ return super.getInt(fieldName);
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("pn")) {
+ return pn;
+ }
+ return super.getInt(fieldName);
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("pn")) {
+ pn = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("ps")) {
+ return ps2;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("ps")) {
+ ps2 = (StarArrayOfPtr) newData;
+ return newData;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "typedef struct Ppoly_t",
+ // "{",
+ // "Ppoint_t *ps",
+ // "int pn",
+ // "}",
+ // "Ppoly_t");
+}
+
+// typedef struct Ppoly_t {
+// Ppoint_t *ps;
+// int pn;
+// } Ppoly_t; \ No newline at end of file
diff --git a/src/h/ST_RTree.java b/src/h/ST_RTree.java
new file mode 100644
index 0000000..dfb3db1
--- /dev/null
+++ b/src/h/ST_RTree.java
@@ -0,0 +1,165 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import h.ST_RTree.Amp;
+
+import java.util.Arrays;
+import java.util.List;
+
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_RTree extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_RTree() {
+ this(null);
+ }
+
+ public ST_RTree(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ // "struct RTree",
+ // "{",
+ // "Node_t *root",
+ // "SplitQ_t split",
+ // "int MinFill",
+ // "long ElapsedTime",
+ // "float UserTime, SystemTime",
+ // "int Deleting",
+ // "int StatFlag",
+ // "int InsertCount",
+ // "int DeleteCount",
+ // "int ReInsertCount",
+ // "int InSplitCount",
+ // "int DeSplitCount",
+ // "int ElimCount",
+ // "int EvalCount",
+ // "int InTouchCount",
+ // "int DeTouchCount",
+ // "int SeTouchCount",
+ // "int CallCount",
+ // "float SplitMeritSum",
+ // "int RectCount",
+ private int NodeCount;
+ // "int LeafCount, NonLeafCount",
+ // "int EntryCount",
+ // "int SearchCount",
+ // "int HitCount",
+ // "}");
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("NodeCount")) {
+ return NodeCount;
+ }
+ return super.getInt(fieldName);
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("NodeCount")) {
+ this.NodeCount = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+}
+
+// struct RTree {
+// Node_t *root;
+//
+// SplitQ_t split;
+//
+// /* balance criterion for node splitting */
+// int MinFill;
+//
+// /* times */
+// long ElapsedTime;
+// float UserTime, SystemTime;
+//
+// int Deleting;
+//
+// /* variables for statistics */
+// int StatFlag; /* tells if we are counting or not */
+// /* counters affected only when StatFlag set */
+// int InsertCount;
+// int DeleteCount;
+// int ReInsertCount;
+// int InSplitCount;
+// int DeSplitCount;
+// int ElimCount;
+// int EvalCount;
+// int InTouchCount;
+// int DeTouchCount;
+// int SeTouchCount;
+// int CallCount;
+// float SplitMeritSum;
+//
+// /* counters used even when StatFlag not set */
+// int RectCount;
+// int NodeCount;
+// int LeafCount, NonLeafCount;
+// int EntryCount;
+// int SearchCount;
+// int HitCount;
+//
+// }; \ No newline at end of file
diff --git a/src/h/ST_XLabels_t.java b/src/h/ST_XLabels_t.java
new file mode 100644
index 0000000..54ede9c
--- /dev/null
+++ b/src/h/ST_XLabels_t.java
@@ -0,0 +1,116 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_XLabels_t extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_XLabels_t() {
+ this(null);
+ }
+
+ public ST_XLabels_t(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ // "typedef struct XLabels_s",
+ // "{",
+ // "object_t *objs",
+ // "int n_objs",
+ // "xlabel_t *lbls",
+ // "int n_lbls",
+ // "label_params_t *params",
+ private ST_dt_s hdx;
+
+ // "RTree_t *spdx",
+ // "}",
+ // "XLabels_t");
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("hdx")) {
+ return this.hdx;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("hdx")) {
+ this.hdx = (ST_dt_s) newData;
+ return this.hdx;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+}
+
+// typedef struct XLabels_s {
+// object_t *objs;
+// int n_objs;
+// xlabel_t *lbls;
+// int n_lbls;
+// label_params_t *params;
+//
+// Dt_t *hdx; // splay tree keyed with hilbert spatial codes
+// RTree_t *spdx; // rtree
+//
+// } XLabels_t; \ No newline at end of file
diff --git a/src/h/ST_adjmatrix_t.java b/src/h/ST_adjmatrix_t.java
new file mode 100644
index 0000000..9f2bb46
--- /dev/null
+++ b/src/h/ST_adjmatrix_t.java
@@ -0,0 +1,139 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__array_of_integer__;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarArrayOfInteger;
+import smetana.core.amiga.StarStruct;
+
+public class ST_adjmatrix_t extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_adjmatrix_t() {
+ this(null);
+ }
+
+ public ST_adjmatrix_t(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ }
+
+ // "typedef struct adjmatrix_t",
+ // "{",
+ private int nrows, ncols;
+
+ // "char *data",
+ private StarArrayOfInteger data;
+
+ // "}",
+ // "adjmatrix_t");
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("ncols")) {
+ this.ncols = data;
+ return;
+ }
+ if (fieldName.equals("nrows")) {
+ this.nrows = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("nrows")) {
+ return this.nrows;
+ }
+ if (fieldName.equals("ncols")) {
+ return this.ncols;
+ }
+ return super.getInt(fieldName);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("data")) {
+ this.data = (StarArrayOfInteger) newData;
+ return data;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __array_of_integer__ getArrayOfInteger(String fieldName) {
+ if (fieldName.equals("data")) {
+ return data.getInternalArray();
+ }
+ return super.getArrayOfInteger(fieldName);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("data")) {
+ return data;
+ }
+ return super.getPtr(fieldName);
+ }
+}
+
+// typedef struct adjmatrix_t {
+// int nrows, ncols;
+// char *data;
+// } adjmatrix_t; \ No newline at end of file
diff --git a/src/h/ST_aspect_t.java b/src/h/ST_aspect_t.java
new file mode 100644
index 0000000..2ddd468
--- /dev/null
+++ b/src/h/ST_aspect_t.java
@@ -0,0 +1,133 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.amiga.StarStruct;
+
+public class ST_aspect_t extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_aspect_t() {
+ this(null);
+ }
+
+ public ST_aspect_t(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ }
+
+ // "typedef struct aspect_t",
+ // "{",
+ // "double targetAR",
+ // "double combiAR",
+ private int prevIterations;
+ private int curIterations;
+ private int nextIter;
+ private int nPasses;
+ private int badGraph;
+
+ // "}",
+ // "aspect_t");
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("nextIter")) {
+ return this.nextIter;
+ }
+ if (fieldName.equals("nPasses")) {
+ return this.nPasses;
+ }
+ return super.getInt(fieldName);
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("nextIter")) {
+ this.nextIter = data;
+ return;
+ }
+ if (fieldName.equals("badGraph")) {
+ this.badGraph = data;
+ return;
+ }
+ if (fieldName.equals("nPasses")) {
+ this.nPasses = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+ @Override
+ public boolean getBoolean(String fieldName) {
+ if (fieldName.equals("badGraph")) {
+ return this.badGraph != 0;
+ }
+ return super.getBoolean(fieldName);
+ }
+
+}
+
+// typedef struct aspect_t {
+// double targetAR; /* target aspect ratio */
+// double combiAR;
+// int prevIterations; /* no. of iterations in previous pass */
+// int curIterations; /* no. of iterations in current pass */
+// int nextIter; /* dynamically adjusted no. of iterations */
+// int nPasses; /* bound on no. of top-level passes */
+// int badGraph; /* hack: set if graph is disconnected or has
+// * clusters. If so, turn off aspect */
+// } aspect_t; \ No newline at end of file
diff --git a/src/h/ST_bezier.java b/src/h/ST_bezier.java
new file mode 100644
index 0000000..c310ec8
--- /dev/null
+++ b/src/h/ST_bezier.java
@@ -0,0 +1,251 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.UnsupportedSize_t;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__array_of_ptr__;
+import smetana.core.__ptr__;
+import smetana.core.__struct__;
+import smetana.core.size_t;
+import smetana.core.amiga.StarArrayOfPtr;
+import smetana.core.amiga.StarStruct;
+
+public class ST_bezier extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_bezier() {
+ this(null);
+ }
+
+ public ST_bezier(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ // "{",
+ // "pointf *list",
+ private StarArrayOfPtr list;
+
+ private int size;
+ private int sflag, eflag;
+
+ private final ST_pointf sp = new ST_pointf(this), ep = new ST_pointf(this);
+
+ // "}",
+ // "bezier");
+
+ @Override
+ public void ___(__struct__ other) {
+ ST_bezier this2 = (ST_bezier) other;
+ this.list = this2.list;
+ this.size = this2.size;
+ this.sflag = this2.sflag;
+ this.eflag = this2.eflag;
+ this.sp.copyDataFrom((__struct__) this2.sp);
+ this.ep.copyDataFrom((__struct__) this2.ep);
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ return ST_bezier.this.getPtr(fieldName);
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ return ST_bezier.this.getInt(fieldName);
+ }
+
+ @Override
+ public __array_of_ptr__ getArrayOfPtr(String fieldName) {
+ return ST_bezier.this.getArrayOfPtr(fieldName);
+ }
+
+ @Override
+ public boolean getBoolean(String fieldName) {
+ return ST_bezier.this.getBoolean(fieldName);
+ }
+
+ @Override
+ public __struct__ getStruct(String fieldName) {
+ return ST_bezier.this.getStruct(fieldName);
+ }
+
+ }
+
+ @Override
+ public boolean getBoolean(String fieldName) {
+ if (fieldName.equals("sflag")) {
+ return this.sflag != 0;
+ }
+ if (fieldName.equals("eflag")) {
+ return this.eflag != 0;
+ }
+ return super.getBoolean(fieldName);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("list")) {
+ return list;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("list")) {
+ this.list = (StarArrayOfPtr) newData;
+ return list;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public void setStruct(String fieldName, __struct__ newData) {
+ if (fieldName.equals("sp")) {
+ this.sp.copyDataFrom(newData);
+ return;
+ }
+ if (fieldName.equals("ep")) {
+ this.ep.copyDataFrom(newData);
+ return;
+ }
+ super.setStruct(fieldName, newData);
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("size")) {
+ this.size = data;
+ return;
+ }
+ if (fieldName.equals("sflag")) {
+ this.sflag = data;
+ return;
+ }
+ if (fieldName.equals("eflag")) {
+ this.eflag = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("size")) {
+ return this.size;
+ }
+ if (fieldName.equals("sflag")) {
+ return this.sflag;
+ }
+ if (fieldName.equals("eflag")) {
+ return this.eflag;
+ }
+ return super.getInt(fieldName);
+ }
+
+ @Override
+ public __struct__ getStruct(String fieldName) {
+ if (fieldName.equals("sp")) {
+ return this.sp;
+ }
+ if (fieldName.equals("ep")) {
+ return this.ep;
+ }
+ return super.getStruct(fieldName);
+ }
+
+ @Override
+ public __array_of_ptr__ getArrayOfPtr(String fieldName) {
+ if (fieldName.equals("list")) {
+ return this.list.getInternalArray();
+ }
+ return super.getArrayOfPtr(fieldName);
+ }
+
+ @Override
+ public __struct__ getStruct() {
+ return this;
+ }
+
+ public static size_t sizeof(final int nb) {
+ return new UnsupportedSize_t(nb) {
+ @Override
+ public Object malloc() {
+ return new StarArrayOfPtr(new STArray<ST_bezier>(nb, 0, ST_bezier.class));
+ }
+
+ @Override
+ public int getInternalNb() {
+ return nb;
+ }
+
+ @Override
+ public Object realloc(Object old) {
+ StarArrayOfPtr old2 = (StarArrayOfPtr) old;
+ old2.realloc(nb);
+ return old2;
+ }
+ };
+ }
+
+}
+
+// typedef struct bezier {
+// pointf *list;
+// int size;
+// int sflag, eflag;
+// pointf sp, ep;
+// } bezier; \ No newline at end of file
diff --git a/src/h/ST_boxf.java b/src/h/ST_boxf.java
index b882759..e097976 100644
--- a/src/h/ST_boxf.java
+++ b/src/h/ST_boxf.java
@@ -46,10 +46,12 @@
package h;
import smetana.core.HardcodedStruct;
+import smetana.core.UnsupportedSize_t;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr;
-import smetana.core.__ptr__;
import smetana.core.__struct__;
+import smetana.core.size_t;
+import smetana.core.amiga.StarArrayOfPtr;
import smetana.core.amiga.StarStruct;
public class ST_boxf extends UnsupportedStructAndPtr implements HardcodedStruct {
@@ -71,13 +73,23 @@ public class ST_boxf extends UnsupportedStructAndPtr implements HardcodedStruct
// }
@Override
+ public __struct__ getStruct() {
+ return this;
+ }
+
+ @Override
+ public void setStruct(__struct__ value) {
+ copyDataFrom(value);
+ }
+
+ @Override
public __struct__ getStruct(String fieldName) {
- // if (fieldName.equals("LL")) {
- // return LL;
- // }
- // if (fieldName.equals("UR")) {
- // return UR;
- // }
+ if (fieldName.equals("LL")) {
+ return LL;
+ }
+ if (fieldName.equals("UR")) {
+ return UR;
+ }
return super.getStruct(fieldName);
}
@@ -158,6 +170,15 @@ public class ST_boxf extends UnsupportedStructAndPtr implements HardcodedStruct
return new Amp();
}
+ public static size_t sizeof(final int nb) {
+ return new UnsupportedSize_t(nb) {
+ @Override
+ public Object malloc() {
+ return new StarArrayOfPtr(new STArray<ST_boxf>(nb, 0, ST_boxf.class));
+ }
+ };
+ }
+
// public interface ST_boxf extends __ptr__ {
// public static List<String> DEFINITION = Arrays.asList(
// "typedef struct",
diff --git a/src/h/ST_deque_t.java b/src/h/ST_deque_t.java
new file mode 100644
index 0000000..816465a
--- /dev/null
+++ b/src/h/ST_deque_t.java
@@ -0,0 +1,133 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.HardcodedStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_deque_t extends UnsupportedStructAndPtr implements HardcodedStruct {
+
+ // "pointnlink_t **pnlps",
+ public __ptr__ pnlps;
+ public int pnlpn, fpnlpi, lpnlpi, apex;
+
+ public ST_deque_t() {
+ this(null);
+ }
+
+ public ST_deque_t(StarStruct parent) {
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("pnlps")) {
+ return pnlps;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("pnlps")) {
+ pnlps = newData;
+ return pnlps;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("pnlpn")) {
+ return pnlpn;
+ }
+ if (fieldName.equals("fpnlpi")) {
+ return fpnlpi;
+ }
+ if (fieldName.equals("lpnlpi")) {
+ return lpnlpi;
+ }
+ if (fieldName.equals("apex")) {
+ return apex;
+ }
+ return super.getInt(fieldName);
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("pnlpn")) {
+ pnlpn = data;
+ return;
+ }
+ if (fieldName.equals("fpnlpi")) {
+ fpnlpi = data;
+ return;
+ }
+ if (fieldName.equals("lpnlpi")) {
+ lpnlpi = data;
+ return;
+ }
+ if (fieldName.equals("apex")) {
+ apex = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "typedef struct deque_t",
+ // "{",
+ // "pointnlink_t **pnlps",
+ // "int pnlpn, fpnlpi, lpnlpi, apex",
+ // "}",
+ // "deque_t");
+}
+
+// typedef struct deque_t {
+// pointnlink_t **pnlps;
+// int pnlpn, fpnlpi, lpnlpi, apex;
+// } deque_t; \ No newline at end of file
diff --git a/src/h/ST_dt_s.java b/src/h/ST_dt_s.java
new file mode 100644
index 0000000..c130c5d
--- /dev/null
+++ b/src/h/ST_dt_s.java
@@ -0,0 +1,206 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.CFunction;
+import smetana.core.HardcodedStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_dt_s extends UnsupportedStructAndPtr implements HardcodedStruct {
+
+ public CFunction searchf;/* search function */
+
+ public ST_dtdisc_s.Amp disc; /* method to manipulate objs */
+ public ST_dtdata_s data; /* sharable data */
+ public CFunction memoryf;/* function to alloc/free memory */
+ public ST_dtmethod_s.Amp meth; /* dictionary method */
+
+ public int type; /* type information */
+ public int nview; /* number of parent view dictionaries */
+ public ST_dt_s view; /* next on viewpath */
+ public ST_dt_s walk; /* dictionary being walked */
+ public __ptr__ user; /* for user's usage */
+
+ public ST_dt_s() {
+ this(null);
+ }
+
+ public ST_dt_s(StarStruct parent) {
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("searchf")) {
+ this.searchf = (CFunction) newData;
+ return searchf;
+ }
+ if (fieldName.equals("meth")) {
+ this.meth = (ST_dtmethod_s.Amp) newData;
+ return meth;
+ }
+ if (fieldName.equals("disc")) {
+ this.disc = (ST_dtdisc_s.Amp) newData;
+ return disc;
+ }
+ if (fieldName.equals("memoryf")) {
+ this.memoryf = (CFunction) newData;
+ return memoryf;
+ }
+ if (fieldName.equals("view")) {
+ this.view = (ST_dt_s) newData;
+ return view;
+ }
+ if (fieldName.equals("walk")) {
+ this.walk = (ST_dt_s) newData;
+ return walk;
+ }
+ if (fieldName.equals("user")) {
+ this.user = newData;
+ return user;
+ }
+ if (fieldName.equals("data")) {
+ this.data = (ST_dtdata_s) newData;
+ return data;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("disc")) {
+ return disc;
+ }
+ if (fieldName.equals("data")) {
+ return data;
+ }
+ if (fieldName.equals("meth")) {
+ return meth;
+ }
+ if (fieldName.equals("view")) {
+ return view;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public Object call(String fieldName, Object... args) {
+ if (fieldName.equals("memoryf")) {
+ return this.memoryf.exe(args);
+ }
+ if (fieldName.equals("searchf")) {
+ return this.searchf.exe(args);
+ }
+ return super.call(fieldName, args);
+ }
+
+ @Override
+ public __ptr__ castTo(Class dest) {
+ if (dest == _dt_s.class) {
+ return this;
+ }
+ return super.castTo(dest);
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("type")) {
+ this.type = data;
+ return;
+ }
+ if (fieldName.equals("nview")) {
+ this.nview = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("type")) {
+ return type;
+ }
+ if (fieldName.equals("nview")) {
+ return nview;
+ }
+ return super.getInt(fieldName);
+ }
+
+ @Override
+ public boolean isSameThan(StarStruct other) {
+ ST_dt_s other2 = (ST_dt_s) other;
+ return this == other2;
+ }
+
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "struct _dt_s",
+ // "{",
+ // "Dtsearch_f searchf",
+ // "Dtdisc_t* disc",
+ // "Dtdata_t* data",
+ // "Dtmemory_f memoryf",
+ // "Dtmethod_t* meth",
+ // "int type",
+ // "int nview",
+ // "Dt_t* view",
+ // "Dt_t* walk",
+ // "void* user",
+ // "}");
+}
+
+// struct _dt_s
+// { Dtsearch_f searchf;/* search function */
+// Dtdisc_t* disc; /* method to manipulate objs */
+// Dtdata_t* data; /* sharable data */
+// Dtmemory_f memoryf;/* function to alloc/free memory */
+// Dtmethod_t* meth; /* dictionary method */
+// int type; /* type information */
+// int nview; /* number of parent view dictionaries */
+// Dt_t* view; /* next on viewpath */
+// Dt_t* walk; /* dictionary being walked */
+// void* user; /* for user's usage */
+// }; \ No newline at end of file
diff --git a/src/h/ST_dtdata_s.java b/src/h/ST_dtdata_s.java
new file mode 100644
index 0000000..4dfeba9
--- /dev/null
+++ b/src/h/ST_dtdata_s.java
@@ -0,0 +1,183 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import h.ST_dtdisc_s.Amp;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_dtdata_s extends UnsupportedStructAndPtr {
+
+ public int type; /* type of dictionary */
+ public ST_dtlink_s.Amp here; /* finger to last search element */
+ private __ptr__ _htab; /* hash table */
+ // Dtlink_t* _head; /* linked list */
+ // } hh;
+ public int ntab; /* number of hash slots */
+ public int size; /* number of objects */
+ public int loop; /* number of nested loops */
+ public int minp; /* min path before splay, always even */
+
+ private final StarStruct parent;
+
+ public ST_dtdata_s() {
+ this(null);
+ }
+
+ public ST_dtdata_s(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ public StarStruct getParent() {
+ return parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("here")) {
+ if (newData instanceof ST_dtlink_s) {
+ this.here = (ST_dtlink_s.Amp) ((ST_dtlink_s) newData).amp();
+ } else {
+ this.here = (ST_dtlink_s.Amp) newData;
+ }
+ return here;
+ }
+ if (fieldName.equals("hh._htab")) {
+ this._htab = newData;
+ return _htab;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("here")) {
+ return here;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("type")) {
+ this.type = data;
+ return;
+ }
+ if (fieldName.equals("ntab")) {
+ this.ntab = data;
+ return;
+ }
+ if (fieldName.equals("size")) {
+ this.size = data;
+ return;
+ }
+ if (fieldName.equals("loop")) {
+ this.loop = data;
+ return;
+ }
+ if (fieldName.equals("minp")) {
+ this.minp = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("type")) {
+ return type;
+ }
+ if (fieldName.equals("size")) {
+ return size;
+ }
+ if (fieldName.equals("minp")) {
+ return minp;
+ }
+ return super.getInt(fieldName);
+ }
+
+ // public interface ST_dtdata_s extends __ptr__ {
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "struct _dtdata_s",
+ // "{",
+ // "int type",
+ // "Dtlink_t* here",
+ // "union",
+ // "{",
+ // "Dtlink_t** _htab",
+ // "Dtlink_t* _head",
+ // "}",
+ // "hh",
+ // "int ntab",
+ // "int size",
+ // "int loop",
+ // "int minp",
+ // "}");
+}
+
+// struct _dtdata_s
+// { int type; /* type of dictionary */
+// Dtlink_t* here; /* finger to last search element */
+// union
+// { Dtlink_t** _htab; /* hash table */
+// Dtlink_t* _head; /* linked list */
+// } hh;
+// int ntab; /* number of hash slots */
+// int size; /* number of objects */
+// int loop; /* number of nested loops */
+// int minp; /* min path before splay, always even */
+// /* for hash dt, > 0: fixed table size */
+// }; \ No newline at end of file
diff --git a/src/h/ST_dtdisc_s.java b/src/h/ST_dtdisc_s.java
index 43af69a..4998a7a 100644
--- a/src/h/ST_dtdisc_s.java
+++ b/src/h/ST_dtdisc_s.java
@@ -45,6 +45,7 @@
*/
package h;
+import h.ST_dtmethod_s.Amp;
import smetana.core.CFunction;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr;
@@ -70,8 +71,12 @@ public class ST_dtdisc_s extends UnsupportedStructAndPtr {
this(null);
}
- class Amp extends UnsupportedStarStruct {
+ @Override
+ public StarStruct amp() {
+ return new Amp(this);
+ }
+ public class Amp extends UnsupportedStarStruct {
private final ST_dtdisc_s parent;
public Amp(ST_dtdisc_s me) {
@@ -123,12 +128,6 @@ public class ST_dtdisc_s extends UnsupportedStructAndPtr {
}
return super.setPtr(fieldName, newData);
}
-
- }
-
- @Override
- public StarStruct amp() {
- return new Amp(this);
}
}
diff --git a/src/h/ST_dthold_s.java b/src/h/ST_dthold_s.java
new file mode 100644
index 0000000..50c8e68
--- /dev/null
+++ b/src/h/ST_dthold_s.java
@@ -0,0 +1,115 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_dthold_s extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_dthold_s() {
+ this(null);
+ }
+
+ public ST_dthold_s(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ // "struct _dthold_s",
+ // "{",
+ // "Dtlink_t hdr",
+ // "void* obj",
+ private final ST_dtlink_s hdr = new ST_dtlink_s(this);
+ private __ptr__ obj;
+
+ // "}");
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ }
+
+ @Override
+ public __ptr__ castTo(Class dest) {
+ if (dest == _dthold_s.class) {
+ return this;
+ }
+ if (dest == _dtlink_s.class) {
+ return hdr;
+ }
+ return super.castTo(dest);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("obj")) {
+ this.obj = newData;
+ return this.obj;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("obj")) {
+ return this.obj;
+ }
+ return super.getPtr(fieldName);
+ }
+}
+
+// struct _dthold_s
+// { Dtlink_t hdr; /* header */
+// void* obj; /* user object */
+// }; \ No newline at end of file
diff --git a/src/h/ST_dtlink_s.java b/src/h/ST_dtlink_s.java
new file mode 100644
index 0000000..a7ce688
--- /dev/null
+++ b/src/h/ST_dtlink_s.java
@@ -0,0 +1,227 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.OFFSET;
+import smetana.core.UnsupportedC;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.__struct__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_dtlink_s extends UnsupportedStructAndPtr implements WithParent {
+
+ public ST_dtlink_s.Amp right;
+ public ST_dtlink_s.Amp _left;
+ private final StarStruct parent;
+
+ @Override
+ public void copyDataFrom(__struct__ other) {
+ ST_dtlink_s this2 = (ST_dtlink_s) other;
+ this.right = this2.right;
+ this._left = this2._left;
+ }
+
+ public ST_dtlink_s() {
+ this(null);
+ }
+
+ public ST_dtlink_s(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ public StarStruct getParent() {
+ return parent;
+ }
+
+ @Override
+ public __ptr__ castTo(Class dest) {
+ if (dest == _dtlink_s.class) {
+ return amp();
+ // return this;
+ }
+ if (dest == _dthold_s.class) {
+ return new LinkTo_dthold_s();
+ }
+ return super.castTo(dest);
+ }
+
+ class LinkTo_dthold_s extends UnsupportedStructAndPtr {
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("obj")) {
+ return new LinkTo_Obj();
+ }
+ return super.getPtr(fieldName);
+ }
+
+ }
+
+ class LinkTo_Obj extends UnsupportedStructAndPtr {
+
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+ @Override
+ public __ptr__ castTo(Class dest) {
+ if (dest == _dtlink_s.class) {
+ return this;
+ }
+ if (dest == refstr_t.class && getParent() instanceof ST_refstr_t) {
+ return (ST_refstr_t) getParent();
+ }
+ if (dest == _dthold_s.class && getParent() instanceof ST_dthold_s) {
+ // System.err.println("ITSME");
+ // System.err.println("getParent()=" + getParent());
+ return (ST_dthold_s) getParent();
+
+ }
+ System.err.println("dest=" + dest);
+ return super.castTo(dest);
+ }
+
+ @Override
+ public Object addVirtualBytes(int virtualBytes) {
+ if (virtualBytes == 0) {
+ return this;
+ }
+ if (virtualBytes < 0) {
+ final OFFSET offset = OFFSET.fromInt(-virtualBytes);
+ if (offset.toString().equals("h.Agsubnode_s::id_link")) {
+ return ((ST_Agsubnode_s) parent).from_id_link(ST_dtlink_s.this);
+ }
+ if (offset.toString().equals("h.Agsubnode_s::seq_link")) {
+ return ((ST_Agsubnode_s) parent).from_seq_link(ST_dtlink_s.this);
+ }
+ if (offset.toString().equals("h.Agsym_s::link")) {
+ return ((ST_Agsym_s) parent).from_link(ST_dtlink_s.this);
+ }
+ if (offset.toString().equals("h.Agedge_s::seq_link")) {
+ return ((ST_Agedge_s) parent).from_seq_link(ST_dtlink_s.this);
+ }
+ if (offset.toString().equals("h.Agedge_s::id_link")) {
+ return ((ST_Agedge_s) parent).from_id_link(ST_dtlink_s.this);
+ }
+ if (offset.toString().equals("h.Agraph_s::link")) {
+ return ((ST_Agraph_s) parent).from_link(ST_dtlink_s.this);
+ }
+ System.err.println("virtualBytes=" + virtualBytes);
+ System.err.println("offset=" + offset);
+ return super.addVirtualBytes(virtualBytes);
+ }
+ final OFFSET offset = OFFSET.fromInt(virtualBytes);
+ if (offset.toString().equals("h.refstr_t::s") && parent instanceof ST_refstr_t) {
+ return ((ST_refstr_t) parent).to_s(ST_dtlink_s.this);
+
+ }
+ System.err.println("virtualBytes=" + virtualBytes);
+ System.err.println("offset=" + offset);
+ return super.addVirtualBytes(virtualBytes);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ return ST_dtlink_s.this.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ return ST_dtlink_s.this.getPtr(fieldName);
+ }
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("hl._left")) {
+ this._left = (ST_dtlink_s.Amp) newData;
+ return _left;
+ }
+ if (fieldName.equals("right")) {
+ this.right = (ST_dtlink_s.Amp) newData;
+ return right;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("hl._left")) {
+ return _left;
+ }
+ if (fieldName.equals("right")) {
+ return right;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ // public interface ST_dtlink_s extends __ptr__ {
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "struct _dtlink_s",
+ // "{",
+ // "Dtlink_t* right",
+ // "union",
+ // "{",
+ // "unsigned int _hash",
+ // "Dtlink_t* _left",
+ // "}",
+ // "hl",
+ // "}");
+}
+
+// struct _dtlink_s
+// { Dtlink_t* right; /* right child */
+// union
+// { unsigned int _hash; /* hash value */
+// Dtlink_t* _left; /* left child */
+// } hl;
+// }; \ No newline at end of file
diff --git a/src/h/ST_dtmethod_s.java b/src/h/ST_dtmethod_s.java
index 7bf33f2..d237f09 100644
--- a/src/h/ST_dtmethod_s.java
+++ b/src/h/ST_dtmethod_s.java
@@ -47,11 +47,11 @@ package h;
import smetana.core.CFunction;
import smetana.core.UnsupportedStarStruct;
-import smetana.core.UnsupportedStruct;
+import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__ptr__;
import smetana.core.amiga.StarStruct;
-public class ST_dtmethod_s extends UnsupportedStruct {
+public class ST_dtmethod_s extends UnsupportedStructAndPtr {
public CFunction searchf;
public int type;
@@ -72,30 +72,33 @@ public class ST_dtmethod_s extends UnsupportedStruct {
@Override
public StarStruct amp() {
- return new UnsupportedStarStruct() {
- @Override
- public int getInt(String fieldName) {
- if (fieldName.equals("type")) {
- return type;
- }
- return super.getInt(fieldName);
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("type")) {
+ return type;
}
+ return super.getInt(fieldName);
+ }
- @Override
- public __ptr__ getPtr(String fieldName) {
- if (fieldName.equals("searchf")) {
- return searchf;
- }
- return super.getPtr(fieldName);
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("searchf")) {
+ return searchf;
}
+ return super.getPtr(fieldName);
+ }
- @Override
- public Object call(String fieldName, Object... args) {
- if (fieldName.equals("searchf")) {
- return searchf.exe(args);
- }
- return super.call(fieldName, args);
+ @Override
+ public Object call(String fieldName, Object... args) {
+ if (fieldName.equals("searchf")) {
+ return searchf.exe(args);
}
- };
+ return super.call(fieldName, args);
+ }
}
+
} \ No newline at end of file
diff --git a/src/h/ST_fontinfo.java b/src/h/ST_fontinfo.java
new file mode 100644
index 0000000..f7e3392
--- /dev/null
+++ b/src/h/ST_fontinfo.java
@@ -0,0 +1,164 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.CString;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_fontinfo extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_fontinfo() {
+ this(null);
+ }
+
+ public ST_fontinfo(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ @Override
+ public void setDouble(String fieldName, double data) {
+ ST_fontinfo.this.setDouble(fieldName, data);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ return ST_fontinfo.this.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ return ST_fontinfo.this.getPtr(fieldName);
+ }
+
+ @Override
+ public double getDouble(String fieldName) {
+ return ST_fontinfo.this.getDouble(fieldName);
+ }
+
+ @Override
+ public CString getCString(String fieldName) {
+ return ST_fontinfo.this.getCString(fieldName);
+ }
+
+ }
+
+ // "struct fontinfo",
+ // "{",
+ private double fontsize;
+ private CString fontname;
+ private CString fontcolor;
+
+ // "}");
+
+ @Override
+ public double getDouble(String fieldName) {
+ if (fieldName.equals("fontsize")) {
+ return this.fontsize;
+ }
+ return super.getDouble(fieldName);
+ }
+
+ @Override
+ public void setDouble(String fieldName, double data) {
+ if (fieldName.equals("fontsize")) {
+ this.fontsize = data;
+ return;
+ }
+ super.setDouble(fieldName, data);
+ }
+
+ @Override
+ public CString getCString(String fieldName) {
+ if (fieldName.equals("fontname")) {
+ return this.fontname;
+ }
+ if (fieldName.equals("fontcolor")) {
+ return this.fontcolor;
+ }
+ return super.getCString(fieldName);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("fontname")) {
+ return this.fontname;
+ }
+ if (fieldName.equals("fontcolor")) {
+ return this.fontcolor;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("fontname")) {
+ return this.fontname;
+ }
+ if (fieldName.equals("fontcolor")) {
+ return this.fontcolor;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+}
+
+// struct fontinfo {
+// double fontsize;
+// char *fontname;
+// char *fontcolor;
+// }; \ No newline at end of file
diff --git a/src/h/ST_gvlayout_engine_s.java b/src/h/ST_gvlayout_engine_s.java
new file mode 100644
index 0000000..094212a
--- /dev/null
+++ b/src/h/ST_gvlayout_engine_s.java
@@ -0,0 +1,117 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.CFunction;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_gvlayout_engine_s extends UnsupportedStructAndPtr {
+
+ private CFunction layout;
+ private CFunction cleanup;
+
+ // "struct gvlayout_engine_s",
+ // "{",
+ // "void (*layout) (graph_t * g)",
+ // "void (*cleanup) (graph_t * g)",
+ // "}");
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("layout")) {
+ this.layout = (CFunction) newData;
+ return newData;
+ }
+ if (fieldName.equals("cleanup")) {
+ this.cleanup = (CFunction) newData;
+ return newData;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("layout")) {
+ return layout;
+ }
+ if (fieldName.equals("cleanup")) {
+ return cleanup;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ return ST_gvlayout_engine_s.this.getPtr(fieldName);
+ }
+
+ @Override
+ public Object call(String fieldName, Object... args) {
+ if (fieldName.equals("layout")) {
+ return layout.exe(args);
+ }
+ if (fieldName.equals("cleanup")) {
+ return cleanup.exe(args);
+ }
+ return super.call(fieldName, args);
+ }
+ }
+}
+
+// struct gvlayout_engine_s {
+// void (*layout) (graph_t * g);
+// void (*cleanup) (graph_t * g);
+// }; \ No newline at end of file
diff --git a/src/h/ST_gvlayout_features_t.java b/src/h/ST_gvlayout_features_t.java
new file mode 100644
index 0000000..05cdfd4
--- /dev/null
+++ b/src/h/ST_gvlayout_features_t.java
@@ -0,0 +1,90 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.amiga.StarStruct;
+
+public class ST_gvlayout_features_t extends UnsupportedStructAndPtr {
+
+ // "typedef struct",
+ // "{",
+ private int flags;
+
+ // "}",
+ // "gvlayout_features_t");
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("flags")) {
+ this.flags = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("flags")) {
+ return flags;
+ }
+ return super.getInt(fieldName);
+ }
+ }
+
+}
+
+// typedef struct {
+// int flags;
+// } gvlayout_features_t; \ No newline at end of file
diff --git a/src/h/ST_gvplugin_active_layout_t.java b/src/h/ST_gvplugin_active_layout_t.java
new file mode 100644
index 0000000..9b602ae
--- /dev/null
+++ b/src/h/ST_gvplugin_active_layout_t.java
@@ -0,0 +1,104 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.CString;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+
+public class ST_gvplugin_active_layout_t extends UnsupportedStructAndPtr {
+
+ private ST_gvlayout_engine_s.Amp engine;
+ private int id;
+ private ST_gvlayout_features_t.Amp features;
+ private CString type;
+
+ // "}",
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("type")) {
+ this.type = (CString) newData;
+ return newData;
+ }
+ if (fieldName.equals("engine")) {
+ this.engine = (ST_gvlayout_engine_s.Amp) newData;
+ return newData;
+ }
+ if (fieldName.equals("features")) {
+ this.features = (ST_gvlayout_features_t.Amp) newData;
+ return newData;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("engine")) {
+ return engine;
+ }
+ if (fieldName.equals("features")) {
+ return features;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("id")) {
+ this.id = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+}
+
+// typedef struct gvplugin_active_layout_s {
+// gvlayout_engine_t *engine;
+// int id;
+// gvlayout_features_t *features;
+// const char *type;
+// } gvplugin_active_layout_t; \ No newline at end of file
diff --git a/src/h/ST_gvplugin_installed_t.java b/src/h/ST_gvplugin_installed_t.java
new file mode 100644
index 0000000..f07d223
--- /dev/null
+++ b/src/h/ST_gvplugin_installed_t.java
@@ -0,0 +1,140 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.CString;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_gvplugin_installed_t extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_gvplugin_installed_t() {
+ this(null);
+ }
+
+ public ST_gvplugin_installed_t(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ private int id;
+ private CString type;
+ private int quality;
+
+ private ST_gvlayout_engine_s.Amp engine;
+ private ST_gvlayout_features_t.Amp features;
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("id")) {
+ this.id = data;
+ return;
+ }
+ if (fieldName.equals("quality")) {
+ this.quality = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("id")) {
+ return this.id;
+ }
+ return super.getInt(fieldName);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("type")) {
+ this.type = (CString) newData;
+ return newData;
+ }
+ if (fieldName.equals("engine")) {
+ this.engine = (ST_gvlayout_engine_s.Amp) newData;
+ return newData;
+ }
+ if (fieldName.equals("features")) {
+ this.features = (ST_gvlayout_features_t.Amp) newData;
+ return newData;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("type")) {
+ return type;
+ }
+ if (fieldName.equals("engine")) {
+ return engine;
+ }
+ if (fieldName.equals("features")) {
+ return features;
+ }
+ return super.getPtr(fieldName);
+ }
+
+}
+
+// typedef struct {
+// int id; /* an id that is only unique within a package
+// of plugins of the same api.
+// A renderer-type such as "png" in the cairo package
+// has an id that is different from the "ps" type
+// in the same package */
+// const char *type; /* a string name, such as "png" or "ps" that
+// distinguishes different types withing the same
+// (renderer in this case) */
+// int quality; /* an arbitrary integer used for ordering plugins of
+// the same type from different packages */
+// void *engine; /* pointer to the jump table for the plugin */
+// void *features; /* pointer to the feature description
+// void* because type varies by api */
+// } gvplugin_installed_t; \ No newline at end of file
diff --git a/src/h/ST_inside_t.java b/src/h/ST_inside_t.java
new file mode 100644
index 0000000..9cbdc76
--- /dev/null
+++ b/src/h/ST_inside_t.java
@@ -0,0 +1,150 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.MutableDoublePtr;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarArrayOfStruct;
+import smetana.core.amiga.StarStruct;
+
+public class ST_inside_t extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_inside_t() {
+ this(null);
+ }
+
+ public ST_inside_t(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ // "typedef union inside_t",
+ // "{",
+ // "struct",
+ // "{",
+ // "pointf* p",
+ private StarArrayOfStruct p;
+ private MutableDoublePtr r;
+ // "double* r",
+ // "}",
+ // "a",
+ // "struct",
+ // "{",
+ // "node_t* n",
+ private ST_Agnode_s n;
+ private ST_boxf bp;
+
+ // "boxf* bp",
+ // "}",
+ // "s",
+ // "}",
+ // "inside_t");
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ return ST_inside_t.this.getPtr(fieldName);
+ }
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("s.n")) {
+ this.n = (ST_Agnode_s) newData;
+ return this.n;
+ }
+ if (fieldName.equals("s.bp")) {
+ this.bp = (ST_boxf) newData;
+ return this.bp;
+ }
+ if (fieldName.equals("a.p")) {
+ this.p = (StarArrayOfStruct) newData;
+ return this.p;
+ }
+ if (fieldName.equals("a.r")) {
+ this.r = (MutableDoublePtr) newData;
+ return this.r;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("s.n")) {
+ return this.n;
+ }
+ if (fieldName.equals("s.bp")) {
+ return this.bp;
+ }
+ if (fieldName.equals("a.p")) {
+ return this.p;
+ }
+ if (fieldName.equals("a.r")) {
+ return this.r;
+ }
+ return super.getPtr(fieldName);
+ }
+
+}
+
+// typedef union inside_t {
+// struct {
+// pointf* p;
+// double* r;
+// } a;
+// struct {
+// node_t* n;
+// boxf* bp;
+// } s;
+// } inside_t; \ No newline at end of file
diff --git a/src/h/ST_label_params_t.java b/src/h/ST_label_params_t.java
new file mode 100644
index 0000000..0da6975
--- /dev/null
+++ b/src/h/ST_label_params_t.java
@@ -0,0 +1,110 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import h.ST_label_params_t.Amp;
+
+import java.util.Arrays;
+import java.util.List;
+
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.__struct__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_label_params_t extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_label_params_t() {
+ this(null);
+ }
+
+ public ST_label_params_t(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ // "typedef struct",
+ // "{",
+ private final ST_boxf bb = new ST_boxf(this);
+ private boolean force;
+
+ // "}",
+ // "label_params_t");
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ }
+
+ @Override
+ public void setStruct(String fieldName, __struct__ newData) {
+ if (fieldName.equals("bb")) {
+ this.bb.copyDataFrom(newData);
+ return;
+ }
+ super.setStruct(fieldName, newData);
+ }
+
+ @Override
+ public void setBoolean(String fieldName, boolean data) {
+ if (fieldName.equals("force")) {
+ this.force = data;
+ return;
+ }
+ super.setBoolean(fieldName, data);
+ }
+}
+
+// typedef struct {
+// boxf bb; /* Bounding box of all objects */
+// unsigned char force; /* If true, all labels must be placed */
+// } label_params_t; \ No newline at end of file
diff --git a/src/h/ST_layout_t.java b/src/h/ST_layout_t.java
new file mode 100644
index 0000000..fdd4a1e
--- /dev/null
+++ b/src/h/ST_layout_t.java
@@ -0,0 +1,192 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.__struct__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_layout_t extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_layout_t() {
+ this(null);
+ }
+
+ public ST_layout_t(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+ }
+
+ private double quantum;
+ private double scale;
+ private double ratio;
+ private double dpi;
+
+ private ST_pointf margin = new ST_pointf(this);
+ private ST_pointf page = new ST_pointf(this);
+ private ST_pointf size = new ST_pointf(this);
+
+ private boolean filled;
+ private boolean landscape;
+ private boolean centered;
+
+ // "ratio_t ratio_kind",
+ private int ratio_kind;
+ // "void* xdots",
+ // "char* id",
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("xdots") && newData == null) {
+ return null;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __struct__ getStruct(String fieldName) {
+ if (fieldName.equals("margin")) {
+ return margin;
+ }
+ if (fieldName.equals("page")) {
+ return page;
+ }
+ if (fieldName.equals("size")) {
+ return size;
+ }
+ return super.getStruct(fieldName);
+ }
+
+ @Override
+ public void setBoolean(String fieldName, boolean data) {
+ if (fieldName.equals("filled")) {
+ this.filled = data;
+ return;
+ }
+ if (fieldName.equals("landscape")) {
+ this.landscape = data;
+ return;
+ }
+ if (fieldName.equals("centered")) {
+ this.centered = data;
+ return;
+ }
+ super.setBoolean(fieldName, data);
+ }
+
+ @Override
+ public double getDouble(String fieldName) {
+ if (fieldName.equals("quantum")) {
+ return this.quantum;
+ }
+ if (fieldName.equals("scale")) {
+ return this.scale;
+ }
+ if (fieldName.equals("ratio")) {
+ return this.ratio;
+ }
+ if (fieldName.equals("dpi")) {
+ return this.dpi;
+ }
+ return super.getDouble(fieldName);
+ }
+
+ @Override
+ public void setDouble(String fieldName, double data) {
+ if (fieldName.equals("quantum")) {
+ this.quantum = data;
+ return;
+ }
+ if (fieldName.equals("scale")) {
+ this.scale = data;
+ return;
+ }
+ if (fieldName.equals("ratio")) {
+ this.ratio = data;
+ return;
+ }
+ if (fieldName.equals("dpi")) {
+ this.dpi = data;
+ return;
+ }
+ super.setDouble(fieldName, data);
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("ratio_kind")) {
+ return this.ratio_kind;
+ }
+ return super.getInt(fieldName);
+ }
+}
+
+// typedef struct layout_t {
+// double quantum;
+// double scale;
+// double ratio; /* set only if ratio_kind == R_VALUE */
+// double dpi;
+// pointf margin;
+// pointf page;
+// pointf size;
+// boolean filled;
+// boolean landscape;
+// boolean centered;
+// ratio_t ratio_kind;
+// void* xdots;
+// char* id;
+// } layout_t; \ No newline at end of file
diff --git a/src/h/ST_nodequeue.java b/src/h/ST_nodequeue.java
new file mode 100644
index 0000000..d6918cd
--- /dev/null
+++ b/src/h/ST_nodequeue.java
@@ -0,0 +1,145 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__array_of_ptr__;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarArrayOfPtr;
+import smetana.core.amiga.StarStruct;
+
+public class ST_nodequeue extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_nodequeue() {
+ this(null);
+ }
+
+ public ST_nodequeue(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ }
+
+ // "typedef struct nodequeue",
+ // "{",
+ // "node_t **store, **limit, **head, **tail",
+ private StarArrayOfPtr store;
+ private StarArrayOfPtr tail;
+ private StarArrayOfPtr head;
+ private StarArrayOfPtr limit;
+
+ // "}",
+ // "nodequeue");
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("store")) {
+ this.store = (StarArrayOfPtr) newData;
+ return this.store;
+ }
+ if (fieldName.equals("tail")) {
+ this.tail = (StarArrayOfPtr) newData;
+ return this.tail;
+ }
+ if (fieldName.equals("head")) {
+ this.head = (StarArrayOfPtr) newData;
+ return this.head;
+ }
+ if (fieldName.equals("limit")) {
+ this.limit = (StarArrayOfPtr) newData;
+ return this.limit;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __array_of_ptr__ getArrayOfPtr(String fieldName) {
+ if (fieldName.equals("store")) {
+ return this.store.getInternalArray();
+ }
+ if (fieldName.equals("tail")) {
+ return this.tail.getInternalArray();
+ }
+ if (fieldName.equals("head")) {
+ return this.head.getInternalArray();
+ }
+ if (fieldName.equals("limit")) {
+ return this.limit.getInternalArray();
+ }
+ return super.getArrayOfPtr(fieldName);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("store")) {
+ return this.store;
+ }
+ if (fieldName.equals("tail")) {
+ return this.tail;
+ }
+ if (fieldName.equals("head")) {
+ return this.head;
+ }
+ if (fieldName.equals("limit")) {
+ return this.limit;
+ }
+ return super.getPtr(fieldName);
+ }
+}
+
+// typedef struct nodequeue {
+// node_t **store, **limit, **head, **tail;
+// } nodequeue; \ No newline at end of file
diff --git a/src/h/ST_object_t.java b/src/h/ST_object_t.java
new file mode 100644
index 0000000..8a3c45e
--- /dev/null
+++ b/src/h/ST_object_t.java
@@ -0,0 +1,168 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import h.ST_object_t.Amp;
+
+import java.util.Arrays;
+import java.util.List;
+
+import smetana.core.UnsupportedSize_t;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.__struct__;
+import smetana.core.size_t;
+import smetana.core.amiga.StarArrayOfPtr;
+import smetana.core.amiga.StarStruct;
+
+public class ST_object_t extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_object_t() {
+ this(null);
+ }
+
+ public ST_object_t(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ // "typedef struct",
+ // "{",
+ private final ST_pointf pos = new ST_pointf(this);
+ private final ST_pointf sz = new ST_pointf(this);
+ // "xlabel_t *lbl",
+ private StarArrayOfPtr lbl;
+
+ // "}",
+ // "object_t");
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("pos")) {
+ this.pos.copyDataFrom(newData);
+ return newData;
+ }
+ if (fieldName.equals("lbl")) {
+ this.lbl = (StarArrayOfPtr) newData;
+ return this.lbl;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __struct__ getStruct(String fieldName) {
+ if (fieldName.equals("pos")) {
+ return this.pos;
+ }
+ if (fieldName.equals("sz")) {
+ return this.sz;
+ }
+ return super.getStruct(fieldName);
+ }
+
+ @Override
+ public void setStruct(String fieldName, __struct__ newData) {
+ if (fieldName.equals("pos")) {
+ this.pos.copyDataFrom(newData);
+ return;
+ }
+ if (fieldName.equals("sz")) {
+ this.sz.copyDataFrom(newData);
+ return;
+ }
+ super.setStruct(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("pos")) {
+ return this.pos;
+ }
+ if (fieldName.equals("sz")) {
+ return this.sz;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ public static size_t sizeof(final int nb) {
+ return new UnsupportedSize_t(nb) {
+ @Override
+ public Object malloc() {
+ return new StarArrayOfPtr(new STArray<ST_object_t>(nb, 0, ST_object_t.class));
+ }
+
+ @Override
+ public int getInternalNb() {
+ return nb;
+ }
+
+ @Override
+ public Object realloc(Object old) {
+ StarArrayOfPtr old2 = (StarArrayOfPtr) old;
+ old2.realloc(nb);
+ return old2;
+ }
+ };
+ }
+
+}
+
+// typedef struct {
+// pointf pos; /* Position of lower-left corner of object */
+// pointf sz; /* Size of object; may be zero for a point */
+// xlabel_t *lbl; /* Label attached to object, or NULL */
+// } object_t; \ No newline at end of file
diff --git a/src/h/ST_pack_info.java b/src/h/ST_pack_info.java
new file mode 100644
index 0000000..5aae6d5
--- /dev/null
+++ b/src/h/ST_pack_info.java
@@ -0,0 +1,161 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import h.ST_pack_info.Amp;
+
+import java.util.Arrays;
+import java.util.List;
+
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_pack_info extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_pack_info() {
+ this(null);
+ }
+
+ public ST_pack_info(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ }
+
+ // "typedef struct",
+ // "{",
+ // "float aspect",
+ private int sz;
+ private int margin;
+ private int doSplines;
+ // "pack_mode mode",
+ private int mode;
+ private __ptr__ fixed;
+ // "boolean *fixed",
+ // "packval_t* vals",
+ private __ptr__ vals;
+ private int flags;
+
+ // "}",
+ // "pack_info");
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("flags")) {
+ return this.flags;
+ }
+ if (fieldName.equals("mode")) {
+ return this.mode;
+ }
+ if (fieldName.equals("sz")) {
+ return this.sz;
+ }
+ if (fieldName.equals("margin")) {
+ return this.margin;
+ }
+ return super.getInt(fieldName);
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("flags")) {
+ this.flags = data;
+ return;
+ }
+ if (fieldName.equals("mode")) {
+ this.mode = data;
+ return;
+ }
+ if (fieldName.equals("sz")) {
+ this.sz = data;
+ return;
+ }
+ if (fieldName.equals("margin")) {
+ this.margin = data;
+ return;
+ }
+ if (fieldName.equals("doSplines")) {
+ this.doSplines = data;
+ return;
+ }
+ if (fieldName.equals("fixed") && data == 0) {
+ this.fixed = null;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("vals") && newData == null) {
+ this.vals = newData;
+ return vals;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+}
+
+// typedef struct {
+// float aspect; /* desired aspect ratio */
+// int sz; /* row/column size size */
+// unsigned int margin; /* margin left around objects, in points */
+// int doSplines; /* use splines in constructing graph shape */
+// pack_mode mode; /* granularity and method */
+// boolean *fixed; /* fixed[i] == true implies g[i] should not be moved */
+// packval_t* vals; /* for arrays, sort numbers */
+// int flags;
+// } pack_info; \ No newline at end of file
diff --git a/src/h/ST_path.java b/src/h/ST_path.java
new file mode 100644
index 0000000..dc87643
--- /dev/null
+++ b/src/h/ST_path.java
@@ -0,0 +1,160 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__array_of_ptr__;
+import smetana.core.__ptr__;
+import smetana.core.__struct__;
+import smetana.core.amiga.StarArrayOfPtr;
+import smetana.core.amiga.StarStruct;
+
+public class ST_path extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_path() {
+ this(null);
+ }
+
+ public ST_path(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ }
+
+ // "typedef struct path",
+ // "{",
+ final ST_port start = new ST_port(this), end = new ST_port(this);
+ private int nbox;
+ // "boxf *boxes",
+ private StarArrayOfPtr boxes;
+
+ private ST_Agedge_s.Amp data;
+
+ // "void *data",
+ // "}",
+ // "path");
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("boxes")) {
+ this.boxes = (StarArrayOfPtr) newData;
+ return this.boxes;
+ }
+ if (fieldName.equals("data")) {
+ if (newData instanceof ST_Agedge_s) {
+ newData = ((ST_Agedge_s) newData).amp();
+ }
+ this.data = (ST_Agedge_s.Amp) newData;
+ return this.data;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("data")) {
+ return this.data;
+ }
+ if (fieldName.equals("boxes")) {
+ return this.boxes;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public __struct__ getStruct(String fieldName) {
+ if (fieldName.equals("start")) {
+ return start;
+ }
+ if (fieldName.equals("end")) {
+ return end;
+ }
+ return super.getStruct(fieldName);
+ }
+
+ @Override
+ public __array_of_ptr__ getArrayOfPtr(String fieldName) {
+ if (fieldName.equals("boxes")) {
+ return boxes.getInternalArray();
+ }
+ return super.getArrayOfPtr(fieldName);
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("nbox")) {
+ return this.nbox;
+ }
+ return super.getInt(fieldName);
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("nbox")) {
+ this.nbox = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+}
+
+// typedef struct path { /* internal specification for an edge spline */
+// port start, end;
+// int nbox; /* number of subdivisions */
+// boxf *boxes; /* rectangular regions of subdivision */
+// void *data;
+// } path; \ No newline at end of file
diff --git a/src/h/ST_pathend_t.java b/src/h/ST_pathend_t.java
new file mode 100644
index 0000000..9976232
--- /dev/null
+++ b/src/h/ST_pathend_t.java
@@ -0,0 +1,210 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.UnsupportedArrayOfStruct;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__array_of_struct__;
+import smetana.core.__struct__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_pathend_t extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_pathend_t() {
+ this(null);
+ }
+
+ public ST_pathend_t(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ // "typedef struct pathend_t",
+ // "{",
+ private final ST_boxf nb = new ST_boxf(this);
+ private final ST_pointf np = new ST_pointf(this);
+ private int sidemask;
+ private int boxn;
+
+ private final ST_boxf boxes[] = new ST_boxf[] { new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(),
+ new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(),
+ new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(),
+ new ST_boxf(), new ST_boxf() };
+
+ // "boxf boxes[20]",
+ // "}",
+ // "pathend_t");
+
+ class ArrayOfTwenty extends UnsupportedArrayOfStruct {
+
+ final private int pos;
+
+ public ArrayOfTwenty(int pos) {
+ this.pos = pos;
+ }
+
+ @Override
+ public __array_of_struct__ plus(int delta) {
+ return new ArrayOfTwenty(pos + delta);
+ }
+
+ @Override
+ public __struct__ getStruct() {
+ return boxes[pos];
+ }
+
+ @Override
+ public void setStruct(__struct__ value) {
+ boxes[pos].copyDataFrom(value);
+ }
+
+ @Override
+ public double getDouble(String fieldName) {
+ return getStruct().getDouble(fieldName);
+ }
+
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+ @Override
+ public void setStruct(String fieldName, __struct__ newData) {
+ ST_pathend_t.this.setStruct(fieldName, newData);
+ }
+
+ @Override
+ public __array_of_struct__ getArrayOfStruct(String fieldName) {
+ return ST_pathend_t.this.getArrayOfStruct(fieldName);
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ return ST_pathend_t.this.getInt(fieldName);
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ ST_pathend_t.this.setInt(fieldName, data);
+ }
+
+ @Override
+ public __struct__ getStruct(String fieldName) {
+ return ST_pathend_t.this.getStruct(fieldName);
+ }
+
+ }
+
+ @Override
+ public void setStruct(String fieldName, __struct__ newData) {
+ if (fieldName.equals("np")) {
+ this.np.___(newData);
+ return;
+ }
+ if (fieldName.equals("nb")) {
+ this.nb.___(newData);
+ return;
+ }
+ super.setStruct(fieldName, newData);
+ }
+
+ @Override
+ public __struct__ getStruct(String fieldName) {
+ if (fieldName.equals("nb")) {
+ return this.nb;
+ }
+ if (fieldName.equals("np")) {
+ return this.np;
+ }
+ return super.getStruct(fieldName);
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("boxn")) {
+ return this.boxn;
+ }
+ if (fieldName.equals("sidemask")) {
+ return this.sidemask;
+ }
+ return super.getInt(fieldName);
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("boxn")) {
+ this.boxn = data;
+ return;
+ }
+ if (fieldName.equals("sidemask")) {
+ this.sidemask = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+ @Override
+ public __array_of_struct__ getArrayOfStruct(String fieldName) {
+ if (fieldName.equals("boxes")) {
+ return new ArrayOfTwenty(0);
+ }
+ return super.getArrayOfStruct(fieldName);
+ }
+
+}
+
+// typedef struct pathend_t {
+// boxf nb; /* the node box */
+// pointf np; /* node port */
+// int sidemask;
+// int boxn;
+// boxf boxes[20];
+// } pathend_t; \ No newline at end of file
diff --git a/src/h/ST_point.java b/src/h/ST_point.java
new file mode 100644
index 0000000..8d0c580
--- /dev/null
+++ b/src/h/ST_point.java
@@ -0,0 +1,122 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__struct__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_point extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_point() {
+ this(null);
+ }
+
+ public ST_point(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ }
+
+ // "typedef struct",
+ // "{",
+ private int x, y;
+
+ // "}",
+ // "point");
+
+ @Override
+ public __struct__ copy() {
+ final ST_point result = new ST_point();
+ result.x = this.x;
+ result.y = this.y;
+ return result;
+ }
+
+ @Override
+ public void ___(__struct__ other) {
+ ST_point this2 = (ST_point) other;
+ this.x = this2.x;
+ this.y = this2.y;
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("x")) {
+ return this.x;
+ }
+ if (fieldName.equals("y")) {
+ return this.y;
+ }
+ return super.getInt(fieldName);
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("x")) {
+ this.x = data;
+ return;
+ }
+ if (fieldName.equals("y")) {
+ this.y = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+}
+
+// typedef struct { int x, y; } point; \ No newline at end of file
diff --git a/src/h/ST_pointf.java b/src/h/ST_pointf.java
index 111c293..d4d426a 100644
--- a/src/h/ST_pointf.java
+++ b/src/h/ST_pointf.java
@@ -46,11 +46,13 @@
package h;
import smetana.core.HardcodedStruct;
+import smetana.core.UnsupportedSize_t;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__array_of_ptr__;
import smetana.core.__ptr__;
import smetana.core.__struct__;
+import smetana.core.size_t;
import smetana.core.amiga.Area;
import smetana.core.amiga.StarArrayOfPtr;
import smetana.core.amiga.StarArrayOfStruct;
@@ -97,6 +99,12 @@ public class ST_pointf extends UnsupportedStructAndPtr implements HardcodedStruc
public void setStruct(__struct__ value) {
ST_pointf.this.setStruct(value);
}
+
+ @Override
+ public boolean isSameThan(StarStruct other) {
+ ST_pointf.Amp other2 = (Amp) other;
+ return this.getStruct() == other2.getStruct();
+ }
}
@Override
@@ -113,6 +121,18 @@ public class ST_pointf extends UnsupportedStructAndPtr implements HardcodedStruc
this.x = other2.x;
this.y = other2.y;
}
+
+ @Override
+ public void copyDataFrom(__ptr__ value) {
+ final ST_pointf other2 = (ST_pointf) value;
+ this.x = other2.x;
+ this.y = other2.y;
+ }
+
+ @Override
+ public __struct__ getStruct() {
+ return this;
+ }
@Override
public void memcopyFrom(Area source) {
@@ -199,6 +219,27 @@ public class ST_pointf extends UnsupportedStructAndPtr implements HardcodedStruc
public ST_pointf(StarStruct parent) {
}
+ public static size_t sizeof(final int nb) {
+ return new UnsupportedSize_t(nb) {
+ @Override
+ public Object malloc() {
+ return new StarArrayOfPtr(new STArray<ST_pointf>(nb, 0, ST_pointf.class));
+ }
+
+ @Override
+ public int getInternalNb() {
+ return nb;
+ }
+
+ @Override
+ public Object realloc(Object old) {
+ StarArrayOfPtr old2 = (StarArrayOfPtr) old;
+ old2.realloc(nb);
+ return old2;
+ }
+ };
+ }
+
// public interface ST_pointf extends __ptr__ {
// public static List<String> DEFINITION = Arrays.asList(
// "typedef struct pointf_s",
diff --git a/src/h/ST_pointnlink_t.java b/src/h/ST_pointnlink_t.java
new file mode 100644
index 0000000..12285b6
--- /dev/null
+++ b/src/h/ST_pointnlink_t.java
@@ -0,0 +1,233 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.HardcodedStruct;
+import smetana.core.UnsupportedSize_t;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.__struct__;
+import smetana.core.size_t;
+import smetana.core.amiga.StarArrayOfPtr;
+import smetana.core.amiga.StarArrayOfStruct;
+import smetana.core.amiga.StarStruct;
+
+public class ST_pointnlink_t extends UnsupportedStructAndPtr implements HardcodedStruct {
+
+ public ST_pointf.Amp pp;
+ public ST_pointnlink_t.Amp link;
+
+ public ST_pointnlink_t() {
+ this(null);
+ }
+
+ public ST_pointnlink_t(StarStruct parent) {
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("pp")) {
+ return pp;
+ }
+ if (fieldName.equals("link")) {
+ return link;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public __struct__ getStruct() {
+ return ST_pointnlink_t.this;
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ return ST_pointnlink_t.this.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public boolean isSameThan(StarStruct other) {
+ ST_pointnlink_t.Amp other2 = (Amp) other;
+ return this.getStruct() == other2.getStruct();
+ }
+
+ @Override
+ public Class getRealClass() {
+ return ST_pointnlink_t.class;
+ }
+
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("pp")) {
+ return pp;
+ }
+ if (fieldName.equals("link")) {
+ return link;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("pp")) {
+ if (newData instanceof StarArrayOfPtr) {
+ StarArrayOfPtr tmp = (StarArrayOfPtr) newData;
+ ST_pointf data = (ST_pointf) tmp.getStruct();
+ pp = (ST_pointf.Amp) data.amp();
+ return pp;
+ }
+ if (newData instanceof StarArrayOfStruct) {
+ StarArrayOfStruct tmp = (StarArrayOfStruct) newData;
+ ST_pointf data = (ST_pointf) tmp.getStruct();
+ pp = (ST_pointf.Amp) data.amp();
+ return pp;
+ }
+ System.err.println("newData1=" + newData.getClass());
+ pp = (ST_pointf.Amp) newData;
+ return pp;
+ }
+ if (fieldName.equals("link")) {
+ if (newData == null) {
+ link = null;
+ return link;
+ }
+ if (newData instanceof StarArrayOfPtr) {
+ StarArrayOfPtr tmp = (StarArrayOfPtr) newData;
+ ST_pointnlink_t data = (ST_pointnlink_t) tmp.getStruct();
+ link = (ST_pointnlink_t.Amp) data.amp();
+ return link;
+ }
+ if (newData instanceof StarArrayOfStruct) {
+ StarArrayOfStruct tmp = (StarArrayOfStruct) newData;
+ ST_pointnlink_t data = (ST_pointnlink_t) tmp.getStruct();
+ link = (ST_pointnlink_t.Amp) data.amp();
+ return link;
+ }
+ if (newData instanceof ST_pointnlink_t.Amp) {
+ ST_pointnlink_t.Amp tmp = (ST_pointnlink_t.Amp) newData;
+ link = tmp;
+ return link;
+ }
+ System.err.println("newData2A=" + newData.getClass());
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public static size_t sizeof(final int nb) {
+ return new UnsupportedSize_t(nb) {
+ @Override
+ public Object malloc() {
+ return new StarArrayOfPtr(new STArray<ST_pointnlink_t>(nb, 0, ST_pointnlink_t.class));
+ }
+
+ @Override
+ public int getInternalNb() {
+ return nb;
+ }
+ };
+ }
+
+ @Override
+ public __struct__ getStruct() {
+ return this;
+ }
+
+ class StarStructAdaptor extends UnsupportedStarStruct {
+ private final ST_pointnlink_t me;
+
+ public StarStructAdaptor(ST_pointnlink_t me) {
+ this.me = me;
+ }
+
+ @Override
+ public boolean isSameThan(StarStruct other) {
+ StarStructAdaptor other2 = (StarStructAdaptor) other;
+ return this.me == other2.me;
+ }
+ }
+
+ @Override
+ public StarStruct getInternalData() {
+ return new StarStructAdaptor(this);
+ }
+
+ public static size_t sizeof_starstar_empty(final int nb) {
+ return new UnsupportedSize_t(nb) {
+ @Override
+ public Object malloc() {
+ return STStarArrayOfPointer.malloc(nb);
+ }
+
+ @Override
+ public int getInternalNb() {
+ return nb;
+ }
+ };
+ }
+
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "typedef struct pointnlink_t",
+ // "{",
+ // "Ppoint_t *pp",
+ // "struct pointnlink_t *link",
+ // "}",
+ // "pointnlink_t");
+}
+
+// typedef struct pointnlink_t {
+// Ppoint_t *pp;
+// struct pointnlink_t *link;
+// } pointnlink_t; \ No newline at end of file
diff --git a/src/h/ST_polygon_t.java b/src/h/ST_polygon_t.java
new file mode 100644
index 0000000..621fbb3
--- /dev/null
+++ b/src/h/ST_polygon_t.java
@@ -0,0 +1,221 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.HardcodedStruct;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarArrayOfPtr;
+import smetana.core.amiga.StarStruct;
+
+public class ST_polygon_t extends UnsupportedStructAndPtr implements HardcodedStruct {
+
+ public int regular;
+ public int peripheries;
+ public int sides;
+ public double orientation;
+ public double distortion;
+ public double skew;
+ public int option;
+ private StarArrayOfPtr vertices;
+
+ // "pointf *vertices",
+
+ public ST_polygon_t() {
+ this(null);
+ }
+
+ public ST_polygon_t(StarStruct parent) {
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ @Override
+ public boolean getBoolean(String fieldName) {
+ if (fieldName.equals("regular")) {
+ return regular != 0;
+ }
+ return super.getBoolean(fieldName);
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("peripheries")) {
+ return peripheries;
+ }
+ if (fieldName.equals("sides")) {
+ return sides;
+ }
+ return super.getInt(fieldName);
+ }
+
+ @Override
+ public double getDouble(String fieldName) {
+ if (fieldName.equals("orientation")) {
+ return orientation;
+ }
+ if (fieldName.equals("skew")) {
+ return skew;
+ }
+ if (fieldName.equals("distortion")) {
+ return distortion;
+ }
+ return super.getDouble(fieldName);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ return ST_polygon_t.this.getPtr(fieldName);
+ }
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("regular")) {
+ this.regular = data;
+ return;
+ }
+ if (fieldName.equals("peripheries")) {
+ this.peripheries = data;
+ return;
+ }
+ if (fieldName.equals("sides")) {
+ this.sides = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("option")) {
+ return option;
+ }
+ if (fieldName.equals("sides")) {
+ return sides;
+ }
+ if (fieldName.equals("peripheries")) {
+ return peripheries;
+ }
+ return super.getInt(fieldName);
+ }
+
+ @Override
+ public void setDouble(String fieldName, double data) {
+ if (fieldName.equals("orientation")) {
+ this.orientation = data;
+ return;
+ }
+ if (fieldName.equals("distortion")) {
+ this.distortion = data;
+ return;
+ }
+ if (fieldName.equals("skew")) {
+ this.skew = data;
+ return;
+ }
+ super.setDouble(fieldName, data);
+ }
+
+ private __ptr__ getVertices() {
+ if (vertices == null) {
+ return null;
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("vertices")) {
+ return vertices;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("vertices") && newData == null) {
+ this.vertices = null;
+ return null;
+ }
+ if (fieldName.equals("vertices") && newData instanceof StarArrayOfPtr) {
+ this.vertices = (StarArrayOfPtr) newData;
+ return null;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "typedef struct polygon_t",
+ // "{",
+ // "int regular",
+ // "int peripheries",
+ // "int sides",
+ // "double orientation",
+ // "double distortion",
+ // "double skew",
+ // "int option",
+ // "pointf *vertices",
+ // "}",
+ // "polygon_t");
+}
+
+// typedef struct polygon_t { /* mutable shape information for a node */
+// int regular; /* true for symmetric shapes */
+// int peripheries; /* number of periphery lines */
+// int sides; /* number of sides */
+// double orientation; /* orientation of shape (+ve degrees) */
+// double distortion; /* distortion factor - as in trapezium */
+// double skew; /* skew factor - as in parallelogram */
+// int option; /* ROUNDED, DIAGONAL corners, etc. */
+// pointf *vertices; /* array of vertex points */
+// } polygon_t; \ No newline at end of file
diff --git a/src/h/ST_port.java b/src/h/ST_port.java
index 94fc458..1f84319 100644
--- a/src/h/ST_port.java
+++ b/src/h/ST_port.java
@@ -45,8 +45,6 @@
*/
package h;
-import javax.swing.text.html.CSS;
-
import smetana.core.CString;
import smetana.core.HardcodedStruct;
import smetana.core.UnsupportedStarStruct;
diff --git a/src/h/ST_rank_t.java b/src/h/ST_rank_t.java
new file mode 100644
index 0000000..13d98e5
--- /dev/null
+++ b/src/h/ST_rank_t.java
@@ -0,0 +1,375 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.UnsupportedArrayOfPtr;
+import smetana.core.UnsupportedSize_t;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__array_of_ptr__;
+import smetana.core.__ptr__;
+import smetana.core.__struct__;
+import smetana.core.size_t;
+import smetana.core.amiga.StarArrayOfPtr;
+import smetana.core.amiga.StarStruct;
+
+public class ST_rank_t extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_rank_t() {
+ this(null);
+ }
+
+ public ST_rank_t(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ private int n;
+
+ // "node_t **v",
+ private STStarArrayOfPointer v;
+ private int an;
+ // "node_t **av",
+ private STStarArrayOfPointer av;
+
+ private double ht1, ht2;
+ private double pht1, pht2;
+ private boolean candidate;
+ private int valid;
+
+ private int cache_nc;
+ private ST_adjmatrix_t flat;
+
+ // "}",
+ // "rank_t");
+
+ @Override
+ public void setStruct(__struct__ value) {
+ ST_rank_t this2 = (ST_rank_t) value;
+ this.n = this2.n;
+ this.v = this2.v;
+ this.an = this2.an;
+ this.av = this2.av;
+ this.ht1 = this2.ht1;
+ this.ht2 = this2.ht2;
+ this.pht1 = this2.pht1;
+ this.pht2 = this2.pht2;
+ this.candidate = this2.candidate;
+ this.valid = this2.valid;
+ this.cache_nc = this2.cache_nc;
+ this.flat = this2.flat;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+ @Override
+ public int getInt(String fieldName) {
+ return ST_rank_t.this.getInt(fieldName);
+ }
+
+ @Override
+ public __array_of_ptr__ getArrayOfPtr(String fieldName) {
+ return ST_rank_t.this.getArrayOfPtr(fieldName);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ return ST_rank_t.this.getPtr(fieldName);
+ }
+
+ @Override
+ public __struct__ getStruct() {
+ return ST_rank_t.this.getStruct();
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ return ST_rank_t.this.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public void setBoolean(String fieldName, boolean data) {
+ ST_rank_t.this.setBoolean(fieldName, data);
+ }
+
+ @Override
+ public boolean getBoolean(String fieldName) {
+ return ST_rank_t.this.getBoolean(fieldName);
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ ST_rank_t.this.setInt(fieldName, data);
+ }
+
+ @Override
+ public double getDouble(String fieldName) {
+ return ST_rank_t.this.getDouble(fieldName);
+ }
+
+ @Override
+ public void setStruct(__struct__ value) {
+ ST_rank_t.this.setStruct(value);
+ }
+
+ }
+
+ @Override
+ public __array_of_ptr__ getArrayOfPtr(String fieldName) {
+ if (fieldName.equals("v")) {
+ return new ArrayOfPtr(v, 0);
+ }
+ return super.getArrayOfPtr(fieldName);
+ }
+
+ static class ArrayOfPtr extends UnsupportedArrayOfPtr {
+
+ private final int pos;
+ private final STStarArrayOfPointer tab;
+
+ private ArrayOfPtr(STStarArrayOfPointer tab, int pos) {
+ this.pos = pos;
+ this.tab = tab;
+ }
+
+ @Override
+ public __array_of_ptr__ plus(int delta) {
+ return new ArrayOfPtr(tab, pos + delta);
+ }
+
+ @Override
+ public void setPtr(__ptr__ value) {
+ tab.plus(pos).setPtr(value);
+ }
+
+ @Override
+ public __ptr__ getPtr() {
+ return tab.plus(pos).getPtr();
+ }
+
+ @Override
+ public __ptr__ asPtr() {
+ if (pos == 0) {
+ return tab;
+ }
+ return super.asPtr();
+ }
+
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("n")) {
+ return n;
+ }
+ if (fieldName.equals("an")) {
+ return an;
+ }
+ if (fieldName.equals("cache_nc")) {
+ return cache_nc;
+ }
+ return super.getInt(fieldName);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("v")) {
+ return v;
+ }
+ if (fieldName.equals("av")) {
+ return av;
+ }
+ if (fieldName.equals("flat")) {
+ return flat;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public void setBoolean(String fieldName, boolean data) {
+ if (fieldName.equals("candidate")) {
+ this.candidate = data;
+ return;
+ }
+ if (fieldName.equals("valid")) {
+ this.valid = data ? 1 : 0;
+ return;
+ }
+ super.setBoolean(fieldName, data);
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("n")) {
+ this.n = data;
+ return;
+ }
+ if (fieldName.equals("an")) {
+ this.an = data;
+ return;
+ }
+ if (fieldName.equals("valid")) {
+ this.valid = data;
+ return;
+ }
+ if (fieldName.equals("cache_nc")) {
+ this.cache_nc = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+ @Override
+ public boolean getBoolean(String fieldName) {
+ if (fieldName.equals("valid")) {
+ return valid != 0;
+ }
+ if (fieldName.equals("candidate")) {
+ return candidate;
+ }
+ return super.getBoolean(fieldName);
+ }
+
+ @Override
+ public double getDouble(String fieldName) {
+ if (fieldName.equals("pht1")) {
+ return pht1;
+ }
+ if (fieldName.equals("pht2")) {
+ return pht2;
+ }
+ if (fieldName.equals("ht1")) {
+ return ht1;
+ }
+ if (fieldName.equals("ht2")) {
+ return ht2;
+ }
+ return super.getDouble(fieldName);
+ }
+
+ @Override
+ public void setDouble(String fieldName, double data) {
+ if (fieldName.equals("pht1")) {
+ this.pht1 = data;
+ return;
+ }
+ if (fieldName.equals("pht2")) {
+ this.pht2 = data;
+ return;
+ }
+ if (fieldName.equals("ht1")) {
+ this.ht1 = data;
+ return;
+ }
+ if (fieldName.equals("ht2")) {
+ this.ht2 = data;
+ return;
+ }
+ super.setDouble(fieldName, data);
+ }
+
+ @Override
+ public __struct__ getStruct() {
+ return this;
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("v")) {
+ this.v = (STStarArrayOfPointer) newData;
+ return v;
+ }
+ if (fieldName.equals("av")) {
+ this.av = (STStarArrayOfPointer) newData;
+ return av;
+ }
+ if (fieldName.equals("flat")) {
+ this.flat = (ST_adjmatrix_t) newData;
+ return flat;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ public static size_t sizeof(final int nb) {
+ return new UnsupportedSize_t(nb) {
+ @Override
+ public Object malloc() {
+ return new StarArrayOfPtr(new STArray<ST_rank_t>(nb, 0, ST_rank_t.class));
+ }
+
+ @Override
+ public int getInternalNb() {
+ return nb;
+ }
+
+ @Override
+ public Object realloc(Object old) {
+ StarArrayOfPtr old2 = (StarArrayOfPtr) old;
+ old2.realloc(nb);
+ return old2;
+ }
+ };
+ }
+
+}
+
+// typedef struct rank_t {
+// int n; /* number of nodes in this rank */
+// node_t **v; /* ordered list of nodes in rank */
+// int an; /* globally allocated number of nodes */
+// node_t **av; /* allocated list of nodes in rank */
+// double ht1, ht2; /* height below/above centerline */
+// double pht1, pht2; /* as above, but only primitive nodes */
+// boolean candidate; /* for transpose () */
+// boolean valid;
+// int cache_nc; /* caches number of crossings */
+// adjmatrix_t *flat;
+// } rank_t; \ No newline at end of file
diff --git a/src/h/ST_refstr_t.java b/src/h/ST_refstr_t.java
new file mode 100644
index 0000000..60b4831
--- /dev/null
+++ b/src/h/ST_refstr_t.java
@@ -0,0 +1,190 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.CString;
+import smetana.core.OFFSET;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_refstr_t extends UnsupportedStructAndPtr /* implements WithParent */{
+
+ public final ST_dtlink_s link = new ST_dtlink_s(this);
+ public int refcnt;
+ public CString s;
+
+ private final StarStruct parent;
+
+ public ST_refstr_t() {
+ this(null);
+ }
+
+ public ST_refstr_t(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("refcnt")) {
+ this.refcnt = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("refcnt")) {
+ return refcnt;
+ }
+ return super.getInt(fieldName);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("s")) {
+ return s;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ @Override
+ public Object addVirtualBytes(int virtualBytes) {
+ if (virtualBytes == 0) {
+ return this;
+ }
+ final OFFSET offset = OFFSET.fromInt(virtualBytes);
+ if (offset.toString().equals("h.refstr_t::s")) {
+ return s;
+ }
+ System.err.println("virtualBytes=" + virtualBytes);
+ System.err.println("offset=" + offset);
+ return super.addVirtualBytes(virtualBytes);
+ }
+
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ @Override
+ public Object addVirtualBytes(int virtualBytes) {
+ if (virtualBytes == 0) {
+ return this;
+ }
+ final OFFSET offset = OFFSET.fromInt(virtualBytes);
+ if (offset.toString().equals("h.refstr_t::s")) {
+ return s;
+ }
+ System.err.println("virtualBytes=" + virtualBytes);
+ System.err.println("offset=" + offset);
+ return super.addVirtualBytes(virtualBytes);
+ }
+
+ @Override
+ public __ptr__ castTo(Class dest) {
+ // if (dest == refstr_t.class) {
+ // return this;
+ // }
+ if (dest == _dtlink_s.class) {
+ return link;
+ }
+ return super.castTo(dest);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("s")) {
+ this.s = (CString) newData;
+ this.s.setMyFather(this);
+ return s;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public CString getCString(String fieldName) {
+ if (fieldName.equals("s")) {
+ return s;
+ }
+ return super.getCString(fieldName);
+ }
+
+ public CString to_s(ST_dtlink_s from) {
+ if (from == link) {
+ return s;
+ }
+ throw new IllegalArgumentException();
+ }
+
+ @Override
+ public Class getRealClass() {
+ return refstr_t.class;
+ }
+
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "typedef struct refstr_t",
+ // "{",
+ // "Dtlink_t link",
+ // "unsigned long refcnt",
+ // "char *s",
+ // "char store[1]",
+ // "}",
+ // "refstr_t");
+}
+
+// typedef struct refstr_t {
+// Dtlink_t link;
+// unsigned long refcnt;
+// char *s;
+// char store[1]; /* this is actually a dynamic array */
+// } refstr_t; \ No newline at end of file
diff --git a/src/h/ST_shape_desc.java b/src/h/ST_shape_desc.java
new file mode 100644
index 0000000..0c3586b
--- /dev/null
+++ b/src/h/ST_shape_desc.java
@@ -0,0 +1,128 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.CString;
+import smetana.core.HardcodedStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_shape_desc extends UnsupportedStructAndPtr implements HardcodedStruct {
+
+ public ST_shape_desc(StarStruct parent) {
+ }
+
+ public ST_shape_desc() {
+ this(null);
+ }
+
+ public CString name;
+ public ST_shape_functions.Amp fns;
+ public ST_polygon_t.Amp polygon;
+ public boolean usershape;
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("name")) {
+ this.name = (CString) newData;
+ return newData;
+ }
+ if (fieldName.equals("fns")) {
+ this.fns = (ST_shape_functions.Amp) newData;
+ return newData;
+ }
+ if (fieldName.equals("polygon")) {
+ this.polygon = (ST_polygon_t.Amp) newData;
+ return newData;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public CString getCString(String fieldName) {
+ if (fieldName.equals("name")) {
+ return name;
+ }
+ return super.getCString(fieldName);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("fns")) {
+ return fns;
+ }
+ if (fieldName.equals("polygon")) {
+ return polygon;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public boolean getBoolean(String fieldName) {
+ if (fieldName.equals("usershape")) {
+ return usershape;
+ }
+ return super.getBoolean(fieldName);
+ }
+
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "typedef struct shape_desc",
+ // "{",
+ // "char *name",
+ // "shape_functions *fns",
+ // "polygon_t *polygon",
+ // "boolean usershape",
+ // "}",
+ // "shape_desc");
+}
+
+// typedef struct shape_desc { /* read-only shape descriptor */
+// char *name; /* as read from graph file */
+// shape_functions *fns;
+// polygon_t *polygon; /* base polygon info */
+// boolean usershape;
+// } shape_desc; \ No newline at end of file
diff --git a/src/h/ST_shape_functions.java b/src/h/ST_shape_functions.java
new file mode 100644
index 0000000..1245685
--- /dev/null
+++ b/src/h/ST_shape_functions.java
@@ -0,0 +1,160 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.CFunction;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_shape_functions extends UnsupportedStructAndPtr {
+
+ public CFunction initfn;
+ public CFunction freefn;
+ public CFunction portfn;
+ public CFunction insidefn;
+ public CFunction pboxfn;
+ public CFunction codefn;
+
+ public ST_shape_functions() {
+ this(null);
+ }
+
+ public ST_shape_functions(StarStruct parent) {
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ return ST_shape_functions.this.getPtr(fieldName);
+ }
+
+ @Override
+ public Object call(String fieldName, Object... args) {
+ return ((CFunction) getPtr(fieldName)).exe(args);
+ }
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("initfn")) {
+ return initfn;
+ }
+ if (fieldName.equals("freefn")) {
+ return freefn;
+ }
+ if (fieldName.equals("portfn")) {
+ return portfn;
+ }
+ if (fieldName.equals("insidefn")) {
+ return insidefn;
+ }
+ if (fieldName.equals("pboxfn")) {
+ return pboxfn;
+ }
+ if (fieldName.equals("codefn")) {
+ return codefn;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("initfn")) {
+ this.initfn = (CFunction) newData;
+ return newData;
+ }
+ if (fieldName.equals("freefn")) {
+ this.freefn = (CFunction) newData;
+ return newData;
+ }
+ if (fieldName.equals("portfn")) {
+ this.portfn = (CFunction) newData;
+ return newData;
+ }
+ if (fieldName.equals("insidefn")) {
+ this.insidefn = (CFunction) newData;
+ return newData;
+ }
+ if (fieldName.equals("pboxfn")) {
+ this.pboxfn = (CFunction) newData;
+ return newData;
+ }
+ if (fieldName.equals("codefn")) {
+ this.codefn = (CFunction) newData;
+ return newData;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "typedef struct shape_functions",
+ // "{",
+ // "void (*initfn) (node_t *)",
+ // "void (*freefn) (node_t *)",
+ // "port(*portfn) (node_t *, char *, char *)",
+ // "boolean(*insidefn) (inside_t * inside_context, pointf)",
+ // "int (*pboxfn)(node_t* n, port* p, int side, boxf rv[], int *kptr)",
+ // "void (*codefn) (GVJ_t * job, node_t * n)",
+ // "}",
+ // "shape_functions");
+}
+
+// typedef struct shape_functions { /* read-only shape functions */
+// void (*initfn) (node_t *); /* initializes shape from node u.shape_info structure */
+// void (*freefn) (node_t *); /* frees shape from node u.shape_info structure */
+// port(*portfn) (node_t *, char *, char *); /* finds aiming point and slope of port */
+// boolean(*insidefn) (inside_t * inside_context, pointf); /* clips incident gvc->e spline on shape of gvc->n */
+// int (*pboxfn)(node_t* n, port* p, int side, boxf rv[], int *kptr); /* finds box path to reach port */
+// void (*codefn) (GVJ_t * job, node_t * n); /* emits graphics code for node */
+// } shape_functions; \ No newline at end of file
diff --git a/src/h/ST_splineInfo.java b/src/h/ST_splineInfo.java
new file mode 100644
index 0000000..44db831
--- /dev/null
+++ b/src/h/ST_splineInfo.java
@@ -0,0 +1,138 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.CFunction;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_splineInfo extends UnsupportedStructAndPtr {
+
+ public CFunction swapEnds;
+ public CFunction splineMerge;
+ public boolean ignoreSwap;
+ public boolean isOrtho;
+
+ public ST_splineInfo() {
+ this(null);
+ }
+
+ public ST_splineInfo(StarStruct parent) {
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ @Override
+ public boolean getBoolean(String fieldName) {
+ return ST_splineInfo.this.getBoolean(fieldName);
+ }
+
+ @Override
+ public Object call(String fieldName, Object... args) {
+ return ST_splineInfo.this.call(fieldName, args);
+ }
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("swapEnds")) {
+ this.swapEnds = (CFunction) newData;
+ return swapEnds;
+ }
+ if (fieldName.equals("splineMerge")) {
+ this.splineMerge = (CFunction) newData;
+ return splineMerge;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public Object call(String fieldName, Object... args) {
+ if (fieldName.equals("swapEnds")) {
+ return swapEnds.exe(args);
+ }
+ if (fieldName.equals("splineMerge")) {
+ return splineMerge.exe(args);
+ }
+ return super.call(fieldName, args);
+ }
+
+ @Override
+ public boolean getBoolean(String fieldName) {
+ if (fieldName.equals("ignoreSwap")) {
+ return ignoreSwap;
+ }
+ if (fieldName.equals("isOrtho")) {
+ return isOrtho;
+ }
+ return super.getBoolean(fieldName);
+ }
+
+ // public interface ST_splineInfo extends __ptr__ {
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "typedef struct",
+ // "{",
+ // "boolean(*swapEnds) (edge_t * e)",
+ // "boolean(*splineMerge) (node_t * n)",
+ // "boolean ignoreSwap",
+ // "boolean isOrtho",
+ // "}",
+ // "splineInfo");
+}
+
+// typedef struct {
+// boolean(*swapEnds) (edge_t * e); /* Should head and tail be swapped? */
+// boolean(*splineMerge) (node_t * n); /* Is n a node in the middle of an edge? */
+// boolean ignoreSwap; /* Test for swapped edges if false */
+// boolean isOrtho; /* Orthogonal routing used */
+// } splineInfo; \ No newline at end of file
diff --git a/src/h/ST_spline_info_t.java b/src/h/ST_spline_info_t.java
new file mode 100644
index 0000000..05dc735
--- /dev/null
+++ b/src/h/ST_spline_info_t.java
@@ -0,0 +1,153 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarArrayOfPtr;
+import smetana.core.amiga.StarStruct;
+
+public class ST_spline_info_t extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_spline_info_t() {
+ this(null);
+ }
+
+ public ST_spline_info_t(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "typedef struct",
+ // "{",
+ private int LeftBound, RightBound, Splinesep, Multisep;
+ private StarArrayOfPtr Rank_box;
+
+ // "}",
+ // "spline_info_t");
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+ @Override
+ public int getInt(String fieldName) {
+ return ST_spline_info_t.this.getInt(fieldName);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ return ST_spline_info_t.this.getPtr(fieldName);
+ }
+
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("Rank_box")) {
+ this.Rank_box = (StarArrayOfPtr) newData;
+ return this.Rank_box;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("Rank_box")) {
+ return this.Rank_box;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("LeftBound")) {
+ return this.LeftBound;
+ }
+ if (fieldName.equals("RightBound")) {
+ return this.RightBound;
+ }
+ if (fieldName.equals("Splinesep")) {
+ return this.Splinesep;
+ }
+ if (fieldName.equals("Multisep")) {
+ return this.Multisep;
+ }
+ return super.getInt(fieldName);
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("LeftBound")) {
+ this.LeftBound = data;
+ return;
+ }
+ if (fieldName.equals("RightBound")) {
+ this.RightBound = data;
+ return;
+ }
+ if (fieldName.equals("Splinesep")) {
+ this.Splinesep = data;
+ return;
+ }
+ if (fieldName.equals("Multisep")) {
+ this.Multisep = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+}
+
+// typedef struct {
+// int LeftBound, RightBound, Splinesep, Multisep;
+// boxf* Rank_box;
+// } spline_info_t; \ No newline at end of file
diff --git a/src/h/ST_splines.java b/src/h/ST_splines.java
new file mode 100644
index 0000000..aca80e3
--- /dev/null
+++ b/src/h/ST_splines.java
@@ -0,0 +1,133 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__array_of_ptr__;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarArrayOfPtr;
+import smetana.core.amiga.StarStruct;
+
+public class ST_splines extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_splines() {
+ this(null);
+ }
+
+ public ST_splines(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ }
+
+ // "typedef struct splines",
+ // "{",
+// bezier *list;
+ private StarArrayOfPtr list;
+ private int size;
+
+ // "boxf bb",
+ // "}",
+ // "splines");
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("size")) {
+ this.size = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("size")) {
+ return this.size;
+ }
+ return super.getInt(fieldName);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("list")) {
+ this.list = (StarArrayOfPtr) newData;
+ return list;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("list")) {
+ return this.list;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public __array_of_ptr__ getArrayOfPtr(String fieldName) {
+ if (fieldName.equals("list")) {
+ return this.list.getInternalArray();
+ }
+ return super.getArrayOfPtr(fieldName);
+ }
+}
+
+// typedef struct splines {
+// bezier *list;
+// int size;
+// boxf bb;
+// } splines; \ No newline at end of file
diff --git a/src/h/ST_tedge_t.java b/src/h/ST_tedge_t.java
new file mode 100644
index 0000000..09806aa
--- /dev/null
+++ b/src/h/ST_tedge_t.java
@@ -0,0 +1,206 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import h.ST_Agclos_s.ArrayOfThreePtrDict_t;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import smetana.core.UnsupportedArrayOfPtr;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__array_of_ptr__;
+import smetana.core.__ptr__;
+import smetana.core.amiga.Area;
+import smetana.core.amiga.StarArrayOfPtr;
+import smetana.core.amiga.StarStruct;
+
+public class ST_tedge_t extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_tedge_t() {
+ this(null);
+ }
+
+ public ST_tedge_t(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ }
+
+ // "typedef struct tedge_t",
+ // "{",
+ private __ptr__ pnl0p;
+ private __ptr__ pnl1p;
+ // private ST_pointnlink_t.Amp pnl0p;
+ // private ST_pointnlink_t.Amp pnl1p;
+
+ private StarArrayOfPtr ltp;
+ private StarArrayOfPtr rtp;
+
+ // "struct triangle_t *ltp",
+ // "struct triangle_t *rtp",
+ // "}",
+ // "tedge_t");
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("pnl0p")) {
+ return this.pnl0p;
+ }
+ if (fieldName.equals("pnl1p")) {
+ return this.pnl1p;
+ }
+ if (fieldName.equals("ltp")) {
+ return this.ltp;
+ }
+ if (fieldName.equals("rtp")) {
+ return this.rtp;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ // class Singleton extends UnsupportedArrayOfPtr implements __array_of_ptr__ {
+ // private final ST_pointnlink_t.Amp data;
+ //
+ // Singleton(ST_pointnlink_t.Amp data) {
+ // this.data = data;
+ // }
+ //
+ // @Override
+ // public __ptr__ getPtr() {
+ // return data;
+ // }
+ //
+ // @Override
+ // public Area getInternal(int idx) {
+ // if (idx == 0) {
+ // return data;
+ // }
+ // System.err.println("idx=" + idx);
+ // return super.getInternal(idx);
+ // }
+ //
+ // @Override
+ // public String toString() {
+ // return super.toString() + " " + data + " " + data.getStruct();
+ // }
+ //
+ // @Override
+ // public int comparePointerInternal(__array_of_ptr__ other) {
+ // System.err.println("other=" + other);
+ // Singleton other2 = (Singleton) other;
+ // System.err.println("other2.data=" + other2.data);
+ // System.err.println("pnl0p=" + pnl0p);
+ // System.err.println("pnl0p=" + foo(pnl0p));
+ // System.err.println("pnl1p=" + pnl1p);
+ // System.err.println("pnl0p=" + foo(pnl1p));
+ // // TODO Auto-generated method stub
+ // return super.comparePointerInternal(other);
+ // }
+ //
+ // }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ // if (fieldName.equals("pnl0p")) {
+ // this.pnl0p = (ST_pointnlink_t.Amp) newData;
+ // return this.pnl0p;
+ // }
+ if (fieldName.equals("pnl0p")) {
+ if (newData instanceof ST_pointnlink_t.Amp) {
+ this.pnl0p = (ST_pointnlink_t.Amp) newData;
+ // newData = new StarArrayOfPtr(new Singleton((h.ST_pointnlink_t.Amp) newData));
+ } else {
+ this.pnl0p = (StarArrayOfPtr) newData;
+ }
+ return this.pnl0p;
+ }
+ if (fieldName.equals("pnl1p")) {
+ if (newData instanceof ST_pointnlink_t.Amp) {
+ // newData = new StarArrayOfPtr(new Singleton((h.ST_pointnlink_t.Amp) newData));
+ this.pnl1p = (ST_pointnlink_t.Amp) newData;
+ } else {
+ this.pnl1p = (StarArrayOfPtr) newData;
+ }
+ return this.pnl1p;
+ }
+ // if (fieldName.equals("pnl1p")) {
+ // this.pnl1p = (ST_pointnlink_t.Amp) newData;
+ // return this.pnl1p;
+ // }
+ if (fieldName.equals("ltp")) {
+ this.ltp = (StarArrayOfPtr) newData;
+ return this.ltp;
+ }
+ if (fieldName.equals("rtp")) {
+ this.rtp = (StarArrayOfPtr) newData;
+ return this.rtp;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ public String foo(StarArrayOfPtr data) {
+ __array_of_ptr__ array = data.getInternalArray();
+ return array.toString();
+ }
+}
+
+// typedef struct tedge_t {
+// pointnlink_t *pnl0p;
+// pointnlink_t *pnl1p;
+// struct triangle_t *ltp;
+// struct triangle_t *rtp;
+// } tedge_t; \ No newline at end of file
diff --git a/src/h/ST_textfont_t.java b/src/h/ST_textfont_t.java
new file mode 100644
index 0000000..9652778
--- /dev/null
+++ b/src/h/ST_textfont_t.java
@@ -0,0 +1,104 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.CString;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_textfont_t extends UnsupportedStructAndPtr {
+
+ public CString name;
+ public double size;
+
+ public ST_textfont_t() {
+ this(null);
+ }
+
+ public ST_textfont_t(StarStruct parent) {
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("name")) {
+ this.name = (CString) newData;
+ return name;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public void setDouble(String fieldName, double data) {
+ if (fieldName.equals("size")) {
+ this.size = data;
+ return;
+ }
+ super.setDouble(fieldName, data);
+ }
+
+ // public interface ST_textfont_t extends __ptr__ {
+ // public static List<String> DEFINITION = Arrays.asList(
+ // "typedef struct",
+ // "{",
+ // "char* name",
+ // "char* color",
+ // "PostscriptAlias *postscript_alias",
+ // "double size",
+ // "unsigned int flags:7",
+ // "unsigned int cnt:(sizeof(unsigned int) * 8 - 7)",
+ // "}",
+ // "textfont_t");
+}
+
+// typedef struct {
+// char* name;
+// char* color;
+// PostscriptAlias *postscript_alias;
+// double size;
+// unsigned int flags:7; /* HTML_UL, HTML_IF, HTML_BF, etc. */
+// unsigned int cnt:(sizeof(unsigned int) * 8 - 7); /* reference count */
+// } textfont_t; \ No newline at end of file
diff --git a/src/h/ST_textlabel_t.java b/src/h/ST_textlabel_t.java
new file mode 100644
index 0000000..ab15a47
--- /dev/null
+++ b/src/h/ST_textlabel_t.java
@@ -0,0 +1,275 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.CString;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.__struct__;
+import smetana.core.amiga.StarStruct;
+
+public class ST_textlabel_t extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_textlabel_t() {
+ this(null);
+ }
+
+ public ST_textlabel_t(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ private CString text, fontname, fontcolor;
+ private int charset;
+ private double fontsize;
+
+ private final ST_pointf dimen = new ST_pointf(this);
+ private final ST_pointf space = new ST_pointf(this);
+ private final ST_pointf pos = new ST_pointf(this);
+
+ // "union",
+ // "{",
+ // "struct",
+ // "{",
+ // private ST_textspan_t span;
+ private __ptr__ span;
+ private int nspans;
+
+ // "}",
+ // "txt",
+ // "htmllabel_t *html",
+ private final __ptr__ html = null;
+ // "}",
+ // "u",
+ private int valign;
+
+ private int set;
+
+ // "boolean html",
+ // "}",
+ // "textlabel_t");
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ }
+
+ @Override
+ public __struct__ getStruct(String fieldName) {
+ if (fieldName.equals("dimen")) {
+ return dimen;
+ }
+ if (fieldName.equals("space")) {
+ return space;
+ }
+ if (fieldName.equals("pos")) {
+ return pos;
+ }
+ return super.getStruct(fieldName);
+ }
+
+ @Override
+ public void setStruct(String fieldName, __struct__ newData) {
+ if (fieldName.equals("space")) {
+ space.copyDataFrom(newData);
+ return;
+ }
+ if (fieldName.equals("pos")) {
+ pos.copyDataFrom(newData);
+ return;
+ }
+ super.setStruct(fieldName, newData);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("text")) {
+ this.text = (CString) newData;
+ return text;
+ }
+ if (fieldName.equals("fontname")) {
+ this.fontname = (CString) newData;
+ return fontname;
+ }
+ if (fieldName.equals("fontcolor")) {
+ this.fontcolor = (CString) newData;
+ return fontcolor;
+ }
+ if (fieldName.equals("u.txt.span")) {
+ this.span = newData;
+ return span;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public CString getCString(String fieldName) {
+ if (fieldName.equals("text")) {
+ return text;
+ }
+ return super.getCString(fieldName);
+ }
+
+ @Override
+ public __ptr__ getPtr(String fieldName) {
+ if (fieldName.equals("text")) {
+ return text;
+ }
+ if (fieldName.equals("u.txt.span")) {
+ return span;
+ }
+ if (fieldName.equals("fontname")) {
+ return fontname;
+ }
+ return super.getPtr(fieldName);
+ }
+
+ @Override
+ public boolean getBoolean(String fieldName) {
+ if (fieldName.equals("html")) {
+ return html != null;
+ }
+ if (fieldName.equals("set")) {
+ return set != 0;
+ }
+ return super.getBoolean(fieldName);
+ }
+
+ @Override
+ public void setDouble(String fieldName, double data) {
+ if (fieldName.equals("fontsize")) {
+ this.fontsize = data;
+ return;
+ }
+ super.setDouble(fieldName, data);
+ }
+
+ @Override
+ public double getDouble(String fieldName) {
+ if (fieldName.equals("fontsize")) {
+ return this.fontsize;
+ }
+ return super.getDouble(fieldName);
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("charset")) {
+ this.charset = data;
+ return;
+ }
+ if (fieldName.equals("valign")) {
+ this.valign = data;
+ return;
+ }
+ if (fieldName.equals("u.txt.nspans")) {
+ this.nspans = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+ @Override
+ public void setBoolean(String fieldName, boolean data) {
+ if (fieldName.equals("set")) {
+ this.set = data ? 1 : 0;
+ return;
+ }
+ super.setBoolean(fieldName, data);
+ }
+
+ @Override
+ public boolean isSameThan(StarStruct other) {
+ ST_textlabel_t other2 = (ST_textlabel_t) other;
+ return this == other2;
+ }
+
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("charset")) {
+ return this.charset;
+ }
+ if (fieldName.equals("valign")) {
+ return this.valign;
+ }
+ if (fieldName.equals("u.txt.nspans")) {
+ return this.nspans;
+ }
+ if (fieldName.equals("set")) {
+ return this.set;
+ }
+ return super.getInt(fieldName);
+ }
+
+}
+
+// typedef struct textlabel_t {
+// char *text, *fontname, *fontcolor;
+// int charset;
+// double fontsize;
+// pointf dimen; /* the diagonal size of the label (estimated by layout) */
+// pointf space; /* the diagonal size of the space for the label */
+// /* the rendered label is aligned in this box */
+// /* space does not include pad or margin */
+// pointf pos; /* the center of the space for the label */
+// union {
+// struct {
+// textspan_t *span;
+// short nspans;
+// } txt;
+// htmllabel_t *html;
+// } u;
+// char valign; /* 't' 'c' 'b' */
+// boolean set; /* true if position is set */
+// boolean html; /* true if html label */
+// } textlabel_t; \ No newline at end of file
diff --git a/src/h/ST_textspan_t.java b/src/h/ST_textspan_t.java
new file mode 100644
index 0000000..1a9c651
--- /dev/null
+++ b/src/h/ST_textspan_t.java
@@ -0,0 +1,153 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.CString;
+import smetana.core.UnsupportedSize_t;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.__struct__;
+import smetana.core.size_t;
+import smetana.core.amiga.StarArrayOfPtr;
+import smetana.core.amiga.StarStruct;
+
+public class ST_textspan_t extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_textspan_t() {
+ this(null);
+ }
+
+ public ST_textspan_t(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ private CString str;
+
+ // "textfont_t *font",
+ // "void *layout",
+ // "void (*free_layout) (void *layout)",
+ // "double yoffset_layout, yoffset_centerline",
+ private final ST_pointf size = new ST_pointf(this);
+ private int just;
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ }
+
+ @Override
+ public __struct__ getStruct(String fieldName) {
+ if (fieldName.equals("size")) {
+ return size;
+ }
+ return super.getStruct(fieldName);
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("just")) {
+ this.just = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("just")) {
+ return this.just;
+ }
+ return super.getInt(fieldName);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("str")) {
+ this.str = (CString) newData;
+ return str;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ public static size_t sizeof(final int nb) {
+ return new UnsupportedSize_t(nb) {
+ @Override
+ public Object malloc() {
+ return new StarArrayOfPtr(new STArray<ST_textspan_t>(nb, 0, ST_textspan_t.class));
+ }
+
+ @Override
+ public int getInternalNb() {
+ return nb;
+ }
+
+ @Override
+ public Object realloc(Object old) {
+ StarArrayOfPtr old2 = (StarArrayOfPtr) old;
+ old2.realloc(nb);
+ return old2;
+ }
+ };
+ }
+
+}
+
+// typedef struct {
+// char *str; /* stored in utf-8 */
+// textfont_t *font;
+// void *layout;
+// void (*free_layout) (void *layout); /* FIXME - this is ugly */
+// double yoffset_layout, yoffset_centerline;
+// pointf size;
+// char just; /* 'l' 'n' 'r' */ /* FIXME */
+// } textspan_t; \ No newline at end of file
diff --git a/src/h/ST_tna_t.java b/src/h/ST_tna_t.java
new file mode 100644
index 0000000..f2c74d8
--- /dev/null
+++ b/src/h/ST_tna_t.java
@@ -0,0 +1,180 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import h.ST_tna_t.Amp;
+import h.ST_triangle_t.ArrayOfThree;
+
+import java.util.Arrays;
+import java.util.List;
+
+import smetana.core.UnsupportedArrayOfStruct;
+import smetana.core.UnsupportedSize_t;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__array_of_struct__;
+import smetana.core.__ptr__;
+import smetana.core.__struct__;
+import smetana.core.size_t;
+import smetana.core.amiga.StarArrayOfPtr;
+import smetana.core.amiga.StarStruct;
+
+public class ST_tna_t extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_tna_t() {
+ this(null);
+ }
+
+ public ST_tna_t(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ }
+
+ // "typedef struct tna_t",
+ // "{",
+ // "Ppoint_t a[2]",
+ // "}",
+ // "tna_t");
+ private double t;
+ private final ST_pointf a[] = new ST_pointf[] { new ST_pointf(), new ST_pointf() };
+
+ class ArrayOfTwo extends UnsupportedArrayOfStruct {
+
+ final private int pos;
+
+ public ArrayOfTwo(int pos) {
+ this.pos = pos;
+ }
+
+ @Override
+ public __array_of_struct__ plus(int delta) {
+ return new ArrayOfTwo(pos + delta);
+ }
+
+ @Override
+ public __struct__ getStruct() {
+ return a[pos];
+ }
+
+ @Override
+ public void setStruct(__struct__ value) {
+ a[pos].copyDataFrom(value);
+ }
+
+ @Override
+ public double getDouble(String fieldName) {
+ return getStruct().getDouble(fieldName);
+ }
+
+ }
+
+ @Override
+ public __array_of_struct__ getArrayOfStruct(String fieldName) {
+ if (fieldName.equals("a")) {
+ return new ArrayOfTwo(0);
+ }
+ return super.getArrayOfStruct(fieldName);
+ }
+
+ @Override
+ public double getDouble(String fieldName) {
+ if (fieldName.equals("t")) {
+ return this.t;
+ }
+ return super.getDouble(fieldName);
+ }
+
+ @Override
+ public void setDouble(String fieldName, double data) {
+ if (fieldName.equals("t")) {
+ this.t = data;
+ return;
+ }
+ super.setDouble(fieldName, data);
+ }
+
+ @Override
+ public __struct__ getStruct() {
+ return this;
+ }
+
+ public static size_t sizeof(final int nb) {
+ return new UnsupportedSize_t(nb) {
+ @Override
+ public Object malloc() {
+ return new StarArrayOfPtr(new STArray<ST_tna_t>(nb, 0, ST_tna_t.class));
+ }
+
+ @Override
+ public int getInternalNb() {
+ return nb;
+ }
+
+ @Override
+ public Object realloc(Object old) {
+ StarArrayOfPtr old2 = (StarArrayOfPtr) old;
+ old2.realloc(nb);
+ return old2;
+ }
+ };
+ }
+
+}
+
+// typedef struct tna_t {
+// double t;
+// Ppoint_t a[2];
+// } tna_t; \ No newline at end of file
diff --git a/src/h/ST_triangle_t.java b/src/h/ST_triangle_t.java
new file mode 100644
index 0000000..b3eb359
--- /dev/null
+++ b/src/h/ST_triangle_t.java
@@ -0,0 +1,179 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import h.ST_pathend_t.ArrayOfTwenty;
+import smetana.core.UnsupportedArrayOfStruct;
+import smetana.core.UnsupportedSize_t;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__array_of_struct__;
+import smetana.core.__struct__;
+import smetana.core.size_t;
+import smetana.core.amiga.StarArrayOfPtr;
+import smetana.core.amiga.StarStruct;
+
+public class ST_triangle_t extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_triangle_t() {
+ this(null);
+ }
+
+ public ST_triangle_t(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ }
+
+ // "typedef struct triangle_t",
+ // "{",
+ private int mark;
+
+ private final ST_tedge_t e[] = new ST_tedge_t[] { new ST_tedge_t(), new ST_tedge_t(), new ST_tedge_t() };
+
+ class ArrayOfThree extends UnsupportedArrayOfStruct {
+
+ final private int pos;
+
+ public ArrayOfThree(int pos) {
+ this.pos = pos;
+ }
+
+ @Override
+ public __array_of_struct__ plus(int delta) {
+ return new ArrayOfThree(pos + delta);
+ }
+
+ @Override
+ public __struct__ getStruct() {
+ return e[pos];
+ }
+
+ @Override
+ public void setStruct(__struct__ value) {
+ e[pos].copyDataFrom(value);
+ }
+
+ @Override
+ public double getDouble(String fieldName) {
+ return getStruct().getDouble(fieldName);
+ }
+
+ }
+
+ // "struct tedge_t e[3]",
+ // "}",
+ // "triangle_t");
+
+ @Override
+ public int getInt(String fieldName) {
+ if (fieldName.equals("mark")) {
+ return this.mark;
+ }
+ return super.getInt(fieldName);
+ }
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("mark")) {
+ this.mark = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+ @Override
+ public boolean getBoolean(String fieldName) {
+ if (fieldName.equals("mark")) {
+ return this.mark != 0;
+ }
+ return super.getBoolean(fieldName);
+ }
+
+ @Override
+ public __array_of_struct__ getArrayOfStruct(String fieldName) {
+ if (fieldName.equals("e")) {
+ return new ArrayOfThree(0);
+ }
+ return super.getArrayOfStruct(fieldName);
+ }
+
+ public static size_t sizeof(final int nb) {
+ return new UnsupportedSize_t(nb) {
+ @Override
+ public Object malloc() {
+ return new StarArrayOfPtr(new STArray<ST_triangle_t>(nb, 0, ST_triangle_t.class));
+ }
+
+ @Override
+ public int getInternalNb() {
+ return nb;
+ }
+
+ @Override
+ public Object realloc(Object old) {
+ StarArrayOfPtr old2 = (StarArrayOfPtr) old;
+ old2.realloc(nb);
+ return old2;
+ }
+ };
+ }
+
+}
+
+// typedef struct triangle_t {
+// int mark;
+// struct tedge_t e[3];
+// } triangle_t; \ No newline at end of file
diff --git a/src/h/ST_xlabel_t.java b/src/h/ST_xlabel_t.java
new file mode 100644
index 0000000..dbd1b13
--- /dev/null
+++ b/src/h/ST_xlabel_t.java
@@ -0,0 +1,161 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.UnsupportedSize_t;
+import smetana.core.UnsupportedStarStruct;
+import smetana.core.UnsupportedStructAndPtr;
+import smetana.core.__ptr__;
+import smetana.core.__struct__;
+import smetana.core.size_t;
+import smetana.core.amiga.StarArrayOfPtr;
+import smetana.core.amiga.StarStruct;
+
+public class ST_xlabel_t extends UnsupportedStructAndPtr {
+
+ private final StarStruct parent;
+
+ public ST_xlabel_t() {
+ this(null);
+ }
+
+ public ST_xlabel_t(StarStruct parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public StarStruct amp() {
+ return new Amp();
+ }
+
+ public class Amp extends UnsupportedStarStruct {
+
+ }
+
+ // "typedef struct",
+ // "{",
+ final private ST_pointf sz = new ST_pointf(this);
+ final private ST_pointf pos = new ST_pointf(this);
+
+ // "void *lbl",
+ private ST_textlabel_t lbl;
+ private int set;
+
+ // "unsigned char set",
+ // "}",
+ // "xlabel_t");
+
+ @Override
+ public void setInt(String fieldName, int data) {
+ if (fieldName.equals("set")) {
+ this.set = data;
+ return;
+ }
+ super.setInt(fieldName, data);
+ }
+
+ @Override
+ public __ptr__ setPtr(String fieldName, __ptr__ newData) {
+ if (fieldName.equals("lbl")) {
+ this.lbl = (ST_textlabel_t) newData;
+ return this.lbl;
+ }
+ return super.setPtr(fieldName, newData);
+ }
+
+ @Override
+ public __struct__ getStruct(String fieldName) {
+ if (fieldName.equals("sz")) {
+ return this.sz;
+ }
+ if (fieldName.equals("pos")) {
+ return this.pos;
+ }
+ return super.getStruct(fieldName);
+ }
+
+ @Override
+ public void setStruct(String fieldName, __struct__ newData) {
+ if (fieldName.equals("sz")) {
+ this.sz.copyDataFrom(newData);
+ return;
+ }
+ if (fieldName.equals("pos")) {
+ this.pos.copyDataFrom(newData);
+ return;
+ }
+ super.setStruct(fieldName, newData);
+ }
+
+ public static size_t sizeof(final int nb) {
+ return new UnsupportedSize_t(nb) {
+ @Override
+ public Object malloc() {
+ return new StarArrayOfPtr(new STArray<ST_xlabel_t>(nb, 0, ST_xlabel_t.class));
+ }
+
+ @Override
+ public int getInternalNb() {
+ return nb;
+ }
+
+ @Override
+ public Object realloc(Object old) {
+ StarArrayOfPtr old2 = (StarArrayOfPtr) old;
+ old2.realloc(nb);
+ return old2;
+ }
+ };
+ }
+
+}
+
+// typedef struct {
+// pointf sz; /* Size of label (input) */
+// pointf pos; /* Position of lower-left corner of label (output) */
+// void *lbl; /* Pointer to label in the graph */
+// unsigned char set; /* True if the position has been set (input/output) */
+// } xlabel_t; \ No newline at end of file
diff --git a/src/h/WithParent.java b/src/h/WithParent.java
new file mode 100644
index 0000000..f8b82b7
--- /dev/null
+++ b/src/h/WithParent.java
@@ -0,0 +1,54 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program:
+ *
+ *************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: See CVS logs. Details at http://www.graphviz.org/
+ *************************************************************************
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package h;
+
+import smetana.core.amiga.StarStruct;
+
+public interface WithParent {
+
+ public StarStruct getParent();
+
+} \ No newline at end of file
diff --git a/src/h/_Note_t___.java b/src/h/_Node_t___.java
index f84448f..388c425 100644
--- a/src/h/_Note_t___.java
+++ b/src/h/_Node_t___.java
@@ -51,7 +51,7 @@ import smetana.core.__ptr__;
//2 aqoki3wwzhqcy2mpz21vzdona
-public interface _Note_t___ extends __ptr__ {
+public interface _Node_t___ extends __ptr__ {
public static List<String> DEFINITION = Arrays.asList(
"typedef struct Node",
"{",
diff --git a/src/net/sourceforge/plantuml/AbstractPSystem.java b/src/net/sourceforge/plantuml/AbstractPSystem.java
index 49d204d..31a943a 100644
--- a/src/net/sourceforge/plantuml/AbstractPSystem.java
+++ b/src/net/sourceforge/plantuml/AbstractPSystem.java
@@ -56,6 +56,7 @@ import net.sourceforge.plantuml.version.Version;
public abstract class AbstractPSystem implements Diagram {
private UmlSource source;
+ private Scale scale;
private String getVersion() {
final StringBuilder toAppend = new StringBuilder();
@@ -98,9 +99,9 @@ public abstract class AbstractPSystem implements Diagram {
public DisplayPositionned getTitle() {
if (source == null) {
- return new DisplayPositionned(Display.empty(), HorizontalAlignment.CENTER, VerticalAlignment.TOP);
+ return DisplayPositionned.single(Display.empty(), HorizontalAlignment.CENTER, VerticalAlignment.TOP);
}
- return new DisplayPositionned(source.getTitle(), HorizontalAlignment.CENTER, VerticalAlignment.TOP);
+ return DisplayPositionned.single(source.getTitle(), HorizontalAlignment.CENTER, VerticalAlignment.TOP);
}
public String getWarningOrError() {
@@ -140,6 +141,14 @@ public abstract class AbstractPSystem implements Diagram {
}
}
+ final public void setScale(Scale scale) {
+ this.scale = scale;
+ }
+
+ final public Scale getScale() {
+ return scale;
+ }
+
protected abstract ImageData exportDiagramNow(OutputStream os, int index, FileFormatOption fileFormatOption,
long seed) throws IOException;
diff --git a/src/net/sourceforge/plantuml/AlignParam.java b/src/net/sourceforge/plantuml/AlignmentParam.java
index 493a48e..e6293b2 100644
--- a/src/net/sourceforge/plantuml/AlignParam.java
+++ b/src/net/sourceforge/plantuml/AlignmentParam.java
@@ -38,16 +38,18 @@ package net.sourceforge.plantuml;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-public enum AlignParam {
+public enum AlignmentParam {
- ARROW_MESSAGE_ALIGN(HorizontalAlignment.LEFT),
- SEQUENCE_MESSAGE_ALIGN(HorizontalAlignment.LEFT),
- SEQUENCE_MESSAGETEXT_ALIGN(HorizontalAlignment.LEFT),
- SEQUENCE_REFERENCE_ALIGN(HorizontalAlignment.CENTER);
+ arrowMessageAlignment(HorizontalAlignment.LEFT),
+ sequenceMessageAlignment(HorizontalAlignment.LEFT),
+ sequenceMessageTextAlignment(HorizontalAlignment.LEFT),
+ sequenceReferenceAlignment(HorizontalAlignment.CENTER),
+ packageTitleAlignment(HorizontalAlignment.CENTER),
+ noteTextAlignment(HorizontalAlignment.LEFT);
private final HorizontalAlignment defaultValue;
- private AlignParam(HorizontalAlignment defaultValue) {
+ private AlignmentParam(HorizontalAlignment defaultValue) {
this.defaultValue = defaultValue;
}
diff --git a/src/net/sourceforge/plantuml/Annotated.java b/src/net/sourceforge/plantuml/Annotated.java
index fc68f15..7bf7596 100644
--- a/src/net/sourceforge/plantuml/Annotated.java
+++ b/src/net/sourceforge/plantuml/Annotated.java
@@ -36,6 +36,7 @@
package net.sourceforge.plantuml;
import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
+import net.sourceforge.plantuml.cucadiagram.DisplaySection;
public interface Annotated {
@@ -45,8 +46,8 @@ public interface Annotated {
public DisplayPositionned getLegend();
- public DisplayPositionned getHeader();
+ public DisplaySection getHeader();
- public DisplayPositionned getFooter();
+ public DisplaySection getFooter();
}
diff --git a/src/net/sourceforge/plantuml/AnnotatedWorker.java b/src/net/sourceforge/plantuml/AnnotatedWorker.java
index 2fa421a..0331b08 100644
--- a/src/net/sourceforge/plantuml/AnnotatedWorker.java
+++ b/src/net/sourceforge/plantuml/AnnotatedWorker.java
@@ -37,6 +37,7 @@ package net.sourceforge.plantuml;
import net.sourceforge.plantuml.activitydiagram3.ftile.EntityImageLegend;
import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
+import net.sourceforge.plantuml.cucadiagram.DisplaySection;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -64,13 +65,13 @@ public class AnnotatedWorker {
}
private TextBlock addLegend(TextBlock original) {
- if (DisplayPositionned.isNull(annotated.getLegend())) {
+ final DisplayPositionned legend = annotated.getLegend();
+ if (legend.isNull()) {
return original;
}
- final TextBlock text = EntityImageLegend.create(annotated.getLegend().getDisplay(), getSkinParam());
+ final TextBlock text = EntityImageLegend.create(legend.getDisplay(), getSkinParam());
- return DecorateEntityImage.add(original, text, annotated.getLegend().getHorizontalAlignment(), annotated
- .getLegend().getVerticalAlignment());
+ return DecorateEntityImage.add(original, text, legend.getHorizontalAlignment(), legend.getVerticalAlignment());
}
private ISkinParam getSkinParam() {
@@ -78,7 +79,8 @@ public class AnnotatedWorker {
}
private TextBlock addCaption(TextBlock original) {
- if (DisplayPositionned.isNull(annotated.getCaption())) {
+ final DisplayPositionned caption = annotated.getCaption();
+ if (caption.isNull()) {
return original;
}
final TextBlock text = getCaption();
@@ -87,19 +89,17 @@ public class AnnotatedWorker {
}
public TextBlock getCaption() {
- if (DisplayPositionned.isNull(annotated.getCaption())) {
+ final DisplayPositionned caption = annotated.getCaption();
+ if (caption.isNull()) {
return TextBlockUtils.empty(0, 0);
}
- return annotated
- .getCaption()
- .getDisplay()
- .create(new FontConfiguration(getSkinParam(), FontParam.CAPTION, null), HorizontalAlignment.CENTER,
- getSkinParam());
+ return caption.getDisplay().create(new FontConfiguration(getSkinParam(), FontParam.CAPTION, null),
+ HorizontalAlignment.CENTER, getSkinParam());
}
private TextBlock addTitle(TextBlock original) {
final DisplayPositionned title = annotated.getTitle();
- if (DisplayPositionned.isNull(title)) {
+ if (title.isNull()) {
return original;
}
ISkinParam skinParam = getSkinParam();
@@ -110,22 +110,21 @@ public class AnnotatedWorker {
}
private TextBlock addHeaderAndFooter(TextBlock original) {
- if (DisplayPositionned.isNull(annotated.getFooter()) && DisplayPositionned.isNull(annotated.getHeader())) {
+ final DisplaySection footer = annotated.getFooter();
+ final DisplaySection header = annotated.getHeader();
+ if (footer.isNull() && header.isNull()) {
return original;
}
- final TextBlock textFooter = DisplayPositionned.isNull(annotated.getFooter()) ? null : annotated
- .getFooter()
- .getDisplay()
- .create(new FontConfiguration(getSkinParam(), FontParam.FOOTER, null),
- annotated.getFooter().getHorizontalAlignment(), getSkinParam());
- final TextBlock textHeader = DisplayPositionned.isNull(annotated.getHeader()) ? null : annotated
- .getHeader()
- .getDisplay()
- .create(new FontConfiguration(getSkinParam(), FontParam.HEADER, null),
- annotated.getHeader().getHorizontalAlignment(), getSkinParam());
-
- return new DecorateEntityImage(original, textHeader, annotated.getHeader().getHorizontalAlignment(),
- textFooter, annotated.getFooter().getHorizontalAlignment());
- }
+ TextBlock textFooter = null;
+ if (footer.isNull() == false) {
+ textFooter = footer.createRibbon(new FontConfiguration(getSkinParam(), FontParam.FOOTER, null), getSkinParam());
+ }
+ TextBlock textHeader = null;
+ if (header.isNull() == false) {
+ textHeader = header.createRibbon(new FontConfiguration(getSkinParam(), FontParam.HEADER, null), getSkinParam());
+ }
+ return DecorateEntityImage.addTopAndBottom(original, textHeader, header.getHorizontalAlignment(), textFooter,
+ footer.getHorizontalAlignment());
+ }
}
diff --git a/src/net/sourceforge/plantuml/BackSlash.java b/src/net/sourceforge/plantuml/BackSlash.java
index 0b2ef9b..1985c19 100644
--- a/src/net/sourceforge/plantuml/BackSlash.java
+++ b/src/net/sourceforge/plantuml/BackSlash.java
@@ -99,7 +99,7 @@ public class BackSlash {
final StringBuilder result = new StringBuilder();
for (int i = 0; i < s.length(); i++) {
final char c = s.charAt(i);
- if (c == '\\' && i < s.length() - 1 && isEnglishLetter(s.charAt(i + 1))) {
+ if (c == '\\' && i < s.length() - 1 && isEnglishLetterOfBackSlash(s.charAt(i + 1))) {
result.append('\\');
result.append(translateChar(s.charAt(i + 1)));
i++;
@@ -110,6 +110,11 @@ public class BackSlash {
return result.toString();
}
+ private static boolean isEnglishLetterOfBackSlash(char c) {
+ return c == 'n';
+ // return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
+ }
+
public static String untranslateBackSlashes(CharSequence s) {
if (s == null) {
return null;
@@ -125,10 +130,6 @@ public class BackSlash {
return result.toString();
}
- private static boolean isEnglishLetter(char c) {
- return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
- }
-
private static char translateChar(char c) {
if (c > 128) {
throw new IllegalArgumentException();
diff --git a/src/net/sourceforge/plantuml/BasicEnsureVisible.java b/src/net/sourceforge/plantuml/BasicEnsureVisible.java
index cbc021d..c1765d1 100644
--- a/src/net/sourceforge/plantuml/BasicEnsureVisible.java
+++ b/src/net/sourceforge/plantuml/BasicEnsureVisible.java
@@ -57,6 +57,10 @@ public class BasicEnsureVisible implements EnsureVisible {
}
}
+ public boolean hasData() {
+ return minX != Double.MAX_VALUE;
+ }
+
public String getCoords(double scale) {
if (minX == Double.MAX_VALUE) {
return "0,0,0,0";
diff --git a/src/net/sourceforge/plantuml/BlockUml.java b/src/net/sourceforge/plantuml/BlockUml.java
index 33a6d7b..70dfbf8 100644
--- a/src/net/sourceforge/plantuml/BlockUml.java
+++ b/src/net/sourceforge/plantuml/BlockUml.java
@@ -173,9 +173,9 @@ public class BlockUml {
return data.get(0).toString().equalsIgnoreCase(signature);
}
- public List<? extends CharSequence> getDefinition() {
- if (data.get(0).toString().startsWith("@startdef") == false) {
- throw new IllegalStateException();
+ public List<? extends CharSequence> getDefinition(boolean withHeader) {
+ if (withHeader) {
+ return Collections.unmodifiableList(data);
}
return Collections.unmodifiableList(data.subList(1, data.size() - 1));
}
diff --git a/src/net/sourceforge/plantuml/BlockUmlBuilder.java b/src/net/sourceforge/plantuml/BlockUmlBuilder.java
index 0d8a1d2..ef1587a 100644
--- a/src/net/sourceforge/plantuml/BlockUmlBuilder.java
+++ b/src/net/sourceforge/plantuml/BlockUmlBuilder.java
@@ -39,7 +39,6 @@ import java.io.File;
import java.io.IOException;
import java.io.Reader;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
@@ -64,9 +63,9 @@ public final class BlockUmlBuilder implements DefinitionsContainer {
Preprocessor includer = null;
this.defines = defines;
try {
- reader2 = new UncommentReadLine(new ReadLineReader(reader, desc));
- includer = new Preprocessor(reader2, charset, defines, newCurrentDir, this);
- init(includer, config);
+ reader2 = new UncommentReadLine(ReadLineReader.create(reader, desc));
+ includer = new Preprocessor(config, reader2, charset, defines, newCurrentDir, this);
+ init(includer);
} finally {
if (includer != null) {
includer.close();
@@ -79,7 +78,7 @@ public final class BlockUmlBuilder implements DefinitionsContainer {
this(config, charset, defines, reader, null, null);
}
- private void init(Preprocessor includer, List<String> config) throws IOException {
+ private void init(Preprocessor includer) throws IOException {
CharSequence2 s = null;
List<CharSequence2> current2 = null;
boolean paused = false;
@@ -94,6 +93,10 @@ public final class BlockUmlBuilder implements DefinitionsContainer {
paused = true;
reader2.setPaused(true);
}
+ if (StartUtils.isExit(s)) {
+ paused = true;
+ reader2.setPaused(true);
+ }
if (current2 != null && paused == false) {
current2.add(s);
} else if (paused) {
@@ -108,21 +111,23 @@ public final class BlockUmlBuilder implements DefinitionsContainer {
reader2.setPaused(false);
}
if (StartUtils.isArobaseEndDiagram(s) && current2 != null) {
- current2.addAll(1, convert(config, new LineLocationImpl(null, null).oneLineRead()));
- blocks.add(new BlockUml(current2, startLine - config.size(), defines.cloneMe()));
+ if (paused) {
+ current2.add(s);
+ }
+ blocks.add(new BlockUml(current2, startLine/* - config.size() */, defines.cloneMe()));
current2 = null;
reader2.setPaused(false);
}
}
}
- private Collection<CharSequence2> convert(List<String> config, LineLocation location) {
- final List<CharSequence2> result = new ArrayList<CharSequence2>();
- for (String s : config) {
- result.add(new CharSequence2Impl(s, location));
- }
- return result;
- }
+ // private Collection<CharSequence2> convert(List<String> config, LineLocation location) {
+ // final List<CharSequence2> result = new ArrayList<CharSequence2>();
+ // for (String s : config) {
+ // result.add(new CharSequence2Impl(s, location));
+ // }
+ // return result;
+ // }
public List<BlockUml> getBlockUmls() {
return Collections.unmodifiableList(blocks);
@@ -136,7 +141,7 @@ public final class BlockUmlBuilder implements DefinitionsContainer {
for (BlockUml block : blocks) {
if (block.isStartDef(name)) {
this.defines.importFrom(block.getLocalDefines());
- return block.getDefinition();
+ return block.getDefinition(false);
}
}
return Collections.emptyList();
diff --git a/src/net/sourceforge/plantuml/CMapData.java b/src/net/sourceforge/plantuml/CMapData.java
index 1f393d2..8ed1574 100644
--- a/src/net/sourceforge/plantuml/CMapData.java
+++ b/src/net/sourceforge/plantuml/CMapData.java
@@ -60,7 +60,7 @@ public class CMapData {
stringBuilder.append(s);
}
- public void appendUrl(int seq, Url url, double scale) {
+ private void appendUrl(int seq, Url url, double scale) {
appendString("<area shape=\"rect\" id=\"id");
appendLong(seq);
appendString("\" href=\"");
@@ -76,9 +76,6 @@ public class CMapData {
appendString(BackSlash.NEWLINE);
}
- // private CMapData() {
- // }
-
public static CMapData cmapString(Set<Url> allUrlEncountered, double scale) {
final CMapData cmapdata = new CMapData();
@@ -87,6 +84,9 @@ public class CMapData {
int seq = 1;
for (Url u : all) {
+ if (u.hasData() == false) {
+ continue;
+ }
cmapdata.appendUrl(seq, u, scale);
seq++;
}
diff --git a/src/net/sourceforge/plantuml/CharSequence2Impl.java b/src/net/sourceforge/plantuml/CharSequence2Impl.java
index 6cdbe0a..6d74bae 100644
--- a/src/net/sourceforge/plantuml/CharSequence2Impl.java
+++ b/src/net/sourceforge/plantuml/CharSequence2Impl.java
@@ -103,4 +103,35 @@ public class CharSequence2Impl implements CharSequence2 {
return preprocessorError;
}
+ public CharSequence2 removeInnerComment() {
+ final String string = s.toString();
+ final String trim = string.replace('\t', ' ').trim();
+ if (trim.startsWith("/'")) {
+ final int idx = string.indexOf("'/");
+ if (idx != -1) {
+ return new CharSequence2Impl(removeSpecialInnerComment(s.subSequence(idx + 2, s.length())), location,
+ preprocessorError);
+ }
+ }
+ if (trim.endsWith("'/")) {
+ final int idx = string.lastIndexOf("/'");
+ if (idx != -1) {
+ return new CharSequence2Impl(removeSpecialInnerComment(s.subSequence(0, idx)), location,
+ preprocessorError);
+ }
+ }
+ if (trim.contains("/'''") && trim.contains("'''/")) {
+ return new CharSequence2Impl(removeSpecialInnerComment(s), location, preprocessorError);
+ }
+ return this;
+ }
+
+ private CharSequence removeSpecialInnerComment(CharSequence cs) {
+ final String s = cs.toString();
+ if (s.contains("/'''") && s.contains("'''/")) {
+ return s.replaceAll("/'''[-\\w]*'''/", "");
+
+ }
+ return cs;
+ }
}
diff --git a/src/net/sourceforge/plantuml/ClipboardLoop.java b/src/net/sourceforge/plantuml/ClipboardLoop.java
new file mode 100644
index 0000000..3d268d0
--- /dev/null
+++ b/src/net/sourceforge/plantuml/ClipboardLoop.java
@@ -0,0 +1,122 @@
+/* ========================================================================
+ * 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.awt.Toolkit;
+import java.awt.datatransfer.Clipboard;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+import javax.imageio.ImageIO;
+
+import net.sourceforge.plantuml.core.DiagramDescription;
+
+public class ClipboardLoop {
+
+ public static void runLoop() throws IOException, InterruptedException {
+ final ClipboardLoop clipboardLoop = new ClipboardLoop();
+ while (true) {
+ final String text = clipboardLoop.getClipboardText();
+ if (clipboardLoop.isTextOk(text)) {
+ clipboardLoop.runText(text);
+ }
+ Thread.sleep(10000L);
+ }
+ }
+
+ public static void runOnce() throws IOException, InterruptedException {
+ final ClipboardLoop clipboardLoop = new ClipboardLoop();
+ final String text = clipboardLoop.getClipboardText();
+ if (clipboardLoop.isTextOk(text)) {
+ clipboardLoop.runText(text);
+ } else {
+ clipboardLoop.setClipboardImage(new BufferedImage(10, 10, BufferedImage.TYPE_INT_ARGB));
+ }
+
+ }
+
+ private boolean isTextOk(String text) {
+ if (text == null) {
+ return false;
+ }
+ return text.startsWith("@start");
+ }
+
+ private void runText(String text) throws IOException, InterruptedException {
+ Log.info("Getting some text from clipboard");
+ final SourceStringReader source = new SourceStringReader(text);
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ final DiagramDescription desc = source.outputImage(baos);
+ if (desc == null) {
+ Log.info("No image generated");
+ } else {
+ Log.info("Image ok " + desc.getDescription());
+ final byte[] data = baos.toByteArray();
+ baos.close();
+ final ByteArrayInputStream bais = new ByteArrayInputStream(data);
+ final BufferedImage image = ImageIO.read(bais);
+ setClipboardImage(image);
+ bais.close();
+ Log.info("Image copied in clipboard");
+ }
+ }
+
+ private String getClipboardText() {
+ final Transferable t = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null);
+ try {
+ if (t != null && t.isDataFlavorSupported(DataFlavor.stringFlavor)) {
+ final String text = (String) t.getTransferData(DataFlavor.stringFlavor);
+ return text;
+ }
+ } catch (UnsupportedFlavorException e) {
+ Log.error(e.toString());
+ } catch (IOException e) {
+ Log.error(e.toString());
+ }
+ return null;
+ }
+
+ private void setClipboardImage(BufferedImage image) {
+ final Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
+ clipboard.setContents(new ImageSelection(image), null);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/ColorParam.java b/src/net/sourceforge/plantuml/ColorParam.java
index 1b886ac..d35adf1 100644
--- a/src/net/sourceforge/plantuml/ColorParam.java
+++ b/src/net/sourceforge/plantuml/ColorParam.java
@@ -51,16 +51,13 @@ public enum ColorParam {
activityStart(HtmlColorUtils.BLACK),
activityEnd(HtmlColorUtils.BLACK),
activityBar(HtmlColorUtils.BLACK),
- // activityArrow(HtmlColorUtils.MY_RED, ColorType.ARROW),
swimlaneBorder(HtmlColorUtils.BLACK),
usecaseBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
usecaseBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- // usecaseArrow(HtmlColorUtils.MY_RED, ColorType.ARROW),
objectBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
objectBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
- // objectArrow(HtmlColorUtils.MY_RED, ColorType.ARROW),
classHeaderBackground(null, true, ColorType.BACK),
classBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
@@ -70,7 +67,11 @@ public enum ColorParam {
stereotypeABackground(HtmlColorUtils.COL_A9DCDF),
stereotypeIBackground(HtmlColorUtils.COL_B4A7E5),
stereotypeEBackground(HtmlColorUtils.COL_EB937F),
- // classArrow(HtmlColorUtils.MY_RED, ColorType.ARROW),
+ stereotypeCBorder(null),
+ stereotypeNBorder(null),
+ stereotypeABorder(null),
+ stereotypeIBorder(null),
+ stereotypeEBorder(null),
packageBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
packageBorder(HtmlColorUtils.BLACK, ColorType.LINE),
@@ -86,7 +87,6 @@ public enum ColorParam {
stateBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
stateBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
- // stateArrow(HtmlColorUtils.MY_RED, ColorType.ARROW),
stateStart(HtmlColorUtils.BLACK),
stateEnd(HtmlColorUtils.BLACK),
@@ -116,7 +116,6 @@ public enum ColorParam {
sequenceLifeLineBackground(HtmlColorUtils.WHITE, true, ColorType.BACK),
sequenceLifeLineBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
sequenceNewpageSeparator(HtmlColorUtils.BLACK, ColorType.LINE),
- // sequenceArrow(HtmlColorUtils.MY_RED),
sequenceBoxBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
sequenceBoxBackground(HtmlColorUtils.COL_DDDDDD, true, ColorType.BACK),
@@ -140,6 +139,8 @@ public enum ColorParam {
nodeBorder(HtmlColorUtils.BLACK, ColorType.LINE),
rectangleBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
rectangleBorder(HtmlColorUtils.BLACK, ColorType.LINE),
+ cardBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
+ cardBorder(HtmlColorUtils.BLACK, ColorType.LINE),
agentBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
agentBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
storageBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
@@ -162,7 +163,22 @@ public enum ColorParam {
iconProtectedBackground(HtmlColorUtils.COL_FFFF44),
iconPublic(HtmlColorUtils.COL_038048),
iconPublicBackground(HtmlColorUtils.COL_84BE84),
- iconIEMandatory(HtmlColorUtils.BLACK);
+ iconIEMandatory(HtmlColorUtils.BLACK),
+
+ arrowLollipop(HtmlColorUtils.WHITE),
+
+ machineBackground(HtmlColorUtils.WHITE),
+ machineBorder(HtmlColorUtils.BLACK, ColorType.LINE),
+ requirementBackground(HtmlColorUtils.WHITE),
+ requirementBorder(HtmlColorUtils.BLACK, ColorType.LINE),
+ designedBackground(HtmlColorUtils.WHITE),
+ designedBorder(HtmlColorUtils.BLACK, ColorType.LINE),
+ domainBackground(HtmlColorUtils.WHITE),
+ domainBorder(HtmlColorUtils.BLACK, ColorType.LINE),
+ lexicalBackground(HtmlColorUtils.WHITE),
+ lexicalBorder(HtmlColorUtils.BLACK, ColorType.LINE),
+ biddableBackground(HtmlColorUtils.WHITE),
+ biddableBorder(HtmlColorUtils.BLACK, ColorType.LINE);
private final boolean isBackground;
private final HtmlColor defaultValue;
diff --git a/src/net/sourceforge/plantuml/CornerParam.java b/src/net/sourceforge/plantuml/CornerParam.java
new file mode 100644
index 0000000..eb2271d
--- /dev/null
+++ b/src/net/sourceforge/plantuml/CornerParam.java
@@ -0,0 +1,55 @@
+/* ========================================================================
+ * 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 enum CornerParam {
+ DEFAULT, diagramBorder, titleBorder, rectangle, component, card, agent;
+
+ public String getRoundKey() {
+ if (this == DEFAULT) {
+ return "roundcorner";
+ }
+ return name() + "roundcorner";
+ }
+
+ public String getDiagonalKey() {
+ if (this == DEFAULT) {
+ return "diagonalcorner";
+ }
+ return name() + "diagonalcorner";
+ }
+
+} \ No newline at end of file
diff --git a/src/net/sourceforge/plantuml/Dimension2DDouble.java b/src/net/sourceforge/plantuml/Dimension2DDouble.java
index da42121..5b9c706 100644
--- a/src/net/sourceforge/plantuml/Dimension2DDouble.java
+++ b/src/net/sourceforge/plantuml/Dimension2DDouble.java
@@ -45,6 +45,9 @@ public class Dimension2DDouble extends Dimension2D {
final private double height;
public Dimension2DDouble(double width, double height) {
+ if (Double.isNaN(width) || Double.isNaN(height)) {
+ throw new IllegalArgumentException();
+ }
this.width = width;
this.height = height;
}
@@ -73,6 +76,10 @@ public class Dimension2DDouble extends Dimension2D {
return delta(dim, delta, delta);
}
+ public Dimension2DDouble withWidth(double newWidth) {
+ return new Dimension2DDouble(newWidth, height);
+ }
+
public static Dimension2D delta(Dimension2D dim, double deltaWidth, double deltaHeight) {
if (deltaHeight == 0 && deltaWidth == 0) {
return dim;
diff --git a/src/net/sourceforge/plantuml/EmptyImageBuilder.java b/src/net/sourceforge/plantuml/EmptyImageBuilder.java
index a5ae18d..1682473 100644
--- a/src/net/sourceforge/plantuml/EmptyImageBuilder.java
+++ b/src/net/sourceforge/plantuml/EmptyImageBuilder.java
@@ -49,18 +49,18 @@ public class EmptyImageBuilder {
private final BufferedImage im;
private final Graphics2D g2d;
-
+
public EmptyImageBuilder(double width, double height, Color background) {
this((int) width, (int) height, background);
}
public EmptyImageBuilder(int width, int height, Color background) {
if (width > GraphvizUtils.getenvImageLimit()) {
- Log.info("Width too large " + width);
+ Log.info("Width too large " + width + ". You should set PLANTUML_LIMIT_SIZE");
width = GraphvizUtils.getenvImageLimit();
}
if (height > GraphvizUtils.getenvImageLimit()) {
- Log.info("Height too large " + height);
+ Log.info("Height too large " + height + ". You should set PLANTUML_LIMIT_SIZE");
height = GraphvizUtils.getenvImageLimit();
}
Log.info("Creating image " + width + "x" + height);
diff --git a/src/net/sourceforge/plantuml/FileFormat.java b/src/net/sourceforge/plantuml/FileFormat.java
index 91d7932..ba691c9 100644
--- a/src/net/sourceforge/plantuml/FileFormat.java
+++ b/src/net/sourceforge/plantuml/FileFormat.java
@@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml;
+import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics2D;
import java.awt.geom.Dimension2D;
@@ -54,7 +55,7 @@ import net.sourceforge.plantuml.ugraphic.UFont;
*
*/
public enum FileFormat {
- PNG, SVG, EPS, EPS_TEXT, ATXT, UTXT, XMI_STANDARD, XMI_STAR, XMI_ARGO, SCXML, PDF, MJPEG, ANIMATED_GIF, HTML, HTML5, VDX, LATEX, LATEX_NO_PREAMBLE, BASE64, BRAILLE_PNG;
+ PNG, SVG, EPS, EPS_TEXT, ATXT, UTXT, XMI_STANDARD, XMI_STAR, XMI_ARGO, SCXML, PDF, MJPEG, ANIMATED_GIF, HTML, HTML5, VDX, LATEX, LATEX_NO_PREAMBLE, BASE64, BRAILLE_PNG, PREPROC;
/**
* Returns the file format to be used for that format.
@@ -86,24 +87,71 @@ public enum FileFormat {
final static private BufferedImage imDummy = new BufferedImage(800, 100, BufferedImage.TYPE_INT_RGB);
final static private Graphics2D gg = imDummy.createGraphics();
- public StringBounder getDefaultStringBounder() {
+ public StringBounder getDefaultStringBounder(TikzFontDistortion tikzFontDistortion) {
+ if (this == LATEX || this == LATEX_NO_PREAMBLE) {
+ return getTikzStringBounder(tikzFontDistortion);
+ }
if (this == BRAILLE_PNG) {
- return new StringBounder() {
- public Dimension2D calculateDimension(UFont font, String text) {
- final int nb = BrailleCharFactory.build(text).size();
- final double quanta = UGraphicBraille.QUANTA;
- final double height = 5 * quanta;
- final double width = 3 * nb * quanta + 1;
- return new Dimension2DDouble(width, height);
- }
- };
+ return getBrailleStringBounder();
}
+ return getNormalStringBounder();
+ }
+
+ private StringBounder getNormalStringBounder() {
+ return new StringBounder() {
+ @Override
+ public String toString() {
+ return "FileFormat::getNormalStringBounder";
+ }
+
+ public Dimension2D calculateDimension(UFont font, String text) {
+ return getJavaDimension(font, text);
+ }
+
+ };
+ }
+
+ private Dimension2DDouble getJavaDimension(UFont font, String text) {
+ final Font javaFont = font.getFont();
+ final FontMetrics fm = gg.getFontMetrics(javaFont);
+ final Rectangle2D rect = fm.getStringBounds(text, gg);
+ return new Dimension2DDouble(rect.getWidth(), rect.getHeight());
+ }
+
+ private StringBounder getBrailleStringBounder() {
+ return new StringBounder() {
+ @Override
+ public String toString() {
+ return "FileFormat::getBrailleStringBounder";
+ }
+
+ public Dimension2D calculateDimension(UFont font, String text) {
+ final int nb = BrailleCharFactory.build(text).size();
+ final double quanta = UGraphicBraille.QUANTA;
+ final double height = 5 * quanta;
+ final double width = 3 * nb * quanta + 1;
+ return new Dimension2DDouble(width, height);
+ }
+ };
+ }
+
+ private StringBounder getTikzStringBounder(final TikzFontDistortion tikzFontDistortion) {
return new StringBounder() {
+ @Override
+ public String toString() {
+ return "FileFormat::getTikzStringBounder";
+ }
+
public Dimension2D calculateDimension(UFont font, String text) {
- final FontMetrics fm = gg.getFontMetrics(font.getFont());
- final Rectangle2D rect = fm.getStringBounds(text, gg);
- return new Dimension2DDouble(rect.getWidth(), rect.getHeight());
+ final Dimension2DDouble w1 = getJavaDimension(font.goTikz(-1), text);
+ final Dimension2DDouble w2 = getJavaDimension(font.goTikz(0), text);
+ final Dimension2DDouble w3 = getJavaDimension(font.goTikz(1), text);
+ final double factor = (w3.getWidth() - w1.getWidth()) / w2.getWidth();
+ final double distortion = tikzFontDistortion.getDistortion();
+ final double magnify = tikzFontDistortion.getMagnify();
+ final double delta = (w2.getWidth() - w1.getWidth()) * factor * distortion;
+ return w2.withWidth(Math.max(w1.getWidth(), magnify * w2.getWidth() - delta));
}
};
}
diff --git a/src/net/sourceforge/plantuml/FileFormatOption.java b/src/net/sourceforge/plantuml/FileFormatOption.java
index fbe6943..df8ecdd 100644
--- a/src/net/sourceforge/plantuml/FileFormatOption.java
+++ b/src/net/sourceforge/plantuml/FileFormatOption.java
@@ -55,13 +55,14 @@ public class FileFormatOption implements Serializable {
private final boolean useRedForError;
private final String svgLinkTarget;
private final String hoverColor;
+ private final TikzFontDistortion tikzFontDistortion;
public FileFormatOption(FileFormat fileFormat) {
- this(fileFormat, null, true, false, "_top", false, null);
+ this(fileFormat, null, true, false, "_top", false, null, TikzFontDistortion.getDefault());
}
public StringBounder getDefaultStringBounder() {
- return fileFormat.getDefaultStringBounder();
+ return fileFormat.getDefaultStringBounder(tikzFontDistortion);
}
public String getSvgLinkTarget() {
@@ -73,11 +74,11 @@ public class FileFormatOption implements Serializable {
}
public FileFormatOption(FileFormat fileFormat, boolean withMetadata) {
- this(fileFormat, null, false, false, "_top", false, null);
+ this(fileFormat, null, false, false, "_top", false, null, TikzFontDistortion.getDefault());
}
private FileFormatOption(FileFormat fileFormat, AffineTransform at, boolean withMetadata, boolean useRedForError,
- String svgLinkTarget, boolean debugsvek, String hoverColor) {
+ String svgLinkTarget, boolean debugsvek, String hoverColor, TikzFontDistortion tikzFontDistortion) {
this.hoverColor = hoverColor;
this.fileFormat = fileFormat;
this.affineTransform = at;
@@ -85,21 +86,30 @@ public class FileFormatOption implements Serializable {
this.useRedForError = useRedForError;
this.svgLinkTarget = svgLinkTarget;
this.debugsvek = debugsvek;
+ this.tikzFontDistortion = tikzFontDistortion;
+ if (tikzFontDistortion == null) {
+ throw new IllegalArgumentException();
+ }
}
public FileFormatOption withUseRedForError() {
return new FileFormatOption(fileFormat, affineTransform, withMetadata, true, svgLinkTarget, debugsvek,
- hoverColor);
+ hoverColor, tikzFontDistortion);
+ }
+
+ public FileFormatOption withTikzFontDistortion(TikzFontDistortion tikzFontDistortion) {
+ return new FileFormatOption(fileFormat, affineTransform, withMetadata, true, svgLinkTarget, debugsvek,
+ hoverColor, tikzFontDistortion);
}
public FileFormatOption withSvgLinkTarget(String svgLinkTarget) {
return new FileFormatOption(fileFormat, affineTransform, withMetadata, useRedForError, svgLinkTarget,
- debugsvek, hoverColor);
+ debugsvek, hoverColor, tikzFontDistortion);
}
public FileFormatOption withHoverColor(String hoverColor) {
return new FileFormatOption(fileFormat, affineTransform, withMetadata, useRedForError, svgLinkTarget,
- debugsvek, hoverColor);
+ debugsvek, hoverColor, tikzFontDistortion);
}
@Override
@@ -137,4 +147,8 @@ public class FileFormatOption implements Serializable {
this.withMetadata = false;
}
+ public final TikzFontDistortion getTikzFontDistortion() {
+ return tikzFontDistortion;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/FileImageData.java b/src/net/sourceforge/plantuml/FileImageData.java
index e45d842..ad806de 100644
--- a/src/net/sourceforge/plantuml/FileImageData.java
+++ b/src/net/sourceforge/plantuml/FileImageData.java
@@ -40,6 +40,9 @@ import java.io.File;
import net.sourceforge.plantuml.core.ImageData;
public class FileImageData {
+
+ public static final int ERROR = 400;
+ public static final int CRASH = 503;
private final File file;
private final ImageData imageData;
@@ -57,4 +60,11 @@ public class FileImageData {
return imageData;
}
+ public int getStatus() {
+ if (imageData == null) {
+ return 0;
+ }
+ return imageData.getStatus();
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/FileUtils.java b/src/net/sourceforge/plantuml/FileUtils.java
index dda5a47..538ee78 100644
--- a/src/net/sourceforge/plantuml/FileUtils.java
+++ b/src/net/sourceforge/plantuml/FileUtils.java
@@ -35,6 +35,8 @@
*/
package net.sourceforge.plantuml;
+import java.awt.Image;
+import java.awt.image.BufferedImage;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
@@ -46,8 +48,11 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
+import java.net.URL;
import java.util.concurrent.atomic.AtomicInteger;
+import javax.swing.ImageIcon;
+
// Used by the Eclipse Plugin, so do not change package location.
public class FileUtils {
@@ -115,19 +120,27 @@ public class FileUtils {
static public String readSvg(File svgFile) throws IOException {
final BufferedReader br = new BufferedReader(new FileReader(svgFile));
- return readSvg(br, true);
+ return readSvg(br, false, true);
}
static public String readSvg(InputStream is) throws IOException {
final BufferedReader br = new BufferedReader(new InputStreamReader(is));
- return readSvg(br, false);
+ return readSvg(br, false, false);
+ }
+
+ static public String readFile(File svgFile) throws IOException {
+ final BufferedReader br = new BufferedReader(new FileReader(svgFile));
+ return readSvg(br, true, true);
}
- private static String readSvg(final BufferedReader br, boolean withClose) throws IOException {
+ private static String readSvg(final BufferedReader br, boolean withNewline, boolean withClose) throws IOException {
final StringBuilder sb = new StringBuilder();
String s;
while ((s = br.readLine()) != null) {
sb.append(s);
+ if (withNewline) {
+ sb.append("\n");
+ }
}
if (withClose) {
br.close();
@@ -135,4 +148,36 @@ public class FileUtils {
return sb.toString();
}
+ // public static BufferedImage ImageIO_read(File f) throws IOException {
+ // return ImageIO.read(f);
+ // }
+
+ public static BufferedImage ImageIO_read(File f) {
+ // https://www.experts-exchange.com/questions/26171948/Why-are-ImageIO-read-images-losing-their-transparency.html
+ // https://stackoverflow.com/questions/18743790/can-java-load-images-with-transparency
+
+ try {
+ return readImage(new ImageIcon(f.getAbsolutePath()));
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+ public static BufferedImage ImageIO_read(URL url) {
+ try {
+ return readImage(new ImageIcon(url));
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+ private static BufferedImage readImage(final ImageIcon imageIcon) {
+ final Image tmpImage = imageIcon.getImage();
+ final BufferedImage image = new BufferedImage(imageIcon.getIconWidth(), imageIcon.getIconHeight(),
+ BufferedImage.TYPE_INT_ARGB);
+ image.getGraphics().drawImage(tmpImage, 0, 0, null);
+ tmpImage.flush();
+ return image;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/FontParam.java b/src/net/sourceforge/plantuml/FontParam.java
index 2fdf0c2..2ebfca7 100644
--- a/src/net/sourceforge/plantuml/FontParam.java
+++ b/src/net/sourceforge/plantuml/FontParam.java
@@ -76,6 +76,7 @@ public enum FontParam {
ENTITY(14, Font.PLAIN), //
AGENT(14, Font.PLAIN), //
RECTANGLE(14, Font.PLAIN), //
+ CARD(14, Font.PLAIN), //
NODE(14, Font.PLAIN), //
DATABASE(14, Font.PLAIN), //
QUEUE(14, Font.PLAIN), //
@@ -107,6 +108,7 @@ public enum FontParam {
ENTITY_STEREOTYPE(14, Font.ITALIC), //
AGENT_STEREOTYPE(14, Font.ITALIC), //
RECTANGLE_STEREOTYPE(14, Font.ITALIC), //
+ CARD_STEREOTYPE(14, Font.ITALIC), //
NODE_STEREOTYPE(14, Font.ITALIC), //
FOLDER_STEREOTYPE(14, Font.ITALIC), //
FILE_STEREOTYPE(14, Font.ITALIC), //
@@ -116,7 +118,15 @@ public enum FontParam {
STACK_STEREOTYPE(14, Font.ITALIC), //
ACTOR_STEREOTYPE(14, Font.ITALIC), //
SEQUENCE_STEREOTYPE(14, Font.ITALIC), //
- PARTITION(14, Font.PLAIN); //
+ PARTITION(14, Font.PLAIN),
+ DESIGNED_DOMAIN(12, Font.PLAIN), //
+ DESIGNED_DOMAIN_STEREOTYPE(12, Font.ITALIC), //
+ DOMAIN(12, Font.PLAIN), //
+ DOMAIN_STEREOTYPE(12, Font.ITALIC), //
+ MACHINE(12, Font.PLAIN), //
+ MACHINE_STEREOTYPE(12, Font.ITALIC), //
+ REQUIREMENT(12, Font.PLAIN), //
+ REQUIREMENT_STEREOTYPE(12, Font.ITALIC); //
private final int defaultSize;
private final int fontStyle;
diff --git a/src/net/sourceforge/plantuml/GeneratedImage.java b/src/net/sourceforge/plantuml/GeneratedImage.java
index 1354014..ddf7cce 100644
--- a/src/net/sourceforge/plantuml/GeneratedImage.java
+++ b/src/net/sourceforge/plantuml/GeneratedImage.java
@@ -45,4 +45,6 @@ public interface GeneratedImage extends Comparable<GeneratedImage> {
public int lineErrorRaw();
+ public int getStatus();
+
}
diff --git a/src/net/sourceforge/plantuml/GeneratedImageImpl.java b/src/net/sourceforge/plantuml/GeneratedImageImpl.java
index 6a3d3cd..0d92a72 100644
--- a/src/net/sourceforge/plantuml/GeneratedImageImpl.java
+++ b/src/net/sourceforge/plantuml/GeneratedImageImpl.java
@@ -44,11 +44,17 @@ public class GeneratedImageImpl implements GeneratedImage {
private final File pngFile;
private final String description;
private final BlockUml blockUml;
+ private final int status;
- public GeneratedImageImpl(File pngFile, String description, BlockUml blockUml) {
+ public final int getStatus() {
+ return status;
+ }
+
+ public GeneratedImageImpl(File pngFile, String description, BlockUml blockUml, int status) {
this.blockUml = blockUml;
this.pngFile = pngFile;
this.description = description;
+ this.status = status;
}
public File getPngFile() {
diff --git a/src/net/sourceforge/plantuml/ISkinParam.java b/src/net/sourceforge/plantuml/ISkinParam.java
index 58f1ba8..22aed02 100644
--- a/src/net/sourceforge/plantuml/ISkinParam.java
+++ b/src/net/sourceforge/plantuml/ISkinParam.java
@@ -51,6 +51,8 @@ import net.sourceforge.plantuml.ugraphic.UStroke;
public interface ISkinParam extends ISkinSimple {
+ public static final int SWIMLANE_WIDTH_SAME = -1;
+
public HtmlColor getHyperlinkColor();
public boolean useUnderlineForHyperlink();
@@ -67,12 +69,14 @@ public interface ISkinParam extends ISkinSimple {
public UFont getFont(Stereotype stereotype, boolean inPackageTitle, FontParam... fontParam);
- public HorizontalAlignment getHorizontalAlignment(AlignParam param, ArrowDirection arrowDirection);
+ public HorizontalAlignment getHorizontalAlignment(AlignmentParam param, ArrowDirection arrowDirection);
public HorizontalAlignment getDefaultTextAlignment(HorizontalAlignment defaultValue);
public int getCircledCharacterRadius();
+ public char getCircledCharacter(Stereotype stereotype);
+
public int classAttributeIconSize();
public ColorMapper getColorMapper();
@@ -99,10 +103,16 @@ public interface ISkinParam extends ISkinSimple {
public double getRanksep();
- public double getRoundCorner(String param, Stereotype stereotype);
+ public double getRoundCorner(CornerParam param, Stereotype stereotype);
+
+ public double getDiagonalCorner(CornerParam param, Stereotype stereotype);
public LineBreakStrategy maxMessageSize();
+ public LineBreakStrategy wrapWidth();
+
+ public LineBreakStrategy swimlaneWrapTitleWidth();
+
public boolean strictUmlStyle();
public boolean forceSequenceParticipantUnderlined();
@@ -139,8 +149,16 @@ public interface ISkinParam extends ISkinSimple {
public HtmlColor getHoverPathColor();
+ public TikzFontDistortion getTikzFontDistortion();
+
public double getPadding(PaddingParam param);
-
+
public boolean useRankSame();
+ public boolean displayGenericWithOldFashion();
+
+ public boolean responseMessageBelowArrow();
+
+ public boolean svgDimensionStyle();
+
} \ No newline at end of file
diff --git a/src/net/sourceforge/plantuml/ISourceFileReader.java b/src/net/sourceforge/plantuml/ISourceFileReader.java
index 8de17e3..3be74d0 100644
--- a/src/net/sourceforge/plantuml/ISourceFileReader.java
+++ b/src/net/sourceforge/plantuml/ISourceFileReader.java
@@ -41,12 +41,13 @@ import java.util.List;
public interface ISourceFileReader {
public List<GeneratedImage> getGeneratedImages() throws IOException;
-
+
public List<BlockUml> getBlocks();
public boolean hasError();
-
+
public void setFileFormatOption(FileFormatOption fileFormatOption);
+ public void setCheckMetadata(boolean checkMetadata);
}
diff --git a/src/net/sourceforge/plantuml/ImageSelection.java b/src/net/sourceforge/plantuml/ImageSelection.java
new file mode 100644
index 0000000..4999909
--- /dev/null
+++ b/src/net/sourceforge/plantuml/ImageSelection.java
@@ -0,0 +1,64 @@
+/* ========================================================================
+ * 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.awt.Image;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.io.IOException;
+
+public class ImageSelection implements Transferable {
+
+ private Image image;
+
+ public ImageSelection(Image image) {
+ this.image = image;
+ }
+
+ public DataFlavor[] getTransferDataFlavors() {
+ return new DataFlavor[] { DataFlavor.imageFlavor };
+ }
+
+ public boolean isDataFlavorSupported(DataFlavor flavor) {
+ return DataFlavor.imageFlavor.equals(flavor);
+ }
+
+ public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
+ return image;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/LineBreakStrategy.java b/src/net/sourceforge/plantuml/LineBreakStrategy.java
index 347d8fe..5934eb7 100644
--- a/src/net/sourceforge/plantuml/LineBreakStrategy.java
+++ b/src/net/sourceforge/plantuml/LineBreakStrategy.java
@@ -45,7 +45,11 @@ public class LineBreakStrategy {
this.value = value;
}
- public double getMathWidth() {
+ public boolean isAuto() {
+ return "auto".equalsIgnoreCase(value);
+ }
+
+ public double getMaxWidth() {
if (value != null && value.matches("-?\\d+")) {
return Double.parseDouble(value);
}
diff --git a/src/net/sourceforge/plantuml/LineLocationImpl.java b/src/net/sourceforge/plantuml/LineLocationImpl.java
index b46b9da..af4524b 100644
--- a/src/net/sourceforge/plantuml/LineLocationImpl.java
+++ b/src/net/sourceforge/plantuml/LineLocationImpl.java
@@ -43,9 +43,6 @@ public class LineLocationImpl implements LineLocation {
@Override
public String toString() {
- if (desc == null) {
- return "[?] : " + position;
- }
return desc + " : " + position;
}
@@ -54,6 +51,9 @@ public class LineLocationImpl implements LineLocation {
}
private LineLocationImpl(String desc, LineLocation parent, int position) {
+ if (desc == null) {
+ throw new IllegalArgumentException();
+ }
this.parent = parent;
this.desc = desc;
this.position = position;
diff --git a/src/net/sourceforge/plantuml/LineParam.java b/src/net/sourceforge/plantuml/LineParam.java
index 7e9b697..b8ecdc3 100644
--- a/src/net/sourceforge/plantuml/LineParam.java
+++ b/src/net/sourceforge/plantuml/LineParam.java
@@ -46,6 +46,7 @@ public enum LineParam {
sequenceParticipantBorder, noteBorder, sequenceGroupBorder, sequenceReferenceBorder,
legendBorder,
sequenceArrow,
+ arrow,
classBorder, objectBorder, usecaseBorder,
partitionBorder,
packageBorder,
@@ -53,7 +54,11 @@ public enum LineParam {
activityBorder,
titleBorder,
diagramBorder,
- rectangleBorder;
+ rectangleBorder,
+ componentBorder,
+ cardBorder,
+ agentBorder,
+ domainBorder, designedDomainBorder, machineBorder, requirementBorder;
// sequenceBoxBorder(0.1);
}
diff --git a/src/net/sourceforge/plantuml/Option.java b/src/net/sourceforge/plantuml/Option.java
index e86c400..0968f8f 100644
--- a/src/net/sourceforge/plantuml/Option.java
+++ b/src/net/sourceforge/plantuml/Option.java
@@ -68,6 +68,7 @@ public class Option {
private boolean pipeNoStdErr = false;
private boolean syntax = false;
private boolean checkOnly = false;
+ private OptionPreprocOutputMode preprocessorOutput = null;
private boolean failfast = false;
private boolean failfast2 = false;
private boolean pattern = false;
@@ -78,10 +79,12 @@ public class Option {
private int nbThreads = 0;
private int ftpPort = -1;
private boolean hideMetadata = false;
+ private boolean checkMetadata = false;
private int imageIndex = 0;
private File outputDir = null;
private File outputFile = null;
+ private String filename;
private final List<String> result = new ArrayList<String>();
@@ -106,7 +109,13 @@ public class Option {
}
for (int i = 0; i < arg.length; i++) {
String s = arg[i];
- if (s.equalsIgnoreCase("-tsvg") || s.equalsIgnoreCase("-svg")) {
+ if (s.equalsIgnoreCase("-headless")) {
+ // Useless because done in Run.java
+ if (i != 0) {
+ Log.error("Warning: -headless flag must be the first one in the command line");
+ }
+ System.setProperty("java.awt.headless", "true");
+ } else if (s.equalsIgnoreCase("-tsvg") || s.equalsIgnoreCase("-svg")) {
setFileFormatOption(new FileFormatOption(FileFormat.SVG));
} else if (s.equalsIgnoreCase("-tsvg:nornd") || s.equalsIgnoreCase("-svg:nornd")) {
setFileFormatOption(new FileFormatOption(FileFormat.SVG));
@@ -168,6 +177,12 @@ public class Option {
continue;
}
charset = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg[i]);
+ } else if (s.equalsIgnoreCase("-filename")) {
+ i++;
+ if (i == arg.length) {
+ continue;
+ }
+ filename = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg[i]);
} else if (s.startsWith("-o") && s.length() > 3) {
s = s.substring(2);
outputDir = new File(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(s));
@@ -282,8 +297,8 @@ public class Option {
OptionFlags.getInstance().setGui(true);
} else if (s.equalsIgnoreCase("-encodesprite")) {
OptionFlags.getInstance().setEncodesprite(true);
- } else if (s.equalsIgnoreCase("-nosuggestengine")) {
- OptionFlags.getInstance().setUseSuggestEngine(false);
+ // } else if (s.equalsIgnoreCase("-nosuggestengine")) {
+ // OptionFlags.getInstance().setUseSuggestEngine(false);
} else if (s.equalsIgnoreCase("-printfonts")) {
OptionFlags.getInstance().setPrintFonts(true);
} else if (s.equalsIgnoreCase("-dumphtmlstats")) {
@@ -296,6 +311,14 @@ public class Option {
OptionFlags.getInstance().setEnableStats(true);
} else if (s.equalsIgnoreCase("-disablestats")) {
OptionFlags.getInstance().setEnableStats(false);
+ } else if (s.equalsIgnoreCase("-extractstdlib")) {
+ OptionFlags.getInstance().setExtractStdLib(true);
+ } else if (s.equalsIgnoreCase("-stdlib")) {
+ OptionFlags.getInstance().setStdLib(true);
+ } else if (s.equalsIgnoreCase("-clipboard")) {
+ OptionFlags.getInstance().setClipboard(true);
+ } else if (s.equalsIgnoreCase("-clipboardloop")) {
+ OptionFlags.getInstance().setClipboardLoop(true);
} else if (s.equalsIgnoreCase("-htmlstats")) {
StatsUtils.setHtmlStats(true);
} else if (s.equalsIgnoreCase("-xmlstats")) {
@@ -310,6 +333,12 @@ public class Option {
textProgressBar = true;
} else if (s.equalsIgnoreCase("-nometadata")) {
hideMetadata = true;
+ } else if (s.equalsIgnoreCase("-preproc")) {
+ preprocessorOutput = OptionPreprocOutputMode.NORMAL;
+ } else if (s.equalsIgnoreCase("-cypher")) {
+ preprocessorOutput = OptionPreprocOutputMode.CYPHER;
+ } else if (s.equalsIgnoreCase("-checkmetadata")) {
+ checkMetadata = true;
} else if (s.equalsIgnoreCase("-pipeimageindex")) {
i++;
if (i == arg.length) {
@@ -397,7 +426,7 @@ public class Option {
}
public final static String getPattern() {
- return "(?i)^.*\\.(txt|tex|java|htm|html|c|h|cpp|apt|pu)$";
+ return "(?i)^.*\\.(txt|tex|java|htm|html|c|h|cpp|apt|pu|pump|hpp|hh)$";
}
public void setOutputDir(File f) {
@@ -412,7 +441,15 @@ public class Option {
final Defines result = Defines.createWithFileName(f);
for (Map.Entry<String, String> ent : defines.entrySet()) {
result.define(ent.getKey(), Arrays.asList(ent.getValue()), false);
+ }
+ return result;
+ }
+ public Defines getDefaultDefines() {
+ final Defines result = Defines.createEmpty();
+ result.overrideFilename(filename);
+ for (Map.Entry<String, String> ent : defines.entrySet()) {
+ result.define(ent.getKey(), Arrays.asList(ent.getValue()), false);
}
return result;
}
@@ -548,4 +585,20 @@ public class Option {
return imageIndex;
}
+ public final void setFilename(String filename) {
+ this.filename = filename;
+ }
+
+ public final boolean isCheckMetadata() {
+ return checkMetadata;
+ }
+
+ public final OptionPreprocOutputMode getPreprocessorOutputMode() {
+ return preprocessorOutput;
+ }
+
+ // public final void setPreprocessorOutput(boolean preprocessorOutput) {
+ // this.preprocessorOutput = preprocessorOutput;
+ // }
+
}
diff --git a/src/net/sourceforge/plantuml/OptionFlags.java b/src/net/sourceforge/plantuml/OptionFlags.java
index e3369d3..c0588d4 100644
--- a/src/net/sourceforge/plantuml/OptionFlags.java
+++ b/src/net/sourceforge/plantuml/OptionFlags.java
@@ -72,7 +72,6 @@ public class OptionFlags {
static public final boolean OMEGA_CROSSING = false;
// static public final boolean LINK_BETWEEN_FIELDS = true;
- // static public final boolean USE_JDOT = false;
public void reset() {
reset(false);
@@ -97,7 +96,7 @@ public class OptionFlags {
quiet = false;
checkDotError = false;
printFonts = false;
- useSuggestEngine = true;
+ // useSuggestEngine = true;
// failOnError = false;
encodesprite = false;
// PIC_LINE = false;
@@ -116,13 +115,17 @@ public class OptionFlags {
private boolean quiet;
private boolean checkDotError;
private boolean printFonts;
- private boolean useSuggestEngine;
+ // private boolean useSuggestEngine;
private boolean encodesprite;
private boolean dumpHtmlStats;
private boolean dumpStats;
private boolean loopStats;
private boolean overwrite;
private boolean enableStats = defaultForStats();
+ private boolean stdLib;
+ private boolean extractStdLib;
+ private boolean clipboardLoop;
+ private boolean clipboard;
private String fileSeparator = "_";
private long timeoutMs = 15 * 60 * 1000L; // 15 minutes
private File logData;
@@ -250,13 +253,17 @@ public class OptionFlags {
this.printFonts = printFonts;
}
- public final boolean isUseSuggestEngine() {
- return useSuggestEngine;
+ public final boolean isUseSuggestEngine2() {
+ return false;
}
- public final void setUseSuggestEngine(boolean useSuggestEngine) {
- this.useSuggestEngine = useSuggestEngine;
- }
+ // public final boolean isUseSuggestEngine() {
+ // return useSuggestEngine;
+ // }
+ //
+ // public final void setUseSuggestEngine(boolean useSuggestEngine) {
+ // this.useSuggestEngine = useSuggestEngine;
+ // }
public final boolean isEncodesprite() {
return encodesprite;
@@ -311,7 +318,7 @@ public class OptionFlags {
}
private static boolean isTrue(final String value) {
- return "on".equalsIgnoreCase(value) || "true".equalsIgnoreCase(value) || "on".equalsIgnoreCase(value);
+ return "on".equalsIgnoreCase(value) || "true".equalsIgnoreCase(value);
}
public boolean isEnableStats() {
@@ -329,4 +336,36 @@ public class OptionFlags {
public final void setTimeoutMs(long timeoutMs) {
this.timeoutMs = timeoutMs;
}
+
+ public void setExtractStdLib(boolean extractStdLib) {
+ this.extractStdLib = extractStdLib;
+ }
+
+ public boolean isExtractStdLib() {
+ return extractStdLib;
+ }
+
+ public final boolean isClipboardLoop() {
+ return clipboardLoop;
+ }
+
+ public final void setClipboardLoop(boolean clipboardLoop) {
+ this.clipboardLoop = clipboardLoop;
+ }
+
+ public final boolean isClipboard() {
+ return clipboard;
+ }
+
+ public final void setClipboard(boolean clipboard) {
+ this.clipboard = clipboard;
+ }
+
+ public final boolean isStdLib() {
+ return stdLib;
+ }
+
+ public final void setStdLib(boolean stdLib) {
+ this.stdLib = stdLib;
+ }
}
diff --git a/src/net/sourceforge/plantuml/OptionPreprocOutputMode.java b/src/net/sourceforge/plantuml/OptionPreprocOutputMode.java
new file mode 100644
index 0000000..4fc9179
--- /dev/null
+++ b/src/net/sourceforge/plantuml/OptionPreprocOutputMode.java
@@ -0,0 +1,41 @@
+/* ========================================================================
+ * 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 enum OptionPreprocOutputMode {
+ NORMAL, CYPHER
+
+}
diff --git a/src/net/sourceforge/plantuml/OptionPrint.java b/src/net/sourceforge/plantuml/OptionPrint.java
index 07c52a7..bd3e6e2 100644
--- a/src/net/sourceforge/plantuml/OptionPrint.java
+++ b/src/net/sourceforge/plantuml/OptionPrint.java
@@ -104,6 +104,7 @@ public class OptionPrint {
System.out.println(" -e[x]clude pattern\tTo exclude files that match the provided pattern");
System.out.println(" -metadata\t\tTo retrieve PlantUML sources from PNG images");
System.out.println(" -nometadata\t\tTo NOT export metadata in PNG/SVG generated files");
+ System.out.println(" -checkmetadata\t\tSkip PNG files that don't need to be regenerated");
System.out.println(" -version\t\tTo display information about PlantUML and Java versions");
System.out.println(" -checkversion\tTo check if a newer version is available for download");
System.out.println(" -v[erbose]\t\tTo have log information");
@@ -119,7 +120,7 @@ public class OptionPrint {
System.out.println(" -decodeurl\t\tTo retrieve the PlantUML source from an encoded URL");
System.out.println(" -syntax\t\tTo report any syntax error from standard input without generating images");
System.out.println(" -language\t\tTo print the list of PlantUML keywords");
- System.out.println(" -nosuggestengine\tTo disable the suggest engine when errors in diagrams");
+ // System.out.println(" -nosuggestengine\tTo disable the suggest engine when errors in diagrams");
System.out.println(" -checkonly\t\tTo check the syntax of files without generating images");
System.out.println(" -failfast\t\tTo stop processing as soon as a syntax error in diagram occurs");
System.out.println(" -failfast2\t\tTo do a first syntax check before processing files, to fail even faster");
@@ -141,6 +142,10 @@ public class OptionPrint {
System.out.println(" -splash\t\tTo display a splash screen with some progress bar");
System.out.println(" -progress\t\tTo display a textual progress bar in console");
System.out.println(" -pipeimageindex N\tTo generate the Nth image with pipe option");
+ System.out.println(" -stdlib\t\tTo print standart library info");
+ System.out.println(" -extractstdlib\tTo extract PlantUML Standard Library into stdlib folder");
+ System.out.println(" -filename \"example.puml\"\tTo override %filename% variable");
+ System.out.println(" -preproc\t\tTo output preprocessor text of diagrams");
System.out.println();
System.out.println("If needed, you can setup the environment variable GRAPHVIZ_DOT.");
exit();
diff --git a/src/net/sourceforge/plantuml/PSystemBuilder.java b/src/net/sourceforge/plantuml/PSystemBuilder.java
index f935262..68d767c 100644
--- a/src/net/sourceforge/plantuml/PSystemBuilder.java
+++ b/src/net/sourceforge/plantuml/PSystemBuilder.java
@@ -57,6 +57,7 @@ import net.sourceforge.plantuml.descdiagram.DescriptionDiagramFactory;
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;
@@ -157,6 +158,7 @@ public class PSystemBuilder {
factories.add(new PSystemLicenseFactory());
factories.add(new PSystemVersionFactory());
factories.add(new PSystemDonorsFactory());
+ factories.add(new PSystemSkinparameterListFactory());
factories.add(new PSystemListFontsFactory());
factories.add(new PSystemOpenIconicFactory());
factories.add(new PSystemListOpenIconicFactory());
@@ -188,7 +190,8 @@ public class PSystemBuilder {
if (License.getCurrent() == License.GPL || License.getCurrent() == License.GPLV2) {
factories.add(new PSystemXearthFactory());
}
- factories.add(new GanttDiagramFactory());
+ factories.add(new GanttDiagramFactory(DiagramType.GANTT));
+ factories.add(new GanttDiagramFactory(DiagramType.UML));
factories.add(new FlowDiagramFactory());
factories.add(new PSystemTreeFactory(DiagramType.JUNGLE));
factories.add(new PSystemCuteFactory(DiagramType.CUTE));
diff --git a/src/net/sourceforge/plantuml/PSystemError.java b/src/net/sourceforge/plantuml/PSystemError.java
index 1c08d1c..407affa 100644
--- a/src/net/sourceforge/plantuml/PSystemError.java
+++ b/src/net/sourceforge/plantuml/PSystemError.java
@@ -47,6 +47,7 @@ import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
+import net.sourceforge.plantuml.api.ImageDataAbstract;
import net.sourceforge.plantuml.api.ImageDataSimple;
import net.sourceforge.plantuml.asciiart.UmlCharArea;
import net.sourceforge.plantuml.core.DiagramDescription;
@@ -65,10 +66,12 @@ import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
+import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UImage;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.txt.UGraphicTxt;
+import net.sourceforge.plantuml.version.LicenseInfo;
import net.sourceforge.plantuml.version.PSystemVersion;
public class PSystemError extends AbstractPSystem {
@@ -142,12 +145,16 @@ public class PSystemError extends AbstractPSystem {
} else {
udrawable = result;
}
- final int min = (int) (System.currentTimeMillis() / 60000L) % 60;
- if (min == 0) {
- udrawable = addMessage(udrawable);
+ if (LicenseInfo.retrieveQuick().isValid() == false) {
+ final int min = (int) (System.currentTimeMillis() / 60000L) % 60;
+ if (min == 0) {
+ udrawable = addMessage(udrawable);
+ }
}
imageBuilder.setUDrawable(udrawable);
- return imageBuilder.writeImageTOBEMOVED(fileFormat, seed(), os);
+ final ImageData imageData = imageBuilder.writeImageTOBEMOVED(fileFormat, seed(), os);
+ ((ImageDataAbstract) imageData).setStatus(FileImageData.ERROR);
+ return imageData;
}
private TextBlockBackcolored getWelcome() throws IOException {
@@ -185,6 +192,10 @@ public class PSystemError extends AbstractPSystem {
return new Dimension2DDouble(imWidth + 1, imHeight + 1);
}
+ public MinMax getMinMax(StringBounder stringBounder) {
+ return MinMax.fromMax(imWidth + 1, imHeight + 1);
+ }
+
public HtmlColor getBackcolor() {
return backImage;
}
@@ -198,22 +209,6 @@ public class PSystemError extends AbstractPSystem {
result.add(" ");
}
- // final int limit = 4;
- // int start;
- // final int skip = higherErrorPosition - limit + 1;
- // if (skip <= 0) {
- // start = 0;
- // } else {
- // if (skip == 1) {
- // result.add("... (skipping 1 line) ...");
- // } else {
- // result.add("... (skipping " + skip + " lines) ...");
- // }
- // start = higherErrorPosition - limit + 1;
- // }
- // for (int i = start; i < higherErrorPosition; i++) {
- // result.add(getSource().getLine(i));
- // }
for (String s : getPartialCode()) {
result.add(s);
}
@@ -280,11 +275,13 @@ public class PSystemError extends AbstractPSystem {
List<String> result = new ArrayList<String>();
for (Iterator<CharSequence2> it = getSource().iterator2(); it.hasNext();) {
final CharSequence2 s = it.next();
- if (s.getLocation().compareTo(higherErrorPosition) < 0) {
- result.add(s.toString());
+ result.add(s.toString());
+ if (s.getLocation().getDescription().equals(higherErrorPosition.getDescription())
+ && s.getLocation().compareTo(higherErrorPosition) >= 0) {
+ break;
}
}
- final int limit = 4;
+ final int limit = 5;
if (result.size() > limit) {
final int skip = result.size() - limit + 1;
final String skipMessage;
@@ -306,30 +303,20 @@ public class PSystemError extends AbstractPSystem {
htmlStrings.add("----");
}
- // final int limit = 4;
- // int start;
- // final int skip = higherErrorPosition - limit + 1;
- // if (skip <= 0) {
- // start = 0;
- // } else {
- // if (skip == 1) {
- // htmlStrings.add("... (skipping 1 line) ...");
- // } else {
- // htmlStrings.add("... (skipping " + skip + " lines) ...");
- // }
- // start = higherErrorPosition - limit + 1;
- // }
- // for (int i = start; i < higherErrorPosition; i++) {
- // htmlStrings.add(StringUtils.hideComparatorCharacters(getSource().getLine(i)));
- // }
- for (String s : getPartialCode()) {
+ final List<String> partialCode = getPartialCode();
+ for (String s : partialCode) {
htmlStrings.add(StringUtils.hideComparatorCharacters(s));
}
- final String errorLine = getSource().getLine(higherErrorPosition);
- final String err = StringUtils.hideComparatorCharacters(errorLine);
- if (StringUtils.isNotEmpty(err)) {
- htmlStrings.add("<w:" + getRed(useRed) + ">" + err + "</w>");
+ if (partialCode.size() > 0) {
+ final int idx = htmlStrings.size() - 1;
+ final String last = htmlStrings.get(idx);
+ htmlStrings.set(idx, "<w:" + getRed(useRed) + ">" + last + "</w>");
}
+ // final String errorLine = getSource().getLine(higherErrorPosition);
+ // final String err = StringUtils.hideComparatorCharacters(errorLine);
+ // if (StringUtils.isNotEmpty(err)) {
+ // htmlStrings.add("<w:" + getRed(useRed) + ">" + err + "</w>");
+ // }
final Collection<String> textErrors = new LinkedHashSet<String>();
for (ErrorUml er : printedErrors) {
textErrors.add(er.getError());
@@ -352,7 +339,7 @@ public class PSystemError extends AbstractPSystem {
return htmlStrings;
}
- public List<String> getSuggest() {
+ private List<String> getSuggest() {
boolean suggested = false;
for (ErrorUml er : printedErrors) {
if (er.hasSuggest()) {
@@ -383,16 +370,6 @@ public class PSystemError extends AbstractPSystem {
return result;
}
- // private int getHigherErrorPosition(ErrorUmlType type, List<ErrorUml> all) {
- // int max = Integer.MIN_VALUE;
- // for (ErrorUml error : getErrors(type, all)) {
- // if (error.getPosition() > max) {
- // max = error.getPosition();
- // }
- // }
- // return max;
- // }
-
private LineLocation getHigherErrorPosition2(ErrorUmlType type, List<ErrorUml> all) {
LineLocation max = null;
for (ErrorUml error : getErrors(type, all)) {
@@ -403,16 +380,6 @@ public class PSystemError extends AbstractPSystem {
return max;
}
- // private List<ErrorUml> getErrorsAt(int position, ErrorUmlType type, List<ErrorUml> all) {
- // final List<ErrorUml> result = new ArrayList<ErrorUml>();
- // for (ErrorUml error : getErrors(type, all)) {
- // if (error.getPosition() == position && StringUtils.isNotEmpty(error.getError())) {
- // result.add(error);
- // }
- // }
- // return result;
- // }
-
private List<ErrorUml> getErrorsAt2(LineLocation position, ErrorUmlType type, List<ErrorUml> all) {
final List<ErrorUml> result = new ArrayList<ErrorUml>();
for (ErrorUml error : getErrors(type, all)) {
diff --git a/src/net/sourceforge/plantuml/PSystemUtils.java b/src/net/sourceforge/plantuml/PSystemUtils.java
index ad8cc3f..534ebe6 100644
--- a/src/net/sourceforge/plantuml/PSystemUtils.java
+++ b/src/net/sourceforge/plantuml/PSystemUtils.java
@@ -49,14 +49,39 @@ import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.CucaDiagram;
+import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.html.CucaDiagramHtmlMaker;
+import net.sourceforge.plantuml.png.MetadataTag;
import net.sourceforge.plantuml.png.PngSplitter;
+import net.sourceforge.plantuml.project3.GanttDiagram;
import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
public class PSystemUtils {
- public static List<FileImageData> exportDiagrams(Diagram system, SuggestedFile suggestedFile,
+ public static List<FileImageData> exportDiagrams(Diagram system, SuggestedFile suggested,
FileFormatOption fileFormatOption) throws IOException {
+ return exportDiagrams(system, suggested, fileFormatOption, false);
+ }
+
+ public static List<FileImageData> exportDiagrams(Diagram system, SuggestedFile suggestedFile,
+ FileFormatOption fileFormatOption, boolean checkMetadata) throws IOException {
+
+ final File existing = suggestedFile.getFile(0);
+ if (checkMetadata && existing.exists() && system.getNbImages() == 1) {
+ final MetadataTag tag = new MetadataTag(existing, "plantuml");
+ final String previousMetadata = tag.getData();
+ // final String version = Version.versionString();
+ // System.out.println(system.getMetadata());
+ // System.out.println(data);
+ // System.out.println(version);
+ // System.out.println(data.contains(version));
+ final boolean sameMetadata = system.getMetadata().equals(previousMetadata);
+ if (sameMetadata) {
+ Log.info("Skipping " + existing.getAbsolutePath() + " because metadata has not changed.");
+ return Arrays.asList(new FileImageData(existing, null));
+ }
+ }
+
if (system instanceof NewpagedDiagram) {
return exportDiagramsNewpaged((NewpagedDiagram) system, suggestedFile, fileFormatOption);
}
@@ -66,6 +91,9 @@ public class PSystemUtils {
if (system instanceof CucaDiagram) {
return exportDiagramsCuca((CucaDiagram) system, suggestedFile, fileFormatOption);
}
+ if (system instanceof GanttDiagram) {
+ return exportDiagramsGantt2((GanttDiagram) system, suggestedFile, fileFormatOption);
+ }
if (system instanceof ActivityDiagram3) {
return exportDiagramsActivityDiagram3((ActivityDiagram3) system, suggestedFile, fileFormatOption);
}
@@ -230,6 +258,62 @@ public class PSystemUtils {
}
+ // static private List<FileImageData> exportDiagramsGantt1(GanttDiagram system, SuggestedFile suggestedFile,
+ // FileFormatOption fileFormat) throws IOException {
+ // if (suggestedFile.getFile(0).exists() && suggestedFile.getFile(0).isDirectory()) {
+ // throw new IllegalArgumentException("File is a directory " + suggestedFile);
+ // }
+ // OutputStream os = null;
+ // ImageData imageData = null;
+ // try {
+ // if (PSystemUtils.canFileBeWritten(suggestedFile.getFile(0)) == false) {
+ // return Collections.emptyList();
+ // }
+ // os = new BufferedOutputStream(new FileOutputStream(suggestedFile.getFile(0)));
+ // imageData = system.exportDiagram(os, 0, fileFormat);
+ // } finally {
+ // if (os != null) {
+ // os.close();
+ // }
+ // }
+ // return Arrays.asList(new FileImageData(suggestedFile.getFile(0), imageData));
+ // }
+
+ static private List<FileImageData> exportDiagramsGantt2(GanttDiagram system, SuggestedFile suggestedFile,
+ FileFormatOption fileFormat) throws IOException {
+ if (suggestedFile.getFile(0).exists() && suggestedFile.getFile(0).isDirectory()) {
+ throw new IllegalArgumentException("File is a directory " + suggestedFile);
+ }
+
+ ImageData cmap = null;
+ OutputStream os = null;
+ try {
+ if (PSystemUtils.canFileBeWritten(suggestedFile.getFile(0)) == false) {
+ return Collections.emptyList();
+ }
+ os = new NamedOutputStream(suggestedFile.getFile(0));
+ cmap = system.exportDiagram(os, 0, fileFormat);
+ } finally {
+ if (os != null) {
+ os.close();
+ }
+ }
+ List<File> result = Arrays.asList(suggestedFile.getFile(0));
+
+ if (fileFormat.getFileFormat() == FileFormat.PNG) {
+ final SplitParam splitParam = new SplitParam(HtmlColorUtils.BLACK, null, 5);
+ result = new PngSplitter(suggestedFile, system.getHorizontalPages(), system.getVerticalPages(),
+ system.getMetadata(), system.getDpi(fileFormat), fileFormat.isWithMetadata(), splitParam)
+ .getFiles();
+ }
+ final List<FileImageData> result2 = new ArrayList<FileImageData>();
+ for (File f : result) {
+ result2.add(new FileImageData(f, cmap));
+ }
+ return result2;
+
+ }
+
private static List<FileImageData> createFilesHtml(CucaDiagram system, SuggestedFile suggestedFile)
throws IOException {
final String name = suggestedFile.getName();
diff --git a/src/net/sourceforge/plantuml/Pipe.java b/src/net/sourceforge/plantuml/Pipe.java
index 592e810..63d2f8e 100644
--- a/src/net/sourceforge/plantuml/Pipe.java
+++ b/src/net/sourceforge/plantuml/Pipe.java
@@ -69,8 +69,8 @@ public class Pipe {
ps.flush();
return error;
}
- final SourceStringReader sourceStringReader = new SourceStringReader(Defines.createEmpty(), source,
- option.getConfig());
+ final Defines defines = option.getDefaultDefines();
+ final SourceStringReader sourceStringReader = new SourceStringReader(defines, source, option.getConfig());
if (option.isComputeurl()) {
for (BlockUml s : sourceStringReader.getBlocks()) {
ps.println(s.getEncodedUrl());
@@ -88,11 +88,17 @@ public class Pipe {
ps.println(system.getDescription());
}
} else if (option.isPipeMap()) {
- final String result = sourceStringReader.getCMapData(0, option.getFileFormatOption());
- ps.println(result);
+ final String result = sourceStringReader.getCMapData(option.getImageIndex(),
+ option.getFileFormatOption());
+ if (result == null) {
+ ps.println();
+ } else {
+ ps.println(result);
+ }
} else {
final OutputStream os = noStdErr ? new ByteArrayOutputStream() : ps;
- final DiagramDescription result = sourceStringReader.outputImage(os, option.getImageIndex(), option.getFileFormatOption());
+ final DiagramDescription result = sourceStringReader.outputImage(os, option.getImageIndex(),
+ option.getFileFormatOption());
if (result != null && "(error)".equalsIgnoreCase(result.getDescription())) {
error = true;
manageErrors(noStdErr ? ps : System.err, sourceStringReader);
diff --git a/src/net/sourceforge/plantuml/Run.java b/src/net/sourceforge/plantuml/Run.java
index 8cc2ede..7182af8 100644
--- a/src/net/sourceforge/plantuml/Run.java
+++ b/src/net/sourceforge/plantuml/Run.java
@@ -43,6 +43,9 @@ import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
@@ -62,21 +65,46 @@ 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;
import net.sourceforge.plantuml.sequencediagram.SequenceDiagramFactory;
import net.sourceforge.plantuml.statediagram.StateDiagramFactory;
import net.sourceforge.plantuml.stats.StatsUtils;
import net.sourceforge.plantuml.swing.MainWindow2;
+import net.sourceforge.plantuml.syntax.LanguageDescriptor;
import net.sourceforge.plantuml.ugraphic.sprite.SpriteGrayLevel;
import net.sourceforge.plantuml.ugraphic.sprite.SpriteUtils;
+import net.sourceforge.plantuml.utils.Cypher;
import net.sourceforge.plantuml.version.Version;
public class Run {
+ private static Cypher cypher;
+
public static void main(String[] argsArray) throws IOException, InterruptedException {
+ System.setProperty("log4j.debug", "false");
final long start = System.currentTimeMillis();
+ if (argsArray.length > 0 && argsArray[0].equalsIgnoreCase("-headless")) {
+ System.setProperty("java.awt.headless", "true");
+ }
saveCommandLine(argsArray);
final Option option = new Option(argsArray);
ProgressBar.setEnable(option.isTextProgressBar());
+ if (OptionFlags.getInstance().isClipboardLoop()) {
+ ClipboardLoop.runLoop();
+ return;
+ }
+ if (OptionFlags.getInstance().isClipboard()) {
+ ClipboardLoop.runOnce();
+ return;
+ }
+ if (OptionFlags.getInstance().isExtractStdLib()) {
+ Stdlib.extractStdLib();
+ return;
+ }
+ if (OptionFlags.getInstance().isStdLib()) {
+ Stdlib.printStdLib();
+ return;
+ }
if (OptionFlags.getInstance().isDumpStats()) {
StatsUtils.dumpStats();
return;
@@ -114,6 +142,9 @@ public class Run {
}
forceOpenJdkResourceLoad();
+ if (option.getPreprocessorOutputMode() == OptionPreprocOutputMode.CYPHER) {
+ cypher = new LanguageDescriptor().getCypher();
+ }
boolean error = false;
boolean forceQuit = false;
if (option.isPattern()) {
@@ -190,18 +221,33 @@ public class Run {
}
public static void forceOpenJdkResourceLoad() {
- final BufferedImage imDummy = new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB);
- final Graphics2D gg = imDummy.createGraphics();
- final String text = "Alice";
- final Font font = new Font("SansSerif", Font.PLAIN, 12);
- final FontMetrics fm = gg.getFontMetrics(font);
- final Rectangle2D rect = fm.getStringBounds(text, gg);
+ if (isOpenJdkRunning()) {
+ // see https://github.com/plantuml/plantuml/issues/123
+ Log.info("Forcing resource load on OpenJdk");
+ final BufferedImage imDummy = new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB);
+ final Graphics2D gg = imDummy.createGraphics();
+ final String text = "Alice";
+ final Font font = new Font("SansSerif", Font.PLAIN, 12);
+ final FontMetrics fm = gg.getFontMetrics(font);
+ final Rectangle2D rect = fm.getStringBounds(text, gg);
+ }
}
+ public static boolean isOpenJdkRunning() {
+ final String jvmName = System.getProperty("java.vm.name");
+ if (jvmName != null && jvmName.toLowerCase().contains("openjdk")) {
+ return true;
+ }
+ return false;
+ }
+
+ static private final String httpProtocol = "http://";
+ static private final String httpsProtocol = "https://";
+
private static void encodeSprite(List<String> result) throws IOException {
SpriteGrayLevel level = SpriteGrayLevel.GRAY_16;
boolean compressed = false;
- final File f;
+ final String path;
if (result.size() > 1 && result.get(0).matches("(4|8|16)z?")) {
if (result.get(0).startsWith("8")) {
level = SpriteGrayLevel.GRAY_8;
@@ -210,28 +256,52 @@ public class Run {
level = SpriteGrayLevel.GRAY_4;
}
compressed = StringUtils.goLowerCase(result.get(0)).endsWith("z");
- f = new File(result.get(1));
+ path = result.get(1);
} else {
- f = new File(result.get(0));
+ path = result.get(0);
}
- final BufferedImage im = ImageIO.read(f);
- final String name = getSpriteName(f);
+
+ final String fileName;
+ final URL source;
+ final String lowerPath = StringUtils.goLowerCase(path);
+ if (lowerPath.startsWith(httpProtocol) || lowerPath.startsWith(httpsProtocol)) {
+ source = new URL(path);
+ final String p = source.getPath();
+ fileName = p.substring(p.lastIndexOf('/') + 1, p.length());
+ } else {
+ final File f = new File(path);
+ source = f.toURI().toURL();
+ fileName = f.getName();
+ }
+
+ InputStream stream = null;
+ final BufferedImage im;
+ try {
+ stream = source.openStream();
+ im = ImageIO.read(stream);
+ } finally {
+ if (stream != null) {
+ stream.close();
+ }
+ }
+
+ final String name = getSpriteName(fileName);
final String s = compressed ? SpriteUtils.encodeCompressed(im, name, level) : SpriteUtils.encode(im, name,
level);
System.out.println(s);
}
- private static String getSpriteName(File f) {
- final String s = getSpriteNameInternal(f);
+ private static String getSpriteName(String fileName) {
+ final String s = getSpriteNameInternal(fileName);
if (s.length() == 0) {
return "test";
}
return s;
}
- private static String getSpriteNameInternal(File f) {
+ private static String getSpriteNameInternal(String fileName) {
final StringBuilder sb = new StringBuilder();
- for (char c : f.getName().toCharArray()) {
+ for (char c : fileName.toCharArray()) {
if (("" + c).matches("[\\p{L}0-9_]")) {
sb.append(c);
} else {
@@ -258,7 +328,6 @@ public class Run {
for (String n : name) {
System.out.println("n=" + n);
}
-
}
private static void managePattern() {
@@ -323,6 +392,7 @@ public class Run {
files.addAll(group.getFiles());
}
}
+ Log.info("Found " + files.size() + " files");
for (File f : files) {
try {
final boolean error = manageFileInternal(f, option);
@@ -384,6 +454,7 @@ public class Run {
}
private static boolean manageFileInternal(File f, Option option) throws IOException, InterruptedException {
+ Log.info("Working on " + f.getAbsolutePath());
if (OptionFlags.getInstance().isExtractFromMetadata()) {
System.out.println("------------------------");
System.out.println(f);
@@ -401,6 +472,8 @@ public class Run {
sourceFileReader = new SourceFileReader2(option.getDefaultDefines(f), f, option.getOutputFile(),
option.getConfig(), option.getCharset(), option.getFileFormatOption());
}
+ sourceFileReader.setCheckMetadata(option.isCheckMetadata());
+
if (option.isComputeurl()) {
for (BlockUml s : sourceFileReader.getBlocks()) {
System.out.println(s.getEncodedUrl());
@@ -413,10 +486,33 @@ public class Run {
hasErrors(f, result);
return hasError;
}
+ if (option.getPreprocessorOutputMode() != null) {
+ extractPreproc(option, sourceFileReader);
+ return false;
+ }
final List<GeneratedImage> result = sourceFileReader.getGeneratedImages();
+
return hasErrors(f, result);
}
+ private static void extractPreproc(Option option, final ISourceFileReader sourceFileReader) throws IOException {
+ final String charset = option.getCharset();
+ for (BlockUml blockUml : sourceFileReader.getBlocks()) {
+ final SuggestedFile suggested = ((SourceFileReaderAbstract) sourceFileReader).getSuggestedFile(blockUml)
+ .withPreprocFormat();
+ final File file = suggested.getFile(0);
+ Log.info("Export preprocessing source to " + file.getAbsolutePath());
+ final PrintWriter pw = charset == null ? new PrintWriter(file) : new PrintWriter(file, charset);
+ for (CharSequence s : blockUml.getDefinition(true)) {
+ if (cypher != null) {
+ s = cypher.cypher(s.toString());
+ }
+ pw.println(s);
+ }
+ pw.close();
+ }
+ }
+
private static boolean hasErrors(File f, final List<GeneratedImage> list) throws IOException {
boolean result = false;
for (GeneratedImage i : list) {
diff --git a/src/net/sourceforge/plantuml/SignatureUtils.java b/src/net/sourceforge/plantuml/SignatureUtils.java
index cd91244..ea0cf2d 100644
--- a/src/net/sourceforge/plantuml/SignatureUtils.java
+++ b/src/net/sourceforge/plantuml/SignatureUtils.java
@@ -42,18 +42,71 @@ import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
+import java.security.spec.InvalidKeySpecException;
+
+import javax.crypto.SecretKey;
+import javax.crypto.SecretKeyFactory;
+import javax.crypto.spec.PBEKeySpec;
import net.sourceforge.plantuml.code.AsciiEncoder;
public class SignatureUtils {
+ public static byte[] salting(String pass, byte[] salt) throws NoSuchAlgorithmException, InvalidKeySpecException,
+ UnsupportedEncodingException {
+ final int iterations = 10000;
+ final int keyLength = 512;
+ final SecretKeyFactory skf = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
+ final PBEKeySpec spec = new PBEKeySpec(pass.toCharArray(), salt, iterations, keyLength);
+ final SecretKey key = skf.generateSecret(spec);
+ return SignatureUtils.getSHA512raw(key.getEncoded());
+ }
+
public static String getSignature(String s) {
try {
- final AsciiEncoder coder = new AsciiEncoder();
- final MessageDigest msgDigest = MessageDigest.getInstance("MD5");
- msgDigest.update(s.getBytes("UTF-8"));
- final byte[] digest = msgDigest.digest();
- return coder.encode(digest);
+ final byte[] digest = getMD5raw(s);
+ return toString(digest);
+ } catch (NoSuchAlgorithmException e) {
+ e.printStackTrace();
+ throw new UnsupportedOperationException(e);
+ } catch (UnsupportedEncodingException e) {
+ e.printStackTrace();
+ throw new UnsupportedOperationException(e);
+ }
+ }
+
+ public static String toString(byte data[]) {
+ final AsciiEncoder coder = new AsciiEncoder();
+ return coder.encode(data);
+ }
+
+ public static String toHexString(byte data[]) {
+ final StringBuilder sb = new StringBuilder(data.length * 2);
+ for (byte b : data) {
+ sb.append(String.format("%02x", b));
+ }
+ return sb.toString();
+ }
+
+ public static String getMD5Hex(String s) {
+ try {
+ final byte[] digest = getMD5raw(s);
+ assert digest.length == 16;
+ return toHexString(digest);
+ } catch (NoSuchAlgorithmException e) {
+ e.printStackTrace();
+ throw new UnsupportedOperationException(e);
+ } catch (UnsupportedEncodingException e) {
+ e.printStackTrace();
+ throw new UnsupportedOperationException(e);
+ }
+ }
+
+ public static String getSHA512Hex(String s) {
+ try {
+ final byte[] digest = getSHA512raw(s);
+ assert digest.length == 64;
+ return toHexString(digest);
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
throw new UnsupportedOperationException(e);
@@ -63,6 +116,22 @@ public class SignatureUtils {
}
}
+ public static byte[] getMD5raw(String s) throws NoSuchAlgorithmException, UnsupportedEncodingException {
+ final MessageDigest msgDigest = MessageDigest.getInstance("MD5");
+ msgDigest.update(s.getBytes("UTF-8"));
+ return msgDigest.digest();
+ }
+
+ public static byte[] getSHA512raw(String s) throws NoSuchAlgorithmException, UnsupportedEncodingException {
+ return getSHA512raw(s.getBytes("UTF-8"));
+ }
+
+ public static byte[] getSHA512raw(byte data[]) throws NoSuchAlgorithmException, UnsupportedEncodingException {
+ final MessageDigest msgDigest = MessageDigest.getInstance("SHA-512");
+ msgDigest.update(data);
+ return msgDigest.digest();
+ }
+
public static String getSignatureSha512(File f) throws IOException {
final InputStream is = new FileInputStream(f);
try {
@@ -74,14 +143,13 @@ public class SignatureUtils {
public static String getSignatureSha512(InputStream is) throws IOException {
try {
- final AsciiEncoder coder = new AsciiEncoder();
final MessageDigest msgDigest = MessageDigest.getInstance("SHA-512");
int read = 0;
while ((read = is.read()) != -1) {
msgDigest.update((byte) read);
}
final byte[] digest = msgDigest.digest();
- return coder.encode(digest);
+ return toString(digest);
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
throw new UnsupportedOperationException(e);
@@ -106,7 +174,6 @@ public class SignatureUtils {
public static String getSignature(File f) throws IOException {
try {
- final AsciiEncoder coder = new AsciiEncoder();
final MessageDigest msgDigest = MessageDigest.getInstance("MD5");
final FileInputStream is = new FileInputStream(f);
int read = -1;
@@ -115,7 +182,7 @@ public class SignatureUtils {
}
is.close();
final byte[] digest = msgDigest.digest();
- return coder.encode(digest);
+ return toString(digest);
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
throw new UnsupportedOperationException(e);
diff --git a/src/net/sourceforge/plantuml/SkinParam.java b/src/net/sourceforge/plantuml/SkinParam.java
index 8e9ceae..2216ab0 100644
--- a/src/net/sourceforge/plantuml/SkinParam.java
+++ b/src/net/sourceforge/plantuml/SkinParam.java
@@ -36,10 +36,12 @@
package net.sourceforge.plantuml;
import java.awt.Font;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
@@ -48,6 +50,7 @@ import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
import net.sourceforge.plantuml.creole.CommandCreoleMonospaced;
+import net.sourceforge.plantuml.cucadiagram.LinkStyle;
import net.sourceforge.plantuml.cucadiagram.Rankdir;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.cucadiagram.dot.DotSplines;
@@ -91,7 +94,9 @@ public class SkinParam implements ISkinParam {
}
public void setParam(String key, String value) {
- params.put(cleanForKey(key), StringUtils.trin(value));
+ for (String key2 : cleanForKey(key)) {
+ params.put(key2, StringUtils.trin(value));
+ }
}
private SkinParam(UmlDiagramType type) {
@@ -108,16 +113,23 @@ public class SkinParam implements ISkinParam {
return result;
}
- static String cleanForKey(String key) {
+ private final Map<String, List<String>> cacheCleanForKey = new HashMap<String, List<String>>();
+
+ List<String> cleanForKey(String key) {
+ List<String> result = cacheCleanForKey.get(key);
+ if (result == null) {
+ result = cleanForKeySlow(key);
+ cacheCleanForKey.put(key, result);
+ }
+ return result;
+ }
+
+ List<String> cleanForKeySlow(String key) {
key = StringUtils.trin(StringUtils.goLowerCase(key));
key = key.replaceAll("_|\\.|\\s", "");
// key = replaceSmart(key, "partition", "package");
key = replaceSmart(key, "sequenceparticipant", "participant");
key = replaceSmart(key, "sequenceactor", "actor");
- // if (key.contains("arrow")) {
- // key = key.replaceAll("activityarrow|objectarrow|classarrow|componentarrow|statearrow|usecasearrow",
- // "genericarrow");
- // }
key = key.replaceAll("activityarrow", "arrow");
key = key.replaceAll("objectarrow", "arrow");
key = key.replaceAll("classarrow", "arrow");
@@ -125,13 +137,17 @@ public class SkinParam implements ISkinParam {
key = key.replaceAll("statearrow", "arrow");
key = key.replaceAll("usecasearrow", "arrow");
key = key.replaceAll("sequencearrow", "arrow");
- final Matcher2 m = stereoPattern.matcher(key);
- if (m.find()) {
- final String s = m.group(1);
- key = key.replaceAll(stereoPatternString, "");
- key += "<<" + s + ">>";
+ key = key.replaceAll("align$", "alignment");
+ final Matcher2 mm = stereoPattern.matcher(key);
+ final List<String> result = new ArrayList<String>();
+ while (mm.find()) {
+ final String s = mm.group(1);
+ result.add(key.replaceAll(stereoPatternString, "") + "<<" + s + ">>");
+ }
+ if (result.size() == 0) {
+ result.add(key);
}
- return key;
+ return Collections.unmodifiableList(result);
}
private static String replaceSmart(String s, String src, String target) {
@@ -158,7 +174,13 @@ public class SkinParam implements ISkinParam {
}
public String getValue(String key) {
- return params.get(cleanForKey(key));
+ for (String key2 : cleanForKey(key)) {
+ final String result = params.get(key2);
+ if (result != null) {
+ return result;
+ }
+ }
+ return null;
}
static String humanName(String key) {
@@ -191,10 +213,21 @@ public class SkinParam implements ISkinParam {
return null;
}
final boolean acceptTransparent = param == ColorParam.background
- || param == ColorParam.sequenceGroupBodyBackground;
+ || param == ColorParam.sequenceGroupBodyBackground || param == ColorParam.sequenceBoxBackground;
return getIHtmlColorSet().getColorIfValid(value, acceptTransparent);
}
+ public char getCircledCharacter(Stereotype stereotype) {
+ if (stereotype == null) {
+ throw new IllegalArgumentException();
+ }
+ final String value2 = getValue("spotchar" + stereotype.getLabel(false));
+ if (value2 != null && value2.length() > 0) {
+ return value2.charAt(0);
+ }
+ return 0;
+ }
+
public Colors getColors(ColorParam param, Stereotype stereotype) {
if (stereotype != null) {
checkStereotype(stereotype);
@@ -388,6 +421,17 @@ public class SkinParam implements ISkinParam {
result.add("TabSize");
result.add("MaxAsciiMessageLength");
result.add("ColorArrowSeparationSpace");
+ result.add("ResponseMessageBelowArrow");
+ result.add("GenericDisplay");
+ result.add("PathHoverColor");
+ result.add("SwimlaneWidth");
+ result.add("PageBorderColor");
+ result.add("PageExternalColor");
+ result.add("PageMargin");
+ result.add("WrapWidth");
+ result.add("SwimlaneWidth");
+ result.add("SwimlaneWrapTitleWidth");
+
for (FontParam p : EnumSet.allOf(FontParam.class)) {
final String h = humanName(p.name());
result.add(h + "FontStyle");
@@ -403,6 +447,10 @@ public class SkinParam implements ISkinParam {
final String h = capitalize(p.name());
result.add(h + "Thickness");
}
+ for (AlignmentParam p : EnumSet.allOf(AlignmentParam.class)) {
+ final String h = capitalize(p.name());
+ result.add(h);
+ }
return Collections.unmodifiableSet(result);
}
@@ -429,14 +477,14 @@ public class SkinParam implements ISkinParam {
return DotSplines.SPLINES;
}
- public HorizontalAlignment getHorizontalAlignment(AlignParam param, ArrowDirection arrowDirection) {
+ public HorizontalAlignment getHorizontalAlignment(AlignmentParam param, ArrowDirection arrowDirection) {
final String value;
switch (param) {
- case SEQUENCE_MESSAGE_ALIGN:
- value = getArg(getValue(AlignParam.SEQUENCE_MESSAGE_ALIGN.name()), 0);
+ case sequenceMessageAlignment:
+ value = getArg(getValue(AlignmentParam.sequenceMessageAlignment.name()), 0);
break;
- case SEQUENCE_MESSAGETEXT_ALIGN:
- value = getArg(getValue(AlignParam.SEQUENCE_MESSAGE_ALIGN.name()), 1);
+ case sequenceMessageTextAlignment:
+ value = getArg(getValue(AlignmentParam.sequenceMessageAlignment.name()), 1);
break;
default:
value = getValue(param.name());
@@ -448,6 +496,9 @@ public class SkinParam implements ISkinParam {
if (arrowDirection == ArrowDirection.RIGHT_TO_LEFT_REVERSE) {
return HorizontalAlignment.RIGHT;
}
+ if (arrowDirection == ArrowDirection.BOTH_DIRECTION) {
+ return HorizontalAlignment.CENTER;
+ }
}
if ("reversedirection".equalsIgnoreCase(value)) {
if (arrowDirection == ArrowDirection.LEFT_TO_RIGHT_NORMAL) {
@@ -456,9 +507,14 @@ public class SkinParam implements ISkinParam {
if (arrowDirection == ArrowDirection.RIGHT_TO_LEFT_REVERSE) {
return HorizontalAlignment.LEFT;
}
+ if (arrowDirection == ArrowDirection.BOTH_DIRECTION) {
+ return HorizontalAlignment.CENTER;
+ }
}
final HorizontalAlignment result = HorizontalAlignment.fromString(value);
- if (result == null) {
+ if (result == null && param == AlignmentParam.noteTextAlignment) {
+ return getDefaultTextAlignment(HorizontalAlignment.LEFT);
+ } else if (result == null) {
return param.getDefaultValue();
}
return result;
@@ -621,8 +677,39 @@ public class SkinParam implements ISkinParam {
return 0;
}
- public double getRoundCorner(String param, Stereotype stereotype) {
- String key = param + "roundcorner";
+ public double getDiagonalCorner(CornerParam param, Stereotype stereotype) {
+ final String key = param.getDiagonalKey();
+ Double result = getCornerInternal(key, param, stereotype);
+ if (result != null) {
+ return result;
+ }
+ result = getCornerInternal(key, param, null);
+ if (result != null) {
+ return result;
+ }
+ if (param == CornerParam.DEFAULT) {
+ return 0;
+ }
+ return getDiagonalCorner(CornerParam.DEFAULT, stereotype);
+ }
+
+ public double getRoundCorner(CornerParam param, Stereotype stereotype) {
+ final String key = param.getRoundKey();
+ Double result = getCornerInternal(key, param, stereotype);
+ if (result != null) {
+ return result;
+ }
+ result = getCornerInternal(key, param, null);
+ if (result != null) {
+ return result;
+ }
+ if (param == CornerParam.DEFAULT) {
+ return 0;
+ }
+ return getRoundCorner(CornerParam.DEFAULT, stereotype);
+ }
+
+ private Double getCornerInternal(String key, CornerParam param, Stereotype stereotype) {
if (stereotype != null) {
key += stereotype.getLabel(false);
}
@@ -630,26 +717,62 @@ public class SkinParam implements ISkinParam {
if (value != null && value.matches("\\d+")) {
return Double.parseDouble(value);
}
- return 0;
+ return null;
}
public UStroke getThickness(LineParam param, Stereotype stereotype) {
+ LinkStyle style = null;
if (stereotype != null) {
checkStereotype(stereotype);
+
+ final String styleValue = getValue(param.name() + "style" + stereotype.getLabel(false));
+ if (styleValue != null) {
+ style = LinkStyle.fromString2(styleValue);
+ }
+
final String value2 = getValue(param.name() + "thickness" + stereotype.getLabel(false));
if (value2 != null && value2.matches("[\\d.]+")) {
- return new UStroke(Double.parseDouble(value2));
+ if (style == null) {
+ style = LinkStyle.NORMAL();
+ }
+ return style.goThickness(Double.parseDouble(value2)).getStroke3();
}
}
final String value = getValue(param.name() + "thickness");
if (value != null && value.matches("[\\d.]+")) {
- return new UStroke(Double.parseDouble(value));
+ if (style == null) {
+ style = LinkStyle.NORMAL();
+ }
+ return style.goThickness(Double.parseDouble(value)).getStroke3();
+ }
+ if (style == null) {
+ final String styleValue = getValue(param.name() + "style");
+ if (styleValue != null) {
+ style = LinkStyle.fromString2(styleValue);
+ }
+ }
+ if (style != null && style.isNormal() == false) {
+ return style.getStroke3();
}
return null;
}
public LineBreakStrategy maxMessageSize() {
- return new LineBreakStrategy(getValue("maxmessagesize"));
+ String value = getValue("wrapmessagewidth");
+ if (value == null) {
+ value = getValue("maxmessagesize");
+ }
+ return new LineBreakStrategy(value);
+ }
+
+ public LineBreakStrategy wrapWidth() {
+ final String value = getValue("wrapwidth");
+ return new LineBreakStrategy(value);
+ }
+
+ public LineBreakStrategy swimlaneWrapTitleWidth() {
+ final String value = getValue("swimlanewraptitlewidth");
+ return new LineBreakStrategy(value);
}
public boolean strictUmlStyle() {
@@ -814,7 +937,7 @@ public class SkinParam implements ISkinParam {
public int swimlaneWidth() {
final String value = getValue("swimlanewidth");
if ("same".equalsIgnoreCase(value)) {
- return -1;
+ return SWIMLANE_WIDTH_SAME;
}
if (value != null && value.matches("\\d+")) {
return Integer.parseInt(value);
@@ -854,4 +977,33 @@ public class SkinParam implements ISkinParam {
return false;
}
+ public boolean displayGenericWithOldFashion() {
+ final String value = getValue("genericDisplay");
+ if ("old".equalsIgnoreCase(value)) {
+ return true;
+ }
+ return false;
+ }
+
+ public boolean responseMessageBelowArrow() {
+ final String value = getValue("responsemessagebelowarrow");
+ if ("true".equalsIgnoreCase(value)) {
+ return true;
+ }
+ return false;
+ }
+
+ public TikzFontDistortion getTikzFontDistortion() {
+ final String value = getValue("tikzFont");
+ return TikzFontDistortion.fromValue(value);
+ }
+
+ public boolean svgDimensionStyle() {
+ final String value = getValue("svgdimensionstyle");
+ if ("false".equalsIgnoreCase(value)) {
+ return false;
+ }
+ return true;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/SkinParamDelegator.java b/src/net/sourceforge/plantuml/SkinParamDelegator.java
index d39f6a4..854b150 100644
--- a/src/net/sourceforge/plantuml/SkinParamDelegator.java
+++ b/src/net/sourceforge/plantuml/SkinParamDelegator.java
@@ -103,7 +103,7 @@ public class SkinParamDelegator implements ISkinParam {
return skinParam.getDotExecutable();
}
- public HorizontalAlignment getHorizontalAlignment(AlignParam param, ArrowDirection arrowDirection) {
+ public HorizontalAlignment getHorizontalAlignment(AlignmentParam param, ArrowDirection arrowDirection) {
return skinParam.getHorizontalAlignment(param, arrowDirection);
}
@@ -147,10 +147,14 @@ public class SkinParamDelegator implements ISkinParam {
return skinParam.getRanksep();
}
- public double getRoundCorner(String param, Stereotype stereotype) {
+ public double getRoundCorner(CornerParam param, Stereotype stereotype) {
return skinParam.getRoundCorner(param, stereotype);
}
+ public double getDiagonalCorner(CornerParam param, Stereotype stereotype) {
+ return skinParam.getDiagonalCorner(param, stereotype);
+ }
+
public UStroke getThickness(LineParam param, Stereotype stereotype) {
return skinParam.getThickness(param, stereotype);
}
@@ -159,6 +163,10 @@ public class SkinParamDelegator implements ISkinParam {
return skinParam.maxMessageSize();
}
+ public LineBreakStrategy wrapWidth() {
+ return skinParam.wrapWidth();
+ }
+
public boolean strictUmlStyle() {
return skinParam.strictUmlStyle();
}
@@ -267,4 +275,28 @@ public class SkinParamDelegator implements ISkinParam {
return skinParam.useRankSame();
}
+ public boolean displayGenericWithOldFashion() {
+ return skinParam.displayGenericWithOldFashion();
+ }
+
+ public TikzFontDistortion getTikzFontDistortion() {
+ return skinParam.getTikzFontDistortion();
+ }
+
+ public boolean responseMessageBelowArrow() {
+ return skinParam.responseMessageBelowArrow();
+ }
+
+ public boolean svgDimensionStyle() {
+ return skinParam.svgDimensionStyle();
+ }
+
+ public char getCircledCharacter(Stereotype stereotype) {
+ return skinParam.getCircledCharacter(stereotype);
+ }
+
+ public LineBreakStrategy swimlaneWrapTitleWidth() {
+ return skinParam.swimlaneWrapTitleWidth();
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/SourceFileReader.java b/src/net/sourceforge/plantuml/SourceFileReader.java
index 434ca2e..de35ddd 100644
--- a/src/net/sourceforge/plantuml/SourceFileReader.java
+++ b/src/net/sourceforge/plantuml/SourceFileReader.java
@@ -35,33 +35,14 @@
*/
package net.sourceforge.plantuml;
-import java.io.BufferedOutputStream;
import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.PrintStream;
-import java.io.Reader;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import java.util.Set;
-import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.preproc.Defines;
-import net.sourceforge.plantuml.preproc.FileWithSuffix;
-public class SourceFileReader implements ISourceFileReader {
-
- private final File file;
- private final File outputDirectory;
-
- private final BlockUmlBuilder builder;
- private FileFormatOption fileFormatOption;
+public class SourceFileReader extends SourceFileReaderAbstract implements ISourceFileReader {
public SourceFileReader(File file) throws IOException {
this(file, file.getAbsoluteFile().getParentFile());
@@ -105,15 +86,6 @@ public class SourceFileReader implements ISourceFileReader {
.getParentFile(), file.getAbsolutePath());
}
- public boolean hasError() {
- for (final BlockUml b : builder.getBlockUmls()) {
- if (b.getDiagram() instanceof PSystemError) {
- return true;
- }
- }
- return false;
- }
-
private File getDirIfDirectory(String newName) {
Log.info("Checking=" + newName);
if (endsWithSlashOrAntislash(newName)) {
@@ -161,107 +133,31 @@ public class SourceFileReader implements ISourceFileReader {
}
- public List<GeneratedImage> getGeneratedImages() throws IOException {
- Log.info("Reading file: " + file);
-
- int cpt = 0;
- final List<GeneratedImage> result = new ArrayList<GeneratedImage>();
-
- for (BlockUml blockUml : builder.getBlockUmls()) {
- final String newName = blockUml.getFileOrDirname();
- SuggestedFile suggested = null;
- if (newName != null) {
- Log.info("name from block=" + newName);
- final File dir = getDirIfDirectory(newName);
- if (dir == null) {
- Log.info(newName + " is not taken as a directory");
- suggested = SuggestedFile.fromOutputFile(new File(outputDirectory, newName),
- fileFormatOption.getFileFormat(), 0);
- } else {
- Log.info("We are going to create files in directory " + dir);
- suggested = SuggestedFile.fromOutputFile(new File(dir, file.getName()),
- fileFormatOption.getFileFormat(), 0);
- }
- Log.info("We are going to put data in " + suggested);
- }
- if (suggested == null) {
- suggested = SuggestedFile.fromOutputFile(new File(outputDirectory, file.getName()),
- fileFormatOption.getFileFormat(), cpt++);
- }
- suggested.getParentFile().mkdirs();
-
- final Diagram system;
- try {
- system = blockUml.getDiagram();
- } catch (Throwable t) {
- final GeneratedImage image = new GeneratedImageImpl(suggested.getFile(0), "Crash Error", blockUml);
- OutputStream os = null;
- try {
- os = new BufferedOutputStream(new FileOutputStream(suggested.getFile(0)));
- UmlDiagram.exportDiagramError(os, t, fileFormatOption, 42, null, blockUml.getFlashData(),
- UmlDiagram.getFailureText2(t, blockUml.getFlashData()));
- } finally {
- if (os != null) {
- os.close();
- }
- }
-
- return Collections.singletonList(image);
- }
-
- final List<FileImageData> exportDiagrams = PSystemUtils.exportDiagrams(system, suggested, fileFormatOption);
- if (exportDiagrams.size() > 1) {
- cpt += exportDiagrams.size() - 1;
+ @Override
+ protected SuggestedFile getSuggestedFile(BlockUml blockUml) {
+ final String newName = blockUml.getFileOrDirname();
+ SuggestedFile suggested = null;
+ if (newName != null) {
+ Log.info("name from block=" + newName);
+ final File dir = getDirIfDirectory(newName);
+ if (dir == null) {
+ Log.info(newName + " is not taken as a directory");
+ suggested = SuggestedFile.fromOutputFile(new File(outputDirectory, newName),
+ fileFormatOption.getFileFormat(), 0);
+ } else {
+ Log.info("We are going to create files in directory " + dir);
+ suggested = SuggestedFile.fromOutputFile(new File(dir, file.getName()),
+ fileFormatOption.getFileFormat(), 0);
}
- OptionFlags.getInstance().logData(file, system);
-
- for (FileImageData fdata : exportDiagrams) {
- final String desc = "[" + file.getName() + "] " + system.getDescription();
- final File f = fdata.getFile();
- if (OptionFlags.getInstance().isWord()) {
- final String warnOrError = system.getWarningOrError();
- if (warnOrError != null) {
- final String name = f.getName().substring(0, f.getName().length() - 4) + ".err";
- final File errorFile = new File(f.getParentFile(), name);
- final PrintStream ps = new PrintStream(new FileOutputStream(errorFile));
- ps.print(warnOrError);
- ps.close();
- }
- }
- final GeneratedImage generatedImage = new GeneratedImageImpl(f, desc, blockUml);
- result.add(generatedImage);
- }
-
+ Log.info("We are going to put data in " + suggested);
}
-
- Log.info("Number of image(s): " + result.size());
-
- return Collections.unmodifiableList(result);
- }
-
- private boolean endsWithSlashOrAntislash(String newName) {
- return newName.endsWith("/") || newName.endsWith("\\");
- }
-
- public List<BlockUml> getBlocks() {
- return builder.getBlockUmls();
- }
-
- private Reader getReader(String charset) throws FileNotFoundException, UnsupportedEncodingException {
- if (charset == null) {
- Log.info("Using default charset");
- return new InputStreamReader(new FileInputStream(file));
+ if (suggested == null) {
+ suggested = SuggestedFile.fromOutputFile(new File(outputDirectory, file.getName()),
+ fileFormatOption.getFileFormat(), cpt++);
}
- Log.info("Using charset " + charset);
- return new InputStreamReader(new FileInputStream(file), charset);
+ suggested.getParentFile().mkdirs();
+ return suggested;
}
- public final void setFileFormatOption(FileFormatOption fileFormatOption) {
- this.fileFormatOption = fileFormatOption;
- }
-
- public final Set<FileWithSuffix> getIncludedFiles() {
- return builder.getIncludedFiles();
- }
}
diff --git a/src/net/sourceforge/plantuml/SourceFileReader2.java b/src/net/sourceforge/plantuml/SourceFileReader2.java
index aa78623..1821a2e 100644
--- a/src/net/sourceforge/plantuml/SourceFileReader2.java
+++ b/src/net/sourceforge/plantuml/SourceFileReader2.java
@@ -36,28 +36,12 @@
package net.sourceforge.plantuml;
import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
-import java.util.Set;
-import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.preproc.Defines;
-import net.sourceforge.plantuml.preproc.FileWithSuffix;
-public class SourceFileReader2 implements ISourceFileReader {
-
- private final File file;
- private final File outputFile;
-
- private final BlockUmlBuilder builder;
- private FileFormatOption fileFormatOption;
+public class SourceFileReader2 extends SourceFileReaderAbstract implements ISourceFileReader {
public SourceFileReader2(Defines defines, final File file, File outputFile, List<String> config, String charset,
FileFormatOption fileFormatOption) throws IOException {
@@ -73,58 +57,10 @@ public class SourceFileReader2 implements ISourceFileReader {
.getParentFile(), file.getAbsolutePath());
}
- public boolean hasError() {
- for (final BlockUml b : builder.getBlockUmls()) {
- if (b.getDiagram() instanceof PSystemError) {
- return true;
- }
- }
- return false;
- }
-
- public List<GeneratedImage> getGeneratedImages() throws IOException {
- Log.info("Reading file: " + file);
-
- final List<GeneratedImage> result = new ArrayList<GeneratedImage>();
-
- for (BlockUml blockUml : builder.getBlockUmls()) {
- final SuggestedFile suggested = SuggestedFile.fromOutputFile(outputFile, fileFormatOption.getFileFormat());
-
- final Diagram system = blockUml.getDiagram();
- OptionFlags.getInstance().logData(file, system);
-
- for (FileImageData fdata : PSystemUtils.exportDiagrams(system, suggested, fileFormatOption)) {
- final String desc = "[" + file.getName() + "] " + system.getDescription();
- final GeneratedImage generatedImage = new GeneratedImageImpl(fdata.getFile(), desc, blockUml);
- result.add(generatedImage);
- }
-
- }
-
- Log.info("Number of image(s): " + result.size());
-
- return Collections.unmodifiableList(result);
- }
-
- private Reader getReader(String charset) throws FileNotFoundException, UnsupportedEncodingException {
- if (charset == null) {
- Log.info("Using default charset");
- return new InputStreamReader(new FileInputStream(file));
- }
- Log.info("Using charset " + charset);
- return new InputStreamReader(new FileInputStream(file), charset);
- }
-
- public final void setFileFormatOption(FileFormatOption fileFormatOption) {
- this.fileFormatOption = fileFormatOption;
- }
-
- public final Set<FileWithSuffix> getIncludedFiles2() {
- return builder.getIncludedFiles();
- }
-
- public List<BlockUml> getBlocks() {
- return builder.getBlockUmls();
+ @Override
+ protected SuggestedFile getSuggestedFile(BlockUml blockUml) {
+ final SuggestedFile suggested = SuggestedFile.fromOutputFile(outputFile, fileFormatOption.getFileFormat());
+ return suggested;
}
}
diff --git a/src/net/sourceforge/plantuml/SourceFileReaderAbstract.java b/src/net/sourceforge/plantuml/SourceFileReaderAbstract.java
new file mode 100644
index 0000000..7b4bd12
--- /dev/null
+++ b/src/net/sourceforge/plantuml/SourceFileReaderAbstract.java
@@ -0,0 +1,176 @@
+/* ========================================================================
+ * 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.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.io.Reader;
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+import net.sourceforge.plantuml.core.Diagram;
+import net.sourceforge.plantuml.preproc.FileWithSuffix;
+
+public abstract class SourceFileReaderAbstract {
+
+ protected File file;
+ protected File outputDirectory;
+ protected File outputFile;
+
+ protected BlockUmlBuilder builder;
+ protected FileFormatOption fileFormatOption;
+ private boolean checkMetadata;
+
+ public void setCheckMetadata(boolean checkMetadata) {
+ this.checkMetadata = checkMetadata;
+ }
+
+ public boolean hasError() {
+ for (final BlockUml b : builder.getBlockUmls()) {
+ if (b.getDiagram() instanceof PSystemError) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public List<BlockUml> getBlocks() {
+ return builder.getBlockUmls();
+ }
+
+ protected Reader getReader(String charset) throws FileNotFoundException, UnsupportedEncodingException {
+ if (charset == null) {
+ Log.info("Using default charset");
+ return new InputStreamReader(new FileInputStream(file));
+ }
+ Log.info("Using charset " + charset);
+ return new InputStreamReader(new FileInputStream(file), charset);
+ }
+
+ public final Set<FileWithSuffix> getIncludedFiles() {
+ return builder.getIncludedFiles();
+ }
+
+ public final void setFileFormatOption(FileFormatOption fileFormatOption) {
+ this.fileFormatOption = fileFormatOption;
+ }
+
+ protected boolean endsWithSlashOrAntislash(String newName) {
+ return newName.endsWith("/") || newName.endsWith("\\");
+ }
+
+ private List<GeneratedImage> getCrashedImage(BlockUml blockUml, Throwable t, File outputFile) throws IOException {
+ final GeneratedImage image = new GeneratedImageImpl(outputFile, "Crash Error", blockUml, FileImageData.CRASH);
+ OutputStream os = null;
+ try {
+ os = new BufferedOutputStream(new FileOutputStream(outputFile));
+ UmlDiagram.exportDiagramError(os, t, fileFormatOption, 42, null, blockUml.getFlashData(),
+ UmlDiagram.getFailureText2(t, blockUml.getFlashData()));
+ } finally {
+ if (os != null) {
+ os.close();
+ }
+ }
+
+ return Collections.singletonList(image);
+ }
+
+ protected void exportWarnOrErrIfWord(final File f, final Diagram system) throws FileNotFoundException {
+ if (OptionFlags.getInstance().isWord()) {
+ final String warnOrError = system.getWarningOrError();
+ if (warnOrError != null) {
+ final String name = f.getName().substring(0, f.getName().length() - 4) + ".err";
+ final File errorFile = new File(f.getParentFile(), name);
+ final PrintStream ps = new PrintStream(new FileOutputStream(errorFile));
+ ps.print(warnOrError);
+ ps.close();
+ }
+ }
+ }
+
+ protected int cpt;
+
+ final public List<GeneratedImage> getGeneratedImages() throws IOException {
+ Log.info("Reading file: " + file);
+
+ cpt = 0;
+ final List<GeneratedImage> result = new ArrayList<GeneratedImage>();
+
+ for (BlockUml blockUml : builder.getBlockUmls()) {
+ final SuggestedFile suggested = getSuggestedFile(blockUml);
+
+ final Diagram system;
+ try {
+ system = blockUml.getDiagram();
+ } catch (Throwable t) {
+ return getCrashedImage(blockUml, t, suggested.getFile(0));
+ }
+
+ OptionFlags.getInstance().logData(file, system);
+ final List<FileImageData> exportDiagrams = PSystemUtils.exportDiagrams(system, suggested, fileFormatOption,
+ checkMetadata);
+ if (exportDiagrams.size() > 1) {
+ cpt += exportDiagrams.size() - 1;
+ }
+
+ for (FileImageData fdata : exportDiagrams) {
+ final String desc = "[" + file.getName() + "] " + system.getDescription();
+ final File f = fdata.getFile();
+ exportWarnOrErrIfWord(f, system);
+ final GeneratedImage generatedImage = new GeneratedImageImpl(f, desc, blockUml, fdata.getStatus());
+ result.add(generatedImage);
+ }
+
+ }
+
+ Log.info("Number of image(s): " + result.size());
+
+ return Collections.unmodifiableList(result);
+ }
+
+ abstract protected SuggestedFile getSuggestedFile(BlockUml blockUml);
+
+}
diff --git a/src/net/sourceforge/plantuml/SourceStringReader.java b/src/net/sourceforge/plantuml/SourceStringReader.java
index 7ff6da5..cd906e6 100644
--- a/src/net/sourceforge/plantuml/SourceStringReader.java
+++ b/src/net/sourceforge/plantuml/SourceStringReader.java
@@ -83,7 +83,7 @@ public class SourceStringReader {
synchronized (SourceStringReader.class) {
try {
final BlockUmlBuilder builder = new BlockUmlBuilder(config, charset, defines, new StringReader(source),
- newCurrentDir, null);
+ newCurrentDir, "string");
this.blocks = builder.getBlockUmls();
} catch (IOException e) {
Log.error("error " + e);
diff --git a/src/net/sourceforge/plantuml/StringUtils.java b/src/net/sourceforge/plantuml/StringUtils.java
index 511a6ca..bacf7df 100644
--- a/src/net/sourceforge/plantuml/StringUtils.java
+++ b/src/net/sourceforge/plantuml/StringUtils.java
@@ -44,6 +44,7 @@ import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import net.sourceforge.plantuml.asciiart.Wcwidth;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
@@ -284,7 +285,7 @@ public class StringUtils {
return s;
}
- public static int getWidth(Display stringsToDisplay) {
+ private static int getWidth(Display stringsToDisplay) {
int result = 1;
for (CharSequence s : stringsToDisplay) {
if (s != null && result < s.length()) {
@@ -294,6 +295,20 @@ public class StringUtils {
return result;
}
+ public static int getWcWidth(Display stringsToDisplay) {
+ int result = 1;
+ for (CharSequence s : stringsToDisplay) {
+ if (s == null) {
+ continue;
+ }
+ final int length = Wcwidth.length(s);
+ if (result < length) {
+ result = length;
+ }
+ }
+ return result;
+ }
+
public static int getHeight(List<? extends CharSequence> stringsToDisplay) {
return stringsToDisplay.size();
}
@@ -423,6 +438,8 @@ public class StringUtils {
c += 13;
} else if ((c >= 'n' && c <= 'z') || (c >= 'N' && c <= 'Z')) {
c -= 13;
+ } else if (c > 126) {
+ throw new IllegalArgumentException(s);
}
sb.append(c);
}
diff --git a/src/net/sourceforge/plantuml/SuggestedFile.java b/src/net/sourceforge/plantuml/SuggestedFile.java
index 5db9a0c..834fe5a 100644
--- a/src/net/sourceforge/plantuml/SuggestedFile.java
+++ b/src/net/sourceforge/plantuml/SuggestedFile.java
@@ -52,6 +52,10 @@ public class SuggestedFile {
this.initialCpt = initialCpt;
}
+ public SuggestedFile withPreprocFormat() {
+ return new SuggestedFile(outputFile, FileFormat.PREPROC, initialCpt);
+ }
+
@Override
public String toString() {
return outputFile.getAbsolutePath() + "[" + initialCpt + "]";
diff --git a/src/net/sourceforge/plantuml/SvgString.java b/src/net/sourceforge/plantuml/SvgString.java
index f580d4e..7d589bf 100644
--- a/src/net/sourceforge/plantuml/SvgString.java
+++ b/src/net/sourceforge/plantuml/SvgString.java
@@ -48,8 +48,11 @@ public class SvgString {
this.scale = scale;
}
- public String getSvg() {
+ public String getSvg(boolean raw) {
String result = svg;
+ if (raw) {
+ return result;
+ }
if (result.startsWith("<?xml")) {
final int idx = result.indexOf("<svg");
result = result.substring(idx);
diff --git a/src/net/sourceforge/plantuml/TikzFontDistortion.java b/src/net/sourceforge/plantuml/TikzFontDistortion.java
new file mode 100644
index 0000000..1ce14a8
--- /dev/null
+++ b/src/net/sourceforge/plantuml/TikzFontDistortion.java
@@ -0,0 +1,86 @@
+/* ========================================================================
+ * 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.util.StringTokenizer;
+
+public class TikzFontDistortion {
+
+ private final double magnify;
+ private final double distortion;
+
+ private TikzFontDistortion(double magnify, double distortion) {
+ this.magnify = magnify;
+ this.distortion = distortion;
+ }
+
+ @Override
+ public String toString() {
+ return "" + magnify + ";" + distortion;
+ }
+
+ public static TikzFontDistortion fromValue(String value) {
+ if (value == null) {
+ return getDefault();
+ }
+ final StringTokenizer st = new StringTokenizer(value, ";");
+ if (st.hasMoreElements() == false) {
+ return getDefault();
+ }
+ final String v1 = st.nextToken();
+ if (st.hasMoreElements() == false) {
+ return getDefault();
+ }
+ final String v2 = st.nextToken();
+ if (v1.matches("[\\d.]+") && v2.matches("[-\\d.]+")) {
+ return new TikzFontDistortion(Double.parseDouble(v1), Double.parseDouble(v2));
+ }
+ return getDefault();
+ }
+
+ public static TikzFontDistortion getDefault() {
+ return new TikzFontDistortion(1.20, 4.0);
+ }
+
+ public final double getMagnify() {
+ return magnify;
+ }
+
+ public final double getDistortion() {
+ return distortion;
+ }
+
+} \ No newline at end of file
diff --git a/src/net/sourceforge/plantuml/UmlDiagram.java b/src/net/sourceforge/plantuml/UmlDiagram.java
index 7ef34c0..26ce1aa 100644
--- a/src/net/sourceforge/plantuml/UmlDiagram.java
+++ b/src/net/sourceforge/plantuml/UmlDiagram.java
@@ -60,6 +60,7 @@ import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.core.UmlSource;
import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
+import net.sourceforge.plantuml.cucadiagram.DisplaySection;
import net.sourceforge.plantuml.cucadiagram.UnparsableGraphvizException;
import net.sourceforge.plantuml.flashcode.FlashCodeFactory;
import net.sourceforge.plantuml.flashcode.FlashCodeUtils;
@@ -84,7 +85,7 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
import net.sourceforge.plantuml.version.Version;
-public abstract class UmlDiagram extends AbstractPSystem implements Diagram, Annotated {
+public abstract class UmlDiagram extends AbstractPSystem implements Diagram, Annotated, WithSprite {
private boolean rotation;
private boolean hideUnlinkedData;
@@ -93,17 +94,19 @@ public abstract class UmlDiagram extends AbstractPSystem implements Diagram, Ann
private DisplayPositionned title = DisplayPositionned.none(HorizontalAlignment.CENTER, VerticalAlignment.TOP);
private DisplayPositionned caption = DisplayPositionned.none(HorizontalAlignment.CENTER, VerticalAlignment.BOTTOM);
- private DisplayPositionned header = DisplayPositionned.none(HorizontalAlignment.RIGHT, VerticalAlignment.TOP);
- private DisplayPositionned footer = DisplayPositionned.none(HorizontalAlignment.CENTER, VerticalAlignment.BOTTOM);
private DisplayPositionned legend = DisplayPositionned.none(HorizontalAlignment.CENTER, VerticalAlignment.BOTTOM);
+ private final DisplaySection header = DisplaySection.none();
+ private final DisplaySection footer = DisplaySection.none();
private final Pragma pragma = new Pragma();
- private Scale scale;
private Animation animation;
private final SkinParam skinParam = SkinParam.create(getUmlDiagramType());
final public void setTitle(DisplayPositionned title) {
+ if (title.isNull() || title.getDisplay().isWhite()) {
+ return;
+ }
this.title = title;
}
@@ -144,23 +147,15 @@ public abstract class UmlDiagram extends AbstractPSystem implements Diagram, Ann
skinParam.setParam(StringUtils.goLowerCase(key), value);
}
- public final DisplayPositionned getHeader() {
+ public final DisplaySection getHeader() {
return header;
}
- public final void setHeader(DisplayPositionned header) {
- this.header = header;
- }
-
- public final DisplayPositionned getFooter() {
+ public final DisplaySection getFooter() {
return footer;
}
- public final void setFooter(DisplayPositionned footer) {
- this.footer = footer;
- }
-
- public final DisplayPositionned getFooterOrHeaderTeoz(FontParam param) {
+ public final DisplaySection getFooterOrHeaderTeoz(FontParam param) {
if (param == FontParam.FOOTER) {
return getFooter();
}
@@ -176,14 +171,6 @@ public abstract class UmlDiagram extends AbstractPSystem implements Diagram, Ann
return pragma;
}
- final public void setScale(Scale scale) {
- this.scale = scale;
- }
-
- final public Scale getScale() {
- return scale;
- }
-
final public void setAnimation(Iterable<CharSequence> animationData) {
try {
final AnimationDecoder animationDecoder = new AnimationDecoder(animationData);
@@ -223,6 +210,7 @@ public abstract class UmlDiagram extends AbstractPSystem implements Diagram, Ann
final HtmlColor hover = getSkinParam().getHoverPathColor();
fileFormatOption = fileFormatOption.withSvgLinkTarget(getSkinParam().getSvgLinkTarget());
+ fileFormatOption = fileFormatOption.withTikzFontDistortion(getSkinParam().getTikzFontDistortion());
if (hover != null) {
fileFormatOption = fileFormatOption.withHoverColor(StringUtils.getAsHtml(getSkinParam().getColorMapper()
.getMappedColor(hover)));
@@ -243,7 +231,7 @@ public abstract class UmlDiagram extends AbstractPSystem implements Diagram, Ann
e.printStackTrace();
exportDiagramError(os, e, fileFormatOption, seed, null);
}
- return new ImageDataSimple();
+ return ImageDataSimple.error();
}
private void exportDiagramError(OutputStream os, Throwable exception, FileFormatOption fileFormat, long seed,
@@ -282,7 +270,7 @@ public abstract class UmlDiagram extends AbstractPSystem implements Diagram, Ann
graphicStrings.drawU(ug);
final double height = graphicStrings.calculateDimension(ug.getStringBounder()).getHeight();
ug = ug.apply(new UTranslate(0, height));
- ug.draw(new UImage(im));
+ ug.draw(new UImage(im).scaleNearestNeighbor(3));
}
});
}
diff --git a/src/net/sourceforge/plantuml/Url.java b/src/net/sourceforge/plantuml/Url.java
index 1b59d0a..8a75f37 100644
--- a/src/net/sourceforge/plantuml/Url.java
+++ b/src/net/sourceforge/plantuml/Url.java
@@ -54,6 +54,7 @@ public class Url implements EnsureVisible {
if (url.contains("{")) {
throw new IllegalArgumentException(url);
}
+ url = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(url, "\"");
this.url = url;
if (tooltip == null) {
this.tooltip = url;
@@ -113,6 +114,10 @@ public class Url implements EnsureVisible {
visible.ensureVisible(x, y);
}
+ public boolean hasData() {
+ return visible.hasData();
+ }
+
public static final Comparator<Url> SURFACE_COMPARATOR = new Comparator<Url>() {
public int compare(Url url1, Url url2) {
final double surface1 = url1.visible.getSurface();
diff --git a/src/net/sourceforge/plantuml/WithSprite.java b/src/net/sourceforge/plantuml/WithSprite.java
new file mode 100644
index 0000000..746a577
--- /dev/null
+++ b/src/net/sourceforge/plantuml/WithSprite.java
@@ -0,0 +1,44 @@
+/* ========================================================================
+ * 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;
+import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
+
+public interface WithSprite extends Diagram {
+
+ public void addSprite(String name, Sprite sprite);
+}
diff --git a/src/net/sourceforge/plantuml/acearth/PSystemXearth.java b/src/net/sourceforge/plantuml/acearth/PSystemXearth.java
index 24e6357..fc3a861 100644
--- a/src/net/sourceforge/plantuml/acearth/PSystemXearth.java
+++ b/src/net/sourceforge/plantuml/acearth/PSystemXearth.java
@@ -53,9 +53,9 @@ import net.sourceforge.plantuml.api.ImageDataSimple;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData;
-import com.ctreber.acearth.ACearth;
-import com.ctreber.acearth.ConfigurationACearth;
-import com.ctreber.acearth.plugins.markers.Marker;
+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 {
diff --git a/src/net/sourceforge/plantuml/acearth/PSystemXearthFactory.java b/src/net/sourceforge/plantuml/acearth/PSystemXearthFactory.java
index 611d8bb..a4cfd66 100644
--- a/src/net/sourceforge/plantuml/acearth/PSystemXearthFactory.java
+++ b/src/net/sourceforge/plantuml/acearth/PSystemXearthFactory.java
@@ -45,7 +45,7 @@ import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
-import com.ctreber.acearth.plugins.markers.Marker;
+import ext.plantuml.com.ctreber.acearth.plugins.markers.Marker;
public class PSystemXearthFactory extends PSystemBasicFactory<PSystemXearth> {
diff --git a/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagram.java b/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagram.java
index 77d86f0..f49b37c 100644
--- a/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagram.java
+++ b/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagram.java
@@ -48,6 +48,7 @@ import net.sourceforge.plantuml.cucadiagram.GroupType;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.LeafType;
+import net.sourceforge.plantuml.cucadiagram.NamespaceStrategy;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.utils.UniqueSequence;
@@ -100,7 +101,7 @@ public class ActivityDiagram extends CucaDiagram {
}
private void updateLasts(final IEntity result) {
- if (result.getLeafType() == LeafType.NOTE) {
+ if (result == null || result.getLeafType() == LeafType.NOTE) {
return;
}
this.lastEntityConsulted = result;
@@ -154,8 +155,9 @@ public class ActivityDiagram extends CucaDiagram {
public IEntity createInnerActivity() {
// Log.println("createInnerActivity A");
final Code code = Code.of("##" + UniqueSequence.getValue());
- final IEntity g = getOrCreateGroup(code, Display.getWithNewlines(code), GroupType.INNER_ACTIVITY,
- getCurrentGroup());
+ gotoGroup2(code, Display.getWithNewlines(code), GroupType.INNER_ACTIVITY, getCurrentGroup(),
+ NamespaceStrategy.SINGLE);
+ final IEntity g = getCurrentGroup();
// g.setRankdir(Rankdir.LEFT_TO_RIGHT);
lastEntityConsulted = null;
lastEntityBrancheConsulted = null;
@@ -175,7 +177,8 @@ public class ActivityDiagram extends CucaDiagram {
if (getCurrentGroup().getGroupType() != GroupType.INNER_ACTIVITY) {
throw new IllegalStateException("type=" + getCurrentGroup().getGroupType());
}
- getOrCreateGroup(code, Display.getWithNewlines("code"), GroupType.CONCURRENT_ACTIVITY, getCurrentGroup());
+ gotoGroup2(code, Display.getWithNewlines("code"), GroupType.CONCURRENT_ACTIVITY, getCurrentGroup(),
+ NamespaceStrategy.SINGLE);
lastEntityConsulted = null;
lastEntityBrancheConsulted = null;
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkActivity.java b/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkActivity.java
index ca2c0d9..46a19c9 100644
--- a/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkActivity.java
+++ b/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkActivity.java
@@ -58,7 +58,9 @@ import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.LinkDecor;
import net.sourceforge.plantuml.cucadiagram.LinkType;
+import net.sourceforge.plantuml.cucadiagram.NamespaceStrategy;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
+import net.sourceforge.plantuml.descdiagram.command.CommandLinkElement;
import net.sourceforge.plantuml.graphic.color.ColorParser;
import net.sourceforge.plantuml.graphic.color.ColorType;
@@ -84,11 +86,9 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("ARROW_BODY1", "([-.]+)"), //
- new RegexLeaf("ARROW_STYLE1",
- "(?:\\[((?:#\\w+|dotted|dashed|plain|bold|hidden)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden)*)\\])?"), //
+ new RegexLeaf("ARROW_STYLE1", "(?:\\[(" + CommandLinkElement.LINE_STYLE + ")\\])?"), //
new RegexLeaf("ARROW_DIRECTION", "(\\*|left|right|up|down|le?|ri?|up?|do?)?"), //
- new RegexLeaf("ARROW_STYLE2",
- "(?:\\[((?:#\\w+|dotted|dashed|plain|bold|hidden)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden)*)\\])?"), //
+ new RegexLeaf("ARROW_STYLE2", "(?:\\[(" + CommandLinkElement.LINE_STYLE + ")\\])?"), //
new RegexLeaf("ARROW_BODY2", "([-.]*)\\>"), //
new RegexLeaf("[%s]*"), //
@@ -150,7 +150,7 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
LinkType type = new LinkType(LinkDecor.ARROW, LinkDecor.NONE);
if ((arrowBody1 + arrowBody2).contains(".")) {
- type = type.getDotted();
+ type = type.goDotted();
}
Link link = new Link(entity1, entity2, type, linkLabel, lenght);
@@ -167,7 +167,7 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
link.setUrl(urlLink);
}
- CommandLinkClass.applyStyle(arg.getLazzy("ARROW_STYLE", 0), link);
+ link.applyStyle(arg.getLazzy("ARROW_STYLE", 0));
diagram.addLink(link);
return CommandExecutionResult.ok();
@@ -198,8 +198,8 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
final Code code = Code.of(arg.get("CODE" + suf, 0));
if (code != null) {
if (partition != null) {
- system.getOrCreateGroup(Code.of(partition), Display.getWithNewlines(partition), GroupType.PACKAGE,
- system.getRootGroup());
+ system.gotoGroup2(Code.of(partition), Display.getWithNewlines(partition), GroupType.PACKAGE,
+ system.getRootGroup(), NamespaceStrategy.SINGLE);
}
final IEntity result = system.getOrCreate(code, Display.getWithNewlines(code),
CommandLinkActivity.getTypeIfExisting(system, code));
@@ -216,8 +216,8 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
if (quoted.get(0) != null) {
final Code quotedCode = Code.of(quoted.get(1) == null ? quoted.get(0) : quoted.get(1));
if (partition != null) {
- system.getOrCreateGroup(Code.of(partition), Display.getWithNewlines(partition), GroupType.PACKAGE,
- system.getRootGroup());
+ system.gotoGroup2(Code.of(partition), Display.getWithNewlines(partition), GroupType.PACKAGE,
+ system.getRootGroup(), NamespaceStrategy.SINGLE);
}
final IEntity result = system.getOrCreate(quotedCode, Display.getWithNewlines(quoted.get(0)),
CommandLinkActivity.getTypeIfExisting(system, quotedCode));
@@ -229,8 +229,8 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
final Code quotedInvisible = Code.of(arg.get("QUOTED_INVISIBLE" + suf, 0));
if (quotedInvisible != null) {
if (partition != null) {
- system.getOrCreateGroup(Code.of(partition), Display.getWithNewlines(partition), GroupType.PACKAGE,
- system.getRootGroup());
+ system.gotoGroup2(Code.of(partition), Display.getWithNewlines(partition), GroupType.PACKAGE,
+ system.getRootGroup(), NamespaceStrategy.SINGLE);
}
final IEntity result = system.getOrCreate(quotedInvisible, Display.getWithNewlines(quotedInvisible),
LeafType.ACTIVITY);
diff --git a/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkLongActivity.java b/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkLongActivity.java
index 6d9bf16..9bbfb92 100644
--- a/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkLongActivity.java
+++ b/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkLongActivity.java
@@ -63,7 +63,9 @@ import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.LinkDecor;
import net.sourceforge.plantuml.cucadiagram.LinkType;
+import net.sourceforge.plantuml.cucadiagram.NamespaceStrategy;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
+import net.sourceforge.plantuml.descdiagram.command.CommandLinkElement;
import net.sourceforge.plantuml.graphic.color.ColorType;
public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram> {
@@ -93,11 +95,9 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("ARROW_BODY1", "([-.]+)"), //
- new RegexLeaf("ARROW_STYLE1",
- "(?:\\[((?:#\\w+|dotted|dashed|plain|bold|hidden)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden)*)\\])?"), //
+ new RegexLeaf("ARROW_STYLE1", "(?:\\[(" + CommandLinkElement.LINE_STYLE + ")\\])?"), //
new RegexLeaf("ARROW_DIRECTION", "(\\*|left|right|up|down|le?|ri?|up?|do?)?"), //
- new RegexLeaf("ARROW_STYLE2",
- "(?:\\[((?:#\\w+|dotted|dashed|plain|bold|hidden)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden)*)\\])?"), //
+ new RegexLeaf("ARROW_STYLE2", "(?:\\[(" + CommandLinkElement.LINE_STYLE + ")\\])?"), //
new RegexLeaf("ARROW_BODY2", "([-.]*)\\>"), //
new RegexLeaf("[%s]*"), //
@@ -108,11 +108,14 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
new RegexLeaf("$"));
}
- public CommandExecutionResult executeNow(final ActivityDiagram diagram, BlocLines lines) {
+ protected CommandExecutionResult executeNow(final ActivityDiagram diagram, BlocLines lines) {
lines = lines.trim(false);
final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
final IEntity entity1 = CommandLinkActivity.getEntity(diagram, line0, true);
+ if (entity1 == null) {
+ return CommandExecutionResult.error("No such entity");
+ }
if (line0.get("STEREOTYPE", 0) != null) {
entity1.setStereotype(new Stereotype(line0.get("STEREOTYPE", 0)));
@@ -165,9 +168,14 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
partition = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(partition);
}
if (partition != null) {
- diagram.getOrCreateGroup(Code.of(partition), Display.getWithNewlines(partition), GroupType.PACKAGE, null);
+ diagram.gotoGroup2(Code.of(partition), Display.getWithNewlines(partition), GroupType.PACKAGE, null,
+ NamespaceStrategy.SINGLE);
+ }
+ final IEntity entity2 = diagram.getOrCreate(code, Display.getWithNewlines(display), LeafType.ACTIVITY);
+ if (entity2 == null) {
+ return CommandExecutionResult.error("No such entity");
}
- final IEntity entity2 = diagram.createLeaf(code, Display.getWithNewlines(display), LeafType.ACTIVITY, null);
+
if (partition != null) {
diagram.endGroup();
}
@@ -179,11 +187,8 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
entity2.setStereotype(new Stereotype(lineLast.get(2)));
}
if (lineLast.get(4) != null) {
- entity2.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(lineLast.get(4)));
- }
-
- if (entity1 == null || entity2 == null) {
- return CommandExecutionResult.error("No such entity");
+ entity2.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet()
+ .getColorIfValid(lineLast.get(4)));
}
final String arrowBody1 = CommandLinkClass.notNull(line0.get("ARROW_BODY1", 0));
@@ -198,7 +203,7 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
LinkType type = new LinkType(LinkDecor.ARROW, LinkDecor.NONE);
if (arrow.contains(".")) {
- type = type.getDotted();
+ type = type.goDotted();
}
Link link = new Link(entity1, entity2, type, linkLabel, lenght);
final Direction direction = StringUtils.getArrowDirection(arrowBody1 + arrowDirection + arrowBody2 + ">");
@@ -212,7 +217,7 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
link.setUrl(urlLink);
}
- CommandLinkClass.applyStyle(line0.getLazzy("ARROW_STYLE", 0), link);
+ link.applyStyle(line0.getLazzy("ARROW_STYLE", 0));
diagram.addLink(link);
return CommandExecutionResult.ok();
diff --git a/src/net/sourceforge/plantuml/activitydiagram/command/CommandPartition.java b/src/net/sourceforge/plantuml/activitydiagram/command/CommandPartition.java
index 7e91fa3..b43be2c 100644
--- a/src/net/sourceforge/plantuml/activitydiagram/command/CommandPartition.java
+++ b/src/net/sourceforge/plantuml/activitydiagram/command/CommandPartition.java
@@ -48,6 +48,7 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.GroupType;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.IGroup;
+import net.sourceforge.plantuml.cucadiagram.NamespaceStrategy;
import net.sourceforge.plantuml.graphic.color.ColorParser;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.graphic.color.Colors;
@@ -79,8 +80,9 @@ public class CommandPartition extends SingleLineCommand2<ActivityDiagram> {
protected CommandExecutionResult executeArg(ActivityDiagram diagram, RegexResult arg) {
final Code code = Code.of(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("NAME", 0)));
final IGroup currentPackage = diagram.getCurrentGroup();
- final IEntity p = diagram.getOrCreateGroup(code, Display.getWithNewlines(code), GroupType.PACKAGE,
- currentPackage);
+ diagram.gotoGroup2(code, Display.getWithNewlines(code), GroupType.PACKAGE, currentPackage,
+ NamespaceStrategy.SINGLE);
+ final IEntity p = diagram.getCurrentGroup();
final Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
if (colors.isEmpty() == false) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagram3.java b/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagram3.java
index 1b9611d..2b037a8 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagram3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagram3.java
@@ -48,8 +48,7 @@ import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle;
-import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
-import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlanes;
+import net.sourceforge.plantuml.activitydiagram3.ftile.SwimlanesC;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData;
@@ -57,13 +56,13 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockCompressed;
import net.sourceforge.plantuml.graphic.TextBlockRecentred;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.NoteType;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
+import net.sourceforge.plantuml.ugraphic.comp.CompressionMode;
+import net.sourceforge.plantuml.ugraphic.comp.TextBlockCompressedOnXorY;
public class ActivityDiagram3 extends UmlDiagram {
@@ -73,7 +72,7 @@ public class ActivityDiagram3 extends UmlDiagram {
private SwimlaneStrategy swimlaneStrategy;
- private final Swimlanes swinlanes = new Swimlanes(getSkinParam(), getPragma());
+ private final SwimlanesC swinlanes = new SwimlanesC(getSkinParam(), getPragma());
private void manageSwimlaneStrategy() {
if (swimlaneStrategy == null) {
@@ -117,6 +116,13 @@ public class ActivityDiagram3 extends UmlDiagram {
}
}
+ public void addSpot(String spot) {
+ final InstructionSpot ins = new InstructionSpot(spot, nextLinkRenderer(), swinlanes.getCurrentSwimlane());
+ current().add(ins);
+ setNextLinkRendererInternal(LinkRendering.none());
+ manageSwimlaneStrategy();
+ }
+
public CommandExecutionResult addGoto(String name) {
final InstructionGoto ins = new InstructionGoto(swinlanes.getCurrentSwimlane(), name);
current().add(ins);
@@ -186,13 +192,16 @@ public class ActivityDiagram3 extends UmlDiagram {
throws IOException {
// BUG42
// COMPRESSION
- // TextBlock result = swinlanes;
- TextBlock result = new TextBlockCompressed(swinlanes);
+ TextBlock result = swinlanes;
+ // result = new TextBlockCompressedOnY(CompressionMode.ON_Y, result);
+ // result = new TextBlockCompressedOnXorY(CompressionMode.ON_X, result);
+ result = new TextBlockCompressedOnXorY(CompressionMode.ON_Y, result);
result = new TextBlockRecentred(result);
final ISkinParam skinParam = getSkinParam();
result = new AnnotatedWorker(this, skinParam).addAdd(result);
- final Dimension2D dim = TextBlockUtils.getMinMax(result, fileFormatOption.getDefaultStringBounder())
- .getDimension();
+ // final Dimension2D dim = TextBlockUtils.getMinMax(result, fileFormatOption.getDefaultStringBounder())
+ // .getDimension();
+ final Dimension2D dim = result.getMinMax(fileFormatOption.getDefaultStringBounder()).getDimension();
final double margin = 10;
final double dpiFactor = getDpiFactor(fileFormatOption, Dimension2DDouble.delta(dim, 2 * margin, 0));
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagramFactory3.java b/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagramFactory3.java
index fc77602..01b9725 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagramFactory3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagramFactory3.java
@@ -45,6 +45,7 @@ import net.sourceforge.plantuml.activitydiagram3.command.CommandArrow3;
import net.sourceforge.plantuml.activitydiagram3.command.CommandArrowLong3;
import net.sourceforge.plantuml.activitydiagram3.command.CommandBackward3;
import net.sourceforge.plantuml.activitydiagram3.command.CommandBreak;
+import net.sourceforge.plantuml.activitydiagram3.command.CommandCircleSpot3;
import net.sourceforge.plantuml.activitydiagram3.command.CommandElse3;
import net.sourceforge.plantuml.activitydiagram3.command.CommandElseIf2;
import net.sourceforge.plantuml.activitydiagram3.command.CommandElseLegacy1;
@@ -126,6 +127,7 @@ public class ActivityDiagramFactory3 extends UmlDiagramFactory {
// cmds.add(new CommandGroupEnd3());
cmds.add(new CommandStart3());
cmds.add(new CommandStop3());
+ cmds.add(new CommandCircleSpot3());
cmds.add(new CommandBreak());
cmds.add(new CommandEnd3());
cmds.add(new CommandKill3());
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/Branch.java b/src/net/sourceforge/plantuml/activitydiagram3/Branch.java
index 90263ab..87c6dd2 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/Branch.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/Branch.java
@@ -149,8 +149,8 @@ public class Branch {
return list.getLast();
}
- public boolean isOnlySingleStop() {
- return list.isOnlySingleStop();
+ public boolean isOnlySingleStopOrSpot() {
+ return list.isOnlySingleStopOrSpot();
}
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionList.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionList.java
index 7e1df56..7c1add0 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionList.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionList.java
@@ -65,9 +65,14 @@ public class InstructionList extends WithNote implements Instruction, Instructio
return all.isEmpty();
}
- public boolean isOnlySingleStop() {
- return all.size() == 1 && getLast() instanceof InstructionStop
- && ((InstructionStop) getLast()).hasNotes() == false;
+ public boolean isOnlySingleStopOrSpot() {
+ if (all.size() != 1) {
+ return false;
+ }
+ if (getLast() instanceof InstructionSpot) {
+ return true;
+ }
+ return getLast() instanceof InstructionStop && ((InstructionStop) getLast()).hasNotes() == false;
}
public InstructionList(Swimlane defaultSwimlane) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionRepeat.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionRepeat.java
index 12ffc2d..6c8999d 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionRepeat.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionRepeat.java
@@ -78,6 +78,13 @@ public class InstructionRepeat implements Instruction {
this.color = color;
}
+ private boolean isLastOfTheParent() {
+ if (parent instanceof InstructionList) {
+ return ((InstructionList) parent).getLast() == this;
+ }
+ return false;
+ }
+
public void setBackward(Display label) {
this.backward = label;
}
@@ -89,9 +96,9 @@ public class InstructionRepeat implements Instruction {
public Ftile createFtile(FtileFactory factory) {
final Ftile back = Display.isNull(backward) ? null : factory.activity(backward, swimlane, BoxStyle.PLAIN,
Colors.empty());
- final Ftile result = factory.repeat(swimlane, repeatList.getSwimlaneOut(),
- startLabel, factory.decorateOut(repeatList.createFtile(factory), endRepeatLinkRendering), test, yes, out,
- color, backRepeatLinkRendering, back);
+ final Ftile result = factory.repeat(swimlane, repeatList.getSwimlaneOut(), startLabel,
+ factory.decorateOut(repeatList.createFtile(factory), endRepeatLinkRendering), test, yes, out, color,
+ backRepeatLinkRendering, back, isLastOfTheParent());
if (killed) {
return new FtileKilled(result);
}
diff --git a/src/net/sourceforge/plantuml/code/CompressionGZip.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionSpot.java
index 5d86883..a990e40 100644
--- a/src/net/sourceforge/plantuml/code/CompressionGZip.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionSpot.java
@@ -33,52 +33,48 @@
*
*
*/
-package net.sourceforge.plantuml.code;
+package net.sourceforge.plantuml.activitydiagram3;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.zip.GZIPInputStream;
-import java.util.zip.GZIPOutputStream;
+import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
+import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
+import net.sourceforge.plantuml.activitydiagram3.ftile.FtileKilled;
+import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
-public class CompressionGZip implements Compression {
+public class InstructionSpot extends MonoSwimable implements Instruction {
- class MyGZIPOutputStream extends GZIPOutputStream {
+ private boolean killed = false;
+ private final LinkRendering inlinkRendering;
+ private final String spot;
- public MyGZIPOutputStream(OutputStream baos) throws IOException {
- super(baos);
- def.setLevel(9);
+ public InstructionSpot(String spot, LinkRendering inlinkRendering, Swimlane swimlane) {
+ super(swimlane);
+ this.spot = spot;
+ this.inlinkRendering = inlinkRendering;
+ if (inlinkRendering == null) {
+ throw new IllegalArgumentException();
}
-
}
- public byte[] compress(byte[] in) {
- final ByteArrayOutputStream baos = new ByteArrayOutputStream();
- try {
- final GZIPOutputStream gz = new MyGZIPOutputStream(baos);
- gz.write(in);
- gz.close();
- baos.close();
- return baos.toByteArray();
- } catch (IOException e) {
- throw new IllegalStateException(e.toString());
+ public Ftile createFtile(FtileFactory factory) {
+ Ftile result = factory.spot(getSwimlaneIn(), spot);
+ result = eventuallyAddNote(factory, result, result.getSwimlaneIn());
+ if (killed) {
+ return new FtileKilled(result);
}
+ return result;
}
- public byte[] decompress(byte[] in) throws IOException {
- final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ public void add(Instruction other) {
+ throw new UnsupportedOperationException();
+ }
- final ByteArrayInputStream bais = new ByteArrayInputStream(in);
- final GZIPInputStream gz = new GZIPInputStream(bais);
- int read;
- while ((read = gz.read()) != -1) {
- baos.write(read);
- }
- gz.close();
- bais.close();
- baos.close();
- return baos.toByteArray();
+ final public boolean kill() {
+ this.killed = true;
+ return true;
+ }
+
+ public LinkRendering getInLinkRendering() {
+ return inlinkRendering;
}
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivityLong3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivityLong3.java
index d0c722a..8bb6c3c 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivityLong3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivityLong3.java
@@ -72,7 +72,7 @@ public class CommandActivityLong3 extends CommandMultilines2<ActivityDiagram3> {
new RegexLeaf("$"));
}
- public CommandExecutionResult executeNow(ActivityDiagram3 diagram, BlocLines lines) {
+ protected CommandExecutionResult executeNow(ActivityDiagram3 diagram, BlocLines lines) {
lines = lines.removeEmptyColumns();
final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
final Colors colors = color().getColor(line0, diagram.getSkinParam().getIHtmlColorSet());
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandArrow3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandArrow3.java
index b451097..16126a2 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandArrow3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandArrow3.java
@@ -43,11 +43,13 @@ import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexOr;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.descdiagram.command.CommandLinkElement;
import net.sourceforge.plantuml.graphic.Rainbow;
public class CommandArrow3 extends SingleLineCommand2<ActivityDiagram3> {
- public static final String STYLE_COLORS = "-\\[((?:#\\w+|dotted|dashed|plain|bold|hidden)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden)*(?:;(?:#\\w+|dotted|dashed|plain|bold|hidden)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden)*)*)\\]->";
+ public static final String STYLE_COLORS = "-\\[(" + CommandLinkElement.LINE_STYLE + "(?:;"
+ + CommandLinkElement.LINE_STYLE + ")*)\\]->";
public CommandArrow3() {
super(getRegexConcat());
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandArrowLong3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandArrowLong3.java
index a144e91..1a288cf 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandArrowLong3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandArrowLong3.java
@@ -70,7 +70,7 @@ public class CommandArrowLong3 extends CommandMultilines2<ActivityDiagram3> {
new RegexLeaf("$"));
}
- public CommandExecutionResult executeNow(ActivityDiagram3 diagram, BlocLines lines) {
+ protected CommandExecutionResult executeNow(ActivityDiagram3 diagram, BlocLines lines) {
lines = lines.removeEmptyColumns();
final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
// final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR", 0));
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandCircleSpot3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandCircleSpot3.java
new file mode 100644
index 0000000..f01f0b9
--- /dev/null
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandCircleSpot3.java
@@ -0,0 +1,64 @@
+/* ========================================================================
+ * 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.activitydiagram3.command;
+
+import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.SingleLineCommand2;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+
+public class CommandCircleSpot3 extends SingleLineCommand2<ActivityDiagram3> {
+
+ public CommandCircleSpot3() {
+ super(getRegexConcat());
+ }
+
+ static RegexConcat getRegexConcat() {
+ return new RegexConcat(//
+ new RegexLeaf("^"), //
+ new RegexLeaf("SPOT", "\\((\\S)\\)"), //
+ new RegexLeaf(";?$"));
+ }
+
+ @Override
+ protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
+ diagram.addSpot(arg.get("SPOT", 0));
+ return CommandExecutionResult.ok();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandNoteLong3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandNoteLong3.java
index 64a29b5..e69d104 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandNoteLong3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandNoteLong3.java
@@ -66,7 +66,7 @@ public class CommandNoteLong3 extends CommandMultilines2<ActivityDiagram3> {
return "(?i)^end[%s]?note$";
}
- public CommandExecutionResult executeNow(final ActivityDiagram3 diagram, BlocLines lines) {
+ protected CommandExecutionResult executeNow(final ActivityDiagram3 diagram, BlocLines lines) {
// final List<? extends CharSequence> in = StringUtils.removeEmptyColumns2(lines.subList(1, lines.size() - 1));
final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
lines = lines.subExtract(1, 1);
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java
index 82c3d25..336a856 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java
@@ -63,24 +63,27 @@ public class CommandPartition3 extends SingleLineCommand2<ActivityDiagram3> {
new RegexLeaf("[%s]+"), //
new RegexOptional(//
new RegexConcat( //
- color().getRegex(),//
+ color("BACK1").getRegex(),//
new RegexLeaf("[%s]+"))), //
- new RegexLeaf("TITLECOLOR", "(?:(#\\w+)[%s]+)?"), //
new RegexLeaf("NAME", "([%g][^%g]+[%g]|\\S+)"), //
+ new RegexOptional(//
+ new RegexConcat( //
+ new RegexLeaf("[%s]+"), //
+ color("BACK2").getRegex())), //
new RegexLeaf("[%s]*\\{?$"));
}
- private static ColorParser color() {
- return ColorParser.simpleColor(ColorType.BACK);
+ private static ColorParser color(String id) {
+ return ColorParser.simpleColor(ColorType.BACK, id);
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
final String partitionTitle = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("NAME", 0));
- final HtmlColor titleColor = diagram.getSkinParam().getIHtmlColorSet()
- .getColorIfValid(arg.get("TITLECOLOR", 0));
- final Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
+ final String b1 = arg.get("BACK1", 0);
+ final Colors colors = color(b1 == null ? "BACK2" : "BACK1").getColor(arg,
+ diagram.getSkinParam().getIHtmlColorSet());
final HtmlColor backColorInSkinparam = diagram.getSkinParam().getHtmlColor(ColorParam.partitionBackground,
null, false);
@@ -89,9 +92,10 @@ public class CommandPartition3 extends SingleLineCommand2<ActivityDiagram3> {
backColor = colors.getColor(ColorType.BACK);
} else {
backColor = backColorInSkinparam;
-
}
+ final HtmlColor titleColor = colors.getColor(ColorType.HEADER);
+ // Warning : titleColor unused in FTileGroupW
HtmlColor borderColor = diagram.getSkinParam().getHtmlColor(ColorParam.partitionBorder, null, false);
if (borderColor == null) {
borderColor = HtmlColorUtils.BLACK;
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeatWhile3Multilines.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeatWhile3Multilines.java
index 5262cb1..fb1c1bc 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeatWhile3Multilines.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeatWhile3Multilines.java
@@ -74,7 +74,7 @@ public class CommandRepeatWhile3Multilines extends CommandMultilines3<ActivityDi
}
@Override
- public CommandExecutionResult executeNow(ActivityDiagram3 diagram, BlocLines lines) {
+ protected CommandExecutionResult executeNow(ActivityDiagram3 diagram, BlocLines lines) {
lines = lines.trim(false);
final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
final RegexResult lineLast = getPatternEnd2().matcher(lines.getLast499().toString());
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java
index c14c463..7d3984a 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java
@@ -39,28 +39,22 @@ import java.util.Collection;
import java.util.Collections;
import java.util.List;
-import net.sourceforge.plantuml.AlignParam;
+import net.sourceforge.plantuml.AlignmentParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineParam;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
public abstract class AbstractFtile extends AbstractTextBlock implements Ftile {
- private final boolean shadowing;
private final ISkinParam skinParam;
- private AbstractFtile(boolean shadowing) {
- this.shadowing = shadowing;
- this.skinParam = null;
- }
-
public AbstractFtile(ISkinParam skinParam) {
- this.shadowing = skinParam.shadowing();
this.skinParam = skinParam;
}
@@ -101,10 +95,31 @@ public abstract class AbstractFtile extends AbstractTextBlock implements Ftile {
public Collection<Ftile> getMyChildren() {
throw new UnsupportedOperationException("" + getClass());
- // return Collections.emptyList();
}
public HorizontalAlignment arrowHorizontalAlignment() {
- return skinParam.getHorizontalAlignment(AlignParam.ARROW_MESSAGE_ALIGN, null);
+ return skinParam.getHorizontalAlignment(AlignmentParam.arrowMessageAlignment, null);
+ }
+
+ private FtileGeometry cachedGeometry;
+
+ final public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ if (cachedGeometry == null) {
+ cachedGeometry = calculateDimensionFtile(stringBounder);
+ }
+ return cachedGeometry;
}
+
+ abstract protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder);
+
+ @Override
+ final public MinMax getMinMax(StringBounder stringBounder) {
+ throw new UnsupportedOperationException();
+ // return getMinMaxFtile(stringBounder);
+ }
+
+ // protected MinMax getMinMaxFtile(StringBounder stringBounder) {
+ // throw new UnsupportedOperationException();
+ // }
+
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/CollisionDetector.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/CollisionDetector.java
index 482f42f..5b311ed 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/CollisionDetector.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/CollisionDetector.java
@@ -221,4 +221,8 @@ public class CollisionDetector implements UGraphic {
return false;
}
+ public double dpiFactor() {
+ return 1;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileAssemblySimple.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileAssemblySimple.java
index 733e76e..a842cbb 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileAssemblySimple.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileAssemblySimple.java
@@ -40,8 +40,10 @@ import java.util.ArrayList;
import java.util.Arrays;
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.ISkinParam;
@@ -76,7 +78,18 @@ public class FtileAssemblySimple extends AbstractTextBlock implements Ftile {
return tile2.getSwimlaneOut();
}
+ private final Map<Ftile, UTranslate> cachedTranslation = new HashMap<Ftile, UTranslate>();
+
public UTranslate getTranslateFor(Ftile child, StringBounder stringBounder) {
+ UTranslate result = cachedTranslation.get(child);
+ if (result == null) {
+ result = getTranslateForSlow(child, stringBounder);
+ cachedTranslation.put(child, result);
+ }
+ return result;
+ }
+
+ private UTranslate getTranslateForSlow(Ftile child, StringBounder stringBounder) {
if (child == tile1) {
return getTranslated1(stringBounder);
}
@@ -96,8 +109,8 @@ public class FtileAssemblySimple extends AbstractTextBlock implements Ftile {
public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder();
- ug.apply(getTranslated1(stringBounder)).draw(tile1);
- ug.apply(getTranslated2(stringBounder)).draw(tile2);
+ ug.apply(getTranslateFor(tile1, stringBounder)).draw(tile1);
+ ug.apply(getTranslateFor(tile2, stringBounder)).draw(tile2);
}
public LinkRendering getInLinkRendering() {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileBreak.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileBreak.java
index e43fd69..5dc01b3 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileBreak.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileBreak.java
@@ -58,8 +58,9 @@ public class FtileBreak extends FtileEmpty implements WeldingPoint {
return "FtileBreak";
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
- return super.calculateDimension(stringBounder).withoutPointOut();
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
+ return calculateDimensionEmpty().withoutPointOut();
}
@Override
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileEmpty.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileEmpty.java
index 75526fc..db6b630 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileEmpty.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileEmpty.java
@@ -85,7 +85,12 @@ public class FtileEmpty extends AbstractFtile {
public void drawU(UGraphic ug) {
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
+ return calculateDimensionEmpty();
+ }
+
+ final protected FtileGeometry calculateDimensionEmpty() {
return new FtileGeometry(width, height, width / 2, 0, height);
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactory.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactory.java
index c6f9eea..3e4f03b 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactory.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactory.java
@@ -62,6 +62,8 @@ public interface FtileFactory {
public Ftile end(Swimlane swimlane);
+ public Ftile spot(Swimlane swimlane, String spot);
+
public Ftile activity(Display label, Swimlane swimlane, BoxStyle style, Colors colors);
public Ftile addNote(Ftile ftile, Swimlane swimlane, Collection<PositionedNote> notes);
@@ -74,8 +76,9 @@ public interface FtileFactory {
public Ftile assembly(Ftile tile1, Ftile tile2);
- public Ftile repeat(Swimlane swimlane, Swimlane swimlaneOut, Display startLabel, Ftile repeat, Display test, Display yes,
- Display out, HtmlColor color, LinkRendering backRepeatLinkRendering, Ftile backward);
+ public Ftile repeat(Swimlane swimlane, Swimlane swimlaneOut, Display startLabel, Ftile repeat, Display test,
+ Display yes, Display out, HtmlColor color, LinkRendering backRepeatLinkRendering, Ftile backward,
+ boolean noOut);
public Ftile createWhile(Swimlane swimlane, Ftile whileBlock, Display test, Display yes, Display out,
LinkRendering afterEndwhile, HtmlColor color, Instruction specialOut);
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java
index 07461b5..8061639 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java
@@ -111,6 +111,10 @@ public class FtileFactoryDelegator implements FtileFactory {
return factory.stop(swimlane);
}
+ public Ftile spot(Swimlane swimlane, String spot) {
+ return factory.spot(swimlane, spot);
+ }
+
public Ftile activity(Display label, Swimlane swimlane, BoxStyle style, Colors colors) {
return factory.activity(label, swimlane, style, colors);
}
@@ -141,10 +145,11 @@ public class FtileFactoryDelegator implements FtileFactory {
return factory.assembly(tile1, tile2);
}
- public Ftile repeat(Swimlane swimlane, Swimlane swimlaneOut, Display startLabel, Ftile repeat, Display test, Display yes,
- Display out, HtmlColor color, LinkRendering backRepeatLinkRendering, Ftile backward) {
- return factory.repeat(swimlane, swimlaneOut, startLabel, repeat, test, yes, out, color, backRepeatLinkRendering,
- backward);
+ public Ftile repeat(Swimlane swimlane, Swimlane swimlaneOut, Display startLabel, Ftile repeat, Display test,
+ Display yes, Display out, HtmlColor color, LinkRendering backRepeatLinkRendering, Ftile backward,
+ boolean noOut) {
+ return factory.repeat(swimlane, swimlaneOut, startLabel, repeat, test, yes, out, color,
+ backRepeatLinkRendering, backward, noOut);
}
public Ftile createWhile(Swimlane swimlane, Ftile whileBlock, Display test, Display yes, Display out,
@@ -181,4 +186,5 @@ public class FtileFactoryDelegator implements FtileFactory {
protected FtileFactory getFactory() {
return factory;
}
+
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileGoto.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileGoto.java
index 22e069d..cf895da 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileGoto.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileGoto.java
@@ -47,8 +47,9 @@ public class FtileGoto extends FtileEmpty {
this.name = name;
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
- return super.calculateDimension(stringBounder).withoutPointOut();
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
+ return calculateDimensionEmpty().withoutPointOut();
}
public String getName() {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileHeightFixed.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileHeightFixed.java
index cc23f56..673d121 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileHeightFixed.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileHeightFixed.java
@@ -76,7 +76,8 @@ public class FtileHeightFixed extends AbstractFtile {
return tile.getSwimlaneOut();
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
return tile.calculateDimension(stringBounder).translate(getTranslate(stringBounder)).fixedHeight(fixedHeight);
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileKilled.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileKilled.java
index 71003b5..149b65a 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileKilled.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileKilled.java
@@ -61,7 +61,8 @@ public class FtileKilled extends AbstractFtile {
return tile.getSwimlaneOut();
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
final FtileGeometry geo = tile.calculateDimension(stringBounder);
return new FtileGeometry(tile.calculateDimension(stringBounder), geo.getLeft(), geo.getInY());
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMarged.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMarged.java
index 6f5ed4b..d69ca60 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMarged.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMarged.java
@@ -85,7 +85,8 @@ public class FtileMarged extends AbstractFtile {
return tile.getSwimlaneOut();
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
final FtileGeometry orig = tile.calculateDimension(stringBounder);
return new FtileGeometry(orig.getWidth() + margin1 + margin2, orig.getHeight(), orig.getLeft() + margin1,
orig.getInY(), orig.getOutY());
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMargedRight.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMargedRight.java
index a64d590..ec9e23c 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMargedRight.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMargedRight.java
@@ -74,7 +74,8 @@ public class FtileMargedRight extends AbstractFtile {
return tile.getSwimlaneOut();
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
final FtileGeometry orig = tile.calculateDimension(stringBounder);
if (orig.getWidth() > maxX) {
throw new IllegalStateException();
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMargedVertically.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMargedVertically.java
index 0123ea4..b480e9f 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMargedVertically.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMargedVertically.java
@@ -58,7 +58,16 @@ public class FtileMargedVertically extends FtileDecorate {
ug.draw(getFtileDelegated());
}
+ private FtileGeometry cached;
+
public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ if (cached == null) {
+ this.cached = calculateDimensionSlow(stringBounder);
+ }
+ return this.cached;
+ }
+
+ private FtileGeometry calculateDimensionSlow(StringBounder stringBounder) {
final FtileGeometry orig = getFtileDelegated().calculateDimension(stringBounder);
return new FtileGeometry(orig.getWidth(), orig.getHeight() + margin1 + margin2, orig.getLeft(), orig.getInY()
+ margin1, orig.hasPointOut() ? orig.getOutY() + margin1 : orig.getOutY());
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Snake.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Snake.java
index c86334d..3cb54fa 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Snake.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Snake.java
@@ -39,6 +39,7 @@ import java.awt.geom.Dimension2D;
import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import net.sourceforge.plantuml.Direction;
@@ -48,11 +49,12 @@ import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
-import net.sourceforge.plantuml.ugraphic.CompressionTransform;
+import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.UShape;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.comp.CompressionTransform;
public class Snake implements UShape {
@@ -140,10 +142,14 @@ public class Snake implements UShape {
}
private void drawRainbow(UGraphic ug) {
- final List<HtmlColorAndStyle> colors = color.getColors();
+ List<HtmlColorAndStyle> colors = color.getColors();
final int colorArrowSeparationSpace = color.getColorArrowSeparationSpace();
final double move = 2 + colorArrowSeparationSpace;
final WormMutation mutation = WormMutation.create(worm, move);
+ if (mutation.isDxNegative()) {
+ colors = new ArrayList<HtmlColorAndStyle>(colors);
+ Collections.reverse(colors);
+ }
final double globalMove = -1.0 * (colors.size() - 1) / 2.0;
Worm current = worm.moveFirstPoint(mutation.getFirst().multiplyBy(globalMove));
if (mutation.size() > 2) {
@@ -268,4 +274,8 @@ public class Snake implements UShape {
this.emphasizeDirection = direction;
}
+ public boolean doesHorizontalCross(MinMax minMax) {
+ return worm.doesHorizontalCross(minMax);
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlane.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlane.java
index 37bca5c..cc92ca9 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlane.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlane.java
@@ -50,7 +50,7 @@ public class Swimlane implements SpecificBackcolorable {
private Display display;
private UTranslate translate = new UTranslate();
- private double totalWidth;
+ private double actualWidth;
public Swimlane(String name) {
this.name = name;
@@ -79,9 +79,9 @@ public class Swimlane implements SpecificBackcolorable {
return translate;
}
- public final void setTranslateAndWidth(UTranslate translate, double totalWidth) {
+ public final void setTranslateAndWidth(UTranslate translate, double actualWidth) {
this.translate = translate;
- this.totalWidth = totalWidth;
+ this.actualWidth = actualWidth;
}
public Colors getColors(ISkinParam skinParam) {
@@ -96,8 +96,8 @@ public class Swimlane implements SpecificBackcolorable {
private Colors colors = Colors.empty();
- public final double getTotalWidth() {
- return totalWidth;
+ public final double getActualWidth() {
+ return actualWidth;
}
public void setColors(Colors colors) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlanes.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlanes.java
index 4e13fb1..b0d7e2f 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlanes.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlanes.java
@@ -71,7 +71,6 @@ import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.svek.UGraphicForSnake;
import net.sourceforge.plantuml.ugraphic.LimitFinder;
import net.sourceforge.plantuml.ugraphic.MinMax;
-import net.sourceforge.plantuml.ugraphic.SlotSet;
import net.sourceforge.plantuml.ugraphic.UChange;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
@@ -81,6 +80,7 @@ import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UShape;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.comp.SlotSet;
import net.sourceforge.plantuml.utils.MathUtils;
public class Swimlanes extends AbstractTextBlock implements TextBlock {
@@ -113,7 +113,8 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock {
factory = new FtileFactoryDelegatorWhile(factory);
factory = new FtileFactoryDelegatorRepeat(factory);
factory = new FtileFactoryDelegatorCreateParallel(factory);
- // factory = new FtileFactoryDelegatorCreateParallelAddingMargin(new FtileFactoryDelegatorCreateParallel1(factory));
+ // factory = new FtileFactoryDelegatorCreateParallelAddingMargin(new
+ // FtileFactoryDelegatorCreateParallel1(factory));
factory = new FtileFactoryDelegatorAddNote(factory);
factory = new FtileFactoryDelegatorCreateGroup(factory);
return factory;
@@ -173,59 +174,26 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock {
}
static private final double separationMargin = 10;
+ private TextBlock full;
public void drawU(UGraphic ug) {
- final FtileFactory factory = getFtileFactory(ug.getStringBounder());
- TextBlock full = root.createFtile(factory);
+ if (full == null) {
+ final FtileFactory factory = getFtileFactory(ug.getStringBounder());
+ full = root.createFtile(factory);
+ if (swimlanes.size() <= 1) {
+ // BUG42
+ full = new TextBlockInterceptorUDrawable(full);
+ }
+ }
ug = new UGraphicForSnake(ug);
if (swimlanes.size() <= 1) {
- full = new TextBlockInterceptorUDrawable(full);
- // BUG42
- // full.drawU(ug);
full.drawU(ug);
ug.flushUg();
return;
}
- // if (OptionFlags.SWI2) {
- //
- // final SlotFinderX slotFinder = new SlotFinderX(ug.getStringBounder());
- // drawWhenSwimlanes(slotFinder, full);
- // final SlotSet slotX = slotFinder.getXSlotSet().reverse();
- // //
- // // // final SlotSet ysSlotSet = slotFinder.getYSlotSet().reverse().smaller(5.0);
- // //
- // System.err.println("slotX=" + slotX);
- //
- // printDebug(ug, slotX, HtmlColorUtils.GRAY, full);
- //
- // double x2 = 0;
- // double y2 = 0;
- // final double stepy = 40;
- // int i = 0;
- // final SlotSet deconnectedSwimlanes = new SlotSet();
- // for (Swimlane swimlane : swimlanes) {
- // final UGraphic ug2 = ug.apply(new UChangeColor(HtmlColorUtils.GREEN)).apply(
- // new UChangeBackColor(HtmlColorUtils.GREEN));
- // final double totalWidth = swimlane.getTotalWidth();
- // final SlotSet slot2 = slotX.filter(x2 + separationMargin, x2 + totalWidth - separationMargin);
- // deconnectedSwimlanes.addAll(slot2);
- // // ug2.apply(new UTranslate(x2, y2)).draw(new URectangle(totalWidth, stepy));
- // x2 += totalWidth;
- // y2 += stepy;
- // i++;
- // }
- // // printDebug(ug, deconnectedSwimlanes, HtmlColorUtils.GRAY, full);
- //
- // //
- // final CompressionTransform compressionTransform = new CompressionTransform(deconnectedSwimlanes);
- // // ug = new UGraphicCompress2(ug, compressionTransform);
- // drawWhenSwimlanes(ug, full);
- // } else {
drawWhenSwimlanes(ug, full);
- // }
- // getCollisionDetector(ug, titleHeightTranslate).drawDebug(ug);
}
static private void printDebug(UGraphic ug, SlotSet slot, HtmlColor col, TextBlock full) {
@@ -248,26 +216,24 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock {
if (back != null) {
final UGraphic background = ug.apply(new UChangeBackColor(back)).apply(new UChangeColor(back))
.apply(new UTranslate(x2, 0));
- background.draw(new URectangle(swimlane.getTotalWidth(), dimensionFull.getHeight()
+ background.draw(new URectangle(swimlane.getActualWidth(), dimensionFull.getHeight()
+ titleHeightTranslate.getDy()));
}
- // if (OptionFlags.SWI2 == false) {
- final TextBlock swTitle = swimlane.getDisplay().create(getFontConfiguration(), HorizontalAlignment.LEFT,
- skinParam);
+ final TextBlock swTitle = getTitle(swimlane);
final double titleWidth = swTitle.calculateDimension(stringBounder).getWidth();
- final double posTitle = x2 + (swimlane.getTotalWidth() - titleWidth) / 2;
+ final double posTitle = x2 + (swimlane.getActualWidth() - titleWidth) / 2;
swTitle.drawU(ug.apply(new UTranslate(posTitle, 0)));
- // }
drawSeparation(ug.apply(new UTranslate(x2, 0)), dimensionFull.getHeight() + titleHeightTranslate.getDy());
full.drawU(new UGraphicInterceptorOneSwimlane(ug, swimlane).apply(swimlane.getTranslate()).apply(
titleHeightTranslate));
- x2 += swimlane.getTotalWidth();
+ x2 += swimlane.getActualWidth();
}
drawSeparation(ug.apply(new UTranslate(x2, 0)), dimensionFull.getHeight() + titleHeightTranslate.getDy());
+
final Cross cross = new Cross(ug.apply(titleHeightTranslate));
full.drawU(cross);
cross.flushUg();
@@ -303,8 +269,7 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock {
final MinMax minMax = swimlane.getMinMax();
final double drawingWidth = minMax.getWidth() + 2 * separationMargin;
- final TextBlock swTitle = swimlane.getDisplay().create(getFontConfiguration(), HorizontalAlignment.LEFT,
- skinParam);
+ final TextBlock swTitle = getTitle(swimlane);
final double titleWidth = swTitle.calculateDimension(stringBounder).getWidth();
final double totalWidth = MathUtils.max(swimlaneWidth, drawingWidth, titleWidth + 2 * separationMargin);
@@ -316,37 +281,10 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock {
}
}
- private void computeSizeOld(UGraphic ug, TextBlock full) {
- double x1 = 0;
- final StringBounder stringBounder = ug.getStringBounder();
- for (Swimlane swimlane : swimlanes) {
-
- final LimitFinder limitFinder = new LimitFinder(stringBounder, false);
- final UGraphicInterceptorOneSwimlane interceptor = new UGraphicInterceptorOneSwimlane(new UGraphicForSnake(
- limitFinder), swimlane);
- full.drawU(interceptor);
- interceptor.flushUg();
- final MinMax minMax = limitFinder.getMinMax();
-
- final double drawingWidth = minMax.getWidth() + 2 * separationMargin;
- final TextBlock swTitle = swimlane.getDisplay().create(getFontConfiguration(), HorizontalAlignment.LEFT,
- skinParam);
- final double titleWidth = swTitle.calculateDimension(stringBounder).getWidth();
- final double totalWidth = Math.max(drawingWidth, titleWidth + 2 * separationMargin);
-
- final UTranslate translate = new UTranslate(x1 - minMax.getMinX() + separationMargin
- + (totalWidth - drawingWidth) / 2.0, 0);
- swimlane.setTranslateAndWidth(translate, totalWidth);
-
- x1 += totalWidth;
- }
- }
-
private UTranslate getTitleHeightTranslate(final StringBounder stringBounder) {
double titlesHeight = 0;
for (Swimlane swimlane : swimlanes) {
- final TextBlock swTitle = swimlane.getDisplay().create(getFontConfiguration(), HorizontalAlignment.LEFT,
- skinParam);
+ final TextBlock swTitle = getTitle(swimlane);
titlesHeight = Math.max(titlesHeight, swTitle.calculateDimension(stringBounder).getHeight());
}
@@ -354,24 +292,9 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock {
return titleHeightTranslate;
}
- private CollisionDetector getCollisionDetector(UGraphic ug, final UTranslate titleHeightTranslate) {
- final FtileFactory factory = getFtileFactory(ug.getStringBounder());
- final TextBlock full = root.createFtile(factory);
- ug = new UGraphicForSnake(ug);
-
- final CollisionDetector collisionDetector = new CollisionDetector(ug.getStringBounder());
-
- for (Swimlane swimlane : swimlanes) {
- full.drawU(new UGraphicInterceptorOneSwimlane(collisionDetector, swimlane).apply(swimlane.getTranslate())
- .apply(titleHeightTranslate));
- }
-
- collisionDetector.setManageSnakes(true);
- final Cross cross = new Cross(collisionDetector.apply(titleHeightTranslate));
- full.drawU(cross);
- cross.flushUg();
-
- return collisionDetector;
+ private TextBlock getTitle(Swimlane swimlane) {
+ return swimlane.getDisplay().create(getFontConfiguration(), HorizontalAlignment.LEFT, skinParam,
+ skinParam.wrapWidth());
}
private void drawSeparation(UGraphic ug, double height) {
@@ -384,7 +307,7 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock {
}
public Dimension2D calculateDimension(StringBounder stringBounder) {
- return TextBlockUtils.getMinMax(this, stringBounder).getDimension();
+ return getMinMax(stringBounder).getDimension();
}
public Instruction getCurrent() {
@@ -410,4 +333,14 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock {
return currentSwimlane;
}
+ private MinMax cachedMinMax;
+
+ @Override
+ public MinMax getMinMax(StringBounder stringBounder) {
+ if (cachedMinMax == null) {
+ cachedMinMax = TextBlockUtils.getMinMax(this, stringBounder);
+ }
+ return cachedMinMax;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/SwimlanesA.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/SwimlanesA.java
new file mode 100644
index 0000000..6907b20
--- /dev/null
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/SwimlanesA.java
@@ -0,0 +1,309 @@
+/* ========================================================================
+ * 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.activitydiagram3.ftile;
+
+import java.awt.geom.Dimension2D;
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sourceforge.plantuml.FontParam;
+import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.Pragma;
+import net.sourceforge.plantuml.activitydiagram3.Instruction;
+import net.sourceforge.plantuml.activitydiagram3.InstructionList;
+import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
+import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDelegatorAddNote;
+import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDelegatorAddUrl;
+import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDelegatorAssembly;
+import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDelegatorCreateGroup;
+import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDelegatorCreateParallel;
+import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDelegatorIf;
+import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDelegatorRepeat;
+import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDelegatorWhile;
+import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.UGraphicInterceptorOneSwimlane;
+import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.VCompactFactory;
+import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.graphic.TextBlockUtils;
+import net.sourceforge.plantuml.graphic.UGraphicDelegator;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.svek.UGraphicForSnake;
+import net.sourceforge.plantuml.ugraphic.LimitFinder;
+import net.sourceforge.plantuml.ugraphic.MinMax;
+import net.sourceforge.plantuml.ugraphic.UChange;
+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.UShape;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.comp.SlotSet;
+import net.sourceforge.plantuml.utils.MathUtils;
+
+public class SwimlanesA extends AbstractTextBlock implements TextBlock {
+
+ protected final ISkinParam skinParam;;
+ private final Pragma pragma;
+
+ protected final List<Swimlane> swimlanes = new ArrayList<Swimlane>();
+ private Swimlane currentSwimlane = null;
+
+ private final Instruction root = new InstructionList();
+ private Instruction currentInstruction = root;
+
+ private LinkRendering nextLinkRenderer = LinkRendering.none();
+
+ public SwimlanesA(ISkinParam skinParam, Pragma pragma) {
+ this.skinParam = skinParam;
+ this.pragma = pragma;
+ }
+
+ private FtileFactory getFtileFactory(StringBounder stringBounder) {
+ FtileFactory factory = new VCompactFactory(skinParam, stringBounder);
+ factory = new FtileFactoryDelegatorAddUrl(factory);
+ factory = new FtileFactoryDelegatorAssembly(factory);
+ factory = new FtileFactoryDelegatorIf(factory, pragma);
+ factory = new FtileFactoryDelegatorWhile(factory);
+ factory = new FtileFactoryDelegatorRepeat(factory);
+ factory = new FtileFactoryDelegatorCreateParallel(factory);
+ // factory = new FtileFactoryDelegatorCreateParallelAddingMargin(new
+ // FtileFactoryDelegatorCreateParallel1(factory));
+ factory = new FtileFactoryDelegatorAddNote(factory);
+ factory = new FtileFactoryDelegatorCreateGroup(factory);
+ return factory;
+ }
+
+ public void swimlane(String name, HtmlColor color, Display label) {
+ currentSwimlane = getOrCreate(name);
+ if (color != null) {
+ currentSwimlane.setSpecificColorTOBEREMOVED(ColorType.BACK, color);
+ }
+ if (Display.isNull(label) == false) {
+ currentSwimlane.setDisplay(label);
+ }
+ }
+
+ private Swimlane getOrCreate(String name) {
+ for (Swimlane s : swimlanes) {
+ if (s.getName().equals(name)) {
+ return s;
+ }
+ }
+ final Swimlane result = new Swimlane(name);
+ swimlanes.add(result);
+ return result;
+ }
+
+ class Cross extends UGraphicDelegator {
+
+ private Cross(UGraphic ug) {
+ super(ug);
+ }
+
+ @Override
+ public void draw(UShape shape) {
+ if (shape instanceof Ftile) {
+ final Ftile tile = (Ftile) shape;
+ tile.drawU(this);
+ } else if (shape instanceof Connection) {
+ final Connection connection = (Connection) shape;
+ final Ftile tile1 = connection.getFtile1();
+ final Ftile tile2 = connection.getFtile2();
+
+ if (tile1 == null || tile2 == null) {
+ return;
+ }
+ if (tile1.getSwimlaneOut() != tile2.getSwimlaneIn()) {
+ final ConnectionCross connectionCross = new ConnectionCross(connection);
+ connectionCross.drawU(getUg());
+ }
+ }
+ }
+
+ public UGraphic apply(UChange change) {
+ return new Cross(getUg().apply(change));
+ }
+
+ }
+
+ static protected final double separationMargin = 10;
+
+ private TextBlock full;
+
+ public void drawU(UGraphic ug) {
+ if (full == null) {
+ final FtileFactory factory = getFtileFactory(ug.getStringBounder());
+ full = root.createFtile(factory);
+ if (swimlanes.size() <= 1) {
+ // BUG42
+ full = new TextBlockInterceptorUDrawable(full);
+ }
+ }
+
+ ug = new UGraphicForSnake(ug);
+ if (swimlanes.size() <= 1) {
+ full.drawU(ug);
+ ug.flushUg();
+ return;
+ }
+
+ drawWhenSwimlanes(ug, full);
+ }
+
+ static private void printDebug(UGraphic ug, SlotSet slot, HtmlColor col, TextBlock full) {
+ slot.drawDebugX(ug.apply(new UChangeColor(col)).apply(new UChangeBackColor(col)),
+ full.calculateDimension(ug.getStringBounder()).getHeight());
+
+ }
+
+ protected void drawWhenSwimlanes(final UGraphic ug, TextBlock full) {
+ final StringBounder stringBounder = ug.getStringBounder();
+ final Dimension2D dimensionFull = full.calculateDimension(stringBounder);
+
+ computeSize(ug, full);
+ final UTranslate titleHeightTranslate = getTitleHeightTranslate(stringBounder);
+
+ double x2 = 0;
+ for (Swimlane swimlane : swimlanes) {
+ final HtmlColor back = swimlane.getColors(skinParam).getColor(ColorType.BACK);
+ if (back != null) {
+ final UGraphic background = ug.apply(new UChangeBackColor(back)).apply(new UChangeColor(back))
+ .apply(new UTranslate(x2, 0));
+ background.draw(new URectangle(swimlane.getActualWidth(), dimensionFull.getHeight()
+ + titleHeightTranslate.getDy()));
+ }
+
+ full.drawU(new UGraphicInterceptorOneSwimlane(ug, swimlane).apply(swimlane.getTranslate()).apply(
+ titleHeightTranslate));
+ x2 += swimlane.getActualWidth();
+
+ }
+ final Cross cross = new Cross(ug.apply(titleHeightTranslate));
+ full.drawU(cross);
+ cross.flushUg();
+ }
+
+ protected UTranslate getTitleHeightTranslate(final StringBounder stringBounder) {
+ return new UTranslate();
+ }
+
+ private void computeDrawingWidths(UGraphic ug, TextBlock full) {
+ final StringBounder stringBounder = ug.getStringBounder();
+ for (Swimlane swimlane : swimlanes) {
+ final LimitFinder limitFinder = new LimitFinder(stringBounder, false);
+ final UGraphicInterceptorOneSwimlane interceptor = new UGraphicInterceptorOneSwimlane(new UGraphicForSnake(
+ limitFinder), swimlane);
+ full.drawU(interceptor);
+ interceptor.flushUg();
+ final MinMax minMax = limitFinder.getMinMax();
+ swimlane.setMinMax(minMax);
+ }
+ }
+
+ private void computeSize(UGraphic ug, TextBlock full) {
+ computeDrawingWidths(ug, full);
+ double x1 = 0;
+
+ double swimlaneWidth = skinParam.swimlaneWidth();
+
+ if (swimlaneWidth == ISkinParam.SWIMLANE_WIDTH_SAME) {
+ for (Swimlane swimlane : swimlanes) {
+ swimlaneWidth = Math.max(swimlaneWidth, rawDrawingWidth(swimlane));
+ }
+
+ }
+ for (Swimlane swimlane : swimlanes) {
+ final double swimlaneActualWidth = swimlaneActualWidth(ug.getStringBounder(), swimlaneWidth, swimlane);
+
+ final UTranslate translate = new UTranslate(x1 - swimlane.getMinMax().getMinX() + separationMargin
+ + (swimlaneActualWidth - rawDrawingWidth(swimlane)) / 2.0, 0);
+ swimlane.setTranslateAndWidth(translate, swimlaneActualWidth);
+
+ x1 += swimlaneActualWidth;
+ }
+ }
+
+ protected double swimlaneActualWidth(StringBounder stringBounder, double swimlaneWidth, Swimlane swimlane) {
+ return MathUtils.max(swimlaneWidth, rawDrawingWidth(swimlane));
+ }
+
+ private double rawDrawingWidth(Swimlane swimlane) {
+ return swimlane.getMinMax().getWidth() + 2 * separationMargin;
+ }
+
+ public Dimension2D calculateDimension(StringBounder stringBounder) {
+ return getMinMax(stringBounder).getDimension();
+ }
+
+ public Instruction getCurrent() {
+ return currentInstruction;
+ }
+
+ public void setCurrent(Instruction current) {
+ this.currentInstruction = current;
+ }
+
+ public LinkRendering nextLinkRenderer() {
+ return nextLinkRenderer;
+ }
+
+ public void setNextLinkRenderer(LinkRendering link) {
+ if (link == null) {
+ throw new IllegalArgumentException();
+ }
+ this.nextLinkRenderer = link;
+ }
+
+ public Swimlane getCurrentSwimlane() {
+ return currentSwimlane;
+ }
+
+ private MinMax cachedMinMax;
+
+ @Override
+ public MinMax getMinMax(StringBounder stringBounder) {
+ if (cachedMinMax == null) {
+ cachedMinMax = TextBlockUtils.getMinMax(this, stringBounder);
+ }
+ return cachedMinMax;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/SwimlanesB.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/SwimlanesB.java
new file mode 100644
index 0000000..9250a32
--- /dev/null
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/SwimlanesB.java
@@ -0,0 +1,112 @@
+/* ========================================================================
+ * 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.activitydiagram3.ftile;
+
+import net.sourceforge.plantuml.FontParam;
+import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.LineBreakStrategy;
+import net.sourceforge.plantuml.Pragma;
+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.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.utils.MathUtils;
+
+public class SwimlanesB extends SwimlanesA {
+
+ public SwimlanesB(ISkinParam skinParam, Pragma pragma) {
+ super(skinParam, pragma);
+ }
+
+ @Override
+ protected void drawWhenSwimlanes(UGraphic ug, TextBlock full) {
+ super.drawWhenSwimlanes(ug, full);
+ double x2 = 0;
+
+ final StringBounder stringBounder = ug.getStringBounder();
+ for (Swimlane swimlane : swimlanes) {
+ final TextBlock swTitle = getTitle(swimlane);
+ final double titleWidth = swTitle.calculateDimension(stringBounder).getWidth();
+ final double posTitle = x2 + (swimlane.getActualWidth() - titleWidth) / 2;
+ swTitle.drawU(ug.apply(new UTranslate(posTitle, 0)));
+ x2 += swimlane.getActualWidth();
+ }
+ }
+
+ private TextBlock getTitle(Swimlane swimlane) {
+ final FontConfiguration fontConfiguration = new FontConfiguration(skinParam, FontParam.SWIMLANE_TITLE, null);
+
+ LineBreakStrategy wrap = getWrap();
+ if (wrap.isAuto()) {
+ wrap = new LineBreakStrategy("" + ((int) swimlane.getActualWidth()));
+ }
+
+ return swimlane.getDisplay().create(fontConfiguration, HorizontalAlignment.LEFT, skinParam, wrap);
+ }
+
+ private LineBreakStrategy getWrap() {
+ LineBreakStrategy wrap = skinParam.swimlaneWrapTitleWidth();
+ if (wrap == LineBreakStrategy.NONE) {
+ wrap = skinParam.wrapWidth();
+ }
+ return wrap;
+ }
+
+ @Override
+ protected double swimlaneActualWidth(StringBounder stringBounder, double swimlaneWidth, Swimlane swimlane) {
+ final double m1 = super.swimlaneActualWidth(stringBounder, swimlaneWidth, swimlane);
+ if (getWrap().isAuto()) {
+ return m1;
+ }
+
+ final double titleWidth = getTitle(swimlane).calculateDimension(stringBounder).getWidth();
+ return MathUtils.max(m1, titleWidth + 2 * separationMargin);
+
+ }
+
+ @Override
+ protected UTranslate getTitleHeightTranslate(final StringBounder stringBounder) {
+ double titlesHeight = 0;
+ for (Swimlane swimlane : swimlanes) {
+ final TextBlock swTitle = getTitle(swimlane);
+ titlesHeight = Math.max(titlesHeight, swTitle.calculateDimension(stringBounder).getHeight());
+ }
+ return new UTranslate(0, titlesHeight);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/SwimlanesC.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/SwimlanesC.java
new file mode 100644
index 0000000..1184b41
--- /dev/null
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/SwimlanesC.java
@@ -0,0 +1,89 @@
+/* ========================================================================
+ * 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.activitydiagram3.ftile;
+
+import java.awt.geom.Dimension2D;
+
+import net.sourceforge.plantuml.ColorParam;
+import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.LineParam;
+import net.sourceforge.plantuml.Pragma;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.skin.rose.Rose;
+import net.sourceforge.plantuml.ugraphic.UChangeColor;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.ULine;
+import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class SwimlanesC extends SwimlanesB {
+
+ public SwimlanesC(ISkinParam skinParam, Pragma pragma) {
+ super(skinParam, pragma);
+ }
+
+ @Override
+ protected void drawWhenSwimlanes(UGraphic ug, TextBlock full) {
+ super.drawWhenSwimlanes(ug, full);
+ double x2 = 0;
+
+ final StringBounder stringBounder = ug.getStringBounder();
+ final Dimension2D dimensionFull = full.calculateDimension(stringBounder);
+
+ final UTranslate titleHeightTranslate = getTitleHeightTranslate(stringBounder);
+
+ for (Swimlane swimlane : swimlanes) {
+ drawSeparation(ug.apply(new UTranslate(x2, 0)), dimensionFull.getHeight() + titleHeightTranslate.getDy());
+
+ x2 += swimlane.getActualWidth();
+
+ }
+ drawSeparation(ug.apply(new UTranslate(x2, 0)), dimensionFull.getHeight() + titleHeightTranslate.getDy());
+
+ }
+
+ private void drawSeparation(UGraphic ug, double height) {
+ HtmlColor color = skinParam.getHtmlColor(ColorParam.swimlaneBorder, null, false);
+ if (color == null) {
+ color = ColorParam.swimlaneBorder.getDefaultValue();
+ }
+ final UStroke thickness = Rose.getStroke(skinParam, LineParam.swimlaneBorder, 2);
+ ug.apply(thickness).apply(new UChangeColor(color)).draw(new ULine(0, height));
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/TextBlockInterceptorUDrawable.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/TextBlockInterceptorUDrawable.java
index ac71857..fe4c0e9 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/TextBlockInterceptorUDrawable.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/TextBlockInterceptorUDrawable.java
@@ -41,7 +41,6 @@ import java.util.HashMap;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
@@ -59,7 +58,8 @@ public class TextBlockInterceptorUDrawable extends AbstractTextBlock implements
}
public Dimension2D calculateDimension(StringBounder stringBounder) {
- return TextBlockUtils.getMinMax(this, stringBounder).getDimension();
+ // return TextBlockUtils.getMinMax(this, stringBounder).getDimension();
+ throw new UnsupportedOperationException();
}
} \ No newline at end of file
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java
index 9b3a585..011e215 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java
@@ -47,6 +47,7 @@ import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.cucadiagram.LinkStyle;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
+import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
@@ -70,15 +71,15 @@ public class Worm implements Iterable<Point2D.Double> {
throw new IllegalArgumentException();
}
final LinkStyle style = color.getStyle();
- if (style == LinkStyle.INVISIBLE) {
+ if (style.isInvisible()) {
return;
}
ug = ug.apply(new UChangeColor(color2));
ug = ug.apply(new UChangeBackColor(color2));
- if (style == LinkStyle.NORMAL) {
+ if (style.isNormal()) {
ug = ug.apply(new UStroke(stroke));
} else {
- ug = ug.apply(LinkStyle.getStroke(style, stroke));
+ ug = ug.apply(style.goThickness(stroke).getStroke3());
}
boolean drawn = false;
for (int i = 0; i < points.size() - 1; i++) {
@@ -231,6 +232,17 @@ public class Worm implements Iterable<Point2D.Double> {
return Collections.unmodifiableCollection(points).iterator();
}
+ public boolean doesHorizontalCross(MinMax area) {
+ for (int i = 0; i < points.size() - 1; i++) {
+ final Point2D.Double pt1 = get(i);
+ final Point2D.Double pt2 = get(i + 1);
+ if (pt1.getY() == pt2.getY() && area.doesHorizontalCross(pt1, pt2)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
public int size() {
return this.points.size();
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/WormMutation.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/WormMutation.java
index 195b105..53b3131 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/WormMutation.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/WormMutation.java
@@ -91,7 +91,7 @@ public class WormMutation {
public UTranslate getFirst() {
return translations.get(0);
}
-
+
public int size() {
return translations.size();
}
@@ -187,6 +187,10 @@ public class WormMutation {
return new UTranslate(result.getExtreme() * (size - 1), 0);
}
+ public boolean isDxNegative() {
+ return translations.get(0).getDx() < 0;
+ }
+
public Worm mute(Worm original) {
final Worm result = new Worm();
for (int i = 0; i < original.size(); i++) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Zad.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Zad.java
new file mode 100644
index 0000000..004f1e1
--- /dev/null
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Zad.java
@@ -0,0 +1,74 @@
+/* ========================================================================
+ * 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.activitydiagram3.ftile;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.ugraphic.MinMax;
+import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
+import net.sourceforge.plantuml.ugraphic.UChangeColor;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+
+public class Zad {
+
+ private final List<MinMax> rectangles = new ArrayList<MinMax>();
+
+ public void add(MinMax rect) {
+ // System.err.println("add " + rect);
+ this.rectangles.add(rect);
+
+ }
+
+ public void drawDebug(UGraphic ug) {
+ ug = ug.apply(new UChangeBackColor(HtmlColorUtils.BLUE)).apply(new UChangeColor(HtmlColorUtils.RED_LIGHT));
+ for (MinMax minMax : rectangles) {
+ System.err.println("minmax=" + minMax);
+ minMax.drawGrey(ug);
+ }
+
+ }
+
+ public boolean doesHorizontalCross(Snake snake) {
+ for (MinMax minMax : rectangles) {
+ if (snake.doesHorizontalCross(minMax)) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/src/net/sourceforge/plantuml/ugraphic/SlotFinder.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/ZadBuilder.java
index 9151010..4cf3fb9 100644
--- a/src/net/sourceforge/plantuml/ugraphic/SlotFinder.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/ZadBuilder.java
@@ -30,49 +30,61 @@
*
*
* Original Author: Arnaud Roques
- *
+ *
*
*/
-package net.sourceforge.plantuml.ugraphic;
+package net.sourceforge.plantuml.activitydiagram3.ftile;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.graphic.StringBounder;
-
-public class SlotFinder implements UGraphic {
-
- public boolean matchesProperty(String propertyName) {
- return false;
- }
+import net.sourceforge.plantuml.ugraphic.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.MinMax;
+import net.sourceforge.plantuml.ugraphic.UChange;
+import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
+import net.sourceforge.plantuml.ugraphic.UChangeColor;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UParam;
+import net.sourceforge.plantuml.ugraphic.UParamNull;
+import net.sourceforge.plantuml.ugraphic.URectangle;
+import net.sourceforge.plantuml.ugraphic.UShape;
+import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class ZadBuilder implements UGraphic {
public UGraphic apply(UChange change) {
if (change instanceof UTranslate) {
- return new SlotFinder(stringBounder, yslot, translate.compose((UTranslate) change));
+ return new ZadBuilder(stringBounder, translate.compose((UTranslate) change), this.context);
} else if (change instanceof UStroke) {
- return new SlotFinder(this);
+ return new ZadBuilder(this);
} else if (change instanceof UChangeBackColor) {
- return new SlotFinder(this);
+ return new ZadBuilder(this);
} else if (change instanceof UChangeColor) {
- return new SlotFinder(this);
+ return new ZadBuilder(this);
}
throw new UnsupportedOperationException();
}
- private final SlotSet yslot;
private final StringBounder stringBounder;
private final UTranslate translate;
+ private final Context context;
- public SlotFinder(StringBounder stringBounder) {
- this(stringBounder, new SlotSet(), new UTranslate());
+ static class Context {
+ private final Zad zad = new Zad();
}
- private SlotFinder(StringBounder stringBounder, SlotSet yslot, UTranslate translate) {
+ public ZadBuilder(StringBounder stringBounder) {
+ this(stringBounder, new UTranslate(), new Context());
+ }
+
+ private ZadBuilder(StringBounder stringBounder, UTranslate translate, Context context) {
this.stringBounder = stringBounder;
- this.yslot = yslot;
this.translate = translate;
+ this.context = context;
}
- private SlotFinder(SlotFinder other) {
- this(other.stringBounder, other.yslot, other.translate);
+ private ZadBuilder(ZadBuilder other) {
+ this(other.stringBounder, other.translate, other.context);
}
public StringBounder getStringBounder() {
@@ -84,58 +96,40 @@ public class SlotFinder implements UGraphic {
}
public void draw(UShape shape) {
- final double x = translate.getDx();
- final double y = translate.getDy();
if (shape instanceof URectangle) {
- drawRectangle(x, y, (URectangle) shape);
- } else if (shape instanceof UPolygon) {
- drawPolygon(x, y, (UPolygon) shape);
- } else if (shape instanceof UEllipse) {
- drawEllipse(x, y, (UEllipse) shape);
- } else if (shape instanceof UText) {
- drawText(x, y, (UText) shape);
- } else if (shape instanceof UEmpty) {
- drawEmpty(x, y, (UEmpty) shape);
+ drawRectangle((URectangle) shape);
}
}
- private void drawEmpty(double x, double y, UEmpty shape) {
- yslot.addSlot(y, y + shape.getHeight());
- }
-
- private void drawText(double x, double y, UText shape) {
- final TextLimitFinder finder = new TextLimitFinder(stringBounder, false);
- finder.apply(new UTranslate(x, y)).draw(shape);
- yslot.addSlot(finder.getMinY(), finder.getMaxY());
- }
-
- private void drawEllipse(double x, double y, UEllipse shape) {
- yslot.addSlot(y, y + shape.getHeight());
+ private void drawRectangle(URectangle shape) {
+ final MinMax area = shape.getMinMax().translate(translate);
+ // System.err.println("ZadBuilder " + shape + " " + area);
+ context.zad.add(area);
}
- private void drawPolygon(double x, double y, UPolygon shape) {
- yslot.addSlot(y + shape.getMinY(), y + shape.getMaxY());
+ public ColorMapper getColorMapper() {
+ throw new UnsupportedOperationException();
}
- private void drawRectangle(double x, double y, URectangle shape) {
- yslot.addSlot(y, y + shape.getHeight());
+ public void startUrl(Url url) {
}
- public ColorMapper getColorMapper() {
- return new ColorMapperIdentity();
+ public void closeAction() {
}
- public void startUrl(Url url) {
+ public void flushUg() {
}
- public void closeAction() {
+ public boolean matchesProperty(String propertyName) {
+ return false;
}
- public SlotSet getYSlotSet() {
- return yslot;
+ public double dpiFactor() {
+ return 1;
}
- public void flushUg() {
+ public Zad getZad() {
+ return context.zad;
}
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorRepeat.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorRepeat.java
index 84b4382..4c455e0 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorRepeat.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorRepeat.java
@@ -72,13 +72,14 @@ public class FtileFactoryDelegatorRepeat extends FtileFactoryDelegator {
@Override
public Ftile repeat(Swimlane swimlane, Swimlane swimlaneOut, Display startLabel, final Ftile repeat, Display test,
- Display yes, Display out, HtmlColor color, LinkRendering backRepeatLinkRendering, Ftile backward) {
+ Display yes, Display out, HtmlColor color, LinkRendering backRepeatLinkRendering, Ftile backward,
+ boolean noOut) {
final ConditionStyle conditionStyle = skinParam().getConditionStyle();
final HtmlColor borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder);
- final HtmlColor backColor = color == null ? getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground)
- : color;
+ final HtmlColor backColor = color == null ? getRose().getHtmlColor(skinParam(),
+ ColorParam.activityDiamondBackground) : color;
final Rainbow arrowColor = HtmlColorAndStyle.build(skinParam());
final LinkRendering endRepeatLinkRendering = repeat.getOutLinkRendering();
@@ -92,7 +93,7 @@ public class FtileFactoryDelegatorRepeat extends FtileFactoryDelegator {
Ftile result = FtileRepeat.create(backRepeatLinkRendering, swimlane, swimlaneOut, backStart, repeat, test, yes,
out, borderColor, backColor, arrowColor, endRepeatLinkColor, conditionStyle, this.skinParam(),
- fcDiamond, fcArrow, backward);
+ fcDiamond, fcArrow, backward, noOut);
final List<WeldingPoint> weldingPoints = repeat.getWeldingPoints();
if (weldingPoints.size() > 0) {
@@ -110,7 +111,8 @@ public class FtileFactoryDelegatorRepeat extends FtileFactoryDelegator {
final UTranslate tr2 = genealogy.getTranslate(diamondBreak, ug.getStringBounder());
final Dimension2D dimDiamond = diamondBreak.calculateDimension(ug.getStringBounder());
- final Snake snake = new Snake(getFtile1().arrowHorizontalAlignment(), arrowColor, Arrows.asToRight());
+ final Snake snake = new Snake(getFtile1().arrowHorizontalAlignment(), arrowColor, Arrows
+ .asToRight());
snake.addPoint(tr1.getDx(), tr1.getDy());
snake.addPoint(0, tr1.getDy());
snake.addPoint(0, tr2.getDy() + dimDiamond.getHeight() / 2);
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorWhile.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorWhile.java
index d29467d..e77f635 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorWhile.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorWhile.java
@@ -35,20 +35,33 @@
*/
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
+import java.awt.geom.Dimension2D;
+import java.util.List;
+
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.activitydiagram3.Instruction;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
+import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
+import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
+import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
+import net.sourceforge.plantuml.activitydiagram3.ftile.FtileBreak;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator;
+import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
+import net.sourceforge.plantuml.activitydiagram3.ftile.Genealogy;
+import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
+import net.sourceforge.plantuml.activitydiagram3.ftile.WeldingPoint;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.svek.ConditionStyle;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
public class FtileFactoryDelegatorWhile extends FtileFactoryDelegator {
@@ -60,8 +73,8 @@ public class FtileFactoryDelegatorWhile extends FtileFactoryDelegator {
public Ftile createWhile(Swimlane swimlane, Ftile whileBlock, Display test, Display yes, Display out,
LinkRendering afterEndwhile, HtmlColor color, Instruction specialOut) {
final HtmlColor borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder);
- final HtmlColor backColor = color == null ? getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground)
- : color;
+ final HtmlColor backColor = color == null ? getRose().getHtmlColor(skinParam(),
+ ColorParam.activityDiamondBackground) : color;
final Rainbow arrowColor = HtmlColorAndStyle.build(skinParam());
final ConditionStyle conditionStyle = skinParam().getConditionStyle();
@@ -75,8 +88,39 @@ public class FtileFactoryDelegatorWhile extends FtileFactoryDelegator {
final FontConfiguration fontArrow = new FontConfiguration(skinParam(), FontParam.ARROW, null);
- return FtileWhile.create(swimlane, whileBlock, test, borderColor, backColor, arrowColor, yes, out,
+ Ftile result = FtileWhile.create(swimlane, whileBlock, test, borderColor, backColor, arrowColor, yes, out,
endInlinkColor, afterEndwhile, fontArrow, getFactory(), conditionStyle, fcTest, specialOut);
+
+ final List<WeldingPoint> weldingPoints = whileBlock.getWeldingPoints();
+ if (weldingPoints.size() > 0) {
+ // printAllChild(repeat);
+
+ final Genealogy genealogy = new Genealogy(result);
+
+ final FtileBreak ftileBreak = (FtileBreak) weldingPoints.get(0);
+
+ result = FtileUtils.addConnection(result, new Connection() {
+ public void drawU(UGraphic ug) {
+ final UTranslate tr1 = genealogy.getTranslate(ftileBreak, ug.getStringBounder());
+
+ final Snake snake = new Snake(getFtile1().arrowHorizontalAlignment(), arrowColor, Arrows.asToLeft());
+ snake.addPoint(tr1.getDx(), tr1.getDy());
+ snake.addPoint(Diamond.diamondHalfSize, tr1.getDy());
+ ug.draw(snake);
+ }
+
+ public Ftile getFtile1() {
+ return ftileBreak;
+ }
+
+ public Ftile getFtile2() {
+ return null;
+ }
+
+ });
+ }
+
+ return result;
}
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInner.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInner.java
index e598acb..653ef84 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInner.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInner.java
@@ -93,7 +93,8 @@ class FtileForkInner extends AbstractFtile {
}
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
double height = 0;
double width = 0;
for (Ftile ftile : forks) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInnerOverlapped.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInnerOverlapped.java
index 6e4a391..29938c4 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInnerOverlapped.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInnerOverlapped.java
@@ -93,7 +93,8 @@ class FtileForkInnerOverlapped extends AbstractFtile {
}
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
double height = 0;
double width = 0;
for (Ftile ftile : forks) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java
index 3b0c90e..c566a34 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java
@@ -38,6 +38,7 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import java.awt.geom.Dimension2D;
import java.util.Set;
+import net.sourceforge.plantuml.AlignmentParam;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineParam;
@@ -82,7 +83,7 @@ public class FtileGroup extends AbstractFtile {
super(inner.skinParam());
this.backColor = backColor == null ? HtmlColorUtils.WHITE : backColor;
this.inner = FtileUtils.addHorizontalMargin(inner, 10);
- this.borderColor = backColor == null ? HtmlColorUtils.BLACK : borderColor;
+ this.borderColor = borderColor == null ? HtmlColorUtils.BLACK : borderColor;
final UFont font = skinParam.getFont(null, false, FontParam.PARTITION);
final HtmlColor fontColor = skinParam.getFontHtmlColor(null, FontParam.PARTITION);
@@ -130,12 +131,12 @@ public class FtileGroup extends AbstractFtile {
return new UTranslate(suppWidth / 2, diffHeightTitle(stringBounder) + headerNoteHeight(stringBounder));
}
- private static MinMax getMinMax(TextBlock tb, StringBounder stringBounder) {
+ private MinMax getInnerMinMax(StringBounder stringBounder) {
final LimitFinder limitFinder = new LimitFinder(stringBounder, false);
final UGraphicForSnake interceptor = new UGraphicForSnake(limitFinder);
final UGraphicInterceptorUDrawable interceptor2 = new UGraphicInterceptorUDrawable(interceptor);
- tb.drawU(interceptor2);
+ inner.drawU(interceptor2);
interceptor2.flushUg();
return limitFinder.getMinMax();
}
@@ -149,9 +150,19 @@ public class FtileGroup extends AbstractFtile {
return suppWidth;
}
+ private FtileGeometry cachedInnerDimension;
+
private FtileGeometry getInnerDimension(StringBounder stringBounder) {
+ if (cachedInnerDimension == null) {
+ cachedInnerDimension = getInnerDimensionSlow(stringBounder);
+ }
+ return cachedInnerDimension;
+
+ }
+
+ private FtileGeometry getInnerDimensionSlow(StringBounder stringBounder) {
final FtileGeometry orig = inner.calculateDimension(stringBounder);
- final MinMax minMax = getMinMax(inner, stringBounder);
+ final MinMax minMax = getInnerMinMax(stringBounder);
final double missingWidth = minMax.getMaxX() - orig.getWidth();
if (missingWidth > 0) {
return orig.addDim(missingWidth + 5, 0);
@@ -159,7 +170,8 @@ public class FtileGroup extends AbstractFtile {
return orig;
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
final FtileGeometry orig = getInnerDimension(stringBounder);
final double suppWidth = suppWidth(stringBounder);
final double width = orig.getWidth() + suppWidth;
@@ -184,8 +196,8 @@ public class FtileGroup extends AbstractFtile {
final SymbolContext symbolContext = new SymbolContext(backColor, borderColor).withShadow(
skinParam().shadowing()).withStroke(stroke);
- USymbol.FRAME.asBig(name, TextBlockUtils.empty(0, 0), dimTotal.getWidth(), dimTotal.getHeight(), symbolContext)
- .drawU(ug);
+ USymbol.FRAME.asBig(name, inner.skinParam().getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null),
+ TextBlockUtils.empty(0, 0), dimTotal.getWidth(), dimTotal.getHeight(), symbolContext).drawU(ug);
final Dimension2D dimHeaderNote = headerNote.calculateDimension(stringBounder);
headerNote.drawU(ug.apply(new UTranslate(dimTotal.getWidth() - dimHeaderNote.getWidth() - 10,
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java
index 638c292..c7212f6 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java
@@ -271,7 +271,8 @@ class FtileIfAndStop extends AbstractFtile {
ug.apply(getTranslateStop(stringBounder)).draw(stop2);
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
final Dimension2D dimStop2 = stop2.calculateDimension(stringBounder);
final FtileGeometry dim1 = tile1.calculateDimension(stringBounder).addDim(0,
getDiamondStopDistance() + dimStop2.getWidth());
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfDown.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfDown.java
index da70065..a8c1399 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfDown.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfDown.java
@@ -341,7 +341,8 @@ public class FtileIfDown extends AbstractFtile {
}
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
final FtileGeometry geoDiamond1 = diamond1.calculateDimension(stringBounder);
final FtileGeometry geoThen = thenBlock.calculateDimension(stringBounder);
final FtileGeometry geoDiamond2 = diamond2.calculateDimension(stringBounder);
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongHorizontal.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongHorizontal.java
index 1011a66..557ca5d 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongHorizontal.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongHorizontal.java
@@ -38,7 +38,6 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import java.awt.geom.Dimension2D;
import java.awt.geom.Point2D;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
@@ -561,7 +560,8 @@ class FtileIfLongHorizontal extends AbstractFtile {
return new FtileGeometry(result, result.getWidth() / 2, 0);
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
final List<Ftile> all = new ArrayList<Ftile>(tiles);
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongVertical.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongVertical.java
index 8fef817..b586b27 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongVertical.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongVertical.java
@@ -571,7 +571,8 @@ class FtileIfLongVertical extends AbstractFtile {
return width;
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
final List<Ftile> all = new ArrayList<Ftile>(tiles);
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileNoteAlone.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileNoteAlone.java
index 8083263..0a3ab2d 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileNoteAlone.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileNoteAlone.java
@@ -113,7 +113,8 @@ public class FtileNoteAlone extends AbstractFtile implements Stencil {
opale.drawU(ug);
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
if (withOutPoint) {
return new FtileGeometry(dimTotal, dimTotal.getWidth() / 2, 0, dimTotal.getHeight());
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileRepeat.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileRepeat.java
index 60dec91..743699d 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileRepeat.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileRepeat.java
@@ -54,6 +54,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
import net.sourceforge.plantuml.activitydiagram3.ftile.ConnectionTranslatable;
import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
+import net.sourceforge.plantuml.activitydiagram3.ftile.FtileEmpty;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
@@ -111,7 +112,8 @@ class FtileRepeat extends AbstractFtile {
public static Ftile create(LinkRendering backRepeatLinkRendering, Swimlane swimlane, Swimlane swimlaneOut,
Ftile backStart, Ftile repeat, Display test, Display yes, Display out, HtmlColor borderColor,
HtmlColor backColor, Rainbow arrowColor, Rainbow endRepeatLinkColor, ConditionStyle conditionStyle,
- ISkinSimple spriteContainer, FontConfiguration fcDiamond, FontConfiguration fcArrow, Ftile backward) {
+ ISkinSimple spriteContainer, FontConfiguration fcDiamond, FontConfiguration fcArrow, Ftile backward,
+ boolean noOut) {
final FontConfiguration fontConfiguration1 = conditionStyle == ConditionStyle.INSIDE ? fcDiamond : fcArrow;
@@ -123,14 +125,19 @@ class FtileRepeat extends AbstractFtile {
final Ftile diamond1;
if (backStart == null) {
- diamond1 = new FtileDiamond(repeat.skinParam(), backColor, borderColor, swimlane);
+ diamond1 = new FtileDiamond(repeat.skinParam(), backColor, borderColor, repeat.getSwimlaneIn());
} else {
diamond1 = backStart;
}
final FtileRepeat result;
if (conditionStyle == ConditionStyle.INSIDE) {
- final Ftile diamond2 = new FtileDiamondInside(repeat.skinParam(), backColor, borderColor, swimlaneOut,
- tbTest).withEast(yesTb).withSouth(outTb);
+ final Ftile diamond2;
+ if (noOut && Display.isNull(test)) {
+ diamond2 = new FtileEmpty(repeat.skinParam());
+ } else {
+ diamond2 = new FtileDiamondInside(repeat.skinParam(), backColor, borderColor, swimlaneOut, tbTest)
+ .withEast(yesTb).withSouth(outTb);
+ }
result = new FtileRepeat(repeat, diamond1, diamond2, TextBlockUtils.empty(0, 0), backward);
} else if (conditionStyle == ConditionStyle.DIAMOND) {
final Ftile diamond2 = new FtileDiamond(repeat.skinParam(), backColor, borderColor, swimlane)
@@ -483,7 +490,8 @@ class FtileRepeat extends AbstractFtile {
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
return new FtileGeometry(dimTotal, getLeft(stringBounder), 0, dimTotal.getHeight());
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSplit1.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSplit1.java
index d4df515..5468659 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSplit1.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSplit1.java
@@ -91,7 +91,8 @@ class FtileSplit1 extends AbstractFtile {
}
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
double height = 0;
double width = 0;
for (Ftile ftile : forks) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWhile.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWhile.java
index cdf8eed..85c1736 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWhile.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWhile.java
@@ -38,6 +38,8 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import java.awt.geom.Dimension2D;
import java.awt.geom.Point2D;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -81,6 +83,14 @@ class FtileWhile extends AbstractFtile {
private final Ftile diamond1;
private final Ftile specialOut;
+ @Override
+ public Collection<Ftile> getMyChildren() {
+ if (specialOut == null) {
+ return Arrays.asList(whileBlock, diamond1);
+ }
+ return Arrays.asList(whileBlock, diamond1, specialOut);
+ }
+
public Set<Swimlane> getSwimlanes() {
final Set<Swimlane> result = new HashSet<Swimlane>(whileBlock.getSwimlanes());
result.add(getSwimlaneIn());
@@ -240,7 +250,6 @@ class FtileWhile extends AbstractFtile {
final double x1 = p1.getX();
final double y1 = p1.getY();
final double x2 = p2.getX() + dimDiamond1.getWidth();
- // final double y2 = p2.getY() + dimDiamond1.getOutY() / 2;
final double half = (dimDiamond1.getOutY() - dimDiamond1.getInY()) / 2;
final double y2 = p2.getY() + dimDiamond1.getInY() + half;
@@ -258,8 +267,6 @@ class FtileWhile extends AbstractFtile {
ug.apply(new UTranslate(x1, y1bis)).draw(new UEmpty(5, Diamond.diamondHalfSize));
- // ug = ug.apply(new UChangeColor(endInlinkColor)).apply(new UChangeBackColor(endInlinkColor));
- // ug.apply(new UTranslate(xx, (y1 + y2) / 2)).draw(Arrows.asToUp());
}
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
@@ -271,12 +278,13 @@ class FtileWhile extends AbstractFtile {
final Point2D p1 = translate1.getTranslated(ap1);
final Point2D p2 = translate2.getTranslated(ap2);
- final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
+ final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
final double x1 = p1.getX();
final double y1 = p1.getY();
final double x2 = p2.getX() + dimDiamond1.getWidth();
- final double y2 = p2.getY() + dimDiamond1.getHeight() / 2;
+ final double half = (dimDiamond1.getOutY() - dimDiamond1.getInY()) / 2;
+ final double y2 = p2.getY() + dimDiamond1.getInY() + half;
snake.addPoint(x1, y1);
snake.addPoint(x1, y1 + Diamond.diamondHalfSize);
@@ -392,8 +400,6 @@ class FtileWhile extends AbstractFtile {
snake.goUnmergeable(MergeStrategy.LIMITED);
ug.draw(snake);
- // ug = ug.apply(new UChangeColor(afterEndwhileColor)).apply(new UChangeBackColor(afterEndwhileColor));
- // ug.apply(new UTranslate(Diamond.diamondHalfSize, (y1 + y2) / 2)).draw(Arrows.asToDown());
final Snake snake2 = new Snake(arrowHorizontalAlignment(), afterEndwhileColor);
snake2.addPoint(Diamond.diamondHalfSize, y2);
@@ -454,7 +460,8 @@ class FtileWhile extends AbstractFtile {
}
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
final FtileGeometry geoDiamond1 = diamond1.calculateDimension(stringBounder);
FtileGeometry geoWhile = whileBlock.calculateDimension(stringBounder);
final double diff = -geoWhile.getWidth();
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java
index c47a3f6..d4b41bd 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java
@@ -199,7 +199,8 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil {
ug.apply(getTranslate(stringBounder)).draw(tile);
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
final FtileGeometry orig = tile.calculateDimension(stringBounder);
final UTranslate translate = getTranslate(stringBounder);
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNotes.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNotes.java
index eb7395f..cf2e906 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNotes.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNotes.java
@@ -173,7 +173,8 @@ public class FtileWithNotes extends AbstractFtile {
ug.apply(getTranslate(stringBounder)).draw(tile);
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
final FtileGeometry orig = tile.calculateDimension(stringBounder);
final UTranslate translate = getTranslate(stringBounder);
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit2.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit2.java
index 1bc10eb..c442271 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit2.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit2.java
@@ -111,7 +111,8 @@ public class ParallelBuilderSplit2 extends ParallelFtilesBuilder {
}
final Rainbow thinColor = result.getInLinkRendering().getRainbow(HtmlColorAndStyle.build(skinParam()));
- final Ftile out = new FtileThinSplit(skinParam(), thinColor.getColor(), getList().get(0).getSwimlaneIn());
+ // final Ftile out = new FtileThinSplit(skinParam(), thinColor.getColor(), getList().get(0).getSwimlaneIn());
+ final Ftile out = new FtileThinSplit(skinParam(), thinColor.getColor(), swimlane());
result = new FtileAssemblySimple(result, out);
final List<Connection> conns = new ArrayList<Connection>();
double x = 0;
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java
index 2f90ff9..11ca981 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java
@@ -55,6 +55,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileBox;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileCircleEnd;
+import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileCircleSpot;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileCircleStart;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileCircleStop;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDecorateIn;
@@ -91,6 +92,12 @@ public class VCompactFactory implements FtileFactory {
return new FtileCircleStop(skinParam(), color, swimlane);
}
+ public Ftile spot(Swimlane swimlane, String spot) {
+ // final HtmlColor color = rose.getHtmlColor(skinParam, ColorParam.activityBackground);
+ final UFont font = skinParam.getFont(null, false, FontParam.ACTIVITY);
+ return new FtileCircleSpot(skinParam(), swimlane, spot, font);
+ }
+
public Ftile end(Swimlane swimlane) {
final HtmlColor color = rose.getHtmlColor(skinParam, ColorParam.activityEnd);
return new FtileCircleEnd(skinParam(), color, swimlane);
@@ -116,8 +123,9 @@ public class VCompactFactory implements FtileFactory {
return new FtileAssemblySimple(tile1, tile2);
}
- public Ftile repeat(Swimlane swimlane, Swimlane swimlaneOut, Display startLabel, Ftile repeat, Display test, Display yes,
- Display out, HtmlColor color, LinkRendering backRepeatLinkRendering, Ftile backward) {
+ public Ftile repeat(Swimlane swimlane, Swimlane swimlaneOut, Display startLabel, Ftile repeat, Display test,
+ Display yes, Display out, HtmlColor color, LinkRendering backRepeatLinkRendering, Ftile backward,
+ boolean noOut) {
return repeat;
}
@@ -162,5 +170,4 @@ public class VCompactFactory implements FtileFactory {
public ISkinParam skinParam() {
return skinParam;
}
-
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java
index 04ebdbb..2808193 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java
@@ -108,16 +108,16 @@ public class ConditionalBuilder {
ISkinParam skinParam, StringBounder stringBounder, FontConfiguration fcArrow, FontConfiguration fcTest) {
final ConditionalBuilder builder = new ConditionalBuilder(swimlane, borderColor, backColor, arrowColor,
ftileFactory, conditionStyle, branch1, branch2, skinParam, stringBounder, fcArrow, fcTest);
- if (isEmptyOrOnlySingleStop(branch2) && isEmptyOrOnlySingleStop(branch1) == false) {
+ if (isEmptyOrOnlySingleStopOrSpot(branch2) && isEmptyOrOnlySingleStopOrSpot(branch1) == false) {
return builder.createDown(builder.branch1, builder.branch2);
}
- if (branch1.isEmpty() && branch2.isOnlySingleStop()) {
+ if (branch1.isEmpty() && branch2.isOnlySingleStopOrSpot()) {
return builder.createDown(builder.branch1, builder.branch2);
}
- if (isEmptyOrOnlySingleStop(branch1) && isEmptyOrOnlySingleStop(branch2) == false) {
+ if (isEmptyOrOnlySingleStopOrSpot(branch1) && isEmptyOrOnlySingleStopOrSpot(branch2) == false) {
return builder.createDown(builder.branch2, builder.branch1);
}
- if (branch2.isEmpty() && branch1.isOnlySingleStop()) {
+ if (branch2.isEmpty() && branch1.isOnlySingleStopOrSpot()) {
return builder.createDown(builder.branch2, builder.branch1);
}
return builder.createWithLinks();
@@ -125,8 +125,8 @@ public class ConditionalBuilder {
// return builder.createNude();
}
- private static boolean isEmptyOrOnlySingleStop(Branch branch) {
- return branch.isEmpty() || branch.isOnlySingleStop();
+ private static boolean isEmptyOrOnlySingleStopOrSpot(Branch branch) {
+ return branch.isEmpty() || branch.isOnlySingleStopOrSpot();
}
private Ftile createDown(Branch branch1, Branch branch2) {
@@ -136,11 +136,11 @@ public class ConditionalBuilder {
final TextBlock tb2 = getLabelPositive(branch2);
final Ftile diamond1 = getDiamond1(false, tb1, tb2);
final Ftile diamond2 = getDiamond2(branch1, branch2, true);
- if (branch2.isOnlySingleStop()) {
+ if (branch2.isOnlySingleStopOrSpot()) {
return FtileIfDown.create(diamond1, diamond2, swimlane, FtileUtils.addHorizontalMargin(tile1, 10),
arrowColor, ftileFactory, branch2.getFtile(), branch2.getInlinkRenderingColorAndStyle());
}
- if (branch1.isOnlySingleStop()) {
+ if (branch1.isOnlySingleStopOrSpot()) {
return FtileIfDown.create(diamond1, diamond2, swimlane, FtileUtils.addHorizontalMargin(tile2, 10),
arrowColor, ftileFactory, branch1.getFtile(), branch1.getInlinkRenderingColorAndStyle());
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfNude.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfNude.java
index 1610b0c..aa6a024 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfNude.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfNude.java
@@ -128,7 +128,8 @@ public class FtileIfNude extends FtileDimensionMemoize {
ug.apply(getTranslate2(stringBounder)).draw(tile2);
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
final FtileGeometry dimTotal = calculateDimensionInternal(stringBounder);
if (tile1.calculateDimension(stringBounder).hasPointOut()
|| tile2.calculateDimension(stringBounder).hasPointOut()) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java
index 2857a40..92973f2 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java
@@ -81,7 +81,8 @@ public class FtileBlackBlock extends AbstractFtile {
this.label = label;
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
double supp = label.calculateDimension(stringBounder).getWidth();
if (supp > 0) {
supp += labelMargin;
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java
index d1269ca..d7868eb 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java
@@ -82,7 +82,7 @@ public class FtileBox extends AbstractFtile {
private final LinkRendering inRenreding;
private final Swimlane swimlane;
private final BoxStyle style;
- private final ISkinParam skinParam;
+ // private final ISkinParam skinParam;
final public LinkRendering getInLinkRendering() {
return inRenreding;
@@ -119,13 +119,13 @@ public class FtileBox extends AbstractFtile {
public FtileBox(ISkinParam skinParam, Display label, UFont font, Swimlane swimlane, BoxStyle style) {
super(skinParam);
this.style = style;
- this.skinParam = skinParam;
+ // this.skinParam = skinParam;
this.swimlane = swimlane;
this.inRenreding = new LinkRendering(HtmlColorAndStyle.build(skinParam));
final FontConfiguration fc = new FontConfiguration(skinParam, FontParam.ACTIVITY, null);
final Sheet sheet = new CreoleParser(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT),
skinParam, CreoleMode.FULL).createSheet(label);
- this.tb = new SheetBlock2(new SheetBlock1(sheet, LineBreakStrategy.NONE, skinParam.getPadding()), new MyStencil(), new UStroke(1));
+ this.tb = new SheetBlock2(new SheetBlock1(sheet, skinParam.wrapWidth(), skinParam.getPadding()), new MyStencil(), new UStroke(1));
this.print = label.toString();
}
@@ -142,8 +142,8 @@ public class FtileBox extends AbstractFtile {
final double heightTotal = dimTotal.getHeight();
final UDrawable rect = style.getUDrawable(widthTotal, heightTotal, skinParam().shadowing());
- final HtmlColor borderColor = SkinParamUtils.getColor(skinParam, ColorParam.activityBorder, null);
- final HtmlColor backColor = SkinParamUtils.getColor(skinParam, ColorParam.activityBackground, null);
+ final HtmlColor borderColor = SkinParamUtils.getColor(skinParam(), ColorParam.activityBorder, null);
+ final HtmlColor backColor = SkinParamUtils.getColor(skinParam(), ColorParam.activityBackground, null);
ug = ug.apply(new UChangeColor(borderColor)).apply(new UChangeBackColor(backColor)).apply(getThickness());
rect.drawU(ug);
@@ -151,7 +151,8 @@ public class FtileBox extends AbstractFtile {
tb.drawU(ug.apply(new UTranslate(MARGIN, MARGIN)));
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
final Dimension2D dim = tb.calculateDimension(stringBounder);
return new FtileGeometry(Dimension2DDouble.delta(dim, 2 * MARGIN, 2 * MARGIN), dim.getWidth() / 2 + MARGIN, 0,
dim.getHeight() + 2 * MARGIN);
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleEnd.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleEnd.java
index bbf3a0e..0654f33 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleEnd.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleEnd.java
@@ -111,7 +111,8 @@ public class FtileCircleEnd extends AbstractFtile {
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
return new FtileGeometry(SIZE, SIZE, SIZE / 2, 0);
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleSpot.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleSpot.java
new file mode 100644
index 0000000..56bb8bb
--- /dev/null
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleSpot.java
@@ -0,0 +1,119 @@
+/* ========================================================================
+ * 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.activitydiagram3.ftile.vertical;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Set;
+
+import net.sourceforge.plantuml.ColorParam;
+import net.sourceforge.plantuml.FontParam;
+import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.SkinParamUtils;
+import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
+import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
+import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
+import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.ugraphic.UCenteredCharacter;
+import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
+import net.sourceforge.plantuml.ugraphic.UChangeColor;
+import net.sourceforge.plantuml.ugraphic.UEllipse;
+import net.sourceforge.plantuml.ugraphic.UFont;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class FtileCircleSpot extends AbstractFtile {
+
+ private static final int SIZE = 20;
+
+ private final Swimlane swimlane;
+ private final String spot;
+ private final FontConfiguration fc;
+
+ public FtileCircleSpot(ISkinParam skinParam, Swimlane swimlane, String spot, UFont font) {
+ super(skinParam);
+ this.spot = spot;
+ this.swimlane = swimlane;
+ // this.font = font;
+ this.fc = new FontConfiguration(skinParam, FontParam.ACTIVITY, null);
+ }
+
+ @Override
+ public Collection<Ftile> getMyChildren() {
+ return Collections.emptyList();
+ }
+
+ public Set<Swimlane> getSwimlanes() {
+ if (swimlane == null) {
+ return Collections.emptySet();
+ }
+ return Collections.singleton(swimlane);
+ }
+
+ public Swimlane getSwimlaneIn() {
+ return swimlane;
+ }
+
+ public Swimlane getSwimlaneOut() {
+ return swimlane;
+ }
+
+ public void drawU(UGraphic ug) {
+
+ final HtmlColor borderColor = SkinParamUtils.getColor(skinParam(), ColorParam.activityBorder, null);
+ final HtmlColor backColor = SkinParamUtils.getColor(skinParam(), ColorParam.activityBackground, null);
+
+ final UEllipse circle = new UEllipse(SIZE, SIZE);
+ if (skinParam().shadowing()) {
+ circle.setDeltaShadow(3);
+ }
+ ug.apply(new UChangeColor(borderColor)).apply(new UChangeBackColor(backColor)).apply(getThickness())
+ .draw(circle);
+
+ ug.apply(new UChangeColor(fc.getColor())).apply(new UTranslate(SIZE / 2, SIZE / 2))
+ .draw(new UCenteredCharacter(spot.charAt(0), fc.getFont()));
+
+ }
+
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
+ return new FtileGeometry(SIZE, SIZE, SIZE / 2, 0, SIZE);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStart.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStart.java
index 1d6b1a8..d1bcc52 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStart.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStart.java
@@ -92,7 +92,8 @@ public class FtileCircleStart extends AbstractFtile {
ug.apply(new UChangeColor(null)).apply(new UChangeBackColor(backColor)).draw(circle);
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
return new FtileGeometry(SIZE, SIZE, SIZE / 2, 0, SIZE);
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStop.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStop.java
index 4d51d6a..c121fe0 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStop.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStop.java
@@ -108,7 +108,8 @@ public class FtileCircleStop extends AbstractFtile {
.draw(circleSmall);
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
return new FtileGeometry(SIZE, SIZE, SIZE / 2, 0);
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamond.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamond.java
index 942ba81..fab6461 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamond.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamond.java
@@ -147,7 +147,8 @@ public class FtileDiamond extends AbstractFtile {
+ Diamond.diamondHalfSize)));
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
final double suppY1 = north.calculateDimension(stringBounder).getHeight();
final Dimension2D dim = new Dimension2DDouble(Diamond.diamondHalfSize * 2, Diamond.diamondHalfSize * 2 + suppY1);
return new FtileGeometry(dim, dim.getWidth() / 2, suppY1, dim.getHeight());
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondFoo1.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondFoo1.java
index 3af0a21..4d95012 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondFoo1.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondFoo1.java
@@ -130,7 +130,8 @@ public class FtileDiamondFoo1 extends AbstractFtile {
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
final Dimension2D dim = calculateDimensionInternal(stringBounder);
return new FtileGeometry(dim, dim.getWidth() / 2, 0, dim.getHeight());
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside.java
index 569c02d..d655fd4 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside.java
@@ -161,7 +161,8 @@ public class FtileDiamondInside extends AbstractFtile {
return new FtileGeometry(dim, dim.getWidth() / 2, 0, dim.getHeight());
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
final FtileGeometry dimDiamonAlone = calculateDimensionAlone(stringBounder);
final Dimension2D dimWest = west.calculateDimension(stringBounder);
final Dimension2D dimEast = east.calculateDimension(stringBounder);
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside2.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside2.java
index 11d28a2..979ef38 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside2.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside2.java
@@ -150,7 +150,8 @@ public class FtileDiamondInside2 extends AbstractFtile {
return new FtileGeometry(dim, dim.getWidth() / 2, 0, dim.getHeight());
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
final Dimension2D diamond = calculateDimensionAlone(stringBounder);
final Dimension2D north = this.north.calculateDimension(stringBounder);
final double height = diamond.getHeight() + north.getHeight();
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside3.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside3.java
index 09c00f1..28eeab3 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside3.java
@@ -152,7 +152,8 @@ public class FtileDiamondInside3 extends AbstractFtile implements FtileOverpassi
return new FtileGeometry(dim, dim.getWidth() / 2, 0, dim.getHeight());
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
final Dimension2D diamond = calculateDimensionAlone(stringBounder);
final Dimension2D north = this.north.calculateDimension(stringBounder);
final double height = diamond.getHeight() + north.getHeight();
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileThinSplit.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileThinSplit.java
index 122fffd..4fbbf73 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileThinSplit.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileThinSplit.java
@@ -44,7 +44,6 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
-import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
@@ -73,7 +72,8 @@ public class FtileThinSplit extends AbstractFtile {
this.last = last;
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ @Override
+ protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
return new FtileGeometry(width, height, width / 2, 0, height);
}
diff --git a/src/net/sourceforge/plantuml/ant/PlantUmlTask.java b/src/net/sourceforge/plantuml/ant/PlantUmlTask.java
index c3f555e..e20d326 100644
--- a/src/net/sourceforge/plantuml/ant/PlantUmlTask.java
+++ b/src/net/sourceforge/plantuml/ant/PlantUmlTask.java
@@ -362,10 +362,10 @@ public class PlantUmlTask extends Task {
setNbThread(s);
}
- public void setSuggestEngine(String s) {
- OptionFlags.getInstance().setUseSuggestEngine(
- "true".equalsIgnoreCase(s) || "yes".equalsIgnoreCase(s) || "on".equalsIgnoreCase(s));
- }
+// public void setSuggestEngine(String s) {
+// OptionFlags.getInstance().setUseSuggestEngine(
+// "true".equalsIgnoreCase(s) || "yes".equalsIgnoreCase(s) || "on".equalsIgnoreCase(s));
+// }
public void setFailFast(String s) {
final boolean flag = "true".equalsIgnoreCase(s) || "yes".equalsIgnoreCase(s) || "on".equalsIgnoreCase(s);
diff --git a/src/net/sourceforge/plantuml/api/INumberAnalyzed.java b/src/net/sourceforge/plantuml/api/INumberAnalyzed.java
index 45fdab9..1dcf610 100644
--- a/src/net/sourceforge/plantuml/api/INumberAnalyzed.java
+++ b/src/net/sourceforge/plantuml/api/INumberAnalyzed.java
@@ -40,4 +40,6 @@ public interface INumberAnalyzed {
public long getMean();
+ public long getSliddingMean();
+
}
diff --git a/src/net/sourceforge/plantuml/api/ImageDataAbstract.java b/src/net/sourceforge/plantuml/api/ImageDataAbstract.java
new file mode 100644
index 0000000..ebc07bc
--- /dev/null
+++ b/src/net/sourceforge/plantuml/api/ImageDataAbstract.java
@@ -0,0 +1,73 @@
+/* ========================================================================
+ * 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.awt.geom.Dimension2D;
+
+import net.sourceforge.plantuml.core.ImageData;
+
+public abstract class ImageDataAbstract implements ImageData {
+
+ private final int width;
+ private final int height;
+ private int status;
+
+ public ImageDataAbstract(int width, int height) {
+ this.width = width;
+ this.height = height;
+ }
+
+ public ImageDataAbstract(Dimension2D dim) {
+ this((int) dim.getWidth(), (int) dim.getHeight());
+ }
+
+ public final int getWidth() {
+ return width;
+ }
+
+ public final int getHeight() {
+ return height;
+ }
+
+ public final int getStatus() {
+ return status;
+ }
+
+ public final void setStatus(int status) {
+ this.status = status;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/api/ImageDataComplex.java b/src/net/sourceforge/plantuml/api/ImageDataComplex.java
index 621407f..218f15a 100644
--- a/src/net/sourceforge/plantuml/api/ImageDataComplex.java
+++ b/src/net/sourceforge/plantuml/api/ImageDataComplex.java
@@ -38,35 +38,18 @@ package net.sourceforge.plantuml.api;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.CMapData;
-import net.sourceforge.plantuml.core.ImageData;
-public class ImageDataComplex implements ImageData {
+public class ImageDataComplex extends ImageDataAbstract {
- private final Dimension2D info;
private final CMapData cmap;
private final String warningOrError;
-// public ImageDataComplex(Dimension2D info, CMapData cmap) {
-// this(info, cmap, null);
-// }
-
public ImageDataComplex(Dimension2D info, CMapData cmap, String warningOrError) {
- if (info==null) {
- throw new IllegalArgumentException();
- }
- this.info = info;
+ super(info);
this.cmap = cmap;
this.warningOrError = warningOrError;
}
- public int getWidth() {
- return (int) info.getWidth();
- }
-
- public int getHeight() {
- return (int) info.getHeight();
- }
-
public boolean containsCMapData() {
return cmap != null && cmap.containsData();
}
diff --git a/src/net/sourceforge/plantuml/api/ImageDataSimple.java b/src/net/sourceforge/plantuml/api/ImageDataSimple.java
index f50316a..d58b950 100644
--- a/src/net/sourceforge/plantuml/api/ImageDataSimple.java
+++ b/src/net/sourceforge/plantuml/api/ImageDataSimple.java
@@ -39,30 +39,18 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.core.ImageData;
-public class ImageDataSimple implements ImageData {
-
- private final int width;
- private final int height;
+public class ImageDataSimple extends ImageDataAbstract {
public ImageDataSimple(int width, int height) {
- this.width = width;
- this.height = height;
- }
-
- public ImageDataSimple() {
- this(0, 0);
+ super(width, height);
}
public ImageDataSimple(Dimension2D dim) {
- this((int) dim.getWidth(), (int) dim.getHeight());
- }
-
- public int getWidth() {
- return width;
+ super(dim);
}
- public int getHeight() {
- return height;
+ private ImageDataSimple() {
+ this(0, 0);
}
public boolean containsCMapData() {
@@ -77,4 +65,14 @@ public class ImageDataSimple implements ImageData {
return null;
}
+ public static ImageData error() {
+ final ImageDataSimple result = new ImageDataSimple();
+ result.setStatus(503);
+ return result;
+ }
+
+ public static ImageData ok() {
+ return new ImageDataSimple();
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/api/NumberAnalyzed.java b/src/net/sourceforge/plantuml/api/NumberAnalyzed.java
index 93ed03b..5ef7531 100644
--- a/src/net/sourceforge/plantuml/api/NumberAnalyzed.java
+++ b/src/net/sourceforge/plantuml/api/NumberAnalyzed.java
@@ -29,7 +29,6 @@
package net.sourceforge.plantuml.api;
import java.util.StringTokenizer;
-import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.prefs.Preferences;
@@ -38,7 +37,7 @@ import net.sourceforge.plantuml.Log;
public class NumberAnalyzed implements INumberAnalyzed {
- private static final int SLIDING_WINDOW = 512;
+ private static final int SLIDING_WINDOW = 1024;
private long nb;
private long sum;
@@ -211,6 +210,16 @@ public class NumberAnalyzed implements INumberAnalyzed {
return sum / nb;
}
+ synchronized public final long getSliddingMean() {
+ if (nb == 0) {
+ return 0;
+ }
+ if (nb < SLIDING_WINDOW) {
+ return sum / nb;
+ }
+ return sliddingSum / nb;
+ }
+
public final long getStandardDeviation() {
final long sum1;
final long sumOfSquare1;
diff --git a/src/net/sourceforge/plantuml/api/NumberAnalyzed2.java b/src/net/sourceforge/plantuml/api/NumberAnalyzed2.java
index dd5e142..c275066 100644
--- a/src/net/sourceforge/plantuml/api/NumberAnalyzed2.java
+++ b/src/net/sourceforge/plantuml/api/NumberAnalyzed2.java
@@ -162,9 +162,21 @@ public class NumberAnalyzed2 implements INumberAnalyzed {
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/asciiart/BasicCharAreaImpl.java b/src/net/sourceforge/plantuml/asciiart/BasicCharAreaImpl.java
index 04ac21e..b3c9755 100644
--- a/src/net/sourceforge/plantuml/asciiart/BasicCharAreaImpl.java
+++ b/src/net/sourceforge/plantuml/asciiart/BasicCharAreaImpl.java
@@ -78,6 +78,18 @@ public class BasicCharAreaImpl implements BasicCharArea {
}
}
+ private boolean isLong(char c) {
+ final int wc = Wcwidth.of(c);
+ if (wc == 1) {
+ return false;
+ }
+ if (wc == 2) {
+ return true;
+ }
+ return false;
+// throw new IllegalArgumentException("warning width=" + wc + " char=" + ((int) c));
+ }
+
private void ensurePossible(int x, int y) {
int newCharSize1 = charSize1;
int newCharSize2 = charSize2;
@@ -106,8 +118,15 @@ public class BasicCharAreaImpl implements BasicCharArea {
}
public void drawStringLR(String string, int x, int y) {
+ int pos = x;
for (int i = 0; i < string.length(); i++) {
- drawChar(string.charAt(i), x + i, y);
+ final char c = string.charAt(i);
+ drawChar(c, pos, y);
+ pos++;
+ if (isLong(c)) {
+ drawChar('\0', pos, y);
+ pos++;
+ }
}
}
@@ -120,7 +139,10 @@ public class BasicCharAreaImpl implements BasicCharArea {
public String getLine(int line) {
final StringBuilder sb = new StringBuilder(charSize1);
for (int x = 0; x < width; x++) {
- sb.append(chars[x][line]);
+ final char c = chars[x][line];
+ if (c != '\0') {
+ sb.append(c);
+ }
}
return sb.toString();
}
diff --git a/src/net/sourceforge/plantuml/asciiart/ComponentTextActor.java b/src/net/sourceforge/plantuml/asciiart/ComponentTextActor.java
index 92c5c62..a7a130f 100644
--- a/src/net/sourceforge/plantuml/asciiart/ComponentTextActor.java
+++ b/src/net/sourceforge/plantuml/asciiart/ComponentTextActor.java
@@ -100,7 +100,7 @@ public class ComponentTextActor extends AbstractComponentText {
}
public double getPreferredWidth(StringBounder stringBounder) {
- return StringUtils.getWidth(stringsToDisplay) + 2;
+ return StringUtils.getWcWidth(stringsToDisplay) + 2;
}
}
diff --git a/src/net/sourceforge/plantuml/asciiart/ComponentTextArrow.java b/src/net/sourceforge/plantuml/asciiart/ComponentTextArrow.java
index db099b0..ba52a0e 100644
--- a/src/net/sourceforge/plantuml/asciiart/ComponentTextArrow.java
+++ b/src/net/sourceforge/plantuml/asciiart/ComponentTextArrow.java
@@ -96,7 +96,7 @@ public class ComponentTextArrow extends AbstractComponentText {
final UmlCharArea charArea = ((UGraphicTxt) ug).getCharArea();
final int width = (int) dimensionToUse.getWidth();
final int height = (int) dimensionToUse.getHeight();
- final int textWidth = StringUtils.getWidth(stringsToDisplay);
+ final int textWidth = StringUtils.getWcWidth(stringsToDisplay);
final int yarrow = height - 2;
charArea.drawHLine(fileFormat == FileFormat.UTXT ? '\u2500' : '-', yarrow, 1, width);
@@ -125,7 +125,7 @@ public class ComponentTextArrow extends AbstractComponentText {
}
public double getPreferredWidth(StringBounder stringBounder) {
- final int width = StringUtils.getWidth(stringsToDisplay) + 2;
+ final int width = StringUtils.getWcWidth(stringsToDisplay) + 2;
if (maxAsciiMessageLength > 0) {
return Math.min(maxAsciiMessageLength, width);
}
diff --git a/src/net/sourceforge/plantuml/asciiart/ComponentTextDelay.java b/src/net/sourceforge/plantuml/asciiart/ComponentTextDelay.java
index 13fa8b1..8737ff7 100644
--- a/src/net/sourceforge/plantuml/asciiart/ComponentTextDelay.java
+++ b/src/net/sourceforge/plantuml/asciiart/ComponentTextDelay.java
@@ -59,7 +59,7 @@ public class ComponentTextDelay extends AbstractComponentText {
final Dimension2D dimensionToUse = area.getDimensionToUse();
final UmlCharArea charArea = ((UGraphicTxt) ug).getCharArea();
final int width = (int) dimensionToUse.getWidth();
- final int textWidth = StringUtils.getWidth(stringsToDisplay);
+ final int textWidth = StringUtils.getWcWidth(stringsToDisplay);
final int textPos = (width - textWidth) / 2;
if (stringsToDisplay.isWhite()) {
@@ -75,7 +75,7 @@ public class ComponentTextDelay extends AbstractComponentText {
}
public double getPreferredWidth(StringBounder stringBounder) {
- return StringUtils.getWidth(stringsToDisplay) + 2;
+ return StringUtils.getWcWidth(stringsToDisplay) + 2;
}
}
diff --git a/src/net/sourceforge/plantuml/asciiart/ComponentTextDivider.java b/src/net/sourceforge/plantuml/asciiart/ComponentTextDivider.java
index e55186a..abb177f 100644
--- a/src/net/sourceforge/plantuml/asciiart/ComponentTextDivider.java
+++ b/src/net/sourceforge/plantuml/asciiart/ComponentTextDivider.java
@@ -63,7 +63,7 @@ public class ComponentTextDivider extends AbstractComponentText {
final Dimension2D dimensionToUse = area.getDimensionToUse();
final UmlCharArea charArea = ((UGraphicTxt) ug).getCharArea();
final int width = (int) dimensionToUse.getWidth();
- final int textWidth = StringUtils.getWidth(stringsToDisplay);
+ final int textWidth = StringUtils.getWcWidth(stringsToDisplay);
// final int height = (int) dimensionToUse.getHeight();
final int textPos = (width - textWidth - 1) / 2;
@@ -91,7 +91,7 @@ public class ComponentTextDivider extends AbstractComponentText {
}
public double getPreferredWidth(StringBounder stringBounder) {
- return StringUtils.getWidth(stringsToDisplay) + 2;
+ return StringUtils.getWcWidth(stringsToDisplay) + 2;
}
}
diff --git a/src/net/sourceforge/plantuml/asciiart/ComponentTextGroupingHeader.java b/src/net/sourceforge/plantuml/asciiart/ComponentTextGroupingHeader.java
index 58d8334..fa23945 100644
--- a/src/net/sourceforge/plantuml/asciiart/ComponentTextGroupingHeader.java
+++ b/src/net/sourceforge/plantuml/asciiart/ComponentTextGroupingHeader.java
@@ -103,7 +103,7 @@ public class ComponentTextGroupingHeader extends AbstractComponentText {
}
public double getPreferredWidth(StringBounder stringBounder) {
- return StringUtils.getWidth(stringsToDisplay) + 2;
+ return StringUtils.getWcWidth(stringsToDisplay) + 2;
}
}
diff --git a/src/net/sourceforge/plantuml/asciiart/ComponentTextNote.java b/src/net/sourceforge/plantuml/asciiart/ComponentTextNote.java
index 5e6f538..83195d9 100644
--- a/src/net/sourceforge/plantuml/asciiart/ComponentTextNote.java
+++ b/src/net/sourceforge/plantuml/asciiart/ComponentTextNote.java
@@ -86,7 +86,7 @@ public class ComponentTextNote extends AbstractComponentText {
}
public double getPreferredWidth(StringBounder stringBounder) {
- return StringUtils.getWidth(stringsToDisplay) + 7;
+ return StringUtils.getWcWidth(stringsToDisplay) + 7;
}
}
diff --git a/src/net/sourceforge/plantuml/asciiart/ComponentTextParticipant.java b/src/net/sourceforge/plantuml/asciiart/ComponentTextParticipant.java
index e8dc9a8..3947992 100644
--- a/src/net/sourceforge/plantuml/asciiart/ComponentTextParticipant.java
+++ b/src/net/sourceforge/plantuml/asciiart/ComponentTextParticipant.java
@@ -91,7 +91,7 @@ public class ComponentTextParticipant extends AbstractComponentText {
}
public double getPreferredWidth(StringBounder stringBounder) {
- return StringUtils.getWidth(stringsToDisplay) + 2;
+ return StringUtils.getWcWidth(stringsToDisplay) + 2;
}
}
diff --git a/src/net/sourceforge/plantuml/asciiart/ComponentTextSelfArrow.java b/src/net/sourceforge/plantuml/asciiart/ComponentTextSelfArrow.java
index 3286562..1a14a62 100644
--- a/src/net/sourceforge/plantuml/asciiart/ComponentTextSelfArrow.java
+++ b/src/net/sourceforge/plantuml/asciiart/ComponentTextSelfArrow.java
@@ -102,7 +102,7 @@ public class ComponentTextSelfArrow extends AbstractComponentText {
}
public double getPreferredWidth(StringBounder stringBounder) {
- return StringUtils.getWidth(stringsToDisplay) + 6;
+ return StringUtils.getWcWidth(stringsToDisplay) + 6;
}
}
diff --git a/src/net/sourceforge/plantuml/asciiart/ComponentTextShape.java b/src/net/sourceforge/plantuml/asciiart/ComponentTextShape.java
index 369e0b8..d8189b9 100644
--- a/src/net/sourceforge/plantuml/asciiart/ComponentTextShape.java
+++ b/src/net/sourceforge/plantuml/asciiart/ComponentTextShape.java
@@ -84,7 +84,7 @@ public class ComponentTextShape extends AbstractComponentText {
}
public double getPreferredWidth(StringBounder stringBounder) {
- return StringUtils.getWidth(stringsToDisplay) + 2;
+ return StringUtils.getWcWidth(stringsToDisplay) + 2;
}
}
diff --git a/src/net/sourceforge/plantuml/asciiart/Wcwidth.java b/src/net/sourceforge/plantuml/asciiart/Wcwidth.java
new file mode 100644
index 0000000..f69d9a9
--- /dev/null
+++ b/src/net/sourceforge/plantuml/asciiart/Wcwidth.java
@@ -0,0 +1,253 @@
+/* ========================================================================
+ * 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
+ * Source code provided by Yasuhiro Matsumoto
+ *
+ */
+/**
+ * Source code provided by Yasuhiro Matsumoto.
+ * See:
+ * https://github.com/plantuml/plantuml/issues/74
+ *
+ * Many thanks for his help!
+ */
+/**
+ * <p>See <a href="http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c">wcwidth.c</a></p>
+ *
+ * <p>This is an implementation of wcwidth() and wcswidth() (defined in
+ * IEEE Std 1002.1-2001) for Unicode.</p>
+ *
+ * http://www.opengroup.org/onlinepubs/007904975/functions/wcwidth.html
+ * http://www.opengroup.org/onlinepubs/007904975/functions/wcswidth.html
+ *
+ * <p>In fixed-width output devices, Latin characters all occupy a single
+ * "cell" position of equal width, whereas ideographic CJK characters
+ * occupy two such cells. Interoperability between terminal-line
+ * applications and (teletype-style) character terminals using the
+ * UTF-8 encoding requires agreement on which character should advance
+ * the cursor by how many cell positions. No established formal
+ * standards exist at present on which Unicode character shall occupy
+ * how many cell positions on character terminals. These routines are
+ * a first attempt of defining such behavior based on simple rules
+ * applied to data provided by the Unicode Consortium.</p>
+ *
+ * <p>For some graphical characters, the Unicode standard explicitly
+ * defines a character-cell width via the definition of the East Asian
+ * FullWidth (F), Wide (W), Half-width (H), and Narrow (Na) classes.
+ * In all these cases, there is no ambiguity about which width a
+ * terminal shall use. For characters in the East Asian Ambiguous (A)
+ * class, the width choice depends purely on a preference of backward
+ * compatibility with either historic CJK or Western practice.
+ * Choosing single-width for these characters is easy to justify as
+ * the appropriate long-term solution, as the CJK practice of
+ * displaying these characters as double-width comes from historic
+ * implementation simplicity (8-bit encoded characters were displayed
+ * single-width and 16-bit ones double-width, even for Greek,
+ * Cyrillic, etc.) and not any typographic considerations.</p>
+ *
+ * <p>Much less clear is the choice of width for the Not East Asian
+ * (Neutral) class. Existing practice does not dictate a width for any
+ * of these characters. It would nevertheless make sense
+ * typographically to allocate two character cells to characters such
+ * as for instance EM SPACE or VOLUME INTEGRAL, which cannot be
+ * represented adequately with a single-width glyph. The following
+ * routines at present merely assign a single-cell width to all
+ * neutral characters, in the interest of simplicity. This is not
+ * entirely satisfactory and should be reconsidered before
+ * establishing a formal standard in this area. At the moment, the
+ * decision which Not East Asian (Neutral) characters should be
+ * represented by double-width glyphs cannot yet be answered by
+ * applying a simple rule from the Unicode database content. Setting
+ * up a proper standard for the behavior of UTF-8 character terminals
+ * will require a careful analysis not only of each Unicode character,
+ * but also of each presentation form, something the author of these
+ * routines has avoided to do so far.</p>
+ *
+ * <p>http://www.unicode.org/unicode/reports/tr11/</p>
+ */
+package net.sourceforge.plantuml.asciiart;
+
+public class Wcwidth {
+
+ /**
+ * sorted list of non-overlapping intervals of non-spacing characters
+ * generated by "uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c"
+ */
+ private static final int[][] COMBINING = {
+ {0x0300, 0x036F}, {0x0483, 0x0486}, {0x0488, 0x0489},
+ {0x0591, 0x05BD}, {0x05BF, 0x05BF}, {0x05C1, 0x05C2},
+ {0x05C4, 0x05C5}, {0x05C7, 0x05C7}, {0x0600, 0x0603},
+ {0x0610, 0x0615}, {0x064B, 0x065E}, {0x0670, 0x0670},
+ {0x06D6, 0x06E4}, {0x06E7, 0x06E8}, {0x06EA, 0x06ED},
+ {0x070F, 0x070F}, {0x0711, 0x0711}, {0x0730, 0x074A},
+ {0x07A6, 0x07B0}, {0x07EB, 0x07F3}, {0x0901, 0x0902},
+ {0x093C, 0x093C}, {0x0941, 0x0948}, {0x094D, 0x094D},
+ {0x0951, 0x0954}, {0x0962, 0x0963}, {0x0981, 0x0981},
+ {0x09BC, 0x09BC}, {0x09C1, 0x09C4}, {0x09CD, 0x09CD},
+ {0x09E2, 0x09E3}, {0x0A01, 0x0A02}, {0x0A3C, 0x0A3C},
+ {0x0A41, 0x0A42}, {0x0A47, 0x0A48}, {0x0A4B, 0x0A4D},
+ {0x0A70, 0x0A71}, {0x0A81, 0x0A82}, {0x0ABC, 0x0ABC},
+ {0x0AC1, 0x0AC5}, {0x0AC7, 0x0AC8}, {0x0ACD, 0x0ACD},
+ {0x0AE2, 0x0AE3}, {0x0B01, 0x0B01}, {0x0B3C, 0x0B3C},
+ {0x0B3F, 0x0B3F}, {0x0B41, 0x0B43}, {0x0B4D, 0x0B4D},
+ {0x0B56, 0x0B56}, {0x0B82, 0x0B82}, {0x0BC0, 0x0BC0},
+ {0x0BCD, 0x0BCD}, {0x0C3E, 0x0C40}, {0x0C46, 0x0C48},
+ {0x0C4A, 0x0C4D}, {0x0C55, 0x0C56}, {0x0CBC, 0x0CBC},
+ {0x0CBF, 0x0CBF}, {0x0CC6, 0x0CC6}, {0x0CCC, 0x0CCD},
+ {0x0CE2, 0x0CE3}, {0x0D41, 0x0D43}, {0x0D4D, 0x0D4D},
+ {0x0DCA, 0x0DCA}, {0x0DD2, 0x0DD4}, {0x0DD6, 0x0DD6},
+ {0x0E31, 0x0E31}, {0x0E34, 0x0E3A}, {0x0E47, 0x0E4E},
+ {0x0EB1, 0x0EB1}, {0x0EB4, 0x0EB9}, {0x0EBB, 0x0EBC},
+ {0x0EC8, 0x0ECD}, {0x0F18, 0x0F19}, {0x0F35, 0x0F35},
+ {0x0F37, 0x0F37}, {0x0F39, 0x0F39}, {0x0F71, 0x0F7E},
+ {0x0F80, 0x0F84}, {0x0F86, 0x0F87}, {0x0F90, 0x0F97},
+ {0x0F99, 0x0FBC}, {0x0FC6, 0x0FC6}, {0x102D, 0x1030},
+ {0x1032, 0x1032}, {0x1036, 0x1037}, {0x1039, 0x1039},
+ {0x1058, 0x1059}, {0x1160, 0x11FF}, {0x135F, 0x135F},
+ {0x1712, 0x1714}, {0x1732, 0x1734}, {0x1752, 0x1753},
+ {0x1772, 0x1773}, {0x17B4, 0x17B5}, {0x17B7, 0x17BD},
+ {0x17C6, 0x17C6}, {0x17C9, 0x17D3}, {0x17DD, 0x17DD},
+ {0x180B, 0x180D}, {0x18A9, 0x18A9}, {0x1920, 0x1922},
+ {0x1927, 0x1928}, {0x1932, 0x1932}, {0x1939, 0x193B},
+ {0x1A17, 0x1A18}, {0x1B00, 0x1B03}, {0x1B34, 0x1B34},
+ {0x1B36, 0x1B3A}, {0x1B3C, 0x1B3C}, {0x1B42, 0x1B42},
+ {0x1B6B, 0x1B73}, {0x1DC0, 0x1DCA}, {0x1DFE, 0x1DFF},
+ {0x200B, 0x200F}, {0x202A, 0x202E}, {0x2060, 0x2063},
+ {0x206A, 0x206F}, {0x20D0, 0x20EF}, {0x302A, 0x302F},
+ {0x3099, 0x309A}, {0xA806, 0xA806}, {0xA80B, 0xA80B},
+ {0xA825, 0xA826}, {0xFB1E, 0xFB1E}, {0xFE00, 0xFE0F},
+ {0xFE20, 0xFE23}, {0xFEFF, 0xFEFF}, {0xFFF9, 0xFFFB},
+ {0x10A01, 0x10A03}, {0x10A05, 0x10A06}, {0x10A0C, 0x10A0F},
+ {0x10A38, 0x10A3A}, {0x10A3F, 0x10A3F}, {0x1D167, 0x1D169},
+ {0x1D173, 0x1D182}, {0x1D185, 0x1D18B}, {0x1D1AA, 0x1D1AD},
+ {0x1D242, 0x1D244}, {0xE0001, 0xE0001}, {0xE0020, 0xE007F},
+ {0xE0100, 0xE01EF}
+ };
+
+ static boolean bisearch(int ucs) {
+ int min = 0;
+ int mid;
+ int max = COMBINING.length - 1;
+
+ if (ucs < COMBINING[0][0] || ucs > COMBINING[max][1]) {
+ return false;
+ }
+ while (max >= min) {
+ mid = (min + max) / 2;
+ if (ucs > COMBINING[mid][1]) {
+ min = mid + 1;
+ } else if (ucs < COMBINING[mid][0]) {
+ max = mid - 1;
+ } else {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * See : http://www.cl.cam.ac.uk/%7Emgk25/ucs/wcwidth.c
+ *
+ * The following two functions define the column width of an ISO 10646
+ * character as follows:
+ *
+ * - The null character (U+0000) has a column width of 0.
+ *
+ * - Other C0/C1 control characters and DEL will lead to a return
+ * value of -1.
+ *
+ * - Non-spacing and enclosing combining characters (general
+ * category code Mn or Me in the Unicode database) have a
+ * column width of 0.
+ *
+ * - SOFT HYPHEN (U+00AD) has a column width of 1.
+ *
+ * - Other format characters (general category code Cf in the Unicode
+ * database) and ZERO WIDTH SPACE (U+200B) have a column width of 0.
+ *
+ * - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF)
+ * have a column width of 0.
+ *
+ * - Spacing characters in the East Asian Wide (W) or East Asian
+ * Full-width (F) category as defined in Unicode Technical
+ * Report #11 have a column width of 2.
+ *
+ * - All remaining characters (including all printable
+ * ISO 8859-1 and WGL4 characters, Unicode control characters,
+ * etc.) have a column width of 1.
+ *
+ * This implementation assumes that wchar_t characters are encoded
+ * in ISO 10646.
+ */
+ public static int of(int codePoint) {
+ // test for 8-bit control characters
+ if (codePoint == 0) {
+ return 0;
+ }
+ if (codePoint < 32 || (codePoint >= 0x7f && codePoint < 0xa0)) {
+ return -1;
+ }
+ // Added by Arnaud : Usual 8 bit char
+ if (codePoint < 127) {
+ return 1;
+ }
+ // binary search in table of non-spacing characters
+ if (bisearch(codePoint)) {
+ return 0;
+ }
+
+ // if we arrive here, ucs is not a combining or C0/C1 control character
+ return 1 +
+ ((codePoint >= 0x1100 &&
+ (codePoint <= 0x115f || // Hangul Jamo init. consonants
+ codePoint == 0x2329 || codePoint == 0x232a ||
+ (codePoint >= 0x2e80 && codePoint <= 0xa4cf &&
+ codePoint != 0x303f) || // CJK ... Yi
+ (codePoint >= 0xac00 && codePoint <= 0xd7a3) || // Hangul Syllables
+ (codePoint >= 0xf900 && codePoint <= 0xfaff) || // CJK Compatibility Ideographs
+ (codePoint >= 0xfe10 && codePoint <= 0xfe19) || // Vertical forms
+ (codePoint >= 0xfe30 && codePoint <= 0xfe6f) || // CJK Compatibility Forms
+ (codePoint >= 0xff00 && codePoint <= 0xff60) || // Fullwidth Forms
+ (codePoint >= 0xffe0 && codePoint <= 0xffe6) ||
+ (codePoint >= 0x20000 && codePoint <= 0x2fffd) ||
+ (codePoint >= 0x30000 && codePoint <= 0x3fffd))) ? 1 : 0);
+ }
+
+ public static int length(CharSequence s) {
+ int result = 0;
+ for (int i = 0; i < s.length(); i++) {
+ result += of(s.charAt(i));
+ }
+ return result;
+ }
+} \ No newline at end of file
diff --git a/src/net/sourceforge/plantuml/bpm/BpmElement.java b/src/net/sourceforge/plantuml/bpm/BpmElement.java
index b8573a4..3be07f7 100644
--- a/src/net/sourceforge/plantuml/bpm/BpmElement.java
+++ b/src/net/sourceforge/plantuml/bpm/BpmElement.java
@@ -52,6 +52,7 @@ import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.InnerStrategy;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
@@ -111,6 +112,10 @@ public class BpmElement extends AbstractConnectorPuzzle implements ConnectorPuzz
public Dimension2D calculateDimension(StringBounder stringBounder) {
return raw.calculateDimension(stringBounder);
}
+
+ public MinMax getMinMax(StringBounder stringBounder) {
+ return raw.getMinMax(stringBounder);
+ }
};
}
diff --git a/src/net/sourceforge/plantuml/bpm/ConnectorPuzzleEmpty.java b/src/net/sourceforge/plantuml/bpm/ConnectorPuzzleEmpty.java
index c6c5c65..b2a36c7 100644
--- a/src/net/sourceforge/plantuml/bpm/ConnectorPuzzleEmpty.java
+++ b/src/net/sourceforge/plantuml/bpm/ConnectorPuzzleEmpty.java
@@ -44,6 +44,7 @@ import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.InnerStrategy;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
@@ -115,6 +116,11 @@ public class ConnectorPuzzleEmpty extends AbstractConnectorPuzzle implements Pla
public Dimension2D calculateDimension(StringBounder stringBounder) {
return new Dimension2DDouble(20, 20);
}
+
+ public MinMax getMinMax(StringBounder stringBounder) {
+ throw new UnsupportedOperationException();
+ }
+
public Rectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
return null;
diff --git a/src/net/sourceforge/plantuml/braille/UGraphicBraille.java b/src/net/sourceforge/plantuml/braille/UGraphicBraille.java
index 3e9ef2f..060baa5 100644
--- a/src/net/sourceforge/plantuml/braille/UGraphicBraille.java
+++ b/src/net/sourceforge/plantuml/braille/UGraphicBraille.java
@@ -39,6 +39,7 @@ import java.io.OutputStream;
import net.sourceforge.plantuml.FileFormat;
import net.sourceforge.plantuml.FileFormatOption;
+import net.sourceforge.plantuml.TikzFontDistortion;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
@@ -117,7 +118,7 @@ public class UGraphicBraille extends AbstractUGraphic<BrailleGrid> implements Cl
}
public StringBounder getStringBounder() {
- return FileFormat.BRAILLE_PNG.getDefaultStringBounder();
+ return FileFormat.BRAILLE_PNG.getDefaultStringBounder(TikzFontDistortion.getDefault());
}
public void startUrl(Url url) {
diff --git a/src/net/sourceforge/plantuml/brotli/BitReader.java b/src/net/sourceforge/plantuml/brotli/BitReader.java
new file mode 100644
index 0000000..9e48e52
--- /dev/null
+++ b/src/net/sourceforge/plantuml/brotli/BitReader.java
@@ -0,0 +1,269 @@
+/* Copyright 2015 Google Inc. All Rights Reserved.
+
+ Distributed under MIT license.
+ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+
+package net.sourceforge.plantuml.brotli;
+
+/**
+ * Bit reading helpers.
+ */
+final class BitReader {
+
+ // Added by Arnaud... not very beautifull
+ private static final boolean CHECK_UNUSED_BYTES_AFTER_END = false;
+
+ // Possible values: {5, 6}. 5 corresponds to 32-bit build, 6 to 64-bit. This value is used for
+ // conditional compilation -> produced artifacts might be binary INCOMPATIBLE (JLS 13.2).
+ private static final int LOG_BITNESS = 6;
+ private static final int BITNESS = 1 << LOG_BITNESS;
+
+ private static final int BYTENESS = BITNESS / 8;
+ private static final int CAPACITY = 4096;
+ // After encountering the end of the input stream, this amount of zero bytes will be appended.
+ private static final int SLACK = 64;
+ private static final int BUFFER_SIZE = CAPACITY + SLACK;
+ // Don't bother to replenish the buffer while this number of bytes is available.
+ private static final int SAFEGUARD = 36;
+ private static final int WATERLINE = CAPACITY - SAFEGUARD;
+
+ // "Half" refers to "half of native integer type", i.e. on 64-bit machines it is 32-bit type,
+ // on 32-bit machines it is 16-bit.
+ private static final int HALF_BITNESS = BITNESS / 2;
+ private static final int HALF_SIZE = BYTENESS / 2;
+ private static final int HALVES_CAPACITY = CAPACITY / HALF_SIZE;
+ private static final int HALF_BUFFER_SIZE = BUFFER_SIZE / HALF_SIZE;
+ private static final int HALF_WATERLINE = WATERLINE / HALF_SIZE;
+
+ private static final int LOG_HALF_SIZE = LOG_BITNESS - 4;
+
+ /**
+ * Fills up the input buffer.
+ *
+ * <p> No-op if there are at least 36 bytes present after current position.
+ *
+ * <p> After encountering the end of the input stream, 64 additional zero bytes are copied to the
+ * buffer.
+ */
+ static void readMoreInput(State s) {
+ if (s.halfOffset > HALF_WATERLINE) {
+ doReadMoreInput(s);
+ }
+ }
+
+ static void doReadMoreInput(State s) {
+ if (s.endOfStreamReached != 0) {
+ if (halfAvailable(s) >= -2) {
+ return;
+ }
+ throw new BrotliRuntimeException("No more input");
+ }
+ int readOffset = s.halfOffset << LOG_HALF_SIZE;
+ int bytesInBuffer = CAPACITY - readOffset;
+ // Move unused bytes to the head of the buffer.
+ Utils.copyBytesWithin(s.byteBuffer, 0, readOffset, CAPACITY);
+ s.halfOffset = 0;
+ while (bytesInBuffer < CAPACITY) {
+ int spaceLeft = CAPACITY - bytesInBuffer;
+ int len = Utils.readInput(s.input, s.byteBuffer, bytesInBuffer, spaceLeft);
+ // EOF is -1 in Java, but 0 in C#.
+ if (len <= 0) {
+ s.endOfStreamReached = 1;
+ s.tailBytes = bytesInBuffer;
+ bytesInBuffer += HALF_SIZE - 1;
+ break;
+ }
+ bytesInBuffer += len;
+ }
+ bytesToNibbles(s, bytesInBuffer);
+ }
+
+ static void checkHealth(State s, int endOfStream) {
+ if (s.endOfStreamReached == 0) {
+ return;
+ }
+ int byteOffset = (s.halfOffset << LOG_HALF_SIZE) + ((s.bitOffset + 7) >> 3) - BYTENESS;
+ if (byteOffset > s.tailBytes) {
+ throw new BrotliRuntimeException("Read after end");
+ }
+ if (CHECK_UNUSED_BYTES_AFTER_END && (endOfStream != 0) && (byteOffset != s.tailBytes)) {
+ throw new BrotliRuntimeException("Unused bytes after end");
+ }
+ }
+
+ static void fillBitWindow(State s) {
+ if (s.bitOffset >= HALF_BITNESS) {
+ // Same as doFillBitWindow. JVM fails to inline it.
+ if (BITNESS == 64) {
+ s.accumulator64 = ((long) s.intBuffer[s.halfOffset++] << HALF_BITNESS)
+ | (s.accumulator64 >>> HALF_BITNESS);
+ } else {
+ s.accumulator32 = ((int) s.shortBuffer[s.halfOffset++] << HALF_BITNESS)
+ | (s.accumulator32 >>> HALF_BITNESS);
+ }
+ s.bitOffset -= HALF_BITNESS;
+ }
+ }
+
+ private static void doFillBitWindow(State s) {
+ if (BITNESS == 64) {
+ s.accumulator64 = ((long) s.intBuffer[s.halfOffset++] << HALF_BITNESS)
+ | (s.accumulator64 >>> HALF_BITNESS);
+ } else {
+ s.accumulator32 = ((int) s.shortBuffer[s.halfOffset++] << HALF_BITNESS)
+ | (s.accumulator32 >>> HALF_BITNESS);
+ }
+ s.bitOffset -= HALF_BITNESS;
+ }
+
+ static int peekBits(State s) {
+ if (BITNESS == 64) {
+ return (int) (s.accumulator64 >>> s.bitOffset);
+ } else {
+ return s.accumulator32 >>> s.bitOffset;
+ }
+ }
+
+ static int readFewBits(State s, int n) {
+ int val = peekBits(s) & ((1 << n) - 1);
+ s.bitOffset += n;
+ return val;
+ }
+
+ static int readBits(State s, int n) {
+ if (HALF_BITNESS >= 24) {
+ return readFewBits(s, n);
+ } else {
+ return (n <= 16) ? readFewBits(s, n) : readManyBits(s, n);
+ }
+ }
+
+ private static int readManyBits(State s, int n) {
+ int low = readFewBits(s, 16);
+ doFillBitWindow(s);
+ return low | (readFewBits(s, n - 16) << 16);
+ }
+
+ static void initBitReader(State s) {
+ s.byteBuffer = new byte[BUFFER_SIZE];
+ if (BITNESS == 64) {
+ s.accumulator64 = 0;
+ s.intBuffer = new int[HALF_BUFFER_SIZE];
+ } else {
+ s.accumulator32 = 0;
+ s.shortBuffer = new short[HALF_BUFFER_SIZE];
+ }
+ s.bitOffset = BITNESS;
+ s.halfOffset = HALVES_CAPACITY;
+ s.endOfStreamReached = 0;
+ prepare(s);
+ }
+
+ private static void prepare(State s) {
+ readMoreInput(s);
+ checkHealth(s, 0);
+ doFillBitWindow(s);
+ doFillBitWindow(s);
+ }
+
+ static void reload(State s) {
+ if (s.bitOffset == BITNESS) {
+ prepare(s);
+ }
+ }
+
+ static void jumpToByteBoundary(State s) {
+ int padding = (BITNESS - s.bitOffset) & 7;
+ if (padding != 0) {
+ int paddingBits = readFewBits(s, padding);
+ if (paddingBits != 0) {
+ throw new BrotliRuntimeException("Corrupted padding bits");
+ }
+ }
+ }
+
+ static int halfAvailable(State s) {
+ int limit = HALVES_CAPACITY;
+ if (s.endOfStreamReached != 0) {
+ limit = (s.tailBytes + (HALF_SIZE - 1)) >> LOG_HALF_SIZE;
+ }
+ return limit - s.halfOffset;
+ }
+
+ static void copyBytes(State s, byte[] data, int offset, int length) {
+ if ((s.bitOffset & 7) != 0) {
+ throw new BrotliRuntimeException("Unaligned copyBytes");
+ }
+
+ // Drain accumulator.
+ while ((s.bitOffset != BITNESS) && (length != 0)) {
+ data[offset++] = (byte) peekBits(s);
+ s.bitOffset += 8;
+ length--;
+ }
+ if (length == 0) {
+ return;
+ }
+
+ // Get data from shadow buffer with "sizeof(int)" granularity.
+ int copyNibbles = Math.min(halfAvailable(s), length >> LOG_HALF_SIZE);
+ if (copyNibbles > 0) {
+ int readOffset = s.halfOffset << LOG_HALF_SIZE;
+ int delta = copyNibbles << LOG_HALF_SIZE;
+ System.arraycopy(s.byteBuffer, readOffset, data, offset, delta);
+ offset += delta;
+ length -= delta;
+ s.halfOffset += copyNibbles;
+ }
+ if (length == 0) {
+ return;
+ }
+
+ // Read tail bytes.
+ if (halfAvailable(s) > 0) {
+ // length = 1..3
+ fillBitWindow(s);
+ while (length != 0) {
+ data[offset++] = (byte) peekBits(s);
+ s.bitOffset += 8;
+ length--;
+ }
+ checkHealth(s, 0);
+ return;
+ }
+
+ // Now it is possible to copy bytes directly.
+ while (length > 0) {
+ int len = Utils.readInput(s.input, data, offset, length);
+ if (len == -1) {
+ throw new BrotliRuntimeException("Unexpected end of input");
+ }
+ offset += len;
+ length -= len;
+ }
+ }
+
+ /**
+ * Translates bytes to halves (int/short).
+ */
+ static void bytesToNibbles(State s, int byteLen) {
+ byte[] byteBuffer = s.byteBuffer;
+ int halfLen = byteLen >> LOG_HALF_SIZE;
+ if (BITNESS == 64) {
+ int[] intBuffer = s.intBuffer;
+ for (int i = 0; i < halfLen; ++i) {
+ intBuffer[i] = ((byteBuffer[i * 4] & 0xFF))
+ | ((byteBuffer[(i * 4) + 1] & 0xFF) << 8)
+ | ((byteBuffer[(i * 4) + 2] & 0xFF) << 16)
+ | ((byteBuffer[(i * 4) + 3] & 0xFF) << 24);
+ }
+ } else {
+ short[] shortBuffer = s.shortBuffer;
+ for (int i = 0; i < halfLen; ++i) {
+ shortBuffer[i] = (short) ((byteBuffer[i * 2] & 0xFF)
+ | ((byteBuffer[(i * 2) + 1] & 0xFF) << 8));
+ }
+ }
+ }
+}
diff --git a/src/net/sourceforge/plantuml/brotli/BrotliInputStream.java b/src/net/sourceforge/plantuml/brotli/BrotliInputStream.java
new file mode 100644
index 0000000..8debc6c
--- /dev/null
+++ b/src/net/sourceforge/plantuml/brotli/BrotliInputStream.java
@@ -0,0 +1,150 @@
+/* Copyright 2015 Google Inc. All Rights Reserved.
+
+ Distributed under MIT license.
+ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+
+package net.sourceforge.plantuml.brotli;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * {@link InputStream} decorator that decompresses brotli data.
+ *
+ * <p> Not thread-safe.
+ */
+public class BrotliInputStream extends InputStream {
+
+ public static final int DEFAULT_INTERNAL_BUFFER_SIZE = 16384;
+
+ /**
+ * Internal buffer used for efficient byte-by-byte reading.
+ */
+ private byte[] buffer;
+
+ /**
+ * Number of decoded but still unused bytes in internal buffer.
+ */
+ private int remainingBufferBytes;
+
+ /**
+ * Next unused byte offset.
+ */
+ private int bufferOffset;
+
+ /**
+ * Decoder state.
+ */
+ private final State state = new State();
+
+ /**
+ * Creates a {@link InputStream} wrapper that decompresses brotli data.
+ *
+ * <p> For byte-by-byte reading ({@link #read()}) internal buffer with
+ * {@link #DEFAULT_INTERNAL_BUFFER_SIZE} size is allocated and used.
+ *
+ * <p> Will block the thread until first kilobyte of data of source is available.
+ *
+ * @param source underlying data source
+ * @throws IOException in case of corrupted data or source stream problems
+ */
+ public BrotliInputStream(InputStream source) throws IOException {
+ this(source, DEFAULT_INTERNAL_BUFFER_SIZE);
+ }
+
+ /**
+ * Creates a {@link InputStream} wrapper that decompresses brotli data.
+ *
+ * <p> For byte-by-byte reading ({@link #read()}) internal buffer of specified size is
+ * allocated and used.
+ *
+ * <p> Will block the thread until first kilobyte of data of source is available.
+ *
+ * @param source compressed data source
+ * @param byteReadBufferSize size of internal buffer used in case of
+ * byte-by-byte reading
+ * @throws IOException in case of corrupted data or source stream problems
+ */
+ public BrotliInputStream(InputStream source, int byteReadBufferSize) throws IOException {
+ if (byteReadBufferSize <= 0) {
+ throw new IllegalArgumentException("Bad buffer size:" + byteReadBufferSize);
+ } else if (source == null) {
+ throw new IllegalArgumentException("source is null");
+ }
+ this.buffer = new byte[byteReadBufferSize];
+ this.remainingBufferBytes = 0;
+ this.bufferOffset = 0;
+ try {
+ Decode.initState(state, source);
+ } catch (BrotliRuntimeException ex) {
+ throw new IOException("Brotli decoder initialization failed", ex);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void close() throws IOException {
+ Decode.close(state);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int read() throws IOException {
+ if (bufferOffset >= remainingBufferBytes) {
+ remainingBufferBytes = read(buffer, 0, buffer.length);
+ bufferOffset = 0;
+ if (remainingBufferBytes == -1) {
+ return -1;
+ }
+ }
+ return buffer[bufferOffset++] & 0xFF;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int read(byte[] destBuffer, int destOffset, int destLen) throws IOException {
+ if (destOffset < 0) {
+ throw new IllegalArgumentException("Bad offset: " + destOffset);
+ } else if (destLen < 0) {
+ throw new IllegalArgumentException("Bad length: " + destLen);
+ } else if (destOffset + destLen > destBuffer.length) {
+ throw new IllegalArgumentException(
+ "Buffer overflow: " + (destOffset + destLen) + " > " + destBuffer.length);
+ } else if (destLen == 0) {
+ return 0;
+ }
+ int copyLen = Math.max(remainingBufferBytes - bufferOffset, 0);
+ if (copyLen != 0) {
+ copyLen = Math.min(copyLen, destLen);
+ System.arraycopy(buffer, bufferOffset, destBuffer, destOffset, copyLen);
+ bufferOffset += copyLen;
+ destOffset += copyLen;
+ destLen -= copyLen;
+ if (destLen == 0) {
+ return copyLen;
+ }
+ }
+ try {
+ state.output = destBuffer;
+ state.outputOffset = destOffset;
+ state.outputLength = destLen;
+ state.outputUsed = 0;
+ Decode.decompress(state);
+ if (state.outputUsed == 0) {
+ return -1;
+ }
+ return state.outputUsed + copyLen;
+ } catch (BrotliRuntimeException ex) {
+ throw new IOException("Brotli stream decoding failed", ex);
+ }
+
+ // <{[INJECTED CODE]}>
+ }
+}
diff --git a/src/net/sourceforge/plantuml/brotli/BrotliRuntimeException.java b/src/net/sourceforge/plantuml/brotli/BrotliRuntimeException.java
new file mode 100644
index 0000000..7cf20d7
--- /dev/null
+++ b/src/net/sourceforge/plantuml/brotli/BrotliRuntimeException.java
@@ -0,0 +1,21 @@
+/* Copyright 2015 Google Inc. All Rights Reserved.
+
+ Distributed under MIT license.
+ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+
+package net.sourceforge.plantuml.brotli;
+
+/**
+ * Unchecked exception used internally.
+ */
+class BrotliRuntimeException extends RuntimeException {
+
+ BrotliRuntimeException(String message) {
+ super(message);
+ }
+
+ BrotliRuntimeException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
diff --git a/src/net/sourceforge/plantuml/brotli/Context.java b/src/net/sourceforge/plantuml/brotli/Context.java
new file mode 100644
index 0000000..96083e4
--- /dev/null
+++ b/src/net/sourceforge/plantuml/brotli/Context.java
@@ -0,0 +1,58 @@
+/* Copyright 2015 Google Inc. All Rights Reserved.
+
+ Distributed under MIT license.
+ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+
+package net.sourceforge.plantuml.brotli;
+
+/**
+ * Common context lookup table for all context modes.
+ */
+final class Context {
+
+ static final int[] LOOKUP = new int[2048];
+
+ private static final String UTF_MAP = " !! ! \"#$##%#$&'##(#)#+++++++++"
+ + "+((&*'##,---,---,-----,-----,-----&#'###.///.///./////./////./////&#'# ";
+ private static final String UTF_RLE = "A/* ': & : $ \u0081 @";
+
+ private static void unpackLookupTable(int[] lookup, String map, String rle) {
+ // LSB6, MSB6, SIGNED
+ for (int i = 0; i < 256; ++i) {
+ lookup[i] = i & 0x3F;
+ lookup[512 + i] = i >> 2;
+ lookup[1792 + i] = 2 + (i >> 6);
+ }
+ // UTF8
+ for (int i = 0; i < 128; ++i) {
+ lookup[1024 + i] = 4 * (map.charAt(i) - 32);
+ }
+ for (int i = 0; i < 64; ++i) {
+ lookup[1152 + i] = i & 1;
+ lookup[1216 + i] = 2 + (i & 1);
+ }
+ int offset = 1280;
+ for (int k = 0; k < 19; ++k) {
+ int value = k & 3;
+ int rep = rle.charAt(k) - 32;
+ for (int i = 0; i < rep; ++i) {
+ lookup[offset++] = value;
+ }
+ }
+ // SIGNED
+ for (int i = 0; i < 16; ++i) {
+ lookup[1792 + i] = 1;
+ lookup[2032 + i] = 6;
+ }
+ lookup[1792] = 0;
+ lookup[2047] = 7;
+ for (int i = 0; i < 256; ++i) {
+ lookup[1536 + i] = lookup[1792 + i] << 3;
+ }
+ }
+
+ static {
+ unpackLookupTable(LOOKUP, UTF_MAP, UTF_RLE);
+ }
+}
diff --git a/src/net/sourceforge/plantuml/brotli/Decode.java b/src/net/sourceforge/plantuml/brotli/Decode.java
new file mode 100644
index 0000000..7fc3525
--- /dev/null
+++ b/src/net/sourceforge/plantuml/brotli/Decode.java
@@ -0,0 +1,1002 @@
+/* Copyright 2015 Google Inc. All Rights Reserved.
+
+ Distributed under MIT license.
+ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+
+package net.sourceforge.plantuml.brotli;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * API for Brotli decompression.
+ */
+final class Decode {
+
+ //----------------------------------------------------------------------------
+ // RunningState
+ //----------------------------------------------------------------------------
+ private static final int UNINITIALIZED = 0;
+ private static final int BLOCK_START = 1;
+ private static final int COMPRESSED_BLOCK_START = 2;
+ private static final int MAIN_LOOP = 3;
+ private static final int READ_METADATA = 4;
+ private static final int COPY_UNCOMPRESSED = 5;
+ private static final int INSERT_LOOP = 6;
+ private static final int COPY_LOOP = 7;
+ private static final int COPY_WRAP_BUFFER = 8;
+ private static final int TRANSFORM = 9;
+ private static final int FINISHED = 10;
+ private static final int CLOSED = 11;
+ private static final int WRITE = 12;
+
+ private static final int DEFAULT_CODE_LENGTH = 8;
+ private static final int CODE_LENGTH_REPEAT_CODE = 16;
+ private static final int NUM_LITERAL_CODES = 256;
+ private static final int NUM_INSERT_AND_COPY_CODES = 704;
+ private static final int NUM_BLOCK_LENGTH_CODES = 26;
+ private static final int LITERAL_CONTEXT_BITS = 6;
+ private static final int DISTANCE_CONTEXT_BITS = 2;
+
+ private static final int HUFFMAN_TABLE_BITS = 8;
+ private static final int HUFFMAN_TABLE_MASK = 0xFF;
+
+ /**
+ * Maximum possible Huffman table size for an alphabet size of 704, max code length 15 and root
+ * table bits 8.
+ */
+ static final int HUFFMAN_TABLE_SIZE = 1080;
+
+ private static final int CODE_LENGTH_CODES = 18;
+ private static final int[] CODE_LENGTH_CODE_ORDER = {
+ 1, 2, 3, 4, 0, 5, 17, 6, 16, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ };
+
+ private static final int NUM_DISTANCE_SHORT_CODES = 16;
+ private static final int[] DISTANCE_SHORT_CODE_INDEX_OFFSET = {
+ 3, 2, 1, 0, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2
+ };
+
+ private static final int[] DISTANCE_SHORT_CODE_VALUE_OFFSET = {
+ 0, 0, 0, 0, -1, 1, -2, 2, -3, 3, -1, 1, -2, 2, -3, 3
+ };
+
+ /**
+ * Static Huffman code for the code length code lengths.
+ */
+ private static final int[] FIXED_TABLE = {
+ 0x020000, 0x020004, 0x020003, 0x030002, 0x020000, 0x020004, 0x020003, 0x040001,
+ 0x020000, 0x020004, 0x020003, 0x030002, 0x020000, 0x020004, 0x020003, 0x040005
+ };
+
+ static final int[] DICTIONARY_OFFSETS_BY_LENGTH = {
+ 0, 0, 0, 0, 0, 4096, 9216, 21504, 35840, 44032, 53248, 63488, 74752, 87040, 93696, 100864,
+ 104704, 106752, 108928, 113536, 115968, 118528, 119872, 121280, 122016
+ };
+
+ static final int[] DICTIONARY_SIZE_BITS_BY_LENGTH = {
+ 0, 0, 0, 0, 10, 10, 11, 11, 10, 10, 10, 10, 10, 9, 9, 8, 7, 7, 8, 7, 7, 6, 6, 5, 5
+ };
+
+ static final int MIN_WORD_LENGTH = 4;
+
+ static final int MAX_WORD_LENGTH = 24;
+
+ static final int MAX_TRANSFORMED_WORD_LENGTH = 5 + MAX_WORD_LENGTH + 8;
+
+ //----------------------------------------------------------------------------
+ // Prefix code LUT.
+ //----------------------------------------------------------------------------
+ static final int[] BLOCK_LENGTH_OFFSET = {
+ 1, 5, 9, 13, 17, 25, 33, 41, 49, 65, 81, 97, 113, 145, 177, 209, 241, 305, 369, 497,
+ 753, 1265, 2289, 4337, 8433, 16625
+ };
+
+ static final int[] BLOCK_LENGTH_N_BITS = {
+ 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 8, 9, 10, 11, 12, 13, 24
+ };
+
+ static final int[] INSERT_LENGTH_OFFSET = {
+ 0, 1, 2, 3, 4, 5, 6, 8, 10, 14, 18, 26, 34, 50, 66, 98, 130, 194, 322, 578, 1090, 2114, 6210,
+ 22594
+ };
+
+ static final int[] INSERT_LENGTH_N_BITS = {
+ 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 8, 9, 10, 12, 14, 24
+ };
+
+ static final int[] COPY_LENGTH_OFFSET = {
+ 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 18, 22, 30, 38, 54, 70, 102, 134, 198, 326, 582, 1094,
+ 2118
+ };
+
+ static final int[] COPY_LENGTH_N_BITS = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 8, 9, 10, 24
+ };
+
+ static final int[] INSERT_RANGE_LUT = {
+ 0, 0, 8, 8, 0, 16, 8, 16, 16
+ };
+
+ static final int[] COPY_RANGE_LUT = {
+ 0, 8, 0, 8, 16, 0, 16, 8, 16
+ };
+
+ private static int decodeWindowBits(State s) {
+ BitReader.fillBitWindow(s);
+ if (BitReader.readFewBits(s, 1) == 0) {
+ return 16;
+ }
+ int n = BitReader.readFewBits(s, 3);
+ if (n != 0) {
+ return 17 + n;
+ }
+ n = BitReader.readFewBits(s, 3);
+ if (n != 0) {
+ return 8 + n;
+ }
+ return 17;
+ }
+
+ /**
+ * Associate input with decoder state.
+ *
+ * @param s uninitialized state without associated input
+ * @param input compressed data source
+ */
+ static void initState(State s, InputStream input) {
+ if (s.runningState != UNINITIALIZED) {
+ throw new IllegalStateException("State MUST be uninitialized");
+ }
+ s.blockTrees = new int[6 * HUFFMAN_TABLE_SIZE];
+ s.input = input;
+ BitReader.initBitReader(s);
+ int windowBits = decodeWindowBits(s);
+ if (windowBits == 9) { /* Reserved case for future expansion. */
+ throw new BrotliRuntimeException("Invalid 'windowBits' code");
+ }
+ s.maxRingBufferSize = 1 << windowBits;
+ s.maxBackwardDistance = s.maxRingBufferSize - 16;
+ s.runningState = BLOCK_START;
+ }
+
+ static void close(State s) throws IOException {
+ if (s.runningState == UNINITIALIZED) {
+ throw new IllegalStateException("State MUST be initialized");
+ }
+ if (s.runningState == CLOSED) {
+ return;
+ }
+ s.runningState = CLOSED;
+ if (s.input != null) {
+ Utils.closeInput(s.input);
+ s.input = null;
+ }
+ }
+
+ /**
+ * Decodes a number in the range [0..255], by reading 1 - 11 bits.
+ */
+ private static int decodeVarLenUnsignedByte(State s) {
+ BitReader.fillBitWindow(s);
+ if (BitReader.readFewBits(s, 1) != 0) {
+ int n = BitReader.readFewBits(s, 3);
+ if (n == 0) {
+ return 1;
+ } else {
+ return BitReader.readFewBits(s, n) + (1 << n);
+ }
+ }
+ return 0;
+ }
+
+ private static void decodeMetaBlockLength(State s) {
+ BitReader.fillBitWindow(s);
+ s.inputEnd = BitReader.readFewBits(s, 1);
+ s.metaBlockLength = 0;
+ s.isUncompressed = 0;
+ s.isMetadata = 0;
+ if ((s.inputEnd != 0) && BitReader.readFewBits(s, 1) != 0) {
+ return;
+ }
+ int sizeNibbles = BitReader.readFewBits(s, 2) + 4;
+ if (sizeNibbles == 7) {
+ s.isMetadata = 1;
+ if (BitReader.readFewBits(s, 1) != 0) {
+ throw new BrotliRuntimeException("Corrupted reserved bit");
+ }
+ int sizeBytes = BitReader.readFewBits(s, 2);
+ if (sizeBytes == 0) {
+ return;
+ }
+ for (int i = 0; i < sizeBytes; i++) {
+ BitReader.fillBitWindow(s);
+ int bits = BitReader.readFewBits(s, 8);
+ if (bits == 0 && i + 1 == sizeBytes && sizeBytes > 1) {
+ throw new BrotliRuntimeException("Exuberant nibble");
+ }
+ s.metaBlockLength |= bits << (i * 8);
+ }
+ } else {
+ for (int i = 0; i < sizeNibbles; i++) {
+ BitReader.fillBitWindow(s);
+ int bits = BitReader.readFewBits(s, 4);
+ if (bits == 0 && i + 1 == sizeNibbles && sizeNibbles > 4) {
+ throw new BrotliRuntimeException("Exuberant nibble");
+ }
+ s.metaBlockLength |= bits << (i * 4);
+ }
+ }
+ s.metaBlockLength++;
+ if (s.inputEnd == 0) {
+ s.isUncompressed = BitReader.readFewBits(s, 1);
+ }
+ }
+
+ /**
+ * Decodes the next Huffman code from bit-stream.
+ */
+ private static int readSymbol(int[] table, int offset, State s) {
+ int val = BitReader.peekBits(s);
+ offset += val & HUFFMAN_TABLE_MASK;
+ int bits = table[offset] >> 16;
+ int sym = table[offset] & 0xFFFF;
+ if (bits <= HUFFMAN_TABLE_BITS) {
+ s.bitOffset += bits;
+ return sym;
+ }
+ offset += sym;
+ int mask = (1 << bits) - 1;
+ offset += (val & mask) >>> HUFFMAN_TABLE_BITS;
+ s.bitOffset += ((table[offset] >> 16) + HUFFMAN_TABLE_BITS);
+ return table[offset] & 0xFFFF;
+ }
+
+ private static int readBlockLength(int[] table, int offset, State s) {
+ BitReader.fillBitWindow(s);
+ int code = readSymbol(table, offset, s);
+ int n = BLOCK_LENGTH_N_BITS[code];
+ BitReader.fillBitWindow(s);
+ return BLOCK_LENGTH_OFFSET[code] + BitReader.readBits(s, n);
+ }
+
+ private static int translateShortCodes(int code, int[] ringBuffer, int index) {
+ if (code < NUM_DISTANCE_SHORT_CODES) {
+ index += DISTANCE_SHORT_CODE_INDEX_OFFSET[code];
+ index &= 3;
+ return ringBuffer[index] + DISTANCE_SHORT_CODE_VALUE_OFFSET[code];
+ }
+ return code - NUM_DISTANCE_SHORT_CODES + 1;
+ }
+
+ private static void moveToFront(int[] v, int index) {
+ int value = v[index];
+ for (; index > 0; index--) {
+ v[index] = v[index - 1];
+ }
+ v[0] = value;
+ }
+
+ private static void inverseMoveToFrontTransform(byte[] v, int vLen) {
+ int[] mtf = new int[256];
+ for (int i = 0; i < 256; i++) {
+ mtf[i] = i;
+ }
+ for (int i = 0; i < vLen; i++) {
+ int index = v[i] & 0xFF;
+ v[i] = (byte) mtf[index];
+ if (index != 0) {
+ moveToFront(mtf, index);
+ }
+ }
+ }
+
+ private static void readHuffmanCodeLengths(
+ int[] codeLengthCodeLengths, int numSymbols, int[] codeLengths, State s) {
+ int symbol = 0;
+ int prevCodeLen = DEFAULT_CODE_LENGTH;
+ int repeat = 0;
+ int repeatCodeLen = 0;
+ int space = 32768;
+ int[] table = new int[32];
+
+ Huffman.buildHuffmanTable(table, 0, 5, codeLengthCodeLengths, CODE_LENGTH_CODES);
+
+ while (symbol < numSymbols && space > 0) {
+ BitReader.readMoreInput(s);
+ BitReader.fillBitWindow(s);
+ int p = BitReader.peekBits(s) & 31;
+ s.bitOffset += table[p] >> 16;
+ int codeLen = table[p] & 0xFFFF;
+ if (codeLen < CODE_LENGTH_REPEAT_CODE) {
+ repeat = 0;
+ codeLengths[symbol++] = codeLen;
+ if (codeLen != 0) {
+ prevCodeLen = codeLen;
+ space -= 32768 >> codeLen;
+ }
+ } else {
+ int extraBits = codeLen - 14;
+ int newLen = 0;
+ if (codeLen == CODE_LENGTH_REPEAT_CODE) {
+ newLen = prevCodeLen;
+ }
+ if (repeatCodeLen != newLen) {
+ repeat = 0;
+ repeatCodeLen = newLen;
+ }
+ int oldRepeat = repeat;
+ if (repeat > 0) {
+ repeat -= 2;
+ repeat <<= extraBits;
+ }
+ BitReader.fillBitWindow(s);
+ repeat += BitReader.readFewBits(s, extraBits) + 3;
+ int repeatDelta = repeat - oldRepeat;
+ if (symbol + repeatDelta > numSymbols) {
+ throw new BrotliRuntimeException("symbol + repeatDelta > numSymbols"); // COV_NF_LINE
+ }
+ for (int i = 0; i < repeatDelta; i++) {
+ codeLengths[symbol++] = repeatCodeLen;
+ }
+ if (repeatCodeLen != 0) {
+ space -= repeatDelta << (15 - repeatCodeLen);
+ }
+ }
+ }
+ if (space != 0) {
+ throw new BrotliRuntimeException("Unused space"); // COV_NF_LINE
+ }
+ // TODO: Pass max_symbol to Huffman table builder instead?
+ Utils.fillIntsWithZeroes(codeLengths, symbol, numSymbols);
+ }
+
+ static int checkDupes(int[] symbols, int length) {
+ for (int i = 0; i < length - 1; ++i) {
+ for (int j = i + 1; j < length; ++j) {
+ if (symbols[i] == symbols[j]) {
+ return 0;
+ }
+ }
+ }
+ return 1;
+ }
+
+ // TODO: Use specialized versions for smaller tables.
+ static void readHuffmanCode(int alphabetSize, int[] table, int offset, State s) {
+ int ok = 1;
+ int simpleCodeOrSkip;
+ BitReader.readMoreInput(s);
+ // TODO: Avoid allocation.
+ int[] codeLengths = new int[alphabetSize];
+ BitReader.fillBitWindow(s);
+ simpleCodeOrSkip = BitReader.readFewBits(s, 2);
+ if (simpleCodeOrSkip == 1) { // Read symbols, codes & code lengths directly.
+ int maxBitsCounter = alphabetSize - 1;
+ int maxBits = 0;
+ int[] symbols = new int[4];
+ int numSymbols = BitReader.readFewBits(s, 2) + 1;
+ while (maxBitsCounter != 0) {
+ maxBitsCounter >>= 1;
+ maxBits++;
+ }
+ // TODO: uncomment when codeLengths is reused.
+ // Utils.fillWithZeroes(codeLengths, 0, alphabetSize);
+ for (int i = 0; i < numSymbols; i++) {
+ BitReader.fillBitWindow(s);
+ symbols[i] = BitReader.readFewBits(s, maxBits) % alphabetSize;
+ codeLengths[symbols[i]] = 2;
+ }
+ codeLengths[symbols[0]] = 1;
+ switch (numSymbols) {
+ case 2:
+ codeLengths[symbols[1]] = 1;
+ break;
+ case 4:
+ if (BitReader.readFewBits(s, 1) == 1) {
+ codeLengths[symbols[2]] = 3;
+ codeLengths[symbols[3]] = 3;
+ } else {
+ codeLengths[symbols[0]] = 2;
+ }
+ break;
+ default:
+ break;
+ }
+ ok = checkDupes(symbols, numSymbols);
+ } else { // Decode Huffman-coded code lengths.
+ int[] codeLengthCodeLengths = new int[CODE_LENGTH_CODES];
+ int space = 32;
+ int numCodes = 0;
+ for (int i = simpleCodeOrSkip; i < CODE_LENGTH_CODES && space > 0; i++) {
+ int codeLenIdx = CODE_LENGTH_CODE_ORDER[i];
+ BitReader.fillBitWindow(s);
+ int p = BitReader.peekBits(s) & 15;
+ // TODO: Demultiplex FIXED_TABLE.
+ s.bitOffset += FIXED_TABLE[p] >> 16;
+ int v = FIXED_TABLE[p] & 0xFFFF;
+ codeLengthCodeLengths[codeLenIdx] = v;
+ if (v != 0) {
+ space -= (32 >> v);
+ numCodes++;
+ }
+ }
+ if (space != 0 && numCodes != 1) {
+ ok = 0;
+ }
+ readHuffmanCodeLengths(codeLengthCodeLengths, alphabetSize, codeLengths, s);
+ }
+ if (ok == 0) {
+ throw new BrotliRuntimeException("Can't readHuffmanCode"); // COV_NF_LINE
+ }
+ Huffman.buildHuffmanTable(table, offset, HUFFMAN_TABLE_BITS, codeLengths, alphabetSize);
+ }
+
+ private static int decodeContextMap(int contextMapSize, byte[] contextMap, State s) {
+ BitReader.readMoreInput(s);
+ int numTrees = decodeVarLenUnsignedByte(s) + 1;
+
+ if (numTrees == 1) {
+ Utils.fillBytesWithZeroes(contextMap, 0, contextMapSize);
+ return numTrees;
+ }
+
+ BitReader.fillBitWindow(s);
+ int useRleForZeros = BitReader.readFewBits(s, 1);
+ int maxRunLengthPrefix = 0;
+ if (useRleForZeros != 0) {
+ maxRunLengthPrefix = BitReader.readFewBits(s, 4) + 1;
+ }
+ int[] table = new int[HUFFMAN_TABLE_SIZE];
+ readHuffmanCode(numTrees + maxRunLengthPrefix, table, 0, s);
+ for (int i = 0; i < contextMapSize; ) {
+ BitReader.readMoreInput(s);
+ BitReader.fillBitWindow(s);
+ int code = readSymbol(table, 0, s);
+ if (code == 0) {
+ contextMap[i] = 0;
+ i++;
+ } else if (code <= maxRunLengthPrefix) {
+ BitReader.fillBitWindow(s);
+ int reps = (1 << code) + BitReader.readFewBits(s, code);
+ while (reps != 0) {
+ if (i >= contextMapSize) {
+ throw new BrotliRuntimeException("Corrupted context map"); // COV_NF_LINE
+ }
+ contextMap[i] = 0;
+ i++;
+ reps--;
+ }
+ } else {
+ contextMap[i] = (byte) (code - maxRunLengthPrefix);
+ i++;
+ }
+ }
+ BitReader.fillBitWindow(s);
+ if (BitReader.readFewBits(s, 1) == 1) {
+ inverseMoveToFrontTransform(contextMap, contextMapSize);
+ }
+ return numTrees;
+ }
+
+ private static int decodeBlockTypeAndLength(State s, int treeType, int numBlockTypes) {
+ final int[] ringBuffers = s.rings;
+ final int offset = 4 + treeType * 2;
+ BitReader.fillBitWindow(s);
+ int blockType = readSymbol(s.blockTrees, treeType * HUFFMAN_TABLE_SIZE, s);
+ int result = readBlockLength(s.blockTrees, (treeType + 3) * HUFFMAN_TABLE_SIZE, s);
+
+ if (blockType == 1) {
+ blockType = ringBuffers[offset + 1] + 1;
+ } else if (blockType == 0) {
+ blockType = ringBuffers[offset];
+ } else {
+ blockType -= 2;
+ }
+ if (blockType >= numBlockTypes) {
+ blockType -= numBlockTypes;
+ }
+ ringBuffers[offset] = ringBuffers[offset + 1];
+ ringBuffers[offset + 1] = blockType;
+ return result;
+ }
+
+ private static void decodeLiteralBlockSwitch(State s) {
+ s.literalBlockLength = decodeBlockTypeAndLength(s, 0, s.numLiteralBlockTypes);
+ int literalBlockType = s.rings[5];
+ s.contextMapSlice = literalBlockType << LITERAL_CONTEXT_BITS;
+ s.literalTreeIndex = s.contextMap[s.contextMapSlice] & 0xFF;
+ s.literalTree = s.hGroup0[s.literalTreeIndex];
+ int contextMode = s.contextModes[literalBlockType];
+ s.contextLookupOffset1 = contextMode << 9;
+ s.contextLookupOffset2 = s.contextLookupOffset1 + 256;
+ }
+
+ private static void decodeCommandBlockSwitch(State s) {
+ s.commandBlockLength = decodeBlockTypeAndLength(s, 1, s.numCommandBlockTypes);
+ s.treeCommandOffset = s.hGroup1[s.rings[7]];
+ }
+
+ private static void decodeDistanceBlockSwitch(State s) {
+ s.distanceBlockLength = decodeBlockTypeAndLength(s, 2, s.numDistanceBlockTypes);
+ s.distContextMapSlice = s.rings[9] << DISTANCE_CONTEXT_BITS;
+ }
+
+ private static void maybeReallocateRingBuffer(State s) {
+ int newSize = s.maxRingBufferSize;
+ if (newSize > s.expectedTotalSize) {
+ /* TODO: Handle 2GB+ cases more gracefully. */
+ int minimalNewSize = s.expectedTotalSize;
+ while ((newSize >> 1) > minimalNewSize) {
+ newSize >>= 1;
+ }
+ if ((s.inputEnd == 0) && newSize < 16384 && s.maxRingBufferSize >= 16384) {
+ newSize = 16384;
+ }
+ }
+ if (newSize <= s.ringBufferSize) {
+ return;
+ }
+ int ringBufferSizeWithSlack = newSize + MAX_TRANSFORMED_WORD_LENGTH;
+ byte[] newBuffer = new byte[ringBufferSizeWithSlack];
+ if (s.ringBuffer.length != 0) {
+ System.arraycopy(s.ringBuffer, 0, newBuffer, 0, s.ringBufferSize);
+ }
+ s.ringBuffer = newBuffer;
+ s.ringBufferSize = newSize;
+ }
+
+ private static void readNextMetablockHeader(State s) {
+ if (s.inputEnd != 0) {
+ s.nextRunningState = FINISHED;
+ s.bytesToWrite = s.pos;
+ s.bytesWritten = 0;
+ s.runningState = WRITE;
+ return;
+ }
+ // TODO: Reset? Do we need this?
+ s.hGroup0 = new int[0];
+ s.hGroup1 = new int[0];
+ s.hGroup2 = new int[0];
+
+ BitReader.readMoreInput(s);
+ decodeMetaBlockLength(s);
+ if ((s.metaBlockLength == 0) && (s.isMetadata == 0)) {
+ return;
+ }
+ if ((s.isUncompressed != 0) || (s.isMetadata != 0)) {
+ BitReader.jumpToByteBoundary(s);
+ s.runningState = (s.isMetadata != 0) ? READ_METADATA : COPY_UNCOMPRESSED;
+ } else {
+ s.runningState = COMPRESSED_BLOCK_START;
+ }
+
+ if (s.isMetadata != 0) {
+ return;
+ }
+ s.expectedTotalSize += s.metaBlockLength;
+ if (s.expectedTotalSize > 1 << 30) {
+ s.expectedTotalSize = 1 << 30;
+ }
+ if (s.ringBufferSize < s.maxRingBufferSize) {
+ maybeReallocateRingBuffer(s);
+ }
+ }
+
+ private static int readMetablockPartition(State s, int treeType, int numBlockTypes) {
+ if (numBlockTypes <= 1) {
+ return 1 << 28;
+ }
+ readHuffmanCode(numBlockTypes + 2, s.blockTrees, treeType * HUFFMAN_TABLE_SIZE, s);
+ readHuffmanCode(NUM_BLOCK_LENGTH_CODES, s.blockTrees, (treeType + 3) * HUFFMAN_TABLE_SIZE, s);
+ return readBlockLength(s.blockTrees, (treeType + 3) * HUFFMAN_TABLE_SIZE, s);
+ }
+
+ private static void readMetablockHuffmanCodesAndContextMaps(State s) {
+ s.numLiteralBlockTypes = decodeVarLenUnsignedByte(s) + 1;
+ s.literalBlockLength = readMetablockPartition(s, 0, s.numLiteralBlockTypes);
+ s.numCommandBlockTypes = decodeVarLenUnsignedByte(s) + 1;
+ s.commandBlockLength = readMetablockPartition(s, 1, s.numCommandBlockTypes);
+ s.numDistanceBlockTypes = decodeVarLenUnsignedByte(s) + 1;
+ s.distanceBlockLength = readMetablockPartition(s, 2, s.numDistanceBlockTypes);
+
+ BitReader.readMoreInput(s);
+ BitReader.fillBitWindow(s);
+ s.distancePostfixBits = BitReader.readFewBits(s, 2);
+ s.numDirectDistanceCodes =
+ NUM_DISTANCE_SHORT_CODES + (BitReader.readFewBits(s, 4) << s.distancePostfixBits);
+ s.distancePostfixMask = (1 << s.distancePostfixBits) - 1;
+ int numDistanceCodes = s.numDirectDistanceCodes + (48 << s.distancePostfixBits);
+ // TODO: Reuse?
+ s.contextModes = new byte[s.numLiteralBlockTypes];
+ for (int i = 0; i < s.numLiteralBlockTypes;) {
+ /* Ensure that less than 256 bits read between readMoreInput. */
+ int limit = Math.min(i + 96, s.numLiteralBlockTypes);
+ for (; i < limit; ++i) {
+ BitReader.fillBitWindow(s);
+ s.contextModes[i] = (byte) (BitReader.readFewBits(s, 2));
+ }
+ BitReader.readMoreInput(s);
+ }
+
+ // TODO: Reuse?
+ s.contextMap = new byte[s.numLiteralBlockTypes << LITERAL_CONTEXT_BITS];
+ int numLiteralTrees = decodeContextMap(s.numLiteralBlockTypes << LITERAL_CONTEXT_BITS,
+ s.contextMap, s);
+ s.trivialLiteralContext = 1;
+ for (int j = 0; j < s.numLiteralBlockTypes << LITERAL_CONTEXT_BITS; j++) {
+ if (s.contextMap[j] != j >> LITERAL_CONTEXT_BITS) {
+ s.trivialLiteralContext = 0;
+ break;
+ }
+ }
+
+ // TODO: Reuse?
+ s.distContextMap = new byte[s.numDistanceBlockTypes << DISTANCE_CONTEXT_BITS];
+ int numDistTrees = decodeContextMap(s.numDistanceBlockTypes << DISTANCE_CONTEXT_BITS,
+ s.distContextMap, s);
+
+ s.hGroup0 = decodeHuffmanTreeGroup(NUM_LITERAL_CODES, numLiteralTrees, s);
+ s.hGroup1 =
+ decodeHuffmanTreeGroup(NUM_INSERT_AND_COPY_CODES, s.numCommandBlockTypes, s);
+ s.hGroup2 = decodeHuffmanTreeGroup(numDistanceCodes, numDistTrees, s);
+
+ s.contextMapSlice = 0;
+ s.distContextMapSlice = 0;
+ s.contextLookupOffset1 = (int) (s.contextModes[0]) << 9;
+ s.contextLookupOffset2 = s.contextLookupOffset1 + 256;
+ s.literalTreeIndex = 0;
+ s.literalTree = s.hGroup0[0];
+ s.treeCommandOffset = s.hGroup1[0];
+
+ s.rings[4] = 1;
+ s.rings[5] = 0;
+ s.rings[6] = 1;
+ s.rings[7] = 0;
+ s.rings[8] = 1;
+ s.rings[9] = 0;
+ }
+
+ private static void copyUncompressedData(State s) {
+ final byte[] ringBuffer = s.ringBuffer;
+
+ // Could happen if block ends at ring buffer end.
+ if (s.metaBlockLength <= 0) {
+ BitReader.reload(s);
+ s.runningState = BLOCK_START;
+ return;
+ }
+
+ int chunkLength = Math.min(s.ringBufferSize - s.pos, s.metaBlockLength);
+ BitReader.copyBytes(s, ringBuffer, s.pos, chunkLength);
+ s.metaBlockLength -= chunkLength;
+ s.pos += chunkLength;
+ if (s.pos == s.ringBufferSize) {
+ s.nextRunningState = COPY_UNCOMPRESSED;
+ s.bytesToWrite = s.ringBufferSize;
+ s.bytesWritten = 0;
+ s.runningState = WRITE;
+ return;
+ }
+
+ BitReader.reload(s);
+ s.runningState = BLOCK_START;
+ }
+
+ private static int writeRingBuffer(State s) {
+ int toWrite = Math.min(s.outputLength - s.outputUsed,
+ s.bytesToWrite - s.bytesWritten);
+ if (toWrite != 0) {
+ System.arraycopy(s.ringBuffer, s.bytesWritten, s.output,
+ s.outputOffset + s.outputUsed, toWrite);
+ s.outputUsed += toWrite;
+ s.bytesWritten += toWrite;
+ }
+
+ if (s.outputUsed < s.outputLength) {
+ return 1;
+ } else {
+ return 0;
+ }
+ }
+
+ private static int[] decodeHuffmanTreeGroup(int alphabetSize, int n, State s) {
+ int[] group = new int[n + (n * HUFFMAN_TABLE_SIZE)];
+ int next = n;
+ for (int i = 0; i < n; i++) {
+ group[i] = next;
+ Decode.readHuffmanCode(alphabetSize, group, next, s);
+ next += HUFFMAN_TABLE_SIZE;
+ }
+ return group;
+ }
+
+ /**
+ * Actual decompress implementation.
+ */
+ static void decompress(State s) {
+ if (s.runningState == UNINITIALIZED) {
+ throw new IllegalStateException("Can't decompress until initialized");
+ }
+ if (s.runningState == CLOSED) {
+ throw new IllegalStateException("Can't decompress after close");
+ }
+ int ringBufferMask = s.ringBufferSize - 1;
+ byte[] ringBuffer = s.ringBuffer;
+
+ while (s.runningState != FINISHED) {
+ // TODO: extract cases to methods for the better readability.
+ switch (s.runningState) {
+ case BLOCK_START:
+ if (s.metaBlockLength < 0) {
+ throw new BrotliRuntimeException("Invalid metablock length");
+ }
+ readNextMetablockHeader(s);
+ /* Ring-buffer would be reallocated here. */
+ ringBufferMask = s.ringBufferSize - 1;
+ ringBuffer = s.ringBuffer;
+ continue;
+
+ case COMPRESSED_BLOCK_START:
+ readMetablockHuffmanCodesAndContextMaps(s);
+ s.runningState = MAIN_LOOP;
+ // Fall through
+
+ case MAIN_LOOP:
+ if (s.metaBlockLength <= 0) {
+ s.runningState = BLOCK_START;
+ continue;
+ }
+ BitReader.readMoreInput(s);
+ if (s.commandBlockLength == 0) {
+ decodeCommandBlockSwitch(s);
+ }
+ s.commandBlockLength--;
+ BitReader.fillBitWindow(s);
+ int cmdCode = readSymbol(s.hGroup1, s.treeCommandOffset, s);
+ int rangeIdx = cmdCode >>> 6;
+ s.distanceCode = 0;
+ if (rangeIdx >= 2) {
+ rangeIdx -= 2;
+ s.distanceCode = -1;
+ }
+ int insertCode = INSERT_RANGE_LUT[rangeIdx] + ((cmdCode >>> 3) & 7);
+ BitReader.fillBitWindow(s);
+ int insertBits = INSERT_LENGTH_N_BITS[insertCode];
+ int insertExtra = BitReader.readBits(s, insertBits);
+ s.insertLength = INSERT_LENGTH_OFFSET[insertCode] + insertExtra;
+ int copyCode = COPY_RANGE_LUT[rangeIdx] + (cmdCode & 7);
+ BitReader.fillBitWindow(s);
+ int copyBits = COPY_LENGTH_N_BITS[copyCode];
+ int copyExtra = BitReader.readBits(s, copyBits);
+ s.copyLength = COPY_LENGTH_OFFSET[copyCode] + copyExtra;
+
+ s.j = 0;
+ s.runningState = INSERT_LOOP;
+
+ // Fall through
+ case INSERT_LOOP:
+ if (s.trivialLiteralContext != 0) {
+ while (s.j < s.insertLength) {
+ BitReader.readMoreInput(s);
+ if (s.literalBlockLength == 0) {
+ decodeLiteralBlockSwitch(s);
+ }
+ s.literalBlockLength--;
+ BitReader.fillBitWindow(s);
+ ringBuffer[s.pos] =
+ (byte) readSymbol(s.hGroup0, s.literalTree, s);
+ s.j++;
+ if (s.pos++ == ringBufferMask) {
+ s.nextRunningState = INSERT_LOOP;
+ s.bytesToWrite = s.ringBufferSize;
+ s.bytesWritten = 0;
+ s.runningState = WRITE;
+ break;
+ }
+ }
+ } else {
+ int prevByte1 = ringBuffer[(s.pos - 1) & ringBufferMask] & 0xFF;
+ int prevByte2 = ringBuffer[(s.pos - 2) & ringBufferMask] & 0xFF;
+ while (s.j < s.insertLength) {
+ BitReader.readMoreInput(s);
+ if (s.literalBlockLength == 0) {
+ decodeLiteralBlockSwitch(s);
+ }
+ int literalTreeIndex = s.contextMap[s.contextMapSlice
+ + (Context.LOOKUP[s.contextLookupOffset1 + prevByte1]
+ | Context.LOOKUP[s.contextLookupOffset2 + prevByte2])] & 0xFF;
+ s.literalBlockLength--;
+ prevByte2 = prevByte1;
+ BitReader.fillBitWindow(s);
+ prevByte1 = readSymbol(
+ s.hGroup0, s.hGroup0[literalTreeIndex], s);
+ ringBuffer[s.pos] = (byte) prevByte1;
+ s.j++;
+ if (s.pos++ == ringBufferMask) {
+ s.nextRunningState = INSERT_LOOP;
+ s.bytesToWrite = s.ringBufferSize;
+ s.bytesWritten = 0;
+ s.runningState = WRITE;
+ break;
+ }
+ }
+ }
+ if (s.runningState != INSERT_LOOP) {
+ continue;
+ }
+ s.metaBlockLength -= s.insertLength;
+ if (s.metaBlockLength <= 0) {
+ s.runningState = MAIN_LOOP;
+ continue;
+ }
+ if (s.distanceCode < 0) {
+ BitReader.readMoreInput(s);
+ if (s.distanceBlockLength == 0) {
+ decodeDistanceBlockSwitch(s);
+ }
+ s.distanceBlockLength--;
+ BitReader.fillBitWindow(s);
+ s.distanceCode = readSymbol(s.hGroup2, s.hGroup2[
+ s.distContextMap[s.distContextMapSlice
+ + (s.copyLength > 4 ? 3 : s.copyLength - 2)] & 0xFF], s);
+ if (s.distanceCode >= s.numDirectDistanceCodes) {
+ s.distanceCode -= s.numDirectDistanceCodes;
+ int postfix = s.distanceCode & s.distancePostfixMask;
+ s.distanceCode >>>= s.distancePostfixBits;
+ int n = (s.distanceCode >>> 1) + 1;
+ int offset = ((2 + (s.distanceCode & 1)) << n) - 4;
+ BitReader.fillBitWindow(s);
+ int distanceExtra = BitReader.readBits(s, n);
+ s.distanceCode = s.numDirectDistanceCodes + postfix
+ + ((offset + distanceExtra) << s.distancePostfixBits);
+ }
+ }
+
+ // Convert the distance code to the actual distance by possibly looking up past distances
+ // from the ringBuffer.
+ s.distance = translateShortCodes(s.distanceCode, s.rings, s.distRbIdx);
+ if (s.distance < 0) {
+ throw new BrotliRuntimeException("Negative distance"); // COV_NF_LINE
+ }
+
+ if (s.maxDistance != s.maxBackwardDistance
+ && s.pos < s.maxBackwardDistance) {
+ s.maxDistance = s.pos;
+ } else {
+ s.maxDistance = s.maxBackwardDistance;
+ }
+
+ s.copyDst = s.pos;
+ if (s.distance > s.maxDistance) {
+ s.runningState = TRANSFORM;
+ continue;
+ }
+
+ if (s.distanceCode > 0) {
+ s.rings[s.distRbIdx & 3] = s.distance;
+ s.distRbIdx++;
+ }
+
+ if (s.copyLength > s.metaBlockLength) {
+ throw new BrotliRuntimeException("Invalid backward reference"); // COV_NF_LINE
+ }
+ s.j = 0;
+ s.runningState = COPY_LOOP;
+ // fall through
+ case COPY_LOOP:
+ int src = (s.pos - s.distance) & ringBufferMask;
+ int dst = s.pos;
+ int copyLength = s.copyLength - s.j;
+ int srcEnd = src + copyLength;
+ int dstEnd = dst + copyLength;
+ if ((srcEnd < ringBufferMask) && (dstEnd < ringBufferMask)) {
+ if (copyLength < 12 || (srcEnd > dst && dstEnd > src)) {
+ for (int k = 0; k < copyLength; ++k) {
+ ringBuffer[dst++] = ringBuffer[src++];
+ }
+ } else {
+ Utils.copyBytesWithin(ringBuffer, dst, src, srcEnd);
+ }
+ s.j += copyLength;
+ s.metaBlockLength -= copyLength;
+ s.pos += copyLength;
+ } else {
+ for (; s.j < s.copyLength;) {
+ ringBuffer[s.pos] =
+ ringBuffer[(s.pos - s.distance) & ringBufferMask];
+ s.metaBlockLength--;
+ s.j++;
+ if (s.pos++ == ringBufferMask) {
+ s.nextRunningState = COPY_LOOP;
+ s.bytesToWrite = s.ringBufferSize;
+ s.bytesWritten = 0;
+ s.runningState = WRITE;
+ break;
+ }
+ }
+ }
+ if (s.runningState == COPY_LOOP) {
+ s.runningState = MAIN_LOOP;
+ }
+ continue;
+
+ case TRANSFORM:
+ if (s.copyLength >= MIN_WORD_LENGTH
+ && s.copyLength <= MAX_WORD_LENGTH) {
+ int offset = DICTIONARY_OFFSETS_BY_LENGTH[s.copyLength];
+ int wordId = s.distance - s.maxDistance - 1;
+ int shift = DICTIONARY_SIZE_BITS_BY_LENGTH[s.copyLength];
+ int mask = (1 << shift) - 1;
+ int wordIdx = wordId & mask;
+ int transformIdx = wordId >>> shift;
+ offset += wordIdx * s.copyLength;
+ if (transformIdx < Transform.NUM_TRANSFORMS) {
+ int len = Transform.transformDictionaryWord(ringBuffer, s.copyDst,
+ Dictionary.getData(), offset, s.copyLength, transformIdx);
+ s.copyDst += len;
+ s.pos += len;
+ s.metaBlockLength -= len;
+ if (s.copyDst >= s.ringBufferSize) {
+ s.nextRunningState = COPY_WRAP_BUFFER;
+ s.bytesToWrite = s.ringBufferSize;
+ s.bytesWritten = 0;
+ s.runningState = WRITE;
+ continue;
+ }
+ } else {
+ throw new BrotliRuntimeException("Invalid backward reference"); // COV_NF_LINE
+ }
+ } else {
+ throw new BrotliRuntimeException("Invalid backward reference"); // COV_NF_LINE
+ }
+ s.runningState = MAIN_LOOP;
+ continue;
+
+ case COPY_WRAP_BUFFER:
+ Utils.copyBytesWithin(ringBuffer, 0, s.ringBufferSize, s.copyDst);
+ s.runningState = MAIN_LOOP;
+ continue;
+
+ case READ_METADATA:
+ while (s.metaBlockLength > 0) {
+ BitReader.readMoreInput(s);
+ // Optimize
+ BitReader.fillBitWindow(s);
+ BitReader.readFewBits(s, 8);
+ s.metaBlockLength--;
+ }
+ s.runningState = BLOCK_START;
+ continue;
+
+
+ case COPY_UNCOMPRESSED:
+ copyUncompressedData(s);
+ continue;
+
+ case WRITE:
+ if (writeRingBuffer(s) == 0) {
+ // Output buffer is full.
+ return;
+ }
+ if (s.pos >= s.maxBackwardDistance) {
+ s.maxDistance = s.maxBackwardDistance;
+ }
+ s.pos &= ringBufferMask;
+ s.runningState = s.nextRunningState;
+ continue;
+
+ default:
+ throw new BrotliRuntimeException("Unexpected state " + s.runningState);
+ }
+ }
+ if (s.runningState == FINISHED) {
+ if (s.metaBlockLength < 0) {
+ throw new BrotliRuntimeException("Invalid metablock length");
+ }
+ BitReader.jumpToByteBoundary(s);
+ BitReader.checkHealth(s, 1);
+ }
+ }
+}
diff --git a/src/net/sourceforge/plantuml/brotli/Dictionary.java b/src/net/sourceforge/plantuml/brotli/Dictionary.java
new file mode 100644
index 0000000..53f484f
--- /dev/null
+++ b/src/net/sourceforge/plantuml/brotli/Dictionary.java
@@ -0,0 +1,54 @@
+/* Copyright 2015 Google Inc. All Rights Reserved.
+
+ Distributed under MIT license.
+ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+
+package net.sourceforge.plantuml.brotli;
+
+import java.nio.ByteBuffer;
+
+/**
+ * Collection of static dictionary words.
+ *
+ * <p>Dictionary content is loaded from binary resource when {@link #getData()} is executed for the
+ * first time. Consequently, it saves memory and CPU in case dictionary is not required.
+ *
+ * <p>One possible drawback is that multiple threads that need dictionary data may be blocked (only
+ * once in each classworld). To avoid this, it is enough to call {@link #getData()} proactively.
+ */
+public final class Dictionary {
+ private static volatile ByteBuffer data;
+
+ private static class DataLoader {
+ static final boolean OK;
+
+ static {
+ boolean ok = true;
+ try {
+ Class.forName(Dictionary.class.getPackage().getName() + ".DictionaryData");
+ } catch (Throwable ex) {
+ ok = false;
+ }
+ OK = ok;
+ }
+ }
+
+ public static void setData(ByteBuffer data) {
+ if (!data.isDirect() || !data.isReadOnly()) {
+ throw new BrotliRuntimeException("data must be a direct read-only byte buffer");
+ }
+ Dictionary.data = data;
+ }
+
+ public static ByteBuffer getData() {
+ if (data != null) {
+ return data;
+ }
+ if (!DataLoader.OK) {
+ throw new BrotliRuntimeException("brotli dictionary is not set");
+ }
+ /* Might have been set when {@link DictionaryData} was loaded.*/
+ return data;
+ }
+}
diff --git a/src/net/sourceforge/plantuml/brotli/DictionaryData.java b/src/net/sourceforge/plantuml/brotli/DictionaryData.java
new file mode 100644
index 0000000..1aab2c6
--- /dev/null
+++ b/src/net/sourceforge/plantuml/brotli/DictionaryData.java
@@ -0,0 +1,55 @@
+/* Copyright 2015 Google Inc. All Rights Reserved.
+
+ Distributed under MIT license.
+ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+
+package net.sourceforge.plantuml.brotli;
+
+import java.nio.ByteBuffer;
+
+/**
+ * Built-in dictionary data.
+ *
+ * When this class is loaded, it sets its data: {@link Dictionary#setData(ByteBuffer)}.
+ */
+final class DictionaryData {
+ private static final String DATA0 = "timedownlifeleftbackcodedatashowonlysitecityopenjustlikefreeworktextyearoverbodyloveformbookplaylivelinehelphomesidemorewordlongthemviewfindpagedaysfullheadtermeachareafromtruemarkableuponhighdatelandnewsevennextcasebothpostusedmadehandherewhatnameLinkblogsizebaseheldmakemainuser') +holdendswithNewsreadweresigntakehavegameseencallpathwellplusmenufilmpartjointhislistgoodneedwayswestjobsmindalsologorichuseslastteamarmyfoodkingwilleastwardbestfirePageknowaway.pngmovethanloadgiveselfnotemuchfeedmanyrockicononcelookhidediedHomerulehostajaxinfoclublawslesshalfsomesuchzone100%onescareTimeracebluefourweekfacehopegavehardlostwhenparkkeptpassshiproomHTMLplanTypedonesavekeepflaglinksoldfivetookratetownjumpthusdarkcardfilefearstaykillthatfallautoever.comtalkshopvotedeepmoderestturnbornbandfellroseurl(skinrolecomeactsagesmeetgold.jpgitemvaryfeltthensenddropViewcopy1.0\"</a>stopelseliestourpack.gifpastcss?graymean&gt;rideshotlatesaidroadvar feeljohnrickportfast'UA-dead</b>poorbilltypeU.S.woodmust2px;Inforankwidewantwalllead[0];paulwavesure$('#waitmassarmsgoesgainlangpaid!-- lockunitrootwalkfirmwifexml\"songtest20pxkindrowstoolfontmailsafestarmapscorerainflowbabyspansays4px;6px;artsfootrealwikiheatsteptriporg/lakeweaktoldFormcastfansbankveryrunsjulytask1px;goalgrewslowedgeid=\"sets5px;.js?40pxif (soonseatnonetubezerosentreedfactintogiftharm18pxcamehillboldzoomvoideasyringfillpeakinitcost3px;jacktagsbitsrolleditknewnear<!--growJSONdutyNamesaleyou lotspainjazzcoldeyesfishwww.risktabsprev10pxrise25pxBlueding300,ballfordearnwildbox.fairlackverspairjunetechif(!pickevil$(\"#warmlorddoespull,000ideadrawhugespotfundburnhrefcellkeystickhourlossfuel12pxsuitdealRSS\"agedgreyGET\"easeaimsgirlaids8px;navygridtips#999warsladycars); }php?helltallwhomzh:e*/\r\n 100hall.\n\nA7px;pushchat0px;crew*/</hash75pxflatrare && tellcampontolaidmissskiptentfinemalegetsplot400,\r\n\r\ncoolfeet.php<br>ericmostguidbelldeschairmathatom/img&#82luckcent000;tinygonehtmlselldrugFREEnodenick?id=losenullvastwindRSS wearrelybeensamedukenasacapewishgulfT23:hitsslotgatekickblurthey15px''););\">msiewinsbirdsortbetaseekT18:ordstreemall60pxfarmb\u0000\u0019sboys[0].');\"POSTbearkids);}}marytend(UK)quadzh:f-siz----prop');\rliftT19:viceandydebt>RSSpoolneckblowT16:doorevalT17:letsfailoralpollnovacolsgene b\u0000\u0014softrometillross<h3>pourfadepink<tr>mini)|!(minezh:hbarshear00);milk -->ironfreddiskwentsoilputs/js/holyT22:ISBNT20:adamsees<h2>json', 'contT21: RSSloopasiamoon</p>soulLINEfortcartT14:<h1>80px!--<9px;T04:mike:46ZniceinchYorkricezh:d'));puremageparatonebond:37Z_of_']);000,zh:gtankyardbowlbush:56ZJava30px\n|}\n%C3%:34ZjeffEXPIcashvisagolfsnowzh:iquer.csssickmeatmin.binddellhirepicsrent:36ZHTTP-201fotowolfEND xbox:54ZBODYdick;\n}\nexit:35Zvarsbeat'});diet999;anne}}</[i].LangkmB2wiretoysaddssealalex;\n\t}echonine.org005)tonyjewssandlegsroof000) 200winegeardogsbootgarycutstyletemption.xmlcockgang$('.50pxPh.Dmiscalanloandeskmileryanunixdisc);}\ndustclip).\n\n70px-200DVDs7]><tapedemoi++)wageeurophiloptsholeFAQsasin-26TlabspetsURL bulkcook;}\r\nHEAD[0])abbrjuan(198leshtwin</i>sonyguysfuckpipe|-\n!002)ndow[1];[];\nLog salt\r\n\t\tbangtrimbath){\r\n00px\n});ko:lfeesad>\rs:// [];tollplug(){\n{\r\n .js'200pdualboat.JPG);\n}quot);\n\n');\n\r\n}\r201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037201320122011201020092008200720062005200420032002200120001999199819971996199519941993199219911990198919881987198619851984198319821981198019791978197719761975197419731972197119701969196819671966196519641963196219611960195919581957195619551954195319521951195010001024139400009999comomC!sesteestaperotodohacecadaaC1obiendC-aasC-vidacasootroforosolootracualdijosidograntipotemadebealgoquC)estonadatrespococasabajotodasinoaguapuesunosantediceluisellamayozonaamorpisoobraclicellodioshoracasiP7P0P=P0P>P<Q\u0000P0Q\u0000Q\u0003Q\u0002P0P=P5P?P>P>Q\u0002P8P7P=P>P4P>Q\u0002P>P6P5P>P=P8Q\u0005P\u001DP0P5P5P1Q\u000BP<Q\u000BP\u0012Q\u000BQ\u0001P>P2Q\u000BP2P>P\u001DP>P>P1P\u001FP>P;P8P=P8P P$P\u001DP5P\u001CQ\u000BQ\u0002Q\u000BP\u001EP=P8P<P4P0P\u0017P0P\u0014P0P\u001DQ\u0003P\u001EP1Q\u0002P5P\u0018P7P5P9P=Q\u0003P<P<P\"Q\u000BQ\u0003P6Y\u0001Y\nX#Y\u0006Y\u0005X'Y\u0005X9Y\u0003Y\u0004X#Y\u0008X1X/Y\nX'Y\u0001Y\tY\u0007Y\u0008Y\u0004Y\u0005Y\u0004Y\u0003X'Y\u0008Y\u0004Y\u0007X(X3X'Y\u0004X%Y\u0006Y\u0007Y\nX#Y\nY\u0002X/Y\u0007Y\u0004X+Y\u0005X(Y\u0007Y\u0004Y\u0008Y\u0004Y\nX(Y\u0004X'Y\nX(Y\u0003X4Y\nX'Y\u0005X#Y\u0005Y\u0006X*X(Y\nY\u0004Y\u0006X-X(Y\u0007Y\u0005Y\u0005X4Y\u0008X4firstvideolightworldmediawhitecloseblackrightsmallbooksplacemusicfieldorderpointvalueleveltableboardhousegroupworksyearsstatetodaywaterstartstyledeathpowerphonenighterrorinputabouttermstitletoolseventlocaltimeslargewordsgamesshortspacefocusclearmodelblockguideradiosharewomenagainmoneyimagenamesyounglineslatercolorgreenfront&amp;watchforcepricerulesbeginaftervisitissueareasbelowindextotalhourslabelprintpressbuiltlinksspeedstudytradefoundsenseundershownformsrangeaddedstillmovedtakenaboveflashfixedoftenotherviewschecklegalriveritemsquickshapehumanexistgoingmoviethirdbasicpeacestagewidthloginideaswrotepagesusersdrivestorebreaksouthvoicesitesmonthwherebuildwhichearthforumthreesportpartyClicklowerlivesclasslayerentrystoryusagesoundcourtyour birthpopuptypesapplyImagebeinguppernoteseveryshowsmeansextramatchtrackknownearlybegansuperpapernorthlearngivennamedendedTermspartsGroupbrandusingwomanfalsereadyaudiotakeswhile.com/livedcasesdailychildgreatjudgethoseunitsneverbroadcoastcoverapplefilescyclesceneplansclickwritequeenpieceemailframeolderphotolimitcachecivilscaleenterthemetheretouchboundroyalaskedwholesincestock namefaithheartemptyofferscopeownedmightalbumthinkbloodarraymajortrustcanonunioncountvalidstoneStyleLoginhappyoccurleft:freshquitefilmsgradeneedsurbanfightbasishoverauto;route.htmlmixedfinalYour slidetopicbrownalonedrawnsplitreachRightdatesmarchquotegoodsLinksdoubtasyncthumballowchiefyouthnovel10px;serveuntilhandsCheckSpacequeryjamesequaltwice0,000Startpanelsongsroundeightshiftworthpostsleadsweeksavoidthesemilesplanesmartalphaplantmarksratesplaysclaimsalestextsstarswrong</h3>thing.org/multiheardPowerstandtokensolid(thisbringshipsstafftriedcallsfullyfactsagentThis //-->adminegyptEvent15px;Emailtrue\"crossspentblogsbox\">notedleavechinasizesguest</h4>robotheavytrue,sevengrandcrimesignsawaredancephase><!--en_US&#39;200px_namelatinenjoyajax.ationsmithU.S. holdspeterindianav\">chainscorecomesdoingpriorShare1990sromanlistsjapanfallstrialowneragree</h2>abusealertopera\"-//WcardshillsteamsPhototruthclean.php?saintmetallouismeantproofbriefrow\">genretrucklooksValueFrame.net/-->\n<try {\nvar makescostsplainadultquesttrainlaborhelpscausemagicmotortheir250pxleaststepsCountcouldglasssidesfundshotelawardmouthmovesparisgivesdutchtexasfruitnull,||[];top\">\n<!--POST\"ocean<br/>floorspeakdepth sizebankscatchchart20px;aligndealswould50px;url=\"parksmouseMost ...</amongbrainbody none;basedcarrydraftreferpage_home.meterdelaydreamprovejoint</tr>drugs<!-- aprilidealallenexactforthcodeslogicView seemsblankports (200saved_linkgoalsgrantgreekhomesringsrated30px;whoseparse();\" Blocklinuxjonespixel');\">);if(-leftdavidhorseFocusraiseboxesTrackement</em>bar\">.src=toweralt=\"cablehenry24px;setupitalysharpminortastewantsthis.resetwheelgirls/css/100%;clubsstuffbiblevotes 1000korea});\r\nbandsqueue= {};80px;cking{\r\n\t\taheadclockirishlike ratiostatsForm\"yahoo)[0];Aboutfinds</h1>debugtasksURL =cells})();12px;primetellsturns0x600.jpg\"spainbeachtaxesmicroangel--></giftssteve-linkbody.});\n\tmount (199FAQ</rogerfrankClass28px;feeds<h1><scotttests22px;drink) || lewisshall#039; for lovedwaste00px;ja:c\u0002simon<fontreplymeetsuntercheaptightBrand) != dressclipsroomsonkeymobilmain.Name platefunnytreescom/\"1.jpgwmodeparamSTARTleft idden, 201);\n}\nform.viruschairtransworstPagesitionpatch<!--\no-cacfirmstours,000 asiani++){adobe')[0]id=10both;menu .2.mi.png\"kevincoachChildbruce2.jpgURL)+.jpg|suitesliceharry120\" sweettr>\r\nname=diegopage swiss-->\n\n#fff;\">Log.com\"treatsheet) && 14px;sleepntentfiledja:c\u0003id=\"cName\"worseshots-box-delta\n&lt;bears:48Z<data-rural</a> spendbakershops= \"\";php\">ction13px;brianhellosize=o=%2F joinmaybe<img img\">, fjsimg\" \")[0]MTopBType\"newlyDanskczechtrailknows</h5>faq\">zh-cn10);\n-1\");type=bluestrulydavis.js';>\r\n<!steel you h2>\r\nform jesus100% menu.\r\n\t\r\nwalesrisksumentddingb-likteachgif\" vegasdanskeestishqipsuomisobredesdeentretodospuedeaC1osestC!tienehastaotrospartedondenuevohacerformamismomejormundoaquC-dC-assC3loayudafechatodastantomenosdatosotrassitiomuchoahoralugarmayorestoshorastenerantesfotosestaspaC-snuevasaludforosmedioquienmesespoderchileserC!vecesdecirjosC)estarventagrupohechoellostengoamigocosasnivelgentemismaairesjuliotemashaciafavorjuniolibrepuntobuenoautorabrilbuenatextomarzosaberlistaluegocC3moenerojuegoperC:haberestoynuncamujervalorfueralibrogustaigualvotoscasosguC-apuedosomosavisousteddebennochebuscafaltaeurosseriedichocursoclavecasasleC3nplazolargoobrasvistaapoyojuntotratavistocrearcampohemoscincocargopisosordenhacenC!readiscopedrocercapuedapapelmenorC:tilclarojorgecalleponertardenadiemarcasigueellassiglocochemotosmadreclaserestoniC1oquedapasarbancohijosviajepabloC)stevienereinodejarfondocanalnorteletracausatomarmanoslunesautosvillavendopesartipostengamarcollevapadreunidovamoszonasambosbandamariaabusomuchasubirriojavivirgradochicaallC-jovendichaestantalessalirsuelopesosfinesllamabuscoC)stalleganegroplazahumorpagarjuntadobleislasbolsabaC1ohablaluchaC\u0001readicenjugarnotasvalleallC!cargadolorabajoestC)gustomentemariofirmacostofichaplatahogarartesleyesaquelmuseobasespocosmitadcielochicomiedoganarsantoetapadebesplayaredessietecortecoreadudasdeseoviejodeseaaguas&quot;domaincommonstatuseventsmastersystemactionbannerremovescrollupdateglobalmediumfilternumberchangeresultpublicscreenchoosenormaltravelissuessourcetargetspringmodulemobileswitchphotosborderregionitselfsocialactivecolumnrecordfollowtitle>eitherlengthfamilyfriendlayoutauthorcreatereviewsummerserverplayedplayerexpandpolicyformatdoublepointsseriespersonlivingdesignmonthsforcesuniqueweightpeopleenergynaturesearchfigurehavingcustomoffsetletterwindowsubmitrendergroupsuploadhealthmethodvideosschoolfutureshadowdebatevaluesObjectothersrightsleaguechromesimplenoticesharedendingseasonreportonlinesquarebuttonimagesenablemovinglatestwinterFranceperiodstrongrepeatLondondetailformeddemandsecurepassedtoggleplacesdevicestaticcitiesstreamyellowattackstreetflighthiddeninfo\">openedusefulvalleycausesleadersecretseconddamagesportsexceptratingsignedthingseffectfieldsstatesofficevisualeditorvolumeReportmuseummoviesparentaccessmostlymother\" id=\"marketgroundchancesurveybeforesymbolmomentspeechmotioninsidematterCenterobjectexistsmiddleEuropegrowthlegacymannerenoughcareeransweroriginportalclientselectrandomclosedtopicscomingfatheroptionsimplyraisedescapechosenchurchdefinereasoncorneroutputmemoryiframepolicemodelsNumberduringoffersstyleskilledlistedcalledsilvermargindeletebetterbrowselimitsGlobalsinglewidgetcenterbudgetnowrapcreditclaimsenginesafetychoicespirit-stylespreadmakingneededrussiapleaseextentScriptbrokenallowschargedividefactormember-basedtheoryconfigaroundworkedhelpedChurchimpactshouldalwayslogo\" bottomlist\">){var prefixorangeHeader.push(couplegardenbridgelaunchReviewtakingvisionlittledatingButtonbeautythemesforgotSearchanchoralmostloadedChangereturnstringreloadMobileincomesupplySourceordersviewed&nbsp;courseAbout island<html cookiename=\"amazonmodernadvicein</a>: The dialoghousesBEGIN MexicostartscentreheightaddingIslandassetsEmpireSchooleffortdirectnearlymanualSelect.\n\nOnejoinedmenu\">PhilipawardshandleimportOfficeregardskillsnationSportsdegreeweekly (e.g.behinddoctorloggedunited</b></beginsplantsassistartistissued300px|canadaagencyschemeremainBrazilsamplelogo\">beyond-scaleacceptservedmarineFootercamera</h1>\n_form\"leavesstress\" />\r\n.gif\" onloadloaderOxfordsistersurvivlistenfemaleDesignsize=\"appealtext\">levelsthankshigherforcedanimalanyoneAfricaagreedrecentPeople<br />wonderpricesturned|| {};main\">inlinesundaywrap\">failedcensusminutebeaconquotes150px|estateremoteemail\"linkedright;signalformal1.htmlsignupprincefloat:.png\" forum.AccesspaperssoundsextendHeightsliderUTF-8\"&amp; Before. WithstudioownersmanageprofitjQueryannualparamsboughtfamousgooglelongeri++) {israelsayingdecidehome\">headerensurebranchpiecesblock;statedtop\"><racingresize--&gt;pacitysexualbureau.jpg\" 10,000obtaintitlesamount, Inc.comedymenu\" lyricstoday.indeedcounty_logo.FamilylookedMarketlse ifPlayerturkey);var forestgivingerrorsDomain}else{insertBlog</footerlogin.fasteragents<body 10px 0pragmafridayjuniordollarplacedcoversplugin5,000 page\">boston.test(avatartested_countforumsschemaindex,filledsharesreaderalert(appearSubmitline\">body\">\n* TheThoughseeingjerseyNews</verifyexpertinjurywidth=CookieSTART across_imagethreadnativepocketbox\">\nSystem DavidcancertablesprovedApril reallydriveritem\">more\">boardscolorscampusfirst || [];media.guitarfinishwidth:showedOther .php\" assumelayerswilsonstoresreliefswedenCustomeasily your String\n\nWhiltaylorclear:resortfrenchthough\") + \"<body>buyingbrandsMembername\">oppingsector5px;\">vspacepostermajor coffeemartinmaturehappen</nav>kansaslink\">Images=falsewhile hspace0&amp; \n\nIn powerPolski-colorjordanBottomStart -count2.htmlnews\">01.jpgOnline-rightmillerseniorISBN 00,000 guidesvalue)ectionrepair.xml\" rights.html-blockregExp:hoverwithinvirginphones</tr>\rusing \n\tvar >');\n\t</td>\n</tr>\nbahasabrasilgalegomagyarpolskisrpskiX1X/Y\u0008d8-f\u0016\u0007g.\u0000d=\u0013g9\u0001i+\u0014d?!f\u0001/d8-e\u001B=f\u0008\u0011d;,d8\u0000d8*e\u0005,e\u000F8g.!g\u0010\u0006h.:e\u001D\u001Be\u000F/d;%f\u001C\re\n!f\u00176i\u00174d8*d::d:'e\u0013\u0001h\u0007*e71d<\u0001d8\u001Af\u001F%g\u001C\u000Be7%d=\u001Ch\u0001\u0014g3;f2!f\u001C\tg=\u0011g+\u0019f\t\u0000f\u001C\th/\u0004h.:d8-e?\u0003f\u0016\u0007g+ g\u0014(f\u00087i&\u0016i!5d=\u001Ch\u0000\u0005f\n\u0000f\u001C/i\u0017.i\"\u0018g\u001B8e\u00053d8\u000Bh==f\u0010\u001Cg4\"d=?g\u0014(h=/d;6e\u001C(g:?d8;i\"\u0018h5\u0004f\u0016\u0019h'\u0006i\"\u0011e\u001B\u001Ee$\rf3(e\u0006\u000Cg=\u0011g;\u001Cf\u00146h\u0017\u000Fe\u0006\u0005e.9f\u000E(h\r\u0010e8\u0002e\u001C:f6\u0008f\u0001/g):i\u00174e\u000F\u0011e8\u0003d;\u0000d9\u0008e%=e\u000F\u000Bg\u0014\u001Ff4;e\u001B>g\t\u0007e\u000F\u0011e1\u0015e&\u0002f\u001E\u001Cf\t\u000Bf\u001C:f\u00160i\u0017;f\u001C\u0000f\u00160f\u00169e<\u000Fe\u000C\u0017d:,f\u000F\u0010d>\u001Be\u00053d:\u000Ef\u001B4e$\u001Ah?\u0019d8*g3;g;\u001Fg\u001F%i\u0001\u0013f88f\u0008\u000Fe9?e\u0011\ne\u00056d;\u0016e\u000F\u0011h!(e.\te\u0005(g,,d8\u0000d<\u001Ae\u0011\u0018h?\u001Bh!\u000Cg\u00029e\u0007;g\t\u0008f\u001D\u0003g\u00145e-\u0010d8\u0016g\u0015\u000Ch.>h.!e\u0005\rh49f\u0015\u0019h\u00022e\n e\u0005%f4;e\n(d;\u0016d;,e\u0015\u0006e\u0013\u0001e\r\u001Ae.\"g\u000E0e\u001C(d8\nf57e&\u0002d=\u0015e72g;\u000Fg\u0015\u0019h(\u0000h/&g;\u0006g$>e\u000C:g\u0019;e=\u0015f\u001C,g+\u0019i\u001C\u0000h&\u0001d;7f <f\u0014/f\u000C\u0001e\u001B=i\u0019\u0005i\u0013>f\u000E%e\u001B=e.6e;:h.>f\u001C\u000Be\u000F\u000Bi\u0018\u0005h/;f3\u0015e>\u000Bd=\rg=.g;\u000Ff5\u000Ei\u0000\tf\u000B)h?\u0019f 7e=\u0013e\t\re\u0008\u0006g1;f\u000E\u0012h!\u000Ce\u001B d8:d:$f\u0018\u0013f\u001C\u0000e\u0010\u000Ei\u001F3d9\u0010d8\rh\u0003=i\u0000\u001Ah?\u0007h!\u000Cd8\u001Ag'\u0011f\n\u0000e\u000F/h\u0003=h.>e$\u0007e\u0010\u0008d=\u001Ce$'e.6g$>d<\u001Ag \u0014g)6d8\u0013d8\u001Ae\u0005(i\u0003(i!9g\u001B.h?\u0019i\u0007\u000Ch?\u0018f\u0018/e<\u0000e'\u000Bf\u0003\u0005e\u00065g\u00145h\u0004\u0011f\u0016\u0007d;6e\u0013\u0001g\t\u000Ce8.e\n)f\u0016\u0007e\u000C\u0016h5\u0004f:\u0010e$'e-&e-&d9 e\u001C0e\u001D\u0000f5\u000Fh'\u0008f\n\u0015h5\u0004e7%g(\u000Bh&\u0001f1\u0002f\u0000\u000Ed9\u0008f\u00176e\u0000\u0019e\n\u001Fh\u0003=d8;h&\u0001g\u001B.e\t\rh5\u0004h./e\u001F\u000Ee8\u0002f\u00169f3\u0015g\u00145e=1f\u000B\u001Bh\u0001\u0018e#0f\u0018\u000Ed;;d=\u0015e\u0001%e:7f\u00150f\r.g>\u000Ee\u001B=f1=h=&d;\u000Bg;\rd=\u0006f\u0018/d:$f5\u0001g\u0014\u001Fd:'f\t\u0000d;%g\u00145h/\u001Df\u0018>g$:d8\u0000d:\u001Be\r\u0015d=\rd::e\u0011\u0018e\u0008\u0006f\u001E\u0010e\u001C0e\u001B>f\u0017\u0005f88e7%e\u00057e-&g\u0014\u001Fg3;e\u0008\u0017g=\u0011e\u000F\u000Be8\u0016e-\u0010e/\u0006g \u0001i\"\u0011i\u0001\u0013f\u000E'e\u00086e\u001C0e\u000C:e\u001F:f\u001C,e\u0005(e\u001B=g=\u0011d8\ni\u0007\rh&\u0001g,,d:\u000Ce\u0016\u001Cf,\"h?\u001Be\u0005%e\u000F\u000Bf\u0003\u0005h?\u0019d:\u001Bh\u0000\u0003h/\u0015e\u000F\u0011g\u000E0e\u001F9h.-d;%d8\nf\u0014?e:\u001Cf\u0008\u0010d8:g\u000E/e\"\u0003i&\u0019f8/e\u0010\u000Cf\u00176e(1d9\u0010e\u000F\u0011i\u0000\u0001d8\u0000e.\u001Ae<\u0000e\u000F\u0011d=\u001Ce\u0013\u0001f \u0007e\u0007\u0006f,\"h?\u000Eh'#e\u00063e\u001C0f\u00169d8\u0000d8\u000Bd;%e\u000F\nh4#d;;f\u0008\u0016h\u0000\u0005e.\"f\u00087d;#h!(g'/e\u0008\u0006e%3d::f\u00150g \u0001i\u0014\u0000e\u0014.e\u0007:g\u000E0g&;g:?e:\u0014g\u0014(e\u0008\u0017h!(d8\re\u0010\u000Cg<\u0016h>\u0011g;\u001Fh.!f\u001F%h/\"d8\rh&\u0001f\u001C\te\u00053f\u001C:f\u001E\u0004e>\u0008e$\u001Af\u0012-f\u0014>g;\u0004g;\u0007f\u0014?g-\u0016g\u001B4f\u000E%h\u0003=e\n\u001Bf\u001D%f:\u0010f\u0019\u0002i\u0016\u0013g\u001C\u000Be\u00080g\u0003-i\u0017(e\u00053i\u0014.d8\u0013e\u000C:i\u001D\u001Ee88h\u000B1h/-g\u0019>e:&e8\u000Cf\u001C\u001Bg>\u000Ee%3f/\u0014h>\u0003g\u001F%h/\u0006h'\u0004e.\u001Ae;:h..i\u0003(i\u0017(f\u0004\u000Fh'\u0001g2>e=)f\u0017%f\u001C,f\u000F\u0010i+\u0018e\u000F\u0011h(\u0000f\u00169i\u001D\"e\u001F:i\u0007\u0011e$\u0004g\u0010\u0006f\u001D\u0003i\u0019\u0010e=1g\t\u0007i\u00136h!\u000Ch?\u0018f\u001C\te\u0008\u0006d:+g\t)e\u0013\u0001g;\u000Fh\u0010%f7;e\n d8\u0013e.6h?\u0019g'\rh/\u001Di\"\u0018h57f\u001D%d8\u001Ae\n!e\u0005,e\u0011\nh.0e=\u0015g.\u0000d;\u000Bh4(i\u0007\u000Fg\u00147d::e=1e\u0013\re<\u0015g\u0014(f\n%e\u0011\ni\u0003(e\u0008\u0006e?+i\u0000\u001Fe\u0012(h/\"f\u00176e0\u001Af3(f\u0004\u000Fg\u00143h/7e-&f !e:\u0014h/%e\u000E\u0006e\u000F2e\u000F*f\u0018/h?\u0014e\u001B\u001Eh4-d90e\u0010\rg'0d8:d:\u0006f\u0008\u0010e\n\u001Fh/4f\u0018\u000Ed>\u001Be:\u0014e-)e-\u0010d8\u0013i\"\u0018g(\u000Be:\u000Fd8\u0000h\u0008,f\u001C\u0003e\u0013!e\u000F*f\u001C\te\u00056e.\u0003d?\u001Df\n$h\u0000\u000Cd8\u0014d;\ne$)g*\u0017e\u000F#e\n(f\u0000\u0001g\n6f\u0000\u0001g\t9e\u0008+h.$d8:e?\u0005i!;f\u001B4f\u00160e0\u000Fh/4f\u0008\u0011e\u0000\u0011d=\u001Cd8:e*\u0012d=\u0013e\u000C\u0005f\u000B,i\u0002#d9\u0008d8\u0000f 7e\u001B=e\u0006\u0005f\u0018/e\u0010&f 9f\r.g\u00145h'\u0006e-&i\u0019\"e\u00057f\u001C\th?\u0007g(\u000Bg\u00141d:\u000Ed::f\t\re\u0007:f\u001D%d8\rh?\u0007f-#e\u001C(f\u0018\u000Ef\u0018\u001Ff\u0015\u0005d:\u000Be\u00053g3;f \u0007i\"\u0018e\u0015\u0006e\n!h>\u0013e\u0005%d8\u0000g\u001B4e\u001F:g!\u0000f\u0015\u0019e-&d:\u0006h'#e;:g-\u0011g;\u0013f\u001E\u001Ce\u0005(g\u0010\u0003i\u0000\u001Ag\u001F%h.!e\u0008\u0012e/9d:\u000Eh\t:f\u001C/g\u001B8e\u0006\u000Ce\u000F\u0011g\u0014\u001Fg\u001C\u001Fg\u001A\u0004e;:g+\u000Bg-\tg:'g1;e\u001E\u000Bg;\u000Fi*\u000Ce.\u001Eg\u000E0e\u00086d=\u001Cf\u001D%h\u0007*f \u0007g->d;%d8\u000Be\u000E\u001Fe\u0008\u001Bf\u0017 f3\u0015e\u00056d8-e\u0000\u000Bd::d8\u0000e\u0008\u0007f\u000C\u0007e\r\u0017e\u00053i\u0017-i\u001B\u0006e\u001B\"g,,d8\te\u00053f3(e\u001B f-$g\u0005'g\t\u0007f71e\u001C3e\u0015\u0006d8\u001Ae9?e7\u001Ef\u0017%f\u001C\u001Fi+\u0018g:'f\u001C\u0000h?\u0011g;<e\u0010\u0008h!(g$:d8\u0013h>\u0011h!\u000Cd8:d:$i\u0000\u001Ah/\u0004d;7h'\te>\u0017g2>e\r\u000Ee.6e:-e.\u000Cf\u0008\u0010f\u0004\u001Fh'\te.\th#\u0005e>\u0017e\u00080i\u0002.d;6e\u00086e:&i#\u001Fe\u0013\u0001h\u0019=g\u00046h=,h==f\n%d;7h.0h\u0000\u0005f\u00169f!\u0008h!\u000Cf\u0014?d::f0\u0011g\u0014(e\u0013\u0001d8\u001Ch%?f\u000F\u0010e\u0007:i\u0005\u0012e:\u0017g\u00046e\u0010\u000Ed;\u0018f,>g\u0003-g\u00029d;%e\t\re.\u000Ce\u0005(e\u000F\u0011e8\u0016h.>g=.i\"\u0006e/<e7%d8\u001Ae\u000C;i\u0019\"g\u001C\u000Bg\u001C\u000Bg;\u000Fe\u00058e\u000E\u001Fe\u001B e93e\u000F0e\u0010\u0004g'\re\"\u001Ee\n f\u001D\u0010f\u0016\u0019f\u00160e\"\u001Ed9\u000Be\u0010\u000Eh\u0001\u000Cd8\u001Af\u0015\u0008f\u001E\u001Cd;\ne94h.:f\u0016\u0007f\u0008\u0011e\u001B=e\u0011\nh/\tg\t\u0008d8;d?.f\u00149e\u000F\u0002d8\u000Ef\t\u0013e\r0e?+d9\u0010f\u001C:f\"0h'\u0002g\u00029e-\u0018e\u001C(g2>g%\u001Eh\u000E7e>\u0017e\u0008)g\u0014(g;'g;-d= d;,h?\u0019d9\u0008f(!e<\u000Fh/-h(\u0000h\u0003=e$\u001Fi\u001B\u0005h\u0019\u000Ef\u0013\rd=\u001Ci#\u000Ef <d8\u0000h57g'\u0011e-&d=\u0013h\u00022g\u001F-d?!f\u001D!d;6f2;g\u0016\u0017h?\u0010e\n(d:'d8\u001Ad<\u001Ah..e/<h\u0008*e\u0005\u0008g\u0014\u001Fh\u0001\u0014g\u001B\u001Fe\u000F/f\u0018/e\u0015\u000Fi!\u000Cg;\u0013f\u001E\u0004d=\u001Cg\u0014(h0\u0003f\u001F%h3\u0007f\u0016\u0019h\u0007*e\n(h4\u001Fh4#e\u0006\u001Cd8\u001Ah.?i\u0017.e.\u001Ef\u0016=f\u000E%e\u000F\u0017h.(h.:i\u0002#d8*e\u000F\ri&\u0008e\n e<:e%3f\u0000'h\u000C\u0003e\u001B4f\u001C\re\u000B\u0019d<\u0011i\u00172d;\nf\u0017%e.\"f\u001C\rh'\u0000g\u001C\u000Be\u000F\u0002e\n g\u001A\u0004h/\u001Dd8\u0000g\u00029d?\u001Dh/\u0001e\u001B>d9&f\u001C\tf\u0015\u0008f5\u000Bh/\u0015g';e\n(f\t\rh\u0003=e\u00063e.\u001Ah\u0002!g%(d8\rf\u0016-i\u001C\u0000f1\u0002d8\re>\u0017e\n\u001Ef3\u0015d9\u000Bi\u00174i\u0007\u0007g\u0014(h\u0010%i\u0014\u0000f\n\u0015h/\tg\u001B.f \u0007g\u00081f\u0003\u0005f\u0011\u0004e=1f\u001C\td:\u001Bh$\u0007h#=f\u0016\u0007e-&f\u001C:d<\u001Af\u00150e-\u0017h#\u0005d?.h4-g\t)e\u0006\u001Cf\u001D\u0011e\u0005(i\u001D\"g2>e\u0013\u0001e\u00056e.\u001Ed:\u000Bf\u0003\u0005f04e93f\u000F\u0010g$:d8\ne8\u0002h0\"h0\"f\u0019.i\u0000\u001Af\u0015\u0019e8\u0008d8\nd< g1;e\u0008+f-\u000Cf\u001B2f\u000B%f\u001C\te\u0008\u001Bf\u00160i\u0005\rd;6e\u000F*h&\u0001f\u00176d;#h3\u0007h(\nh>>e\u00080d::g\u0014\u001Fh.\"i\u0018\u0005h\u0000\u0001e8\u0008e1\u0015g$:e?\u0003g\u0010\u0006h44e-\u0010g62g+\u0019d8;i!\u000Ch\u0007*g\u00046g:'e\u0008+g.\u0000e\r\u0015f\u00149i\u001D)i\u0002#d:\u001Bf\u001D%h/4f\t\u0013e<\u0000d;#g \u0001e\u0008 i\u0019$h/\u0001e\u00088h\n\u0002g\u001B.i\u0007\rg\u00029f,!f\u00158e$\u001Ae0\u0011h'\u0004e\u0008\u0012h5\u0004i\u0007\u0011f\t>e\u00080d;%e\u0010\u000Ee$'e\u0005(d8;i!5f\u001C\u0000d=3e\u001B\u001Eg-\u0014e$)d8\u000Bd?\u001Di\u001A\u001Cg\u000E0d;#f#\u0000f\u001F%f\n\u0015g%(e0\u000Ff\u00176f2\u0012f\u001C\tf-#e88g\u0014\u001Ah\u00073d;#g\u0010\u0006g\u001B.e=\u0015e\u0005,e<\u0000e$\re\u00086i\u0007\u0011h\u001E\re98g&\u000Fg\t\u0008f\u001C,e=\"f\u0008\u0010e\u0007\u0006e$\u0007h!\u000Cf\u0003\u0005e\u001B\u001Ee\u00080f\u0000\u001Df\u00033f\u0000\u000Ef 7e\r\u000Fh..h.$h/\u0001f\u001C\u0000e%=d:'g\u0014\u001Ff\u000C\tg\u0005'f\u001C\rh#\u0005e9?d8\u001Ce\n(f<+i\u0007\u0007h4-f\u00160f\t\u000Bg;\u0004e\u001B>i\u001D\"f\u001D?e\u000F\u0002h\u0000\u0003f\u0014?f2;e.9f\u0018\u0013e$)e\u001C0e\n*e\n\u001Bd::d;,e\r\u0007g:'i\u0000\u001Fe:&d::g\t)h0\u0003f\u00154f5\u0001h!\u000Ci\u0000 f\u0008\u0010f\u0016\u0007e-\u0017i\u001F)e\u001B=h48f\u0018\u0013e<\u0000e1\u0015g\u001B8i\u0017\u001Ch!(g\u000E0e=1h'\u0006e&\u0002f-$g>\u000Ee.9e$'e0\u000Ff\n%i\u0001\u0013f\u001D!f,>e?\u0003f\u0003\u0005h.8e$\u001Af3\u0015h'\u0004e.6e1\u0005d9&e:\u0017h?\u001Ef\u000E%g+\u000Be\r3d8>f\n%f\n\u0000e7'e%%h?\u0010g\u0019;e\u0005%d;%f\u001D%g\u0010\u0006h.:d:\u000Bd;6h\u0007*g\u00141d8-e\r\u000Ee\n\u001Ee\u0005,e&\u0008e&\u0008g\u001C\u001Ff-#d8\ri\u0014\u0019e\u0005(f\u0016\u0007e\u0010\u0008e\u0010\u000Cd;7e\u0000<e\u0008+d::g\u001B\u0011g\u001D#e\u00057d=\u0013d8\u0016g:*e\u001B\"i\u0018\u001Fe\u0008\u001Bd8\u001Af\t?f\u000B\u0005e\"\u001Ei\u0015?f\u001C\td::d?\u001Df\u000C\u0001e\u0015\u0006e.6g;4d?.e\u000F0f9>e7&e\u000F3h\u0002!d;=g-\u0014f!\u0008e.\u001Ei\u0019\u0005g\u00145d?!g;\u000Fg\u0010\u0006g\u0014\u001Fe\u0011=e.#d< d;;e\n!f-#e<\u000Fg\t9h\t2d8\u000Bf\u001D%e\r\u000Fd<\u001Ae\u000F*h\u0003=e=\u0013g\u00046i\u0007\rf\u00160e\u0005'e.9f\u000C\u0007e/<h?\u0010h!\u000Cf\u0017%e?\u0017h3#e.6h6\u0005h?\u0007e\u001C\u001Fe\u001C0f5\u0019f1\u001Ff\u0014/d;\u0018f\u000E(e\u0007:g+\u0019i\u0015?f\u001D-e7\u001Ef\t'h!\u000Ce\u00086i\u0000 d9\u000Bd8\u0000f\u000E(e9?g\u000E0e\u001C:f\u000F\u000Fh?0e\u000F\u0018e\u000C\u0016d< g;\u001Ff-\u000Cf\t\u000Bd?\u001Di\u0019)h/>g(\u000Be\u000C;g\u0016\u0017g;\u000Fh?\u0007h?\u0007e\u000E;d9\u000Be\t\rf\u00146e\u0005%e94e:&f\u001D\u0002e?\u0017g>\u000Ed8=f\u001C\u0000i+\u0018g\u0019;i\u0019\u0006f\u001C*f\u001D%e\n e7%e\u0005\rh4#f\u0015\u0019g(\u000Bg\t\u0008e\u001D\u0017h:+d=\u0013i\u0007\re:\u0006e\u0007:e\u0014.f\u0008\u0010f\u001C,e=\"e<\u000Fe\u001C\u001Fh1\u0006e\u0007:e\u00039d8\u001Cf\u00169i\u0002.g.1e\r\u0017d:,f1\u0002h\u0001\u000Ce\u000F\u0016e>\u0017h\u0001\u000Cd=\rg\u001B8d?!i!5i\u001D\"e\u0008\u0006i\u0012\u001Fg=\u0011i!5g!.e.\u001Ae\u001B>d>\u000Bg=\u0011e\u001D\u0000g'/f\u001E\u0001i\u0014\u0019h//g\u001B.g\u001A\u0004e.\u001Dh4\u001Df\u001C:e\u00053i#\u000Ei\u0019)f\u000E\u0008f\u001D\u0003g\u0017\u0005f/\u0012e. g\t)i\u0019$d:\u0006h)\u0015h+\u0016g\u0016>g\u0017\u0005e\u000F\nf\u00176f1\u0002h4-g+\u0019g\u00029e\u0004?g+%f/\u000Fe$)d8-e$.h.$h/\u0006f/\u000Fd8*e$)f4%e-\u0017d=\u0013e\u000F0g\u0001#g;4f\n$f\u001C,i!5d8*f\u0000'e.\u0018f\u00169e88h'\u0001g\u001B8f\u001C:f\u0008\u0018g\u0015%e:\u0014e=\u0013e>\u000Be8\u0008f\u00169d>?f !e\u001B-h\u0002!e8\u0002f\u0008?e1\u000Bf \u000Fg\u001B.e\u0011\u0018e7%e/<h\u00074g*\u0001g\u00046i\u0001\u0013e\u00057f\u001C,g=\u0011g;\u0013e\u0010\u0008f!#f!\u0008e\n3e\n(e\u000F&e$\u0016g>\u000Ee\u0005\u0003e<\u0015h57f\u00149e\u000F\u0018g,,e\u001B\u001Bd<\u001Ah.!h**f\u0018\u000Ei\u001A\u0010g'\u0001e.\u001De.\u001Dh'\u0004h\u000C\u0003f6\u0008h49e\u00051e\u0010\u000Ce?\u0018h.0d=\u0013g3;e8&f\u001D%e\u0010\re-\u0017g\u0019<h!(e<\u0000f\u0014>e\n g\u001B\u001Fe\u000F\u0017e\u00080d:\u000Cf\t\u000Be$'i\u0007\u000Ff\u0008\u0010d::f\u00150i\u0007\u000Fe\u00051d:+e\u000C:e\u001F\u001Fe%3e-)e\u000E\u001Fe\u0008\u0019f\t\u0000e\u001C(g;\u0013f\u001D\u001Fi\u0000\u001Ad?!h6\u0005g:'i\u0005\rg=.e=\u0013f\u00176d<\u0018g'\u0000f\u0000'f\u0004\u001Ff\u0008?d:'i\u0001\nf\u00082e\u0007:e\u000F#f\u000F\u0010d:$e01d8\u001Ad?\u001De\u0001%g(\u000Be:&e\u000F\u0002f\u00150d:\u000Bd8\u001Af\u00154d8*e11d8\u001Cf\u0003\u0005f\u0004\u001Fg\t9f.\ne\u0008\u0006i!\u001Ef\u0010\u001Ce0\u000Be1\u001Ed:\u000Ei\u0017(f\u00087h4\"e\n!e#0i\u001F3e\u000F\ne\u00056h4\"g;\u000Fe\u001D\u001Af\u000C\u0001e92i\u0003(f\u0008\u0010g+\u000Be\u0008)g\u001B\nh\u0000\u0003h\u0019\u0011f\u0008\u0010i\u0003=e\u000C\u0005h#\u0005g\u0014(f\u00086f/\u0014h5\u001Bf\u0016\u0007f\u0018\u000Ef\u000B\u001Be\u0015\u0006e.\u000Cf\u00154g\u001C\u001Ff\u0018/g\u001C<g\u001D\u001Bd<\u0019d<4e(\u0001f\u001C\u001Bi\"\u0006e\u001F\u001Fe\r+g\u0014\u001Fd<\u0018f\u0003 h+\u0016e#\u0007e\u0005,e\u00051h\t/e%=e\u0005\u0005e\u0008\u0006g,&e\u0010\u0008i\u0019\u0004d;6g\t9g\u00029d8\re\u000F/h\u000B1f\u0016\u0007h5\u0004d:'f 9f\u001C,f\u0018\u000Ef\u0018>e/\u0006g\"<e\u0005,d<\u0017f0\u0011f\u0017\u000Ff\u001B4e\n d:+e\u000F\u0017e\u0010\u000Ce-&e\u0010/e\n(i\u0000\u0002e\u0010\u0008e\u000E\u001Ff\u001D%i\u0017.g-\u0014f\u001C,f\u0016\u0007g>\u000Ei#\u001Fg;?h\t2g(3e.\u001Ag;\u0008d:\u000Eg\u0014\u001Fg\t)d>\u001Bf1\u0002f\u0010\u001Cg\u000B\u0010e\n\u001Bi\u0007\u000Fd8%i\u0007\rf08h?\u001Ce\u0006\u0019g\u001C\u001Ff\u001C\ti\u0019\u0010g+\u001Ed:\te/9h1!h49g\u0014(d8\re%=g;\u001De/9e\r\u0001e\u0008\u0006d?\u0003h?\u001Bg\u00029h/\u0004e=1i\u001F3d<\u0018e\n?d8\re0\u0011f,#h5\u000Fe96d8\u0014f\u001C\tg\u00029f\u00169e\u0010\u0011e\u0005(f\u00160d?!g\u0014(h.>f\u0016=e=\"h1!h5\u0004f <g*\u0001g 4i\u001A\u000Fg\u001D\u0000i\u0007\re$'d:\u000Ef\u0018/f/\u0015d8\u001Af\u0019:h\u0003=e\u000C\u0016e7%e.\u000Cg>\u000Ee\u0015\u0006e\u001F\u000Eg;\u001Fd8\u0000e\u0007:g\t\u0008f\t\u0013i\u0000 g\u0014\"e\u0013\u0001f&\u0002e\u00065g\u0014(d:\u000Ed?\u001Dg\u0015\u0019e\u001B g4 d8-e\u001C\u000Be-\u0018e\u0002(h44e\u001B>f\u001C\u0000f\u0004\u001Bi\u0015?f\u001C\u001Fe\u000F#d;7g\u0010\u0006h4\"e\u001F:e\u001C0e.\tf\u000E\u0012f-&f1\ti\u0007\u000Ci\u001D\"e\u0008\u001Be;:e$)g):i&\u0016e\u0005\u0008e.\u000Ce\u0016\u0004i)1e\n(d8\u000Bi\u001D\"d8\re\u0006\rh/\u001Ad?!f\u0004\u000Fd9\ti\u00183e\u0005\th\u000B1e\u001B=f<\u0002d:.e\u0006\u001Bd:\u000Bg\u000E)e.6g>$d<\u0017e\u0006\u001Cf0\u0011e\r3e\u000F/e\u0010\rg(1e.6e\u00057e\n(g\u0014;f\u00033e\u00080f3(f\u0018\u000Ee0\u000Fe-&f\u0000'h\u0003=h\u0000\u0003g \u0014g!,d;6h'\u0002g\u001C\u000Bf8\u0005f%\u001Af\u0010\u001Eg,\u0011i&\u0016i \u0001i;\u0004i\u0007\u0011i\u0000\u0002g\u0014(f1\u001Fh\u000B\u000Fg\u001C\u001Fe.\u001Ed8;g.!i\u00186f.5h(;e\u0006\ng?;h/\u0011f\u001D\u0003e\u0008)e\u0001\u001Ae%=d<<d9\u000Ei\u0000\u001Ah./f\u0016=e7%g\u000B\u0000f\u0005\u000Bd9\u001Fh.8g\u000E/d?\u001De\u001F9e\u0005;f&\u0002e?5e$'e\u001E\u000Bf\u001C:g%(g\u0010\u0006h'#e\u000C?e\u0010\rcuandoenviarmadridbuscariniciotiempoporquecuentaestadopuedenjuegoscontraestC!nnombretienenperfilmaneraamigosciudadcentroaunquepuedesdentroprimerpreciosegC:nbuenosvolverpuntossemanahabC-aagostonuevosunidoscarlosequiponiC1osmuchosalgunacorreoimagenpartirarribamarC-ahombreempleoverdadcambiomuchasfueronpasadolC-neaparecenuevascursosestabaquierolibroscuantoaccesomiguelvarioscuatrotienesgruposserC!neuropamediosfrenteacercademC!sofertacochesmodeloitalialetrasalgC:ncompracualesexistecuerposiendoprensallegarviajesdineromurciapodrC!puestodiariopuebloquieremanuelpropiocrisisciertoseguromuertefuentecerrargrandeefectopartesmedidapropiaofrecetierrae-mailvariasformasfuturoobjetoseguirriesgonormasmismosC:nicocaminositiosrazC3ndebidopruebatoledotenC-ajesC:sesperococinaorigentiendacientocC!dizhablarserC-alatinafuerzaestiloguerraentrarC)xitolC3pezagendavC-deoevitarpaginametrosjavierpadresfC!cilcabezaC!reassalidaenvC-ojapC3nabusosbienestextosllevarpuedanfuertecomC:nclaseshumanotenidobilbaounidadestC!seditarcreadoP4P;Q\u000FQ\u0007Q\u0002P>P:P0P:P8P;P8Q\rQ\u0002P>P2Q\u0001P5P5P3P>P?Q\u0000P8Q\u0002P0P:P5Q\tP5Q\u0003P6P5P\u001AP0P:P1P5P7P1Q\u000BP;P>P=P8P\u0012Q\u0001P5P?P>P4P-Q\u0002P>Q\u0002P>P<Q\u0007P5P<P=P5Q\u0002P;P5Q\u0002Q\u0000P0P7P>P=P0P3P4P5P<P=P5P\u0014P;Q\u000FP\u001FQ\u0000P8P=P0Q\u0001P=P8Q\u0005Q\u0002P5P<P:Q\u0002P>P3P>P4P2P>Q\u0002Q\u0002P0P<P!P(P\u0010P<P0Q\u000FP'Q\u0002P>P2P0Q\u0001P2P0P<P5P<Q\u0003P\"P0P:P4P2P0P=P0P<Q\rQ\u0002P8Q\rQ\u0002Q\u0003P\u0012P0P<Q\u0002P5Q\u0005P?Q\u0000P>Q\u0002Q\u0003Q\u0002P=P0P4P4P=Q\u000FP\u0012P>Q\u0002Q\u0002Q\u0000P8P=P5P9P\u0012P0Q\u0001P=P8P<Q\u0001P0P<Q\u0002P>Q\u0002Q\u0000Q\u0003P1P\u001EP=P8P<P8Q\u0000P=P5P5P\u001EP\u001EP\u001EP;P8Q\u0006Q\rQ\u0002P0P\u001EP=P0P=P5P<P4P>P<P<P>P9P4P2P5P>P=P>Q\u0001Q\u0003P4`$\u0015`%\u0007`$9`%\u0008`$\u0015`%\u0000`$8`%\u0007`$\u0015`$>`$\u0015`%\u000B`$\u0014`$0`$*`$0`$(`%\u0007`$\u000F`$\u0015`$\u0015`$?`$-`%\u0000`$\u0007`$8`$\u0015`$0`$$`%\u000B`$9`%\u000B`$\u0006`$*`$9`%\u0000`$/`$9`$/`$>`$$`$\u0015`$%`$>jagran`$\u0006`$\u001C`$\u001C`%\u000B`$\u0005`$,`$&`%\u000B`$\u0017`$\u0008`$\u001C`$>`$\u0017`$\u000F`$9`$.`$\u0007`$(`$5`$9`$/`%\u0007`$%`%\u0007`$%`%\u0000`$\u0018`$0`$\u001C`$,`$&`%\u0000`$\u0015`$\u0008`$\u001C`%\u0000`$5`%\u0007`$(`$\u0008`$(`$\u000F`$9`$0`$\t`$8`$.`%\u0007`$\u0015`$.`$5`%\u000B`$2`%\u0007`$8`$,`$.`$\u0008`$&`%\u0007`$\u0013`$0`$\u0006`$.`$,`$8`$-`$0`$,`$(`$\u001A`$2`$.`$(`$\u0006`$\u0017`$8`%\u0000`$2`%\u0000X9Y\u0004Y\tX%Y\u0004Y\tY\u0007X0X'X\"X.X1X9X/X/X'Y\u0004Y\tY\u0007X0Y\u0007X5Y\u0008X1X:Y\nX1Y\u0003X'Y\u0006Y\u0008Y\u0004X'X(Y\nY\u0006X9X1X6X0Y\u0004Y\u0003Y\u0007Y\u0006X'Y\nY\u0008Y\u0005Y\u0002X'Y\u0004X9Y\u0004Y\nX'Y\u0006X'Y\u0004Y\u0003Y\u0006X-X*Y\tY\u0002X(Y\u0004Y\u0008X-X)X'X.X1Y\u0001Y\u0002X7X9X(X/X1Y\u0003Y\u0006X%X0X'Y\u0003Y\u0005X'X'X-X/X%Y\u0004X'Y\u0001Y\nY\u0007X(X9X6Y\u0003Y\nY\u0001X(X-X+Y\u0008Y\u0005Y\u0006Y\u0008Y\u0007Y\u0008X#Y\u0006X'X,X/X'Y\u0004Y\u0007X'X3Y\u0004Y\u0005X9Y\u0006X/Y\u0004Y\nX3X9X(X1X5Y\u0004Y\tY\u0005Y\u0006X0X(Y\u0007X'X#Y\u0006Y\u0007Y\u0005X+Y\u0004Y\u0003Y\u0006X*X'Y\u0004X'X-Y\nX+Y\u0005X5X1X4X1X-X-Y\u0008Y\u0004Y\u0008Y\u0001Y\nX'X0X'Y\u0004Y\u0003Y\u0004Y\u0005X1X)X'Y\u0006X*X'Y\u0004Y\u0001X#X(Y\u0008X.X'X5X#Y\u0006X*X'Y\u0006Y\u0007X'Y\u0004Y\nX9X6Y\u0008Y\u0008Y\u0002X/X'X(Y\u0006X.Y\nX1X(Y\u0006X*Y\u0004Y\u0003Y\u0005X4X'X!Y\u0008Y\u0007Y\nX'X(Y\u0008Y\u0002X5X5Y\u0008Y\u0005X'X1Y\u0002Y\u0005X#X-X/Y\u0006X-Y\u0006X9X/Y\u0005X1X#Y\nX'X-X)Y\u0003X*X(X/Y\u0008Y\u0006Y\nX,X(Y\u0005Y\u0006Y\u0007X*X-X*X,Y\u0007X)X3Y\u0006X)Y\nX*Y\u0005Y\u0003X1X)X:X2X)Y\u0006Y\u0001X3X(Y\nX*Y\u0004Y\u0004Y\u0007Y\u0004Y\u0006X'X*Y\u0004Y\u0003Y\u0002Y\u0004X(Y\u0004Y\u0005X'X9Y\u0006Y\u0007X#Y\u0008Y\u0004X4Y\nX!Y\u0006Y\u0008X1X#Y\u0005X'Y\u0001Y\nY\u0003X(Y\u0003Y\u0004X0X'X*X1X*X(X(X#Y\u0006Y\u0007Y\u0005X3X'Y\u0006Y\u0003X(Y\nX9Y\u0001Y\u0002X/X-X3Y\u0006Y\u0004Y\u0007Y\u0005X4X9X1X#Y\u0007Y\u0004X4Y\u0007X1Y\u0002X7X1X7Y\u0004X(profileservicedefaulthimselfdetailscontentsupportstartedmessagesuccessfashion<title>countryaccountcreatedstoriesresultsrunningprocesswritingobjectsvisiblewelcomearticleunknownnetworkcompanydynamicbrowserprivacyproblemServicerespectdisplayrequestreservewebsitehistoryfriendsoptionsworkingversionmillionchannelwindow.addressvisitedweathercorrectproductedirectforwardyou canremovedsubjectcontrolarchivecurrentreadinglibrarylimitedmanagerfurthersummarymachineminutesprivatecontextprogramsocietynumberswrittenenabledtriggersourcesloadingelementpartnerfinallyperfectmeaningsystemskeepingculture&quot;,journalprojectsurfaces&quot;expiresreviewsbalanceEnglishContentthroughPlease opinioncontactaverageprimaryvillageSpanishgallerydeclinemeetingmissionpopularqualitymeasuregeneralspeciessessionsectionwriterscounterinitialreportsfiguresmembersholdingdisputeearlierexpressdigitalpictureAnothermarriedtrafficleadingchangedcentralvictoryimages/reasonsstudiesfeaturelistingmust beschoolsVersionusuallyepisodeplayinggrowingobviousoverlaypresentactions</ul>\r\nwrapperalreadycertainrealitystorageanotherdesktopofferedpatternunusualDigitalcapitalWebsitefailureconnectreducedAndroiddecadesregular &amp; animalsreleaseAutomatgettingmethodsnothingPopularcaptionletterscapturesciencelicensechangesEngland=1&amp;History = new CentralupdatedSpecialNetworkrequirecommentwarningCollegetoolbarremainsbecauseelectedDeutschfinanceworkersquicklybetweenexactlysettingdiseaseSocietyweaponsexhibit&lt;!--Controlclassescoveredoutlineattacksdevices(windowpurposetitle=\"Mobile killingshowingItaliandroppedheavilyeffects-1']);\nconfirmCurrentadvancesharingopeningdrawingbillionorderedGermanyrelated</form>includewhetherdefinedSciencecatalogArticlebuttonslargestuniformjourneysidebarChicagoholidayGeneralpassage,&quot;animatefeelingarrivedpassingnaturalroughly.\n\nThe but notdensityBritainChineselack oftributeIreland\" data-factorsreceivethat isLibraryhusbandin factaffairsCharlesradicalbroughtfindinglanding:lang=\"return leadersplannedpremiumpackageAmericaEdition]&quot;Messageneed tovalue=\"complexlookingstationbelievesmaller-mobilerecordswant tokind ofFirefoxyou aresimilarstudiedmaximumheadingrapidlyclimatekingdomemergedamountsfoundedpioneerformuladynastyhow to SupportrevenueeconomyResultsbrothersoldierlargelycalling.&quot;AccountEdward segmentRobert effortsPacificlearnedup withheight:we haveAngelesnations_searchappliedacquiremassivegranted: falsetreatedbiggestbenefitdrivingStudiesminimumperhapsmorningsellingis usedreversevariant role=\"missingachievepromotestudentsomeoneextremerestorebottom:evolvedall thesitemapenglishway to AugustsymbolsCompanymattersmusicalagainstserving})();\r\npaymenttroubleconceptcompareparentsplayersregionsmonitor ''The winningexploreadaptedGalleryproduceabilityenhancecareers). The collectSearch ancientexistedfooter handlerprintedconsoleEasternexportswindowsChannelillegalneutralsuggest_headersigning.html\">settledwesterncausing-webkitclaimedJusticechaptervictimsThomas mozillapromisepartieseditionoutside:false,hundredOlympic_buttonauthorsreachedchronicdemandssecondsprotectadoptedprepareneithergreatlygreateroverallimprovecommandspecialsearch.worshipfundingthoughthighestinsteadutilityquarterCulturetestingclearlyexposedBrowserliberal} catchProjectexamplehide();FloridaanswersallowedEmperordefenseseriousfreedomSeveral-buttonFurtherout of != nulltrainedDenmarkvoid(0)/all.jspreventRequestStephen\n\nWhen observe</h2>\r\nModern provide\" alt=\"borders.\n\nFor \n\nMany artistspoweredperformfictiontype ofmedicalticketsopposedCouncilwitnessjusticeGeorge Belgium...</a>twitternotablywaitingwarfare Other rankingphrasesmentionsurvivescholar</p>\r\n Countryignoredloss ofjust asGeorgiastrange<head><stopped1']);\r\nislandsnotableborder:list ofcarried100,000</h3>\n severalbecomesselect wedding00.htmlmonarchoff theteacherhighly biologylife ofor evenrise of&raquo;plusonehunting(thoughDouglasjoiningcirclesFor theAncientVietnamvehiclesuch ascrystalvalue =Windowsenjoyeda smallassumed<a id=\"foreign All rihow theDisplayretiredhoweverhidden;battlesseekingcabinetwas notlook atconductget theJanuaryhappensturninga:hoverOnline French lackingtypicalextractenemieseven ifgeneratdecidedare not/searchbeliefs-image:locatedstatic.login\">convertviolententeredfirst\">circuitFinlandchemistshe was10px;\">as suchdivided</span>will beline ofa greatmystery/index.fallingdue to railwaycollegemonsterdescentit withnuclearJewish protestBritishflowerspredictreformsbutton who waslectureinstantsuicidegenericperiodsmarketsSocial fishingcombinegraphicwinners<br /><by the NaturalPrivacycookiesoutcomeresolveSwedishbrieflyPersianso muchCenturydepictscolumnshousingscriptsnext tobearingmappingrevisedjQuery(-width:title\">tooltipSectiondesignsTurkishyounger.match(})();\n\nburningoperatedegreessource=Richardcloselyplasticentries</tr>\r\ncolor:#ul id=\"possessrollingphysicsfailingexecutecontestlink toDefault<br />\n: true,chartertourismclassicproceedexplain</h1>\r\nonline.?xml vehelpingdiamonduse theairlineend -->).attr(readershosting#ffffffrealizeVincentsignals src=\"/ProductdespitediversetellingPublic held inJoseph theatreaffects<style>a largedoesn'tlater, ElementfaviconcreatorHungaryAirportsee theso thatMichaelSystemsPrograms, and width=e&quot;tradingleft\">\npersonsGolden Affairsgrammarformingdestroyidea ofcase ofoldest this is.src = cartoonregistrCommonsMuslimsWhat isin manymarkingrevealsIndeed,equally/show_aoutdoorescape(Austriageneticsystem,In the sittingHe alsoIslandsAcademy\n\t\t<!--Daniel bindingblock\">imposedutilizeAbraham(except{width:putting).html(|| [];\nDATA[ *kitchenmountedactual dialectmainly _blank'installexpertsif(typeIt also&copy; \">Termsborn inOptionseasterntalkingconcerngained ongoingjustifycriticsfactoryits ownassaultinvitedlastinghis ownhref=\"/\" rel=\"developconcertdiagramdollarsclusterphp?id=alcohol);})();using a><span>vesselsrevivalAddressamateurandroidallegedillnesswalkingcentersqualifymatchesunifiedextinctDefensedied in\n\t<!-- customslinkingLittle Book ofeveningmin.js?are thekontakttoday's.html\" target=wearingAll Rig;\n})();raising Also, crucialabout\">declare-->\n<scfirefoxas muchappliesindex, s, but type = \n\r\n<!--towardsRecordsPrivateForeignPremierchoicesVirtualreturnsCommentPoweredinline;povertychamberLiving volumesAnthonylogin\" RelatedEconomyreachescuttinggravitylife inChapter-shadowNotable</td>\r\n returnstadiumwidgetsvaryingtravelsheld bywho arework infacultyangularwho hadairporttown of\n\nSome 'click'chargeskeywordit willcity of(this);Andrew unique checkedor more300px; return;rsion=\"pluginswithin herselfStationFederalventurepublishsent totensionactresscome tofingersDuke ofpeople,exploitwhat isharmonya major\":\"httpin his menu\">\nmonthlyofficercouncilgainingeven inSummarydate ofloyaltyfitnessand wasemperorsupremeSecond hearingRussianlongestAlbertalateralset of small\">.appenddo withfederalbank ofbeneathDespiteCapitalgrounds), and percentit fromclosingcontainInsteadfifteenas well.yahoo.respondfighterobscurereflectorganic= Math.editingonline paddinga wholeonerroryear ofend of barrierwhen itheader home ofresumedrenamedstrong>heatingretainscloudfrway of March 1knowingin partBetweenlessonsclosestvirtuallinks\">crossedEND -->famous awardedLicenseHealth fairly wealthyminimalAfricancompetelabel\">singingfarmersBrasil)discussreplaceGregoryfont copursuedappearsmake uproundedboth ofblockedsaw theofficescoloursif(docuwhen heenforcepush(fuAugust UTF-8\">Fantasyin mostinjuredUsuallyfarmingclosureobject defenceuse of Medical<body>\nevidentbe usedkeyCodesixteenIslamic#000000entire widely active (typeofone cancolor =speakerextendsPhysicsterrain<tbody>funeralviewingmiddle cricketprophetshifteddoctorsRussell targetcompactalgebrasocial-bulk ofman and</td>\n he left).val()false);logicalbankinghome tonaming Arizonacredits);\n});\nfounderin turnCollinsbefore But thechargedTitle\">CaptainspelledgoddessTag -->Adding:but wasRecent patientback in=false&Lincolnwe knowCounterJudaismscript altered']);\n has theunclearEvent',both innot all\n\n<!-- placinghard to centersort ofclientsstreetsBernardassertstend tofantasydown inharbourFreedomjewelry/about..searchlegendsis mademodern only ononly toimage\" linear painterand notrarely acronymdelivershorter00&amp;as manywidth=\"/* <![Ctitle =of the lowest picked escapeduses ofpeoples PublicMatthewtacticsdamagedway forlaws ofeasy to windowstrong simple}catch(seventhinfoboxwent topaintedcitizenI don'tretreat. Some ww.\");\nbombingmailto:made in. Many carries||{};wiwork ofsynonymdefeatsfavoredopticalpageTraunless sendingleft\"><comScorAll thejQuery.touristClassicfalse\" Wilhelmsuburbsgenuinebishops.split(global followsbody ofnominalContactsecularleft tochiefly-hidden-banner</li>\n\n. When in bothdismissExplorealways via thespaC1olwelfareruling arrangecaptainhis sonrule ofhe tookitself,=0&amp;(calledsamplesto makecom/pagMartin Kennedyacceptsfull ofhandledBesides//--></able totargetsessencehim to its by common.mineralto takeways tos.org/ladvisedpenaltysimple:if theyLettersa shortHerbertstrikes groups.lengthflightsoverlapslowly lesser social </p>\n\t\tit intoranked rate oful>\r\n attemptpair ofmake itKontaktAntoniohaving ratings activestreamstrapped\").css(hostilelead tolittle groups,Picture-->\r\n\r\n rows=\" objectinverse<footerCustomV><\\/scrsolvingChamberslaverywoundedwhereas!= 'undfor allpartly -right:Arabianbacked centuryunit ofmobile-Europe,is homerisk ofdesiredClintoncost ofage of become none ofp&quot;Middle ead')[0Criticsstudios>&copy;group\">assemblmaking pressedwidget.ps:\" ? rebuiltby someFormer editorsdelayedCanonichad thepushingclass=\"but arepartialBabylonbottom carrierCommandits useAs withcoursesa thirddenotesalso inHouston20px;\">accuseddouble goal ofFamous ).bind(priests Onlinein Julyst + \"gconsultdecimalhelpfulrevivedis veryr'+'iptlosing femalesis alsostringsdays ofarrivalfuture <objectforcingString(\" />\n\t\there isencoded. The balloondone by/commonbgcolorlaw of Indianaavoidedbut the2px 3pxjquery.after apolicy.men andfooter-= true;for usescreen.Indian image =family,http:// &nbsp;driverseternalsame asnoticedviewers})();\n is moreseasonsformer the newis justconsent Searchwas thewhy theshippedbr><br>width: height=made ofcuisineis thata very Admiral fixed;normal MissionPress, ontariocharsettry to invaded=\"true\"spacingis mosta more totallyfall of});\r\n immensetime inset outsatisfyto finddown tolot of Playersin Junequantumnot thetime todistantFinnishsrc = (single help ofGerman law andlabeledforestscookingspace\">header-well asStanleybridges/globalCroatia About [0];\n it, andgroupedbeing a){throwhe madelighterethicalFFFFFF\"bottom\"like a employslive inas seenprintermost ofub-linkrejectsand useimage\">succeedfeedingNuclearinformato helpWomen'sNeitherMexicanprotein<table by manyhealthylawsuitdevised.push({sellerssimply Through.cookie Image(older\">us.js\"> Since universlarger open to!-- endlies in']);\r\n marketwho is (\"DOMComanagedone fortypeof Kingdomprofitsproposeto showcenter;made itdressedwere inmixtureprecisearisingsrc = 'make a securedBaptistvoting \n\t\tvar March 2grew upClimate.removeskilledway the</head>face ofacting right\">to workreduceshas haderectedshow();action=book ofan area== \"htt<header\n<html>conformfacing cookie.rely onhosted .customhe wentbut forspread Family a meansout theforums.footage\">MobilClements\" id=\"as highintense--><!--female is seenimpliedset thea stateand hisfastestbesidesbutton_bounded\"><img Infoboxevents,a youngand areNative cheaperTimeoutand hasengineswon the(mostlyright: find a -bottomPrince area ofmore ofsearch_nature,legallyperiod,land ofor withinducedprovingmissilelocallyAgainstthe wayk&quot;px;\">\r\npushed abandonnumeralCertainIn thismore inor somename isand, incrownedISBN 0-createsOctobermay notcenter late inDefenceenactedwish tobroadlycoolingonload=it. TherecoverMembersheight assumes<html>\npeople.in one =windowfooter_a good reklamaothers,to this_cookiepanel\">London,definescrushedbaptismcoastalstatus title\" move tolost inbetter impliesrivalryservers SystemPerhapses and contendflowinglasted rise inGenesisview ofrising seem tobut in backinghe willgiven agiving cities.flow of Later all butHighwayonly bysign ofhe doesdiffersbattery&amp;lasinglesthreatsintegertake onrefusedcalled =US&ampSee thenativesby thissystem.head of:hover,lesbiansurnameand allcommon/header__paramsHarvard/pixel.removalso longrole ofjointlyskyscraUnicodebr />\r\nAtlantanucleusCounty,purely count\">easily build aonclicka givenpointerh&quot;events else {\nditionsnow the, with man whoorg/Webone andcavalryHe diedseattle00,000 {windowhave toif(windand itssolely m&quot;renewedDetroitamongsteither them inSenatorUs</a><King ofFrancis-produche usedart andhim andused byscoringat hometo haverelatesibilityfactionBuffalolink\"><what hefree toCity ofcome insectorscountedone daynervoussquare };if(goin whatimg\" alis onlysearch/tuesdaylooselySolomonsexual - <a hrmedium\"DO NOT France,with a war andsecond take a >\r\n\r\n\r\nmarket.highwaydone inctivity\"last\">obligedrise to\"undefimade to Early praisedin its for hisathleteJupiterYahoo! termed so manyreally s. The a woman?value=direct right\" bicycleacing=\"day andstatingRather,higher Office are nowtimes, when a pay foron this-link\">;borderaround annual the Newput the.com\" takin toa brief(in thegroups.; widthenzymessimple in late{returntherapya pointbanninginks\">\n();\" rea place\\u003Caabout atr>\r\n\t\tccount gives a<SCRIPTRailwaythemes/toolboxById(\"xhumans,watchesin some if (wicoming formats Under but hashanded made bythan infear ofdenoted/iframeleft involtagein eacha&quot;base ofIn manyundergoregimesaction </p>\r\n<ustomVa;&gt;</importsor thatmostly &amp;re size=\"</a></ha classpassiveHost = WhetherfertileVarious=[];(fucameras/></td>acts asIn some>\r\n\r\n<!organis <br />BeijingcatalC deutscheuropeueuskaragaeilgesvenskaespaC1amensajeusuariotrabajomC)xicopC!ginasiempresistemaoctubreduranteaC1adirempresamomentonuestroprimeratravC)sgraciasnuestraprocesoestadoscalidadpersonanC:meroacuerdomC:sicamiembroofertasalgunospaC-sesejemploderechoademC!sprivadoagregarenlacesposiblehotelessevillaprimeroC:ltimoeventosarchivoculturamujeresentradaanuncioembargomercadograndesestudiomejoresfebrerodiseC1oturismocC3digoportadaespaciofamiliaantoniopermiteguardaralgunaspreciosalguiensentidovisitastC-tuloconocersegundoconsejofranciaminutossegundatenemosefectosmC!lagasesiC3nrevistagranadacompraringresogarcC-aacciC3necuadorquienesinclusodeberC!materiahombresmuestrapodrC-amaC1anaC:ltimaestamosoficialtambienningC:nsaludospodemosmejorarpositionbusinesshomepagesecuritylanguagestandardcampaignfeaturescategoryexternalchildrenreservedresearchexchangefavoritetemplatemilitaryindustryservicesmaterialproductsz-index:commentssoftwarecompletecalendarplatformarticlesrequiredmovementquestionbuildingpoliticspossiblereligionphysicalfeedbackregisterpicturesdisabledprotocolaudiencesettingsactivityelementslearninganythingabstractprogressoverviewmagazineeconomictrainingpressurevarious <strong>propertyshoppingtogetheradvancedbehaviordownloadfeaturedfootballselectedLanguagedistanceremembertrackingpasswordmodifiedstudentsdirectlyfightingnortherndatabasefestivalbreakinglocationinternetdropdownpracticeevidencefunctionmarriageresponseproblemsnegativeprogramsanalysisreleasedbanner\">purchasepoliciesregionalcreativeargumentbookmarkreferrerchemicaldivisioncallbackseparateprojectsconflicthardwareinterestdeliverymountainobtained= false;for(var acceptedcapacitycomputeridentityaircraftemployedproposeddomesticincludesprovidedhospitalverticalcollapseapproachpartnerslogo\"><adaughterauthor\" culturalfamilies/images/assemblypowerfulteachingfinisheddistrictcriticalcgi-bin/purposesrequireselectionbecomingprovidesacademicexerciseactuallymedicineconstantaccidentMagazinedocumentstartingbottom\">observed: &quot;extendedpreviousSoftwarecustomerdecisionstrengthdetailedslightlyplanningtextareacurrencyeveryonestraighttransferpositiveproducedheritageshippingabsolutereceivedrelevantbutton\" violenceanywherebenefitslaunchedrecentlyalliancefollowedmultiplebulletinincludedoccurredinternal$(this).republic><tr><tdcongressrecordedultimatesolution<ul id=\"discoverHome</a>websitesnetworksalthoughentirelymemorialmessagescontinueactive\">somewhatvictoriaWestern title=\"LocationcontractvisitorsDownloadwithout right\">\nmeasureswidth = variableinvolvedvirginianormallyhappenedaccountsstandingnationalRegisterpreparedcontrolsaccuratebirthdaystrategyofficialgraphicscriminalpossiblyconsumerPersonalspeakingvalidateachieved.jpg\" />machines</h2>\n keywordsfriendlybrotherscombinedoriginalcomposedexpectedadequatepakistanfollow\" valuable</label>relativebringingincreasegovernorplugins/List of Header\">\" name=\" (&quot;graduate</head>\ncommercemalaysiadirectormaintain;height:schedulechangingback to catholicpatternscolor: #greatestsuppliesreliable</ul>\n\t\t<select citizensclothingwatching<li id=\"specificcarryingsentence<center>contrastthinkingcatch(e)southernMichael merchantcarouselpadding:interior.split(\"lizationOctober ){returnimproved--&gt;\n\ncoveragechairman.png\" />subjectsRichard whateverprobablyrecoverybaseballjudgmentconnect..css\" /> websitereporteddefault\"/></a>\r\nelectricscotlandcreationquantity. ISBN 0did not instance-search-\" lang=\"speakersComputercontainsarchivesministerreactiondiscountItalianocriteriastrongly: 'http:'script'coveringofferingappearedBritish identifyFacebooknumerousvehiclesconcernsAmericanhandlingdiv id=\"William provider_contentaccuracysection andersonflexibleCategorylawrence<script>layout=\"approved maximumheader\"></table>Serviceshamiltoncurrent canadianchannels/themes//articleoptionalportugalvalue=\"\"intervalwirelessentitledagenciesSearch\" measuredthousandspending&hellip;new Date\" size=\"pageNamemiddle\" \" /></a>hidden\">sequencepersonaloverflowopinionsillinoislinks\">\n\t<title>versionssaturdayterminalitempropengineersectionsdesignerproposal=\"false\"EspaC1olreleasessubmit\" er&quot;additionsymptomsorientedresourceright\"><pleasurestationshistory.leaving border=contentscenter\">.\n\nSome directedsuitablebulgaria.show();designedGeneral conceptsExampleswilliamsOriginal\"><span>search\">operatorrequestsa &quot;allowingDocumentrevision. \n\nThe yourselfContact michiganEnglish columbiapriorityprintingdrinkingfacilityreturnedContent officersRussian generate-8859-1\"indicatefamiliar qualitymargin:0 contentviewportcontacts-title\">portable.length eligibleinvolvesatlanticonload=\"default.suppliedpaymentsglossary\n\nAfter guidance</td><tdencodingmiddle\">came to displaysscottishjonathanmajoritywidgets.clinicalthailandteachers<head>\n\taffectedsupportspointer;toString</small>oklahomawill be investor0\" alt=\"holidaysResourcelicensed (which . After considervisitingexplorerprimary search\" android\"quickly meetingsestimate;return ;color:# height=approval, &quot; checked.min.js\"magnetic></a></hforecast. While thursdaydvertise&eacute;hasClassevaluateorderingexistingpatients Online coloradoOptions\"campbell<!-- end</span><<br />\r\n_popups|sciences,&quot; quality Windows assignedheight: <b classle&quot; value=\" Companyexamples<iframe believespresentsmarshallpart of properly).\n\nThe taxonomymuch of </span>\n\" data-srtuguC*sscrollTo project<head>\r\nattorneyemphasissponsorsfancyboxworld's wildlifechecked=sessionsprogrammpx;font- Projectjournalsbelievedvacationthompsonlightingand the special border=0checking</tbody><button Completeclearfix\n<head>\narticle <sectionfindingsrole in popular Octoberwebsite exposureused to changesoperatedclickingenteringcommandsinformed numbers </div>creatingonSubmitmarylandcollegesanalyticlistingscontact.loggedInadvisorysiblingscontent\"s&quot;)s. This packagescheckboxsuggestspregnanttomorrowspacing=icon.pngjapanesecodebasebutton\">gamblingsuch as , while </span> missourisportingtop:1px .</span>tensionswidth=\"2lazyloadnovemberused in height=\"cript\">\n&nbsp;</<tr><td height:2/productcountry include footer\" &lt;!-- title\"></jquery.</form>\n(g.\u0000d=\u0013)(g9\u0001i+\u0014)hrvatskiitalianoromC\"nD\u0003tC<rkC'eX'X1X/Y\u0008tambiC)nnoticiasmensajespersonasderechosnacionalserviciocontactousuariosprogramagobiernoempresasanunciosvalenciacolombiadespuC)sdeportesproyectoproductopC:bliconosotroshistoriapresentemillonesmediantepreguntaanteriorrecursosproblemasantiagonuestrosopiniC3nimprimirmientrasamC)ricavendedorsociedadrespectorealizarregistropalabrasinterC)sentoncesespecialmiembrosrealidadcC3rdobazaragozapC!ginassocialesbloqueargestiC3nalquilersistemascienciascompletoversiC3ncompletaestudiospC:blicaobjetivoalicantebuscadorcantidadentradasaccionesarchivossuperiormayorC-aalemaniafunciC3nC:ltimoshaciendoaquellosediciC3nfernandoambientefacebooknuestrasclientesprocesosbastantepresentareportarcongresopublicarcomerciocontratojC3venesdistritotC)cnicaconjuntoenergC-atrabajarasturiasrecienteutilizarboletC-nsalvadorcorrectatrabajosprimerosnegocioslibertaddetallespantallaprC3ximoalmerC-aanimalesquiC)nescorazC3nsecciC3nbuscandoopcionesexteriorconceptotodavC-agalerC-aescribirmedicinalicenciaconsultaaspectoscrC-ticadC3laresjusticiadeberC!nperC-odonecesitamantenerpequeC1orecibidatribunaltenerifecanciC3ncanariasdescargadiversosmallorcarequieretC)cnicodeberC-aviviendafinanzasadelantefuncionaconsejosdifC-cilciudadesantiguasavanzadatC)rminounidadessC!nchezcampaC1asoftonicrevistascontienesectoresmomentosfacultadcrC)ditodiversassupuestofactoressegundospequeC1aP3P>P4P0P5Q\u0001P;P8P5Q\u0001Q\u0002Q\u000CP1Q\u000BP;P>P1Q\u000BQ\u0002Q\u000CQ\rQ\u0002P>P<P\u0015Q\u0001P;P8Q\u0002P>P3P>P<P5P=Q\u000FP2Q\u0001P5Q\u0005Q\rQ\u0002P>P9P4P0P6P5P1Q\u000BP;P8P3P>P4Q\u0003P4P5P=Q\u000CQ\rQ\u0002P>Q\u0002P1Q\u000BP;P0Q\u0001P5P1Q\u000FP>P4P8P=Q\u0001P5P1P5P=P0P4P>Q\u0001P0P9Q\u0002Q\u0004P>Q\u0002P>P=P5P3P>Q\u0001P2P>P8Q\u0001P2P>P9P8P3Q\u0000Q\u000BQ\u0002P>P6P5P2Q\u0001P5P<Q\u0001P2P>Q\u000EP;P8Q\u0008Q\u000CQ\rQ\u0002P8Q\u0005P?P>P:P0P4P=P5P9P4P>P<P0P<P8Q\u0000P0P;P8P1P>Q\u0002P5P<Q\u0003Q\u0005P>Q\u0002Q\u000FP4P2Q\u0003Q\u0005Q\u0001P5Q\u0002P8P;Q\u000EP4P8P4P5P;P>P<P8Q\u0000P5Q\u0002P5P1Q\u000FQ\u0001P2P>P5P2P8P4P5Q\u0007P5P3P>Q\rQ\u0002P8P<Q\u0001Q\u0007P5Q\u0002Q\u0002P5P<Q\u000BQ\u0006P5P=Q\u000BQ\u0001Q\u0002P0P;P2P5P4Q\u000CQ\u0002P5P<P5P2P>P4Q\u000BQ\u0002P5P1P5P2Q\u000BQ\u0008P5P=P0P<P8Q\u0002P8P?P0Q\u0002P>P<Q\u0003P?Q\u0000P0P2P;P8Q\u0006P0P>P4P=P0P3P>P4Q\u000BP7P=P0Q\u000EP<P>P3Q\u0003P4Q\u0000Q\u0003P3P2Q\u0001P5P9P8P4P5Q\u0002P:P8P=P>P>P4P=P>P4P5P;P0P4P5P;P5Q\u0001Q\u0000P>P:P8Q\u000EP=Q\u000FP2P5Q\u0001Q\u000CP\u0015Q\u0001Q\u0002Q\u000CQ\u0000P0P7P0P=P0Q\u0008P8X'Y\u0004Y\u0004Y\u0007X'Y\u0004X*Y\nX,Y\u0005Y\nX9X.X'X5X)X'Y\u0004X0Y\nX9Y\u0004Y\nY\u0007X,X/Y\nX/X'Y\u0004X\"Y\u0006X'Y\u0004X1X/X*X-Y\u0003Y\u0005X5Y\u0001X-X)Y\u0003X'Y\u0006X*X'Y\u0004Y\u0004Y\nY\nY\u0003Y\u0008Y\u0006X4X(Y\u0003X)Y\u0001Y\nY\u0007X'X(Y\u0006X'X*X-Y\u0008X'X!X#Y\u0003X+X1X.Y\u0004X'Y\u0004X'Y\u0004X-X(X/Y\u0004Y\nY\u0004X/X1Y\u0008X3X'X6X:X7X*Y\u0003Y\u0008Y\u0006Y\u0007Y\u0006X'Y\u0003X3X'X-X)Y\u0006X'X/Y\nX'Y\u0004X7X(X9Y\u0004Y\nY\u0003X4Y\u0003X1X'Y\nY\u0005Y\u0003Y\u0006Y\u0005Y\u0006Y\u0007X'X4X1Y\u0003X)X1X&Y\nX3Y\u0006X4Y\nX7Y\u0005X'X0X'X'Y\u0004Y\u0001Y\u0006X4X(X'X(X*X9X(X1X1X-Y\u0005X)Y\u0003X'Y\u0001X)Y\nY\u0002Y\u0008Y\u0004Y\u0005X1Y\u0003X2Y\u0003Y\u0004Y\u0005X)X#X-Y\u0005X/Y\u0002Y\u0004X(Y\nY\nX9Y\u0006Y\nX5Y\u0008X1X)X7X1Y\nY\u0002X4X'X1Y\u0003X,Y\u0008X'Y\u0004X#X.X1Y\tY\u0005X9Y\u0006X'X'X(X-X+X9X1Y\u0008X6X(X4Y\u0003Y\u0004Y\u0005X3X,Y\u0004X(Y\u0006X'Y\u0006X.X'Y\u0004X/Y\u0003X*X'X(Y\u0003Y\u0004Y\nX)X(X/Y\u0008Y\u0006X#Y\nX6X'Y\nY\u0008X,X/Y\u0001X1Y\nY\u0002Y\u0003X*X(X*X#Y\u0001X6Y\u0004Y\u0005X7X(X.X'Y\u0003X+X1X(X'X1Y\u0003X'Y\u0001X6Y\u0004X'X-Y\u0004Y\tY\u0006Y\u0001X3Y\u0007X#Y\nX'Y\u0005X1X/Y\u0008X/X#Y\u0006Y\u0007X'X/Y\nY\u0006X'X'Y\u0004X'Y\u0006Y\u0005X9X1X6X*X9Y\u0004Y\u0005X/X'X.Y\u0004Y\u0005Y\u0005Y\u0003Y\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0000\u0002\u0000\u0002\u0000\u0002\u0000\u0002\u0000\u0004\u0000\u0004\u0000\u0004\u0000\u0004\u0000\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0007\u0006\u0005\u0004\u0003\u0002\u0001\u0000\u0008\t\n\u000B\u000C\r\u000E\u000F\u000F\u000E\r\u000C\u000B\n\t\u0008\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0017\u0016\u0015\u0014\u0013\u0012\u0011\u0010\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F\u001F\u001E\u001D\u001C\u001B\u001A\u0019\u0018\u007F\u007F\u007F\u007F\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u007F\u007F\u007F\u007F\u0001\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u007F\u007F\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u007F\u007F\u0000\u0001\u0000\u0000\u0000\u0008\u0000\u0008\u0000\u0008\u0000\u0008\u0000\u0000\u0000\u0001\u0000\u0002\u0000\u0003\u0000\u0004\u0000\u0005\u0000\u0006\u0000\u0007resourcescountriesquestionsequipmentcommunityavailablehighlightDTD/xhtmlmarketingknowledgesomethingcontainerdirectionsubscribeadvertisecharacter\" value=\"</select>Australia\" class=\"situationauthorityfollowingprimarilyoperationchallengedevelopedanonymousfunction functionscompaniesstructureagreement\" title=\"potentialeducationargumentssecondarycopyrightlanguagesexclusivecondition</form>\r\nstatementattentionBiography} else {\nsolutionswhen the Analyticstemplatesdangeroussatellitedocumentspublisherimportantprototypeinfluence&raquo;</effectivegenerallytransformbeautifultransportorganizedpublishedprominentuntil thethumbnailNational .focus();over the migrationannouncedfooter\">\nexceptionless thanexpensiveformationframeworkterritoryndicationcurrentlyclassNamecriticismtraditionelsewhereAlexanderappointedmaterialsbroadcastmentionedaffiliate</option>treatmentdifferent/default.Presidentonclick=\"biographyotherwisepermanentFranC'aisHollywoodexpansionstandards</style>\nreductionDecember preferredCambridgeopponentsBusiness confusion>\n<title>presentedexplaineddoes not worldwideinterfacepositionsnewspaper</table>\nmountainslike the essentialfinancialselectionaction=\"/abandonedEducationparseInt(stabilityunable to</title>\nrelationsNote thatefficientperformedtwo yearsSince thethereforewrapper\">alternateincreasedBattle ofperceivedtrying tonecessaryportrayedelectionsElizabeth</iframe>discoveryinsurances.length;legendaryGeographycandidatecorporatesometimesservices.inherited</strong>CommunityreligiouslocationsCommitteebuildingsthe worldno longerbeginningreferencecannot befrequencytypicallyinto the relative;recordingpresidentinitiallytechniquethe otherit can beexistenceunderlinethis timetelephoneitemscopepracticesadvantage);return For otherprovidingdemocracyboth the extensivesufferingsupportedcomputers functionpracticalsaid thatit may beEnglish</from the scheduleddownloads</label>\nsuspectedmargin: 0spiritual</head>\n\nmicrosoftgraduallydiscussedhe becameexecutivejquery.jshouseholdconfirmedpurchasedliterallydestroyedup to thevariationremainingit is notcenturiesJapanese among thecompletedalgorithminterestsrebellionundefinedencourageresizableinvolvingsensitiveuniversalprovision(althoughfeaturingconducted), which continued-header\">February numerous overflow:componentfragmentsexcellentcolspan=\"technicalnear the Advanced source ofexpressedHong Kong Facebookmultiple mechanismelevationoffensive</form>\n\tsponsoreddocument.or &quot;there arethose whomovementsprocessesdifficultsubmittedrecommendconvincedpromoting\" width=\".replace(classicalcoalitionhis firstdecisionsassistantindicatedevolution-wrapper\"enough toalong thedelivered-->\r\n<!--American protectedNovember </style><furnitureInternet onblur=\"suspendedrecipientbased on Moreover,abolishedcollectedwere madeemotionalemergencynarrativeadvocatespx;bordercommitteddir=\"ltr\"employeesresearch. selectedsuccessorcustomersdisplayedSeptemberaddClass(Facebook suggestedand lateroperatingelaborateSometimesInstitutecertainlyinstalledfollowersJerusalemthey havecomputinggeneratedprovincesguaranteearbitraryrecognizewanted topx;width:theory ofbehaviourWhile theestimatedbegan to it becamemagnitudemust havemore thanDirectoryextensionsecretarynaturallyoccurringvariablesgiven theplatform.</label><failed tocompoundskinds of societiesalongside --&gt;\n\nsouthwestthe rightradiationmay have unescape(spoken in\" href=\"/programmeonly the come fromdirectoryburied ina similarthey were</font></Norwegianspecifiedproducingpassenger(new DatetemporaryfictionalAfter theequationsdownload.regularlydeveloperabove thelinked tophenomenaperiod oftooltip\">substanceautomaticaspect ofAmong theconnectedestimatesAir Forcesystem ofobjectiveimmediatemaking itpaintingsconqueredare stillproceduregrowth ofheaded byEuropean divisionsmoleculesfranchiseintentionattractedchildhoodalso useddedicatedsingaporedegree offather ofconflicts</a></p>\ncame fromwere usednote thatreceivingExecutiveeven moreaccess tocommanderPoliticalmusiciansdeliciousprisonersadvent ofUTF-8\" /><![CDATA[\">ContactSouthern bgcolor=\"series of. It was in Europepermittedvalidate.appearingofficialsseriously-languageinitiatedextendinglong-terminflationsuch thatgetCookiemarked by</button>implementbut it isincreasesdown the requiringdependent-->\n<!-- interviewWith the copies ofconsensuswas builtVenezuela(formerlythe statepersonnelstrategicfavour ofinventionWikipediacontinentvirtuallywhich wasprincipleComplete identicalshow thatprimitiveaway frommolecularpreciselydissolvedUnder theversion=\">&nbsp;</It is the This is will haveorganismssome timeFriedrichwas firstthe only fact thatform id=\"precedingTechnicalphysicistoccurs innavigatorsection\">span id=\"sought tobelow thesurviving}</style>his deathas in thecaused bypartiallyexisting using thewas givena list oflevels ofnotion ofOfficial dismissedscientistresemblesduplicateexplosiverecoveredall othergalleries{padding:people ofregion ofaddressesassociateimg alt=\"in modernshould bemethod ofreportingtimestampneeded tothe Greatregardingseemed toviewed asimpact onidea thatthe Worldheight ofexpandingThese arecurrent\">carefullymaintainscharge ofClassicaladdressedpredictedownership<div id=\"right\">\r\nresidenceleave thecontent\">are often })();\r\nprobably Professor-button\" respondedsays thathad to beplaced inHungarianstatus ofserves asUniversalexecutionaggregatefor whichinfectionagreed tohowever, popular\">placed onconstructelectoralsymbol ofincludingreturn toarchitectChristianprevious living ineasier toprofessor\n&lt;!-- effect ofanalyticswas takenwhere thetook overbelief inAfrikaansas far aspreventedwork witha special<fieldsetChristmasRetrieved\n\nIn the back intonortheastmagazines><strong>committeegoverninggroups ofstored inestablisha generalits firsttheir ownpopulatedan objectCaribbeanallow thedistrictswisconsinlocation.; width: inhabitedSocialistJanuary 1</footer>similarlychoice ofthe same specific business The first.length; desire todeal withsince theuserAgentconceivedindex.phpas &quot;engage inrecently,few yearswere also\n<head>\n<edited byare knowncities inaccesskeycondemnedalso haveservices,family ofSchool ofconvertednature of languageministers</object>there is a popularsequencesadvocatedThey wereany otherlocation=enter themuch morereflectedwas namedoriginal a typicalwhen theyengineerscould notresidentswednesdaythe third productsJanuary 2what theya certainreactionsprocessorafter histhe last contained\"></div>\n</a></td>depend onsearch\">\npieces ofcompetingReferencetennesseewhich has version=</span> <</header>gives thehistorianvalue=\"\">padding:0view thattogether,the most was foundsubset ofattack onchildren,points ofpersonal position:allegedlyClevelandwas laterand afterare givenwas stillscrollingdesign ofmakes themuch lessAmericans.\n\nAfter , but theMuseum oflouisiana(from theminnesotaparticlesa processDominicanvolume ofreturningdefensive00px|righmade frommouseover\" style=\"states of(which iscontinuesFranciscobuilding without awith somewho woulda form ofa part ofbefore itknown as Serviceslocation and oftenmeasuringand it ispaperbackvalues of\r\n<title>= window.determineer&quot; played byand early</center>from thisthe threepower andof &quot;innerHTML<a href=\"y:inline;Church ofthe eventvery highofficial -height: content=\"/cgi-bin/to createafrikaansesperantofranC'aislatvieE!ulietuviE3D\u000CeE!tinaD\reE!tina`9\u0004`8\u0017`8\"f\u0017%f\u001C,h*\u001Eg.\u0000d=\u0013e-\u0017g9\u0001i+\u0014e-\u0017m\u0015\u001Cj5-l\u00164d8:d;\u0000d9\u0008h.!g.\u0017f\u001C:g,\u0014h.0f\u001C,h(\u000Eh+\u0016e\r\u0000f\u001C\re\n!e\u0019(d:\u0012h\u0001\u0014g=\u0011f\u0008?e\u001C0d:'d?1d9\u0010i\u0003(e\u0007:g\t\u0008g$>f\u000E\u0012h!\u000Cf&\u001Ci\u0003(h\u0010=f <h?\u001Bd8\u0000f-%f\u0014/d;\u0018e.\u001Di*\u000Ch/\u0001g \u0001e'\u0014e\u0011\u0018d<\u001Af\u00150f\r.e:\u0013f6\u0008h49h\u0000\u0005e\n\u001Ee\u0005,e.$h.(h.:e\u000C:f71e\u001C3e8\u0002f\u0012-f\u0014>e\u0019(e\u000C\u0017d:,e8\u0002e$'e-&g\u0014\u001Fh6\nf\u001D%h6\ng.!g\u0010\u0006e\u0011\u0018d?!f\u0001/g=\u0011serviciosartC-culoargentinabarcelonacualquierpublicadoproductospolC-ticarespuestawikipediasiguientebC:squedacomunidadseguridadprincipalpreguntascontenidorespondervenezuelaproblemasdiciembrerelaciC3nnoviembresimilaresproyectosprogramasinstitutoactividadencuentraeconomC-aimC!genescontactardescargarnecesarioatenciC3ntelC)fonocomisiC3ncancionescapacidadencontraranC!lisisfavoritostC)rminosprovinciaetiquetaselementosfuncionesresultadocarC!cterpropiedadprincipionecesidadmunicipalcreaciC3ndescargaspresenciacomercialopinionesejercicioeditorialsalamancagonzC!lezdocumentopelC-cularecientesgeneralestarragonaprC!cticanovedadespropuestapacientestC)cnicasobjetivoscontactos`$.`%\u0007`$\u0002`$2`$?`$\u000F`$9`%\u0008`$\u0002`$\u0017`$/`$>`$8`$>`$%`$\u000F`$5`$\u0002`$0`$9`%\u0007`$\u0015`%\u000B`$\u0008`$\u0015`%\u0001`$\u001B`$0`$9`$>`$,`$>`$&`$\u0015`$9`$>`$8`$-`%\u0000`$9`%\u0001`$\u000F`$0`$9`%\u0000`$.`%\u0008`$\u0002`$&`$?`$(`$,`$>`$$diplodocs`$8`$.`$/`$0`%\u0002`$*`$(`$>`$.`$*`$$`$>`$+`$?`$0`$\u0014`$8`$$`$$`$0`$9`$2`%\u000B`$\u0017`$9`%\u0001`$\u0006`$,`$>`$0`$&`%\u0007`$6`$9`%\u0001`$\u0008`$\u0016`%\u0007`$2`$/`$&`$?`$\u0015`$>`$.`$5`%\u0007`$,`$$`%\u0000`$(`$,`%\u0000`$\u001A`$.`%\u000C`$$`$8`$>`$2`$2`%\u0007`$\u0016`$\u001C`%\t`$,`$.`$&`$&`$$`$%`$>`$(`$9`%\u0000`$6`$9`$0`$\u0005`$2`$\u0017`$\u0015`$-`%\u0000`$(`$\u0017`$0`$*`$>`$8`$0`$>`$$`$\u0015`$?`$\u000F`$\t`$8`%\u0007`$\u0017`$/`%\u0000`$9`%\u0002`$\u0001`$\u0006`$\u0017`%\u0007`$\u001F`%\u0000`$.`$\u0016`%\u000B`$\u001C`$\u0015`$>`$0`$\u0005`$-`%\u0000`$\u0017`$/`%\u0007`$$`%\u0001`$.`$5`%\u000B`$\u001F`$&`%\u0007`$\u0002`$\u0005`$\u0017`$0`$\u0010`$8`%\u0007`$.`%\u0007`$2`$2`$\u0017`$>`$9`$>`$2`$\n`$*`$0`$\u001A`$>`$0`$\u0010`$8`$>`$&`%\u0007`$0`$\u001C`$?`$8`$&`$?`$2`$,`$\u0002`$&`$,`$(`$>`$9`%\u0002`$\u0002`$2`$>`$\u0016`$\u001C`%\u0000`$$`$,`$\u001F`$(`$.`$?`$2`$\u0007`$8`%\u0007`$\u0006`$(`%\u0007`$(`$/`$>`$\u0015`%\u0001`$2`$2`%\t`$\u0017`$-`$>`$\u0017`$0`%\u0007`$2`$\u001C`$\u0017`$9`$0`$>`$.`$2`$\u0017`%\u0007`$*`%\u0007`$\u001C`$9`$>`$%`$\u0007`$8`%\u0000`$8`$9`%\u0000`$\u0015`$2`$>`$ `%\u0000`$\u0015`$9`$>`$\u0001`$&`%\u0002`$0`$$`$9`$$`$8`$>`$$`$/`$>`$&`$\u0006`$/`$>`$*`$>`$\u0015`$\u0015`%\u000C`$(`$6`$>`$.`$&`%\u0007`$\u0016`$/`$9`%\u0000`$0`$>`$/`$\u0016`%\u0001`$&`$2`$\u0017`%\u0000categoriesexperience</title>\r\nCopyright javascriptconditionseverything<p class=\"technologybackground<a class=\"management&copy; 201javaScriptcharactersbreadcrumbthemselveshorizontalgovernmentCaliforniaactivitiesdiscoveredNavigationtransitionconnectionnavigationappearance</title><mcheckbox\" techniquesprotectionapparentlyas well asunt', 'UA-resolutionoperationstelevisiontranslatedWashingtonnavigator. = window.impression&lt;br&gt;literaturepopulationbgcolor=\"#especially content=\"productionnewsletterpropertiesdefinitionleadershipTechnologyParliamentcomparisonul class=\".indexOf(\"conclusiondiscussioncomponentsbiologicalRevolution_containerunderstoodnoscript><permissioneach otheratmosphere onfocus=\"<form id=\"processingthis.valuegenerationConferencesubsequentwell-knownvariationsreputationphenomenondisciplinelogo.png\" (document,boundariesexpressionsettlementBackgroundout of theenterprise(\"https:\" unescape(\"password\" democratic<a href=\"/wrapper\">\nmembershiplinguisticpx;paddingphilosophyassistanceuniversityfacilitiesrecognizedpreferenceif (typeofmaintainedvocabularyhypothesis.submit();&amp;nbsp;annotationbehind theFoundationpublisher\"assumptionintroducedcorruptionscientistsexplicitlyinstead ofdimensions onClick=\"considereddepartmentoccupationsoon afterinvestmentpronouncedidentifiedexperimentManagementgeographic\" height=\"link rel=\".replace(/depressionconferencepunishmenteliminatedresistanceadaptationoppositionwell knownsupplementdeterminedh1 class=\"0px;marginmechanicalstatisticscelebratedGovernment\n\nDuring tdevelopersartificialequivalentoriginatedCommissionattachment<span id=\"there wereNederlandsbeyond theregisteredjournalistfrequentlyall of thelang=\"en\" </style>\r\nabsolute; supportingextremely mainstream</strong> popularityemployment</table>\r\n colspan=\"</form>\n conversionabout the </p></div>integrated\" lang=\"enPortuguesesubstituteindividualimpossiblemultimediaalmost allpx solid #apart fromsubject toin Englishcriticizedexcept forguidelinesoriginallyremarkablethe secondh2 class=\"<a title=\"(includingparametersprohibited= \"http://dictionaryperceptionrevolutionfoundationpx;height:successfulsupportersmillenniumhis fatherthe &quot;no-repeat;commercialindustrialencouragedamount of unofficialefficiencyReferencescoordinatedisclaimerexpeditiondevelopingcalculatedsimplifiedlegitimatesubstring(0\" class=\"completelyillustratefive yearsinstrumentPublishing1\" class=\"psychologyconfidencenumber of absence offocused onjoined thestructurespreviously></iframe>once againbut ratherimmigrantsof course,a group ofLiteratureUnlike the</a>&nbsp;\nfunction it was theConventionautomobileProtestantaggressiveafter the Similarly,\" /></div>collection\r\nfunctionvisibilitythe use ofvolunteersattractionunder the threatened*<![CDATA[importancein generalthe latter</form>\n</.indexOf('i = 0; i <differencedevoted totraditionssearch forultimatelytournamentattributesso-called }\n</style>evaluationemphasizedaccessible</section>successionalong withMeanwhile,industries</a><br />has becomeaspects ofTelevisionsufficientbasketballboth sidescontinuingan article<img alt=\"adventureshis mothermanchesterprinciplesparticularcommentaryeffects ofdecided to\"><strong>publishersJournal ofdifficultyfacilitateacceptablestyle.css\"\tfunction innovation>Copyrightsituationswould havebusinessesDictionarystatementsoften usedpersistentin Januarycomprising</title>\n\tdiplomaticcontainingperformingextensionsmay not beconcept of onclick=\"It is alsofinancial making theLuxembourgadditionalare calledengaged in\"script\");but it waselectroniconsubmit=\"\n<!-- End electricalofficiallysuggestiontop of theunlike theAustralianOriginallyreferences\n</head>\r\nrecognisedinitializelimited toAlexandriaretirementAdventuresfour years\n\n&lt;!-- increasingdecorationh3 class=\"origins ofobligationregulationclassified(function(advantagesbeing the historians<base hrefrepeatedlywilling tocomparabledesignatednominationfunctionalinside therevelationend of thes for the authorizedrefused totake placeautonomouscompromisepolitical restauranttwo of theFebruary 2quality ofswfobject.understandnearly allwritten byinterviews\" width=\"1withdrawalfloat:leftis usuallycandidatesnewspapersmysteriousDepartmentbest knownparliamentsuppressedconvenientremembereddifferent systematichas led topropagandacontrolledinfluencesceremonialproclaimedProtectionli class=\"Scientificclass=\"no-trademarksmore than widespreadLiberationtook placeday of theas long asimprisonedAdditional\n<head>\n<mLaboratoryNovember 2exceptionsIndustrialvariety offloat: lefDuring theassessmenthave been deals withStatisticsoccurrence/ul></div>clearfix\">the publicmany yearswhich wereover time,synonymouscontent\">\npresumablyhis familyuserAgent.unexpectedincluding challengeda minorityundefined\"belongs totaken fromin Octoberposition: said to bereligious Federation rowspan=\"only a fewmeant thatled to the-->\r\n<div <fieldset>Archbishop class=\"nobeing usedapproachesprivilegesnoscript>\nresults inmay be theEaster eggmechanismsreasonablePopulationCollectionselected\">noscript>\r/index.phparrival of-jssdk'));managed toincompletecasualtiescompletionChristiansSeptember arithmeticproceduresmight haveProductionit appearsPhilosophyfriendshipleading togiving thetoward theguaranteeddocumentedcolor:#000video gamecommissionreflectingchange theassociatedsans-serifonkeypress; padding:He was theunderlyingtypically , and the srcElementsuccessivesince the should be networkingaccountinguse of thelower thanshows that</span>\n\t\tcomplaintscontinuousquantitiesastronomerhe did notdue to itsapplied toan averageefforts tothe futureattempt toTherefore,capabilityRepublicanwas formedElectronickilometerschallengespublishingthe formerindigenousdirectionssubsidiaryconspiracydetails ofand in theaffordablesubstancesreason forconventionitemtype=\"absolutelysupposedlyremained aattractivetravellingseparatelyfocuses onelementaryapplicablefound thatstylesheetmanuscriptstands for no-repeat(sometimesCommercialin Americaundertakenquarter ofan examplepersonallyindex.php?</button>\npercentagebest-knowncreating a\" dir=\"ltrLieutenant\n<div id=\"they wouldability ofmade up ofnoted thatclear thatargue thatto anotherchildren'spurpose offormulatedbased uponthe regionsubject ofpassengerspossession.\n\nIn the Before theafterwardscurrently across thescientificcommunity.capitalismin Germanyright-wingthe systemSociety ofpoliticiandirection:went on toremoval of New York apartmentsindicationduring theunless thehistoricalhad been adefinitiveingredientattendanceCenter forprominencereadyStatestrategiesbut in theas part ofconstituteclaim thatlaboratorycompatiblefailure of, such as began withusing the to providefeature offrom which/\" class=\"geologicalseveral ofdeliberateimportant holds thating&quot; valign=topthe Germanoutside ofnegotiatedhis careerseparationid=\"searchwas calledthe fourthrecreationother thanpreventionwhile the education,connectingaccuratelywere builtwas killedagreementsmuch more Due to thewidth: 100some otherKingdom ofthe entirefamous forto connectobjectivesthe Frenchpeople andfeatured\">is said tostructuralreferendummost oftena separate->\n<div id Official worldwide.aria-labelthe planetand it wasd\" value=\"looking atbeneficialare in themonitoringreportedlythe modernworking onallowed towhere the innovative</a></div>soundtracksearchFormtend to beinput id=\"opening ofrestrictedadopted byaddressingtheologianmethods ofvariant ofChristian very largeautomotiveby far therange frompursuit offollow thebrought toin Englandagree thataccused ofcomes frompreventingdiv style=his or hertremendousfreedom ofconcerning0 1em 1em;Basketball/style.cssan earliereven after/\" title=\".com/indextaking thepittsburghcontent\">\r<script>(fturned outhaving the</span>\r\n occasionalbecause itstarted tophysically></div>\n created byCurrently, bgcolor=\"tabindex=\"disastrousAnalytics also has a><div id=\"</style>\n<called forsinger and.src = \"//violationsthis pointconstantlyis locatedrecordingsd from thenederlandsportuguC*sW\"W\u0011W(W\u0019W*Y\u0001X'X1X3[\u000CdesarrollocomentarioeducaciC3nseptiembreregistradodirecciC3nubicaciC3npublicidadrespuestasresultadosimportantereservadosartC-culosdiferentessiguientesrepC:blicasituaciC3nministerioprivacidaddirectorioformaciC3npoblaciC3npresidentecont";
+ private static final String DATA1 = "enidosaccesoriostechnoratipersonalescategorC-aespecialesdisponibleactualidadreferenciavalladolidbibliotecarelacionescalendariopolC-ticasanterioresdocumentosnaturalezamaterialesdiferenciaeconC3micatransporterodrC-guezparticiparencuentrandiscusiC3nestructurafundaciC3nfrecuentespermanentetotalmenteP<P>P6P=P>P1Q\u0003P4P5Q\u0002P<P>P6P5Q\u0002P2Q\u0000P5P<Q\u000FQ\u0002P0P:P6P5Q\u0007Q\u0002P>P1Q\u000BP1P>P;P5P5P>Q\u0007P5P=Q\u000CQ\rQ\u0002P>P3P>P:P>P3P4P0P?P>Q\u0001P;P5P2Q\u0001P5P3P>Q\u0001P0P9Q\u0002P5Q\u0007P5Q\u0000P5P7P<P>P3Q\u0003Q\u0002Q\u0001P0P9Q\u0002P0P6P8P7P=P8P<P5P6P4Q\u0003P1Q\u0003P4Q\u0003Q\u0002P\u001FP>P8Q\u0001P:P7P4P5Q\u0001Q\u000CP2P8P4P5P>Q\u0001P2Q\u000FP7P8P=Q\u0003P6P=P>Q\u0001P2P>P5P9P;Q\u000EP4P5P9P?P>Q\u0000P=P>P<P=P>P3P>P4P5Q\u0002P5P9Q\u0001P2P>P8Q\u0005P?Q\u0000P0P2P0Q\u0002P0P:P>P9P<P5Q\u0001Q\u0002P>P8P<P5P5Q\u0002P6P8P7P=Q\u000CP>P4P=P>P9P;Q\u0003Q\u0007Q\u0008P5P?P5Q\u0000P5P4Q\u0007P0Q\u0001Q\u0002P8Q\u0007P0Q\u0001Q\u0002Q\u000CQ\u0000P0P1P>Q\u0002P=P>P2Q\u000BQ\u0005P?Q\u0000P0P2P>Q\u0001P>P1P>P9P?P>Q\u0002P>P<P<P5P=P5P5Q\u0007P8Q\u0001P;P5P=P>P2Q\u000BP5Q\u0003Q\u0001P;Q\u0003P3P>P:P>P;P>P=P0P7P0P4Q\u0002P0P:P>P5Q\u0002P>P3P4P0P?P>Q\u0007Q\u0002P8P\u001FP>Q\u0001P;P5Q\u0002P0P:P8P5P=P>P2Q\u000BP9Q\u0001Q\u0002P>P8Q\u0002Q\u0002P0P:P8Q\u0005Q\u0001Q\u0000P0P7Q\u0003P!P0P=P:Q\u0002Q\u0004P>Q\u0000Q\u0003P<P\u001AP>P3P4P0P:P=P8P3P8Q\u0001P;P>P2P0P=P0Q\u0008P5P9P=P0P9Q\u0002P8Q\u0001P2P>P8P<Q\u0001P2Q\u000FP7Q\u000CP;Q\u000EP1P>P9Q\u0007P0Q\u0001Q\u0002P>Q\u0001Q\u0000P5P4P8P\u001AQ\u0000P>P<P5P$P>Q\u0000Q\u0003P<Q\u0000Q\u000BP=P:P5Q\u0001Q\u0002P0P;P8P?P>P8Q\u0001P:Q\u0002Q\u000BQ\u0001Q\u000FQ\u0007P<P5Q\u0001Q\u000FQ\u0006Q\u0006P5P=Q\u0002Q\u0000Q\u0002Q\u0000Q\u0003P4P0Q\u0001P0P<Q\u000BQ\u0005Q\u0000Q\u000BP=P:P0P\u001DP>P2Q\u000BP9Q\u0007P0Q\u0001P>P2P<P5Q\u0001Q\u0002P0Q\u0004P8P;Q\u000CP<P<P0Q\u0000Q\u0002P0Q\u0001Q\u0002Q\u0000P0P=P<P5Q\u0001Q\u0002P5Q\u0002P5P:Q\u0001Q\u0002P=P0Q\u0008P8Q\u0005P<P8P=Q\u0003Q\u0002P8P<P5P=P8P8P<P5Q\u000EQ\u0002P=P>P<P5Q\u0000P3P>Q\u0000P>P4Q\u0001P0P<P>P<Q\rQ\u0002P>P<Q\u0003P:P>P=Q\u0006P5Q\u0001P2P>P5P<P:P0P:P>P9P\u0010Q\u0000Q\u0005P8P2Y\u0005Y\u0006X*X/Y\tX%X1X3X'Y\u0004X1X3X'Y\u0004X)X'Y\u0004X9X'Y\u0005Y\u0003X*X(Y\u0007X'X(X1X'Y\u0005X,X'Y\u0004Y\nY\u0008Y\u0005X'Y\u0004X5Y\u0008X1X,X/Y\nX/X)X'Y\u0004X9X6Y\u0008X%X6X'Y\u0001X)X'Y\u0004Y\u0002X3Y\u0005X'Y\u0004X9X'X(X*X-Y\u0005Y\nY\u0004Y\u0005Y\u0004Y\u0001X'X*Y\u0005Y\u0004X*Y\u0002Y\tX*X9X/Y\nY\u0004X'Y\u0004X4X9X1X#X.X(X'X1X*X7Y\u0008Y\nX1X9Y\u0004Y\nY\u0003Y\u0005X%X1Y\u0001X'Y\u0002X7Y\u0004X(X'X*X'Y\u0004Y\u0004X:X)X*X1X*Y\nX(X'Y\u0004Y\u0006X'X3X'Y\u0004X4Y\nX.Y\u0005Y\u0006X*X/Y\nX'Y\u0004X9X1X(X'Y\u0004Y\u0002X5X5X'Y\u0001Y\u0004X'Y\u0005X9Y\u0004Y\nY\u0007X'X*X-X/Y\nX+X'Y\u0004Y\u0004Y\u0007Y\u0005X'Y\u0004X9Y\u0005Y\u0004Y\u0005Y\u0003X*X(X)Y\nY\u0005Y\u0003Y\u0006Y\u0003X'Y\u0004X7Y\u0001Y\u0004Y\u0001Y\nX/Y\nY\u0008X%X/X'X1X)X*X'X1Y\nX.X'Y\u0004X5X-X)X*X3X,Y\nY\u0004X'Y\u0004Y\u0008Y\u0002X*X9Y\u0006X/Y\u0005X'Y\u0005X/Y\nY\u0006X)X*X5Y\u0005Y\nY\u0005X#X1X4Y\nY\u0001X'Y\u0004X0Y\nY\u0006X9X1X(Y\nX)X(Y\u0008X'X(X)X#Y\u0004X9X'X(X'Y\u0004X3Y\u0001X1Y\u0005X4X'Y\u0003Y\u0004X*X9X'Y\u0004Y\tX'Y\u0004X#Y\u0008Y\u0004X'Y\u0004X3Y\u0006X)X,X'Y\u0005X9X)X'Y\u0004X5X-Y\u0001X'Y\u0004X/Y\nY\u0006Y\u0003Y\u0004Y\u0005X'X*X'Y\u0004X.X'X5X'Y\u0004Y\u0005Y\u0004Y\u0001X#X9X6X'X!Y\u0003X*X'X(X)X'Y\u0004X.Y\nX1X1X3X'X&Y\u0004X'Y\u0004Y\u0002Y\u0004X(X'Y\u0004X#X/X(Y\u0005Y\u0002X'X7X9Y\u0005X1X'X3Y\u0004Y\u0005Y\u0006X7Y\u0002X)X'Y\u0004Y\u0003X*X(X'Y\u0004X1X,Y\u0004X'X4X*X1Y\u0003X'Y\u0004Y\u0002X/Y\u0005Y\nX9X7Y\nY\u0003sByTagName(.jpg\" alt=\"1px solid #.gif\" alt=\"transparentinformationapplication\" onclick=\"establishedadvertising.png\" alt=\"environmentperformanceappropriate&amp;mdash;immediately</strong></rather thantemperaturedevelopmentcompetitionplaceholdervisibility:copyright\">0\" height=\"even thoughreplacementdestinationCorporation<ul class=\"AssociationindividualsperspectivesetTimeout(url(http://mathematicsmargin-top:eventually description) no-repeatcollections.JPG|thumb|participate/head><bodyfloat:left;<li class=\"hundreds of\n\nHowever, compositionclear:both;cooperationwithin the label for=\"border-top:New Zealandrecommendedphotographyinteresting&lt;sup&gt;controversyNetherlandsalternativemaxlength=\"switzerlandDevelopmentessentially\n\nAlthough </textarea>thunderbirdrepresented&amp;ndash;speculationcommunitieslegislationelectronics\n\t<div id=\"illustratedengineeringterritoriesauthoritiesdistributed6\" height=\"sans-serif;capable of disappearedinteractivelooking forit would beAfghanistanwas createdMath.floor(surroundingcan also beobservationmaintenanceencountered<h2 class=\"more recentit has beeninvasion of).getTime()fundamentalDespite the\"><div id=\"inspirationexaminationpreparationexplanation<input id=\"</a></span>versions ofinstrumentsbefore the = 'http://Descriptionrelatively .substring(each of theexperimentsinfluentialintegrationmany peopledue to the combinationdo not haveMiddle East<noscript><copyright\" perhaps theinstitutionin Decemberarrangementmost famouspersonalitycreation oflimitationsexclusivelysovereignty-content\">\n<td class=\"undergroundparallel todoctrine ofoccupied byterminologyRenaissancea number ofsupport forexplorationrecognitionpredecessor<img src=\"/<h1 class=\"publicationmay also bespecialized</fieldset>progressivemillions ofstates thatenforcementaround the one another.parentNodeagricultureAlternativeresearcherstowards theMost of themany other (especially<td width=\";width:100%independent<h3 class=\" onchange=\").addClass(interactionOne of the daughter ofaccessoriesbranches of\r\n<div id=\"the largestdeclarationregulationsInformationtranslationdocumentaryin order to\">\n<head>\n<\" height=\"1across the orientation);</script>implementedcan be seenthere was ademonstratecontainer\">connectionsthe Britishwas written!important;px; margin-followed byability to complicatedduring the immigrationalso called<h4 class=\"distinctionreplaced bygovernmentslocation ofin Novemberwhether the</p>\n</div>acquisitioncalled the persecutiondesignation{font-size:appeared ininvestigateexperiencedmost likelywidely useddiscussionspresence of (document.extensivelyIt has beenit does notcontrary toinhabitantsimprovementscholarshipconsumptioninstructionfor exampleone or morepx; paddingthe currenta series ofare usuallyrole in thepreviously derivativesevidence ofexperiencescolorschemestated thatcertificate</a></div>\n selected=\"high schoolresponse tocomfortableadoption ofthree yearsthe countryin Februaryso that thepeople who provided by<param nameaffected byin terms ofappointmentISO-8859-1\"was born inhistorical regarded asmeasurementis based on and other : function(significantcelebrationtransmitted/js/jquery.is known astheoretical tabindex=\"it could be<noscript>\nhaving been\r\n<head>\r\n< &quot;The compilationhe had beenproduced byphilosopherconstructedintended toamong othercompared toto say thatEngineeringa differentreferred todifferencesbelief thatphotographsidentifyingHistory of Republic ofnecessarilyprobabilitytechnicallyleaving thespectacularfraction ofelectricityhead of therestaurantspartnershipemphasis onmost recentshare with saying thatfilled withdesigned toit is often\"></iframe>as follows:merged withthrough thecommercial pointed outopportunityview of therequirementdivision ofprogramminghe receivedsetInterval\"></span></in New Yorkadditional compression\n\n<div id=\"incorporate;</script><attachEventbecame the \" target=\"_carried outSome of thescience andthe time ofContainer\">maintainingChristopherMuch of thewritings of\" height=\"2size of theversion of mixture of between theExamples ofeducationalcompetitive onsubmit=\"director ofdistinctive/DTD XHTML relating totendency toprovince ofwhich woulddespite thescientific legislature.innerHTML allegationsAgriculturewas used inapproach tointelligentyears later,sans-serifdeterminingPerformanceappearances, which is foundationsabbreviatedhigher thans from the individual composed ofsupposed toclaims thatattributionfont-size:1elements ofHistorical his brotherat the timeanniversarygoverned byrelated to ultimately innovationsit is stillcan only bedefinitionstoGMTStringA number ofimg class=\"Eventually,was changedoccurred inneighboringdistinguishwhen he wasintroducingterrestrialMany of theargues thatan Americanconquest ofwidespread were killedscreen and In order toexpected todescendantsare locatedlegislativegenerations backgroundmost peopleyears afterthere is nothe highestfrequently they do notargued thatshowed thatpredominanttheologicalby the timeconsideringshort-lived</span></a>can be usedvery littleone of the had alreadyinterpretedcommunicatefeatures ofgovernment,</noscript>entered the\" height=\"3Independentpopulationslarge-scale. Although used in thedestructionpossibilitystarting intwo or moreexpressionssubordinatelarger thanhistory and</option>\r\nContinentaleliminatingwill not bepractice ofin front ofsite of theensure thatto create amississippipotentiallyoutstandingbetter thanwhat is nowsituated inmeta name=\"TraditionalsuggestionsTranslationthe form ofatmosphericideologicalenterprisescalculatingeast of theremnants ofpluginspage/index.php?remained intransformedHe was alsowas alreadystatisticalin favor ofMinistry ofmovement offormulationis required<link rel=\"This is the <a href=\"/popularizedinvolved inare used toand severalmade by theseems to belikely thatPalestiniannamed afterit had beenmost commonto refer tobut this isconsecutivetemporarilyIn general,conventionstakes placesubdivisionterritorialoperationalpermanentlywas largelyoutbreak ofin the pastfollowing a xmlns:og=\"><a class=\"class=\"textConversion may be usedmanufactureafter beingclearfix\">\nquestion ofwas electedto become abecause of some peopleinspired bysuccessful a time whenmore commonamongst thean officialwidth:100%;technology,was adoptedto keep thesettlementslive birthsindex.html\"Connecticutassigned to&amp;times;account foralign=rightthe companyalways beenreturned toinvolvementBecause thethis period\" name=\"q\" confined toa result ofvalue=\"\" />is actuallyEnvironment\r\n</head>\r\nConversely,>\n<div id=\"0\" width=\"1is probablyhave becomecontrollingthe problemcitizens ofpoliticiansreached theas early as:none; over<table cellvalidity ofdirectly toonmousedownwhere it iswhen it wasmembers of relation toaccommodatealong with In the latethe Englishdelicious\">this is notthe presentif they areand finallya matter of\r\n\t</div>\r\n\r\n</script>faster thanmajority ofafter whichcomparativeto maintainimprove theawarded theer\" class=\"frameborderrestorationin the sameanalysis oftheir firstDuring the continentalsequence offunction(){font-size: work on the</script>\n<begins withjavascript:constituentwas foundedequilibriumassume thatis given byneeds to becoordinatesthe variousare part ofonly in thesections ofis a commontheories ofdiscoveriesassociationedge of thestrength ofposition inpresent-dayuniversallyto form thebut insteadcorporationattached tois commonlyreasons for &quot;the can be madewas able towhich meansbut did notonMouseOveras possibleoperated bycoming fromthe primaryaddition offor severaltransferreda period ofare able tohowever, itshould havemuch larger\n\t</script>adopted theproperty ofdirected byeffectivelywas broughtchildren ofProgramminglonger thanmanuscriptswar againstby means ofand most ofsimilar to proprietaryoriginatingprestigiousgrammaticalexperience.to make theIt was alsois found incompetitorsin the U.S.replace thebrought thecalculationfall of thethe generalpracticallyin honor ofreleased inresidentialand some ofking of thereaction to1st Earl ofculture andprincipally</title>\n they can beback to thesome of hisexposure toare similarform of theaddFavoritecitizenshippart in thepeople within practiceto continue&amp;minus;approved by the first allowed theand for thefunctioningplaying thesolution toheight=\"0\" in his bookmore than afollows thecreated thepresence in&nbsp;</td>nationalistthe idea ofa characterwere forced class=\"btndays of thefeatured inshowing theinterest inin place ofturn of thethe head ofLord of thepoliticallyhas its ownEducationalapproval ofsome of theeach other,behavior ofand becauseand anotherappeared onrecorded inblack&quot;may includethe world'scan lead torefers to aborder=\"0\" government winning theresulted in while the Washington,the subjectcity in the></div>\r\n\t\treflect theto completebecame moreradioactiverejected bywithout anyhis father,which couldcopy of theto indicatea politicalaccounts ofconstitutesworked wither</a></li>of his lifeaccompaniedclientWidthprevent theLegislativedifferentlytogether inhas severalfor anothertext of thefounded thee with the is used forchanged theusually theplace wherewhereas the> <a href=\"\"><a href=\"themselves,although hethat can betraditionalrole of theas a resultremoveChilddesigned bywest of theSome peopleproduction,side of thenewslettersused by thedown to theaccepted bylive in theattempts tooutside thefrequenciesHowever, inprogrammersat least inapproximatealthough itwas part ofand variousGovernor ofthe articleturned into><a href=\"/the economyis the mostmost widelywould laterand perhapsrise to theoccurs whenunder whichconditions.the westerntheory thatis producedthe city ofin which heseen in thethe centralbuilding ofmany of hisarea of theis the onlymost of themany of thethe WesternThere is noextended toStatisticalcolspan=2 |short storypossible totopologicalcritical ofreported toa Christiandecision tois equal toproblems ofThis can bemerchandisefor most ofno evidenceeditions ofelements in&quot;. Thecom/images/which makesthe processremains theliterature,is a memberthe popularthe ancientproblems intime of thedefeated bybody of thea few yearsmuch of thethe work ofCalifornia,served as agovernment.concepts ofmovement in\t\t<div id=\"it\" value=\"language ofas they areproduced inis that theexplain thediv></div>\nHowever thelead to the\t<a href=\"/was grantedpeople havecontinuallywas seen asand relatedthe role ofproposed byof the besteach other.Constantinepeople fromdialects ofto revisionwas renameda source ofthe initiallaunched inprovide theto the westwhere thereand similarbetween twois also theEnglish andconditions,that it wasentitled tothemselves.quantity ofransparencythe same asto join thecountry andthis is theThis led toa statementcontrast tolastIndexOfthrough hisis designedthe term isis providedprotect theng</a></li>The currentthe site ofsubstantialexperience,in the Westthey shouldslovenD\rinacomentariosuniversidadcondicionesactividadesexperienciatecnologC-aproducciC3npuntuaciC3naplicaciC3ncontraseC1acategorC-asregistrarseprofesionaltratamientoregC-stratesecretarC-aprincipalesprotecciC3nimportantesimportanciaposibilidadinteresantecrecimientonecesidadessuscribirseasociaciC3ndisponiblesevaluaciC3nestudiantesresponsableresoluciC3nguadalajararegistradosoportunidadcomercialesfotografC-aautoridadesingenierC-atelevisiC3ncompetenciaoperacionesestablecidosimplementeactualmentenavegaciC3nconformidadline-height:font-family:\" : \"http://applicationslink\" href=\"specifically//<![CDATA[\nOrganizationdistribution0px; height:relationshipdevice-width<div class=\"<label for=\"registration</noscript>\n/index.html\"window.open( !important;application/independence//www.googleorganizationautocompleterequirementsconservative<form name=\"intellectualmargin-left:18th centuryan importantinstitutionsabbreviation<img class=\"organisationcivilization19th centuryarchitectureincorporated20th century-container\">most notably/></a></div>notification'undefined')Furthermore,believe thatinnerHTML = prior to thedramaticallyreferring tonegotiationsheadquartersSouth AfricaunsuccessfulPennsylvaniaAs a result,<html lang=\"&lt;/sup&gt;dealing withphiladelphiahistorically);</script>\npadding-top:experimentalgetAttributeinstructionstechnologiespart of the =function(){subscriptionl.dtd\">\r\n<htgeographicalConstitution', function(supported byagriculturalconstructionpublicationsfont-size: 1a variety of<div style=\"Encyclopediaiframe src=\"demonstratedaccomplisheduniversitiesDemographics);</script><dedicated toknowledge ofsatisfactionparticularly</div></div>English (US)appendChild(transmissions. However, intelligence\" tabindex=\"float:right;Commonwealthranging fromin which theat least onereproductionencyclopedia;font-size:1jurisdictionat that time\"><a class=\"In addition,description+conversationcontact withis generallyr\" content=\"representing&lt;math&gt;presentationoccasionally<img width=\"navigation\">compensationchampionshipmedia=\"all\" violation ofreference toreturn true;Strict//EN\" transactionsinterventionverificationInformation difficultiesChampionshipcapabilities<![endif]-->}\n</script>\nChristianityfor example,Professionalrestrictionssuggest thatwas released(such as theremoveClass(unemploymentthe Americanstructure of/index.html published inspan class=\"\"><a href=\"/introductionbelonging toclaimed thatconsequences<meta name=\"Guide to theoverwhelmingagainst the concentrated,\n.nontouch observations</a>\n</div>\nf (document.border: 1px {font-size:1treatment of0\" height=\"1modificationIndependencedivided intogreater thanachievementsestablishingJavaScript\" neverthelesssignificanceBroadcasting>&nbsp;</td>container\">\nsuch as the influence ofa particularsrc='http://navigation\" half of the substantial &nbsp;</div>advantage ofdiscovery offundamental metropolitanthe opposite\" xml:lang=\"deliberatelyalign=centerevolution ofpreservationimprovementsbeginning inJesus ChristPublicationsdisagreementtext-align:r, function()similaritiesbody></html>is currentlyalphabeticalis sometimestype=\"image/many of the flow:hidden;available indescribe theexistence ofall over thethe Internet\t<ul class=\"installationneighborhoodarmed forcesreducing thecontinues toNonetheless,temperatures\n\t\t<a href=\"close to theexamples of is about the(see below).\" id=\"searchprofessionalis availablethe official\t\t</script>\n\n\t\t<div id=\"accelerationthrough the Hall of Famedescriptionstranslationsinterference type='text/recent yearsin the worldvery popular{background:traditional some of the connected toexploitationemergence ofconstitutionA History ofsignificant manufacturedexpectations><noscript><can be foundbecause the has not beenneighbouringwithout the added to the\t<li class=\"instrumentalSoviet Unionacknowledgedwhich can bename for theattention toattempts to developmentsIn fact, the<li class=\"aimplicationssuitable formuch of the colonizationpresidentialcancelBubble Informationmost of the is describedrest of the more or lessin SeptemberIntelligencesrc=\"http://px; height: available tomanufacturerhuman rightslink href=\"/availabilityproportionaloutside the astronomicalhuman beingsname of the are found inare based onsmaller thana person whoexpansion ofarguing thatnow known asIn the earlyintermediatederived fromScandinavian</a></div>\r\nconsider thean estimatedthe National<div id=\"pagresulting incommissionedanalogous toare required/ul>\n</div>\nwas based onand became a&nbsp;&nbsp;t\" value=\"\" was capturedno more thanrespectivelycontinue to >\r\n<head>\r\n<were createdmore generalinformation used for theindependent the Imperialcomponent ofto the northinclude the Constructionside of the would not befor instanceinvention ofmore complexcollectivelybackground: text-align: its originalinto accountthis processan extensivehowever, thethey are notrejected thecriticism ofduring whichprobably thethis article(function(){It should bean agreementaccidentallydiffers fromArchitecturebetter knownarrangementsinfluence onattended theidentical tosouth of thepass throughxml\" title=\"weight:bold;creating thedisplay:nonereplaced the<img src=\"/ihttps://www.World War IItestimonialsfound in therequired to and that thebetween the was designedconsists of considerablypublished bythe languageConservationconsisted ofrefer to theback to the css\" media=\"People from available onproved to besuggestions\"was known asvarieties oflikely to becomprised ofsupport the hands of thecoupled withconnect and border:none;performancesbefore beinglater becamecalculationsoften calledresidents ofmeaning that><li class=\"evidence forexplanationsenvironments\"></a></div>which allowsIntroductiondeveloped bya wide rangeon behalf ofvalign=\"top\"principle ofat the time,</noscript>\rsaid to havein the firstwhile othershypotheticalphilosopherspower of thecontained inperformed byinability towere writtenspan style=\"input name=\"the questionintended forrejection ofimplies thatinvented thethe standardwas probablylink betweenprofessor ofinteractionschanging theIndian Ocean class=\"lastworking with'http://www.years beforeThis was therecreationalentering themeasurementsan extremelyvalue of thestart of the\n</script>\n\nan effort toincrease theto the southspacing=\"0\">sufficientlythe Europeanconverted toclearTimeoutdid not haveconsequentlyfor the nextextension ofeconomic andalthough theare producedand with theinsufficientgiven by thestating thatexpenditures</span></a>\nthought thaton the basiscellpadding=image of thereturning toinformation,separated byassassinateds\" content=\"authority ofnorthwestern</div>\n<div \"></div>\r\n consultationcommunity ofthe nationalit should beparticipants align=\"leftthe greatestselection ofsupernaturaldependent onis mentionedallowing thewas inventedaccompanyinghis personalavailable atstudy of theon the otherexecution ofHuman Rightsterms of theassociationsresearch andsucceeded bydefeated theand from thebut they arecommander ofstate of theyears of agethe study of<ul class=\"splace in thewhere he was<li class=\"fthere are nowhich becamehe publishedexpressed into which thecommissionerfont-weight:territory ofextensions\">Roman Empireequal to theIn contrast,however, andis typicallyand his wife(also called><ul class=\"effectively evolved intoseem to havewhich is thethere was noan excellentall of thesedescribed byIn practice,broadcastingcharged withreflected insubjected tomilitary andto the pointeconomicallysetTargetingare actuallyvictory over();</script>continuouslyrequired forevolutionaryan effectivenorth of the, which was front of theor otherwisesome form ofhad not beengenerated byinformation.permitted toincludes thedevelopment,entered intothe previousconsistentlyare known asthe field ofthis type ofgiven to thethe title ofcontains theinstances ofin the northdue to theirare designedcorporationswas that theone of thesemore popularsucceeded insupport fromin differentdominated bydesigned forownership ofand possiblystandardizedresponseTextwas intendedreceived theassumed thatareas of theprimarily inthe basis ofin the senseaccounts fordestroyed byat least twowas declaredcould not beSecretary ofappear to bemargin-top:1/^\\s+|\\s+$/ge){throw e};the start oftwo separatelanguage andwho had beenoperation ofdeath of thereal numbers\t<link rel=\"provided thethe story ofcompetitionsenglish (UK)english (US)P\u001CP>P=P3P>P;P!Q\u0000P?Q\u0001P:P8Q\u0001Q\u0000P?Q\u0001P:P8Q\u0001Q\u0000P?Q\u0001P:P>Y\u0004X9X1X(Y\nX)f-#i+\u0014d8-f\u0016\u0007g.\u0000d=\u0013d8-f\u0016\u0007g9\u0001d=\u0013d8-f\u0016\u0007f\u001C\ti\u0019\u0010e\u0005,e\u000F8d::f0\u0011f\u0014?e:\u001Ci\u0018?i\u0007\u000Ce74e74g$>d<\u001Ad8;d9\tf\u0013\rd=\u001Cg3;g;\u001Ff\u0014?g-\u0016f3\u0015h'\u0004informaciC3nherramientaselectrC3nicodescripciC3nclasificadosconocimientopublicaciC3nrelacionadasinformC!ticarelacionadosdepartamentotrabajadoresdirectamenteayuntamientomercadoLibrecontC!ctenoshabitacionescumplimientorestaurantesdisposiciC3nconsecuenciaelectrC3nicaaplicacionesdesconectadoinstalaciC3nrealizaciC3nutilizaciC3nenciclopediaenfermedadesinstrumentosexperienciasinstituciC3nparticularessubcategoriaQ\u0002P>P;Q\u000CP:P>P P>Q\u0001Q\u0001P8P8Q\u0000P0P1P>Q\u0002Q\u000BP1P>P;Q\u000CQ\u0008P5P?Q\u0000P>Q\u0001Q\u0002P>P<P>P6P5Q\u0002P5P4Q\u0000Q\u0003P3P8Q\u0005Q\u0001P;Q\u0003Q\u0007P0P5Q\u0001P5P9Q\u0007P0Q\u0001P2Q\u0001P5P3P4P0P P>Q\u0001Q\u0001P8Q\u000FP\u001CP>Q\u0001P:P2P5P4Q\u0000Q\u0003P3P8P5P3P>Q\u0000P>P4P0P2P>P?Q\u0000P>Q\u0001P4P0P=P=Q\u000BQ\u0005P4P>P;P6P=Q\u000BP8P<P5P=P=P>P\u001CP>Q\u0001P:P2Q\u000BQ\u0000Q\u0003P1P;P5P9P\u001CP>Q\u0001P:P2P0Q\u0001Q\u0002Q\u0000P0P=Q\u000BP=P8Q\u0007P5P3P>Q\u0000P0P1P>Q\u0002P5P4P>P;P6P5P=Q\u0003Q\u0001P;Q\u0003P3P8Q\u0002P5P?P5Q\u0000Q\u000CP\u001EP4P=P0P:P>P?P>Q\u0002P>P<Q\u0003Q\u0000P0P1P>Q\u0002Q\u0003P0P?Q\u0000P5P;Q\u000FP2P>P>P1Q\tP5P>P4P=P>P3P>Q\u0001P2P>P5P3P>Q\u0001Q\u0002P0Q\u0002Q\u000CP8P4Q\u0000Q\u0003P3P>P9Q\u0004P>Q\u0000Q\u0003P<P5Q\u0005P>Q\u0000P>Q\u0008P>P?Q\u0000P>Q\u0002P8P2Q\u0001Q\u0001Q\u000BP;P:P0P:P0P6P4Q\u000BP9P2P;P0Q\u0001Q\u0002P8P3Q\u0000Q\u0003P?P?Q\u000BP2P<P5Q\u0001Q\u0002P5Q\u0000P0P1P>Q\u0002P0Q\u0001P:P0P7P0P;P?P5Q\u0000P2Q\u000BP9P4P5P;P0Q\u0002Q\u000CP4P5P=Q\u000CP3P8P?P5Q\u0000P8P>P4P1P8P7P=P5Q\u0001P>Q\u0001P=P>P2P5P<P>P<P5P=Q\u0002P:Q\u0003P?P8Q\u0002Q\u000CP4P>P;P6P=P0Q\u0000P0P<P:P0Q\u0005P=P0Q\u0007P0P;P>P P0P1P>Q\u0002P0P\"P>P;Q\u000CP:P>Q\u0001P>P2Q\u0001P5P<P2Q\u0002P>Q\u0000P>P9P=P0Q\u0007P0P;P0Q\u0001P?P8Q\u0001P>P:Q\u0001P;Q\u0003P6P1Q\u000BQ\u0001P8Q\u0001Q\u0002P5P<P?P5Q\u0007P0Q\u0002P8P=P>P2P>P3P>P?P>P<P>Q\tP8Q\u0001P0P9Q\u0002P>P2P?P>Q\u0007P5P<Q\u0003P?P>P<P>Q\tQ\u000CP4P>P;P6P=P>Q\u0001Q\u0001Q\u000BP;P:P8P1Q\u000BQ\u0001Q\u0002Q\u0000P>P4P0P=P=Q\u000BP5P<P=P>P3P8P5P?Q\u0000P>P5P:Q\u0002P!P5P9Q\u0007P0Q\u0001P<P>P4P5P;P8Q\u0002P0P:P>P3P>P>P=P;P0P9P=P3P>Q\u0000P>P4P5P2P5Q\u0000Q\u0001P8Q\u000FQ\u0001Q\u0002Q\u0000P0P=P5Q\u0004P8P;Q\u000CP<Q\u000BQ\u0003Q\u0000P>P2P=Q\u000FQ\u0000P0P7P=Q\u000BQ\u0005P8Q\u0001P:P0Q\u0002Q\u000CP=P5P4P5P;Q\u000EQ\u000FP=P2P0Q\u0000Q\u000FP<P5P=Q\u000CQ\u0008P5P<P=P>P3P8Q\u0005P4P0P=P=P>P9P7P=P0Q\u0007P8Q\u0002P=P5P;Q\u000CP7Q\u000FQ\u0004P>Q\u0000Q\u0003P<P0P\"P5P?P5Q\u0000Q\u000CP<P5Q\u0001Q\u000FQ\u0006P0P7P0Q\tP8Q\u0002Q\u000BP\u001BQ\u0003Q\u0007Q\u0008P8P5`$(`$9`%\u0000`$\u0002`$\u0015`$0`$(`%\u0007`$\u0005`$*`$(`%\u0007`$\u0015`$?`$/`$>`$\u0015`$0`%\u0007`$\u0002`$\u0005`$(`%\r`$/`$\u0015`%\r`$/`$>`$\u0017`$>`$\u0007`$!`$,`$>`$0`%\u0007`$\u0015`$?`$8`%\u0000`$&`$?`$/`$>`$*`$9`$2`%\u0007`$8`$?`$\u0002`$9`$-`$>`$0`$$`$\u0005`$*`$(`%\u0000`$5`$>`$2`%\u0007`$8`%\u0007`$5`$>`$\u0015`$0`$$`%\u0007`$.`%\u0007`$0`%\u0007`$9`%\u000B`$(`%\u0007`$8`$\u0015`$$`%\u0007`$,`$9`%\u0001`$$`$8`$>`$\u0007`$\u001F`$9`%\u000B`$\u0017`$>`$\u001C`$>`$(`%\u0007`$.`$?`$(`$\u001F`$\u0015`$0`$$`$>`$\u0015`$0`$(`$>`$\t`$(`$\u0015`%\u0007`$/`$9`$>`$\u0001`$8`$,`$8`%\u0007`$-`$>`$7`$>`$\u0006`$*`$\u0015`%\u0007`$2`$?`$/`%\u0007`$6`%\u0001`$0`%\u0002`$\u0007`$8`$\u0015`%\u0007`$\u0018`$\u0002`$\u001F`%\u0007`$.`%\u0007`$0`%\u0000`$8`$\u0015`$$`$>`$.`%\u0007`$0`$>`$2`%\u0007`$\u0015`$0`$\u0005`$'`$?`$\u0015`$\u0005`$*`$(`$>`$8`$.`$>`$\u001C`$.`%\u0001`$\u001D`%\u0007`$\u0015`$>`$0`$#`$9`%\u000B`$$`$>`$\u0015`$!`$<`%\u0000`$/`$9`$>`$\u0002`$9`%\u000B`$\u001F`$2`$6`$,`%\r`$&`$2`$?`$/`$>`$\u001C`%\u0000`$5`$(`$\u001C`$>`$$`$>`$\u0015`%\u0008`$8`%\u0007`$\u0006`$*`$\u0015`$>`$5`$>`$2`%\u0000`$&`%\u0007`$(`%\u0007`$*`%\u0002`$0`%\u0000`$*`$>`$(`%\u0000`$\t`$8`$\u0015`%\u0007`$9`%\u000B`$\u0017`%\u0000`$,`%\u0008`$ `$\u0015`$\u0006`$*`$\u0015`%\u0000`$5`$0`%\r`$7`$\u0017`$>`$\u0002`$5`$\u0006`$*`$\u0015`%\u000B`$\u001C`$?`$2`$>`$\u001C`$>`$(`$>`$8`$9`$.`$$`$9`$.`%\u0007`$\u0002`$\t`$(`$\u0015`%\u0000`$/`$>`$9`%\u0002`$&`$0`%\r`$\u001C`$8`%\u0002`$\u001A`%\u0000`$*`$8`$\u0002`$&`$8`$5`$>`$2`$9`%\u000B`$(`$>`$9`%\u000B`$$`%\u0000`$\u001C`%\u0008`$8`%\u0007`$5`$>`$*`$8`$\u001C`$(`$$`$>`$(`%\u0007`$$`$>`$\u001C`$>`$0`%\u0000`$\u0018`$>`$/`$2`$\u001C`$?`$2`%\u0007`$(`%\u0000`$\u001A`%\u0007`$\u001C`$>`$\u0002`$\u001A`$*`$$`%\r`$0`$\u0017`%\u0002`$\u0017`$2`$\u001C`$>`$$`%\u0007`$,`$>`$9`$0`$\u0006`$*`$(`%\u0007`$5`$>`$9`$(`$\u0007`$8`$\u0015`$>`$8`%\u0001`$,`$9`$0`$9`$(`%\u0007`$\u0007`$8`$8`%\u0007`$8`$9`$?`$$`$,`$!`$<`%\u0007`$\u0018`$\u001F`$(`$>`$$`$2`$>`$6`$*`$>`$\u0002`$\u001A`$6`%\r`$0`%\u0000`$,`$!`$<`%\u0000`$9`%\u000B`$$`%\u0007`$8`$>`$\u0008`$\u001F`$6`$>`$/`$&`$8`$\u0015`$$`%\u0000`$\u001C`$>`$$`%\u0000`$5`$>`$2`$>`$9`$\u001C`$>`$0`$*`$\u001F`$(`$>`$0`$\u0016`$(`%\u0007`$8`$!`$<`$\u0015`$.`$?`$2`$>`$\t`$8`$\u0015`%\u0000`$\u0015`%\u0007`$5`$2`$2`$\u0017`$$`$>`$\u0016`$>`$(`$>`$\u0005`$0`%\r`$%`$\u001C`$9`$>`$\u0002`$&`%\u0007`$\u0016`$>`$*`$9`$2`%\u0000`$(`$?`$/`$.`$,`$?`$(`$>`$,`%\u0008`$\u0002`$\u0015`$\u0015`$9`%\u0000`$\u0002`$\u0015`$9`$(`$>`$&`%\u0007`$$`$>`$9`$.`$2`%\u0007`$\u0015`$>`$+`%\u0000`$\u001C`$,`$\u0015`$?`$$`%\u0001`$0`$$`$.`$>`$\u0002`$\u0017`$5`$9`%\u0000`$\u0002`$0`%\u000B`$\u001C`$<`$.`$?`$2`%\u0000`$\u0006`$0`%\u000B`$*`$8`%\u0007`$(`$>`$/`$>`$&`$5`$2`%\u0007`$(`%\u0007`$\u0016`$>`$$`$>`$\u0015`$0`%\u0000`$,`$\t`$(`$\u0015`$>`$\u001C`$5`$>`$,`$*`%\u0002`$0`$>`$,`$!`$<`$>`$8`%\u000C`$&`$>`$6`%\u0007`$/`$0`$\u0015`$?`$/`%\u0007`$\u0015`$9`$>`$\u0002`$\u0005`$\u0015`$8`$0`$,`$(`$>`$\u000F`$5`$9`$>`$\u0002`$8`%\r`$%`$2`$.`$?`$2`%\u0007`$2`%\u0007`$\u0016`$\u0015`$5`$?`$7`$/`$\u0015`%\r`$0`$\u0002`$8`$.`%\u0002`$9`$%`$>`$(`$>X*X3X*X7Y\nX9Y\u0005X4X'X1Y\u0003X)X(Y\u0008X'X3X7X)X'Y\u0004X5Y\u0001X-X)Y\u0005Y\u0008X'X6Y\nX9X'Y\u0004X.X'X5X)X'Y\u0004Y\u0005X2Y\nX/X'Y\u0004X9X'Y\u0005X)X'Y\u0004Y\u0003X'X*X(X'Y\u0004X1X/Y\u0008X/X(X1Y\u0006X'Y\u0005X,X'Y\u0004X/Y\u0008Y\u0004X)X'Y\u0004X9X'Y\u0004Y\u0005X'Y\u0004Y\u0005Y\u0008Y\u0002X9X'Y\u0004X9X1X(Y\nX'Y\u0004X3X1Y\nX9X'Y\u0004X,Y\u0008X'Y\u0004X'Y\u0004X0Y\u0007X'X(X'Y\u0004X-Y\nX'X)X'Y\u0004X-Y\u0002Y\u0008Y\u0002X'Y\u0004Y\u0003X1Y\nY\u0005X'Y\u0004X9X1X'Y\u0002Y\u0005X-Y\u0001Y\u0008X8X)X'Y\u0004X+X'Y\u0006Y\nY\u0005X4X'Y\u0007X/X)X'Y\u0004Y\u0005X1X#X)X'Y\u0004Y\u0002X1X\"Y\u0006X'Y\u0004X4X(X'X(X'Y\u0004X-Y\u0008X'X1X'Y\u0004X,X/Y\nX/X'Y\u0004X#X3X1X)X'Y\u0004X9Y\u0004Y\u0008Y\u0005Y\u0005X,Y\u0005Y\u0008X9X)X'Y\u0004X1X-Y\u0005Y\u0006X'Y\u0004Y\u0006Y\u0002X'X7Y\u0001Y\u0004X3X7Y\nY\u0006X'Y\u0004Y\u0003Y\u0008Y\nX*X'Y\u0004X/Y\u0006Y\nX'X(X1Y\u0003X'X*Y\u0007X'Y\u0004X1Y\nX'X6X*X-Y\nX'X*Y\nX(X*Y\u0008Y\u0002Y\nX*X'Y\u0004X#Y\u0008Y\u0004Y\tX'Y\u0004X(X1Y\nX/X'Y\u0004Y\u0003Y\u0004X'Y\u0005X'Y\u0004X1X'X(X7X'Y\u0004X4X.X5Y\nX3Y\nX'X1X'X*X'Y\u0004X+X'Y\u0004X+X'Y\u0004X5Y\u0004X'X)X'Y\u0004X-X/Y\nX+X'Y\u0004X2Y\u0008X'X1X'Y\u0004X.Y\u0004Y\nX,X'Y\u0004X,Y\u0005Y\nX9X'Y\u0004X9X'Y\u0005Y\u0007X'Y\u0004X,Y\u0005X'Y\u0004X'Y\u0004X3X'X9X)Y\u0005X4X'Y\u0007X/Y\u0007X'Y\u0004X1X&Y\nX3X'Y\u0004X/X.Y\u0008Y\u0004X'Y\u0004Y\u0001Y\u0006Y\nX)X'Y\u0004Y\u0003X*X'X(X'Y\u0004X/Y\u0008X1Y\nX'Y\u0004X/X1Y\u0008X3X'X3X*X:X1Y\u0002X*X5X'Y\u0005Y\nY\u0005X'Y\u0004X(Y\u0006X'X*X'Y\u0004X9X8Y\nY\u0005entertainmentunderstanding = function().jpg\" width=\"configuration.png\" width=\"<body class=\"Math.random()contemporary United Statescircumstances.appendChild(organizations<span class=\"\"><img src=\"/distinguishedthousands of communicationclear\"></div>investigationfavicon.ico\" margin-right:based on the Massachusettstable border=internationalalso known aspronunciationbackground:#fpadding-left:For example, miscellaneous&lt;/math&gt;psychologicalin particularearch\" type=\"form method=\"as opposed toSupreme Courtoccasionally Additionally,North Americapx;backgroundopportunitiesEntertainment.toLowerCase(manufacturingprofessional combined withFor instance,consisting of\" maxlength=\"return false;consciousnessMediterraneanextraordinaryassassinationsubsequently button type=\"the number ofthe original comprehensiverefers to the</ul>\n</div>\nphilosophicallocation.hrefwas publishedSan Francisco(function(){\n<div id=\"mainsophisticatedmathematical /head>\r\n<bodysuggests thatdocumentationconcentrationrelationshipsmay have been(for example,This article in some casesparts of the definition ofGreat Britain cellpadding=equivalent toplaceholder=\"; font-size: justificationbelieved thatsuffered fromattempted to leader of thecript\" src=\"/(function() {are available\n\t<link rel=\" src='http://interested inconventional \" alt=\"\" /></are generallyhas also beenmost popular correspondingcredited withtyle=\"border:</a></span></.gif\" width=\"<iframe src=\"table class=\"inline-block;according to together withapproximatelyparliamentarymore and moredisplay:none;traditionallypredominantly&nbsp;|&nbsp;&nbsp;</span> cellspacing=<input name=\"or\" content=\"controversialproperty=\"og:/x-shockwave-demonstrationsurrounded byNevertheless,was the firstconsiderable Although the collaborationshould not beproportion of<span style=\"known as the shortly afterfor instance,described as /head>\n<body starting withincreasingly the fact thatdiscussion ofmiddle of thean individualdifficult to point of viewhomosexualityacceptance of</span></div>manufacturersorigin of thecommonly usedimportance ofdenominationsbackground: #length of thedeterminationa significant\" border=\"0\">revolutionaryprinciples ofis consideredwas developedIndo-Europeanvulnerable toproponents ofare sometimescloser to theNew York City name=\"searchattributed tocourse of themathematicianby the end ofat the end of\" border=\"0\" technological.removeClass(branch of theevidence that![endif]-->\r\nInstitute of into a singlerespectively.and thereforeproperties ofis located insome of whichThere is alsocontinued to appearance of &amp;ndash; describes theconsiderationauthor of theindependentlyequipped withdoes not have</a><a href=\"confused with<link href=\"/at the age ofappear in theThese includeregardless ofcould be used style=&quot;several timesrepresent thebody>\n</html>thought to bepopulation ofpossibilitiespercentage ofaccess to thean attempt toproduction ofjquery/jquerytwo differentbelong to theestablishmentreplacing thedescription\" determine theavailable forAccording to wide range of\t<div class=\"more commonlyorganisationsfunctionalitywas completed &amp;mdash; participationthe characteran additionalappears to befact that thean example ofsignificantlyonmouseover=\"because they async = true;problems withseems to havethe result of src=\"http://familiar withpossession offunction () {took place inand sometimessubstantially<span></span>is often usedin an attemptgreat deal ofEnvironmentalsuccessfully virtually all20th century,professionalsnecessary to determined bycompatibilitybecause it isDictionary ofmodificationsThe followingmay refer to:Consequently,Internationalalthough somethat would beworld's firstclassified asbottom of the(particularlyalign=\"left\" most commonlybasis for thefoundation ofcontributionspopularity ofcenter of theto reduce thejurisdictionsapproximation onmouseout=\"New Testamentcollection of</span></a></in the Unitedfilm director-strict.dtd\">has been usedreturn to thealthough thischange in theseveral otherbut there areunprecedentedis similar toespecially inweight: bold;is called thecomputationalindicate thatrestricted to\t<meta name=\"are typicallyconflict withHowever, the An example ofcompared withquantities ofrather than aconstellationnecessary forreported thatspecificationpolitical and&nbsp;&nbsp;<references tothe same yearGovernment ofgeneration ofhave not beenseveral yearscommitment to\t\t<ul class=\"visualization19th century,practitionersthat he wouldand continuedoccupation ofis defined ascentre of thethe amount of><div style=\"equivalent ofdifferentiatebrought aboutmargin-left: automaticallythought of asSome of these\n<div class=\"input class=\"replaced withis one of theeducation andinfluenced byreputation as\n<meta name=\"accommodation</div>\n</div>large part ofInstitute forthe so-called against the In this case,was appointedclaimed to beHowever, thisDepartment ofthe remainingeffect on theparticularly deal with the\n<div style=\"almost alwaysare currentlyexpression ofphilosophy offor more thancivilizationson the islandselectedIndexcan result in\" value=\"\" />the structure /></a></div>Many of thesecaused by theof the Unitedspan class=\"mcan be tracedis related tobecame one ofis frequentlyliving in thetheoreticallyFollowing theRevolutionarygovernment inis determinedthe politicalintroduced insufficient todescription\">short storiesseparation ofas to whetherknown for itswas initiallydisplay:blockis an examplethe principalconsists of arecognized as/body></html>a substantialreconstructedhead of stateresistance toundergraduateThere are twogravitationalare describedintentionallyserved as theclass=\"headeropposition tofundamentallydominated theand the otheralliance withwas forced torespectively,and politicalin support ofpeople in the20th century.and publishedloadChartbeatto understandmember statesenvironmentalfirst half ofcountries andarchitecturalbe consideredcharacterizedclearIntervalauthoritativeFederation ofwas succeededand there area consequencethe Presidentalso includedfree softwaresuccession ofdeveloped thewas destroyedaway from the;\n</script>\n<although theyfollowed by amore powerfulresulted in aUniversity ofHowever, manythe presidentHowever, someis thought tountil the endwas announcedare importantalso includes><input type=the center of DO NOT ALTERused to referthemes/?sort=that had beenthe basis forhas developedin the summercomparativelydescribed thesuch as thosethe resultingis impossiblevarious otherSouth Africanhave the sameeffectivenessin which case; text-align:structure and; background:regarding thesupported theis also knownstyle=\"marginincluding thebahasa Melayunorsk bokmC%lnorsk nynorskslovenE!D\rinainternacionalcalificaciC3ncomunicaciC3nconstrucciC3n\"><div class=\"disambiguationDomainName', 'administrationsimultaneouslytransportationInternational margin-bottom:responsibility<![endif]-->\n</><meta name=\"implementationinfrastructurerepresentationborder-bottom:</head>\n<body>=http%3A%2F%2F<form method=\"method=\"post\" /favicon.ico\" });\n</script>\n.setAttribute(Administration= new Array();<![endif]-->\r\ndisplay:block;Unfortunately,\">&nbsp;</div>/favicon.ico\">='stylesheet' identification, for example,<li><a href=\"/an alternativeas a result ofpt\"></script>\ntype=\"submit\" \n(function() {recommendationform action=\"/transformationreconstruction.style.display According to hidden\" name=\"along with thedocument.body.approximately Communicationspost\" action=\"meaning &quot;--<![endif]-->Prime Ministercharacteristic</a> <a class=the history of onmouseover=\"the governmenthref=\"https://was originallywas introducedclassificationrepresentativeare considered<![endif]-->\n\ndepends on theUniversity of in contrast to placeholder=\"in the case ofinternational constitutionalstyle=\"border-: function() {Because of the-strict.dtd\">\n<table class=\"accompanied byaccount of the<script src=\"/nature of the the people in in addition tos); js.id = id\" width=\"100%\"regarding the Roman Catholican independentfollowing the .gif\" width=\"1the following discriminationarchaeologicalprime minister.js\"></script>combination of marginwidth=\"createElement(w.attachEvent(</a></td></tr>src=\"https://aIn particular, align=\"left\" Czech RepublicUnited Kingdomcorrespondenceconcluded that.html\" title=\"(function () {comes from theapplication of<span class=\"sbelieved to beement('script'</a>\n</li>\n<livery different><span class=\"option value=\"(also known as\t<li><a href=\"><input name=\"separated fromreferred to as valign=\"top\">founder of theattempting to carbon dioxide\n\n<div class=\"class=\"search-/body>\n</html>opportunity tocommunications</head>\r\n<body style=\"width:Tia:?ng Via;\u0007tchanges in theborder-color:#0\" border=\"0\" </span></div><was discovered\" type=\"text\" );\n</script>\n\nDepartment of ecclesiasticalthere has beenresulting from</body></html>has never beenthe first timein response toautomatically </div>\n\n<div iwas consideredpercent of the\" /></a></div>collection of descended fromsection of theaccept-charsetto be confusedmember of the padding-right:translation ofinterpretation href='http://whether or notThere are alsothere are manya small numberother parts ofimpossible to class=\"buttonlocated in the. However, theand eventuallyAt the end of because of itsrepresents the<form action=\" method=\"post\"it is possiblemore likely toan increase inhave also beencorresponds toannounced thatalign=\"right\">many countriesfor many yearsearliest knownbecause it waspt\"></script>\r valign=\"top\" inhabitants offollowing year\r\n<div class=\"million peoplecontroversial concerning theargue that thegovernment anda reference totransferred todescribing the style=\"color:although therebest known forsubmit\" name=\"multiplicationmore than one recognition ofCouncil of theedition of the <meta name=\"Entertainment away from the ;margin-right:at the time ofinvestigationsconnected withand many otheralthough it isbeginning with <span class=\"descendants of<span class=\"i align=\"right\"</head>\n<body aspects of thehas since beenEuropean Unionreminiscent ofmore difficultVice Presidentcomposition ofpassed throughmore importantfont-size:11pxexplanation ofthe concept ofwritten in the\t<span class=\"is one of the resemblance toon the groundswhich containsincluding the defined by thepublication ofmeans that theoutside of thesupport of the<input class=\"<span class=\"t(Math.random()most prominentdescription ofConstantinoplewere published<div class=\"seappears in the1\" height=\"1\" most importantwhich includeswhich had beendestruction ofthe population\n\t<div class=\"possibility ofsometimes usedappear to havesuccess of theintended to bepresent in thestyle=\"clear:b\r\n</script>\r\n<was founded ininterview with_id\" content=\"capital of the\r\n<link rel=\"srelease of thepoint out thatxMLHttpRequestand subsequentsecond largestvery importantspecificationssurface of theapplied to theforeign policy_setDomainNameestablished inis believed toIn addition tomeaning of theis named afterto protect theis representedDeclaration ofmore efficientClassificationother forms ofhe returned to<span class=\"cperformance of(function() {\rif and only ifregions of theleading to therelations withUnited Nationsstyle=\"height:other than theype\" content=\"Association of\n</head>\n<bodylocated on theis referred to(including theconcentrationsthe individualamong the mostthan any other/>\n<link rel=\" return false;the purpose ofthe ability to;color:#fff}\n.\n<span class=\"the subject ofdefinitions of>\r\n<link rel=\"claim that thehave developed<table width=\"celebration ofFollowing the to distinguish<span class=\"btakes place inunder the namenoted that the><![endif]-->\nstyle=\"margin-instead of theintroduced thethe process ofincreasing thedifferences inestimated thatespecially the/div><div id=\"was eventuallythroughout histhe differencesomething thatspan></span></significantly ></script>\r\n\r\nenvironmental to prevent thehave been usedespecially forunderstand theis essentiallywere the firstis the largesthave been made\" src=\"http://interpreted assecond half ofcrolling=\"no\" is composed ofII, Holy Romanis expected tohave their owndefined as thetraditionally have differentare often usedto ensure thatagreement withcontaining theare frequentlyinformation onexample is theresulting in a</a></li></ul> class=\"footerand especiallytype=\"button\" </span></span>which included>\n<meta name=\"considered thecarried out byHowever, it isbecame part ofin relation topopular in thethe capital ofwas officiallywhich has beenthe History ofalternative todifferent fromto support thesuggested thatin the process <div class=\"the foundationbecause of hisconcerned withthe universityopposed to thethe context of<span class=\"ptext\" name=\"q\"\t\t<div class=\"the scientificrepresented bymathematicianselected by thethat have been><div class=\"cdiv id=\"headerin particular,converted into);\n</script>\n<philosophical srpskohrvatskitia:?ng Via;\u0007tP Q\u0003Q\u0001Q\u0001P:P8P9Q\u0000Q\u0003Q\u0001Q\u0001P:P8P9investigaciC3nparticipaciC3nP:P>Q\u0002P>Q\u0000Q\u000BP5P>P1P;P0Q\u0001Q\u0002P8P:P>Q\u0002P>Q\u0000Q\u000BP9Q\u0007P5P;P>P2P5P:Q\u0001P8Q\u0001Q\u0002P5P<Q\u000BP\u001DP>P2P>Q\u0001Q\u0002P8P:P>Q\u0002P>Q\u0000Q\u000BQ\u0005P>P1P;P0Q\u0001Q\u0002Q\u000CP2Q\u0000P5P<P5P=P8P:P>Q\u0002P>Q\u0000P0Q\u000FQ\u0001P5P3P>P4P=Q\u000FQ\u0001P:P0Q\u0007P0Q\u0002Q\u000CP=P>P2P>Q\u0001Q\u0002P8P#P:Q\u0000P0P8P=Q\u000BP2P>P?Q\u0000P>Q\u0001Q\u000BP:P>Q\u0002P>Q\u0000P>P9Q\u0001P4P5P;P0Q\u0002Q\u000CP?P>P<P>Q\tQ\u000CQ\u000EQ\u0001Q\u0000P5P4Q\u0001Q\u0002P2P>P1Q\u0000P0P7P>P<Q\u0001Q\u0002P>Q\u0000P>P=Q\u000BQ\u0003Q\u0007P0Q\u0001Q\u0002P8P5Q\u0002P5Q\u0007P5P=P8P5P\u0013P;P0P2P=P0Q\u000FP8Q\u0001Q\u0002P>Q\u0000P8P8Q\u0001P8Q\u0001Q\u0002P5P<P0Q\u0000P5Q\u0008P5P=P8Q\u000FP!P:P0Q\u0007P0Q\u0002Q\u000CP?P>Q\rQ\u0002P>P<Q\u0003Q\u0001P;P5P4Q\u0003P5Q\u0002Q\u0001P:P0P7P0Q\u0002Q\u000CQ\u0002P>P2P0Q\u0000P>P2P:P>P=P5Q\u0007P=P>Q\u0000P5Q\u0008P5P=P8P5P:P>Q\u0002P>Q\u0000P>P5P>Q\u0000P3P0P=P>P2P:P>Q\u0002P>Q\u0000P>P<P P5P:P;P0P<P0X'Y\u0004Y\u0005Y\u0006X*X/Y\tY\u0005Y\u0006X*X/Y\nX'X*X'Y\u0004Y\u0005Y\u0008X6Y\u0008X9X'Y\u0004X(X1X'Y\u0005X,X'Y\u0004Y\u0005Y\u0008X'Y\u0002X9X'Y\u0004X1X3X'X&Y\u0004Y\u0005X4X'X1Y\u0003X'X*X'Y\u0004X#X9X6X'X!X'Y\u0004X1Y\nX'X6X)X'Y\u0004X*X5Y\u0005Y\nY\u0005X'Y\u0004X'X9X6X'X!X'Y\u0004Y\u0006X*X'X&X,X'Y\u0004X#Y\u0004X9X'X(X'Y\u0004X*X3X,Y\nY\u0004X'Y\u0004X#Y\u0002X3X'Y\u0005X'Y\u0004X6X:X7X'X*X'Y\u0004Y\u0001Y\nX/Y\nY\u0008X'Y\u0004X*X1X-Y\nX(X'Y\u0004X,X/Y\nX/X)X'Y\u0004X*X9Y\u0004Y\nY\u0005X'Y\u0004X#X.X(X'X1X'Y\u0004X'Y\u0001Y\u0004X'Y\u0005X'Y\u0004X#Y\u0001Y\u0004X'Y\u0005X'Y\u0004X*X'X1Y\nX.X'Y\u0004X*Y\u0002Y\u0006Y\nX)X'Y\u0004X'Y\u0004X9X'X(X'Y\u0004X.Y\u0008X'X7X1X'Y\u0004Y\u0005X,X*Y\u0005X9X'Y\u0004X/Y\nY\u0003Y\u0008X1X'Y\u0004X3Y\nX'X-X)X9X(X/X'Y\u0004Y\u0004Y\u0007X'Y\u0004X*X1X(Y\nX)X'Y\u0004X1Y\u0008X'X(X7X'Y\u0004X#X/X(Y\nX)X'Y\u0004X'X.X(X'X1X'Y\u0004Y\u0005X*X-X/X)X'Y\u0004X'X:X'Y\u0006Y\ncursor:pointer;</title>\n<meta \" href=\"http://\"><span class=\"members of the window.locationvertical-align:/a> | <a href=\"<!doctype html>media=\"screen\" <option value=\"favicon.ico\" />\n\t\t<div class=\"characteristics\" method=\"get\" /body>\n</html>\nshortcut icon\" document.write(padding-bottom:representativessubmit\" value=\"align=\"center\" throughout the science fiction\n <div class=\"submit\" class=\"one of the most valign=\"top\"><was established);\r\n</script>\r\nreturn false;\">).style.displaybecause of the document.cookie<form action=\"/}body{margin:0;Encyclopedia ofversion of the .createElement(name\" content=\"</div>\n</div>\n\nadministrative </body>\n</html>history of the \"><input type=\"portion of the as part of the &nbsp;<a href=\"other countries\">\n<div class=\"</span></span><In other words,display: block;control of the introduction of/>\n<meta name=\"as well as the in recent years\r\n\t<div class=\"</div>\n\t</div>\ninspired by thethe end of the compatible withbecame known as style=\"margin:.js\"></script>< International there have beenGerman language style=\"color:#Communist Partyconsistent withborder=\"0\" cell marginheight=\"the majority of\" align=\"centerrelated to the many different Orthodox Churchsimilar to the />\n<link rel=\"swas one of the until his death})();\n</script>other languagescompared to theportions of thethe Netherlandsthe most commonbackground:url(argued that thescrolling=\"no\" included in theNorth American the name of theinterpretationsthe traditionaldevelopment of frequently useda collection ofvery similar tosurrounding theexample of thisalign=\"center\">would have beenimage_caption =attached to thesuggesting thatin the form of involved in theis derived fromnamed after theIntroduction torestrictions on style=\"width: can be used to the creation ofmost important information andresulted in thecollapse of theThis means thatelements of thewas replaced byanalysis of theinspiration forregarded as themost successfulknown as &quot;a comprehensiveHistory of the were consideredreturned to theare referred toUnsourced image>\n\t<div class=\"consists of thestopPropagationinterest in theavailability ofappears to haveelectromagneticenableServices(function of theIt is important</script></div>function(){var relative to theas a result of the position ofFor example, in method=\"post\" was followed by&amp;mdash; thethe applicationjs\"></script>\r\nul></div></div>after the deathwith respect tostyle=\"padding:is particularlydisplay:inline; type=\"submit\" is divided intod8-f\u0016\u0007 (g.\u0000d=\u0013)responsabilidadadministraciC3ninternacionalescorrespondiente`$\t`$*`$/`%\u000B`$\u0017`$*`%\u0002`$0`%\r`$5`$9`$.`$>`$0`%\u0007`$2`%\u000B`$\u0017`%\u000B`$\u0002`$\u001A`%\u0001`$(`$>`$5`$2`%\u0007`$\u0015`$?`$(`$8`$0`$\u0015`$>`$0`$*`%\u0001`$2`$?`$8`$\u0016`%\u000B`$\u001C`%\u0007`$\u0002`$\u001A`$>`$9`$?`$\u000F`$-`%\u0007`$\u001C`%\u0007`$\u0002`$6`$>`$.`$?`$2`$9`$.`$>`$0`%\u0000`$\u001C`$>`$\u0017`$0`$#`$,`$(`$>`$(`%\u0007`$\u0015`%\u0001`$.`$>`$0`$,`%\r`$2`%\t`$\u0017`$.`$>`$2`$?`$\u0015`$.`$9`$?`$2`$>`$*`%\u0003`$7`%\r`$ `$,`$\"`$<`$$`%\u0007`$-`$>`$\u001C`$*`$>`$\u0015`%\r`$2`$?`$\u0015`$\u001F`%\r`$0`%\u0007`$(`$\u0016`$?`$2`$>`$+`$&`%\u000C`$0`$>`$(`$.`$>`$.`$2`%\u0007`$.`$$`$&`$>`$(`$,`$>`$\u001C`$>`$0`$5`$?`$\u0015`$>`$8`$\u0015`%\r`$/`%\u000B`$\u0002`$\u001A`$>`$9`$$`%\u0007`$*`$9`%\u0001`$\u0001`$\u001A`$,`$$`$>`$/`$>`$8`$\u0002`$5`$>`$&`$&`%\u0007`$\u0016`$(`%\u0007`$*`$?`$\u001B`$2`%\u0007`$5`$?`$6`%\u0007`$7`$0`$>`$\u001C`%\r`$/`$\t`$$`%\r`$$`$0`$.`%\u0001`$\u0002`$,`$\u0008`$&`%\u000B`$(`%\u000B`$\u0002`$\t`$*`$\u0015`$0`$#`$*`$\"`$<`%\u0007`$\u0002`$8`%\r`$%`$?`$$`$+`$?`$2`%\r`$.`$.`%\u0001`$\u0016`%\r`$/`$\u0005`$\u001A`%\r`$\u001B`$>`$\u001B`%\u0002`$\u001F`$$`%\u0000`$8`$\u0002`$\u0017`%\u0000`$$`$\u001C`$>`$\u000F`$\u0017`$>`$5`$?`$-`$>`$\u0017`$\u0018`$#`%\r`$\u001F`%\u0007`$&`%\u0002`$8`$0`%\u0007`$&`$?`$(`%\u000B`$\u0002`$9`$$`%\r`$/`$>`$8`%\u0007`$\u0015`%\r`$8`$\u0017`$>`$\u0002`$'`%\u0000`$5`$?`$6`%\r`$5`$0`$>`$$`%\u0007`$\u0002`$&`%\u0008`$\u001F`%\r`$8`$(`$\u0015`%\r`$6`$>`$8`$>`$.`$(`%\u0007`$\u0005`$&`$>`$2`$$`$,`$?`$\u001C`$2`%\u0000`$*`%\u0001`$0`%\u0002`$7`$9`$?`$\u0002`$&`%\u0000`$.`$?`$$`%\r`$0`$\u0015`$5`$?`$$`$>`$0`%\u0001`$*`$/`%\u0007`$8`%\r`$%`$>`$(`$\u0015`$0`%\u000B`$!`$<`$.`%\u0001`$\u0015`%\r`$$`$/`%\u000B`$\u001C`$(`$>`$\u0015`%\u0003`$*`$/`$>`$*`%\u000B`$8`%\r`$\u001F`$\u0018`$0`%\u0007`$2`%\u0002`$\u0015`$>`$0`%\r`$/`$5`$?`$\u001A`$>`$0`$8`%\u0002`$\u001A`$(`$>`$.`%\u0002`$2`%\r`$/`$&`%\u0007`$\u0016`%\u0007`$\u0002`$9`$.`%\u0007`$6`$>`$8`%\r`$\u0015`%\u0002`$2`$.`%\u0008`$\u0002`$(`%\u0007`$$`%\u0008`$/`$>`$0`$\u001C`$?`$8`$\u0015`%\u0007rss+xml\" title=\"-type\" content=\"title\" content=\"at the same time.js\"></script>\n<\" method=\"post\" </span></a></li>vertical-align:t/jquery.min.js\">.click(function( style=\"padding-})();\n</script>\n</span><a href=\"<a href=\"http://); return false;text-decoration: scrolling=\"no\" border-collapse:associated with Bahasa IndonesiaEnglish language<text xml:space=.gif\" border=\"0\"</body>\n</html>\noverflow:hidden;img src=\"http://addEventListenerresponsible for s.js\"></script>\n/favicon.ico\" />operating system\" style=\"width:1target=\"_blank\">State Universitytext-align:left;\ndocument.write(, including the around the world);\r\n</script>\r\n<\" style=\"height:;overflow:hiddenmore informationan internationala member of the one of the firstcan be found in </div>\n\t\t</div>\ndisplay: none;\">\" />\n<link rel=\"\n (function() {the 15th century.preventDefault(large number of Byzantine Empire.jpg|thumb|left|vast majority ofmajority of the align=\"center\">University Pressdominated by theSecond World Wardistribution of style=\"position:the rest of the characterized by rel=\"nofollow\">derives from therather than the a combination ofstyle=\"width:100English-speakingcomputer scienceborder=\"0\" alt=\"the existence ofDemocratic Party\" style=\"margin-For this reason,.js\"></script>\n\tsByTagName(s)[0]js\"></script>\r\n<.js\"></script>\r\nlink rel=\"icon\" ' alt='' class='formation of theversions of the </a></div></div>/page>\n <page>\n<div class=\"contbecame the firstbahasa Indonesiaenglish (simple)N\u0015N;N;N7N=N9N:N,Q\u0005Q\u0000P2P0Q\u0002Q\u0001P:P8P:P>P<P?P0P=P8P8Q\u000FP2P;Q\u000FP5Q\u0002Q\u0001Q\u000FP\u0014P>P1P0P2P8Q\u0002Q\u000CQ\u0007P5P;P>P2P5P:P0Q\u0000P0P7P2P8Q\u0002P8Q\u000FP\u0018P=Q\u0002P5Q\u0000P=P5Q\u0002P\u001EQ\u0002P2P5Q\u0002P8Q\u0002Q\u000CP=P0P?Q\u0000P8P<P5Q\u0000P8P=Q\u0002P5Q\u0000P=P5Q\u0002P:P>Q\u0002P>Q\u0000P>P3P>Q\u0001Q\u0002Q\u0000P0P=P8Q\u0006Q\u000BP:P0Q\u0007P5Q\u0001Q\u0002P2P5Q\u0003Q\u0001P;P>P2P8Q\u000FQ\u0005P?Q\u0000P>P1P;P5P<Q\u000BP?P>P;Q\u0003Q\u0007P8Q\u0002Q\u000CQ\u000FP2P;Q\u000FQ\u000EQ\u0002Q\u0001Q\u000FP=P0P8P1P>P;P5P5P:P>P<P?P0P=P8Q\u000FP2P=P8P<P0P=P8P5Q\u0001Q\u0000P5P4Q\u0001Q\u0002P2P0X'Y\u0004Y\u0005Y\u0008X'X6Y\nX9X'Y\u0004X1X&Y\nX3Y\nX)X'Y\u0004X'Y\u0006X*Y\u0002X'Y\u0004Y\u0005X4X'X1Y\u0003X'X*Y\u0003X'Y\u0004X3Y\nX'X1X'X*X'Y\u0004Y\u0005Y\u0003X*Y\u0008X(X)X'Y\u0004X3X9Y\u0008X/Y\nX)X'X-X5X'X&Y\nX'X*X'Y\u0004X9X'Y\u0004Y\u0005Y\nX)X'Y\u0004X5Y\u0008X*Y\nX'X*X'Y\u0004X'Y\u0006X*X1Y\u0006X*X'Y\u0004X*X5X'Y\u0005Y\nY\u0005X'Y\u0004X%X3Y\u0004X'Y\u0005Y\nX'Y\u0004Y\u0005X4X'X1Y\u0003X)X'Y\u0004Y\u0005X1X&Y\nX'X*robots\" content=\"<div id=\"footer\">the United States<img src=\"http://.jpg|right|thumb|.js\"></script>\r\n<location.protocolframeborder=\"0\" s\" />\n<meta name=\"</a></div></div><font-weight:bold;&quot; and &quot;depending on the margin:0;padding:\" rel=\"nofollow\" President of the twentieth centuryevision>\n </pageInternet Explorera.async = true;\r\ninformation about<div id=\"header\">\" action=\"http://<a href=\"https://<div id=\"content\"</div>\r\n</div>\r\n<derived from the <img src='http://according to the \n</body>\n</html>\nstyle=\"font-size:script language=\"Arial, Helvetica,</a><span class=\"</script><script political partiestd></tr></table><href=\"http://www.interpretation ofrel=\"stylesheet\" document.write('<charset=\"utf-8\">\nbeginning of the revealed that thetelevision series\" rel=\"nofollow\"> target=\"_blank\">claiming that thehttp%3A%2F%2Fwww.manifestations ofPrime Minister ofinfluenced by theclass=\"clearfix\">/div>\r\n</div>\r\n\r\nthree-dimensionalChurch of Englandof North Carolinasquare kilometres.addEventListenerdistinct from thecommonly known asPhonetic Alphabetdeclared that thecontrolled by theBenjamin Franklinrole-playing gamethe University ofin Western Europepersonal computerProject Gutenbergregardless of thehas been proposedtogether with the></li><li class=\"in some countriesmin.js\"></script>of the populationofficial language<img src=\"images/identified by thenatural resourcesclassification ofcan be consideredquantum mechanicsNevertheless, themillion years ago</body>\r\n</html>\rN\u0015N;N;N7N=N9N:N,\ntake advantage ofand, according toattributed to theMicrosoft Windowsthe first centuryunder the controldiv class=\"headershortly after thenotable exceptiontens of thousandsseveral differentaround the world.reaching militaryisolated from theopposition to thethe Old TestamentAfrican Americansinserted into theseparate from themetropolitan areamakes it possibleacknowledged thatarguably the mosttype=\"text/css\">\nthe InternationalAccording to the pe=\"text/css\" />\ncoincide with thetwo-thirds of theDuring this time,during the periodannounced that hethe internationaland more recentlybelieved that theconsciousness andformerly known assurrounded by thefirst appeared inoccasionally usedposition:absolute;\" target=\"_blank\" position:relative;text-align:center;jax/libs/jquery/1.background-color:#type=\"application/anguage\" content=\"<meta http-equiv=\"Privacy Policy</a>e(\"%3Cscript src='\" target=\"_blank\">On the other hand,.jpg|thumb|right|2</div><div class=\"<div style=\"float:nineteenth century</body>\r\n</html>\r\n<img src=\"http://s;text-align:centerfont-weight: bold; According to the difference between\" frameborder=\"0\" \" style=\"position:link href=\"http://html4/loose.dtd\">\nduring this period</td></tr></table>closely related tofor the first time;font-weight:bold;input type=\"text\" <span style=\"font-onreadystatechange\t<div class=\"cleardocument.location. For example, the a wide variety of <!DOCTYPE html>\r\n<&nbsp;&nbsp;&nbsp;\"><a href=\"http://style=\"float:left;concerned with the=http%3A%2F%2Fwww.in popular culturetype=\"text/css\" />it is possible to Harvard Universitytylesheet\" href=\"/the main characterOxford University name=\"keywords\" cstyle=\"text-align:the United Kingdomfederal government<div style=\"margin depending on the description of the<div class=\"header.min.js\"></script>destruction of theslightly differentin accordance withtelecommunicationsindicates that theshortly thereafterespecially in the European countriesHowever, there aresrc=\"http://staticsuggested that the\" src=\"http://www.a large number of Telecommunications\" rel=\"nofollow\" tHoly Roman Emperoralmost exclusively\" border=\"0\" alt=\"Secretary of Stateculminating in theCIA World Factbookthe most importantanniversary of thestyle=\"background-<li><em><a href=\"/the Atlantic Oceanstrictly speaking,shortly before thedifferent types ofthe Ottoman Empire><img src=\"http://An Introduction toconsequence of thedeparture from theConfederate Statesindigenous peoplesProceedings of theinformation on thetheories have beeninvolvement in thedivided into threeadjacent countriesis responsible fordissolution of thecollaboration withwidely regarded ashis contemporariesfounding member ofDominican Republicgenerally acceptedthe possibility ofare also availableunder constructionrestoration of thethe general publicis almost entirelypasses through thehas been suggestedcomputer and videoGermanic languages according to the different from theshortly afterwardshref=\"https://www.recent developmentBoard of Directors<div class=\"search| <a href=\"http://In particular, theMultiple footnotesor other substancethousands of yearstranslation of the</div>\r\n</div>\r\n\r\n<a href=\"index.phpwas established inmin.js\"></script>\nparticipate in thea strong influencestyle=\"margin-top:represented by thegraduated from theTraditionally, theElement(\"script\");However, since the/div>\n</div>\n<div left; margin-left:protection against0; vertical-align:Unfortunately, thetype=\"image/x-icon/div>\n<div class=\" class=\"clearfix\"><div class=\"footer\t\t</div>\n\t\t</div>\nthe motion pictureP\u0011Q\nP;P3P0Q\u0000Q\u0001P:P8P1Q\nP;P3P0Q\u0000Q\u0001P:P8P$P5P4P5Q\u0000P0Q\u0006P8P8P=P5Q\u0001P:P>P;Q\u000CP:P>Q\u0001P>P>P1Q\tP5P=P8P5Q\u0001P>P>P1Q\tP5P=P8Q\u000FP?Q\u0000P>P3Q\u0000P0P<P<Q\u000BP\u001EQ\u0002P?Q\u0000P0P2P8Q\u0002Q\u000CP1P5Q\u0001P?P;P0Q\u0002P=P>P<P0Q\u0002P5Q\u0000P8P0P;Q\u000BP?P>P7P2P>P;Q\u000FP5Q\u0002P?P>Q\u0001P;P5P4P=P8P5Q\u0000P0P7P;P8Q\u0007P=Q\u000BQ\u0005P?Q\u0000P>P4Q\u0003P:Q\u0006P8P8P?Q\u0000P>P3Q\u0000P0P<P<P0P?P>P;P=P>Q\u0001Q\u0002Q\u000CQ\u000EP=P0Q\u0005P>P4P8Q\u0002Q\u0001Q\u000FP8P7P1Q\u0000P0P=P=P>P5P=P0Q\u0001P5P;P5P=P8Q\u000FP8P7P<P5P=P5P=P8Q\u000FP:P0Q\u0002P5P3P>Q\u0000P8P8P\u0010P;P5P:Q\u0001P0P=P4Q\u0000`$&`%\r`$5`$>`$0`$>`$.`%\u0008`$(`%\u0001`$\u0005`$2`$*`%\r`$0`$&`$>`$(`$-`$>`$0`$$`%\u0000`$/`$\u0005`$(`%\u0001`$&`%\u0007`$6`$9`$?`$(`%\r`$&`%\u0000`$\u0007`$\u0002`$!`$?`$/`$>`$&`$?`$2`%\r`$2`%\u0000`$\u0005`$'`$?`$\u0015`$>`$0`$5`%\u0000`$!`$?`$/`%\u000B`$\u001A`$?`$\u001F`%\r`$ `%\u0007`$8`$.`$>`$\u001A`$>`$0`$\u001C`$\u0002`$\u0015`%\r`$6`$(`$&`%\u0001`$(`$?`$/`$>`$*`%\r`$0`$/`%\u000B`$\u0017`$\u0005`$(`%\u0001`$8`$>`$0`$\u0011`$(`$2`$>`$\u0007`$(`$*`$>`$0`%\r`$\u001F`%\u0000`$6`$0`%\r`$$`%\u000B`$\u0002`$2`%\u000B`$\u0015`$8`$-`$>`$+`$<`%\r`$2`%\u0008`$6`$6`$0`%\r`$$`%\u0007`$\u0002`$*`%\r`$0`$&`%\u0007`$6`$*`%\r`$2`%\u0007`$/`$0`$\u0015`%\u0007`$\u0002`$&`%\r`$0`$8`%\r`$%`$?`$$`$?`$\t`$$`%\r`$*`$>`$&`$\t`$(`%\r`$9`%\u0007`$\u0002`$\u001A`$?`$\u001F`%\r`$ `$>`$/`$>`$$`%\r`$0`$>`$\u001C`%\r`$/`$>`$&`$>`$*`%\u0001`$0`$>`$(`%\u0007`$\u001C`%\u000B`$!`$<`%\u0007`$\u0002`$\u0005`$(`%\u0001`$5`$>`$&`$6`%\r`$0`%\u0007`$#`%\u0000`$6`$?`$\u0015`%\r`$7`$>`$8`$0`$\u0015`$>`$0`%\u0000`$8`$\u0002`$\u0017`%\r`$0`$9`$*`$0`$?`$#`$>`$.`$,`%\r`$0`$>`$\u0002`$!`$,`$\u001A`%\r`$\u001A`%\u000B`$\u0002`$\t`$*`$2`$,`%\r`$'`$.`$\u0002`$$`%\r`$0`%\u0000`$8`$\u0002`$*`$0`%\r`$\u0015`$\t`$.`%\r`$.`%\u0000`$&`$.`$>`$'`%\r`$/`$.`$8`$9`$>`$/`$$`$>`$6`$,`%\r`$&`%\u000B`$\u0002`$.`%\u0000`$!`$?`$/`$>`$\u0006`$\u0008`$*`%\u0000`$\u000F`$2`$.`%\u000B`$,`$>`$\u0007`$2`$8`$\u0002`$\u0016`%\r`$/`$>`$\u0006`$*`$0`%\u0007`$6`$(`$\u0005`$(`%\u0001`$,`$\u0002`$'`$,`$>`$\u001C`$<`$>`$0`$(`$5`%\u0000`$(`$$`$.`$*`%\r`$0`$.`%\u0001`$\u0016`$*`%\r`$0`$6`%\r`$(`$*`$0`$?`$5`$>`$0`$(`%\u0001`$\u0015`$8`$>`$(`$8`$.`$0`%\r`$%`$(`$\u0006`$/`%\u000B`$\u001C`$?`$$`$8`%\u000B`$.`$5`$>`$0X'Y\u0004Y\u0005X4X'X1Y\u0003X'X*X'Y\u0004Y\u0005Y\u0006X*X/Y\nX'X*X'Y\u0004Y\u0003Y\u0005X(Y\nY\u0008X*X1X'Y\u0004Y\u0005X4X'Y\u0007X/X'X*X9X/X/X'Y\u0004X2Y\u0008X'X1X9X/X/X'Y\u0004X1X/Y\u0008X/X'Y\u0004X%X3Y\u0004X'Y\u0005Y\nX)X'Y\u0004Y\u0001Y\u0008X*Y\u0008X4Y\u0008X(X'Y\u0004Y\u0005X3X'X(Y\u0002X'X*X'Y\u0004Y\u0005X9Y\u0004Y\u0008Y\u0005X'X*X'Y\u0004Y\u0005X3Y\u0004X3Y\u0004X'X*X'Y\u0004X,X1X'Y\u0001Y\nY\u0003X3X'Y\u0004X'X3Y\u0004X'Y\u0005Y\nX)X'Y\u0004X'X*X5X'Y\u0004X'X*keywords\" content=\"w3.org/1999/xhtml\"><a target=\"_blank\" text/html; charset=\" target=\"_blank\"><table cellpadding=\"autocomplete=\"off\" text-align: center;to last version by background-color: #\" href=\"http://www./div></div><div id=<a href=\"#\" class=\"\"><img src=\"http://cript\" src=\"http://\n<script language=\"//EN\" \"http://www.wencodeURIComponent(\" href=\"javascript:<div class=\"contentdocument.write('<scposition: absolute;script src=\"http:// style=\"margin-top:.min.js\"></script>\n</div>\n<div class=\"w3.org/1999/xhtml\" \n\r\n</body>\r\n</html>distinction between/\" target=\"_blank\"><link href=\"http://encoding=\"utf-8\"?>\nw.addEventListener?action=\"http://www.icon\" href=\"http:// style=\"background:type=\"text/css\" />\nmeta property=\"og:t<input type=\"text\" style=\"text-align:the development of tylesheet\" type=\"tehtml; charset=utf-8is considered to betable width=\"100%\" In addition to the contributed to the differences betweendevelopment of the It is important to </script>\n\n<script style=\"font-size:1></span><span id=gbLibrary of Congress<img src=\"http://imEnglish translationAcademy of Sciencesdiv style=\"display:construction of the.getElementById(id)in conjunction withElement('script'); <meta property=\"og:P\u0011Q\nP;P3P0Q\u0000Q\u0001P:P8\n type=\"text\" name=\">Privacy Policy</a>administered by theenableSingleRequeststyle=&quot;margin:</div></div></div><><img src=\"http://i style=&quot;float:referred to as the total population ofin Washington, D.C. style=\"background-among other things,organization of theparticipated in thethe introduction ofidentified with thefictional character Oxford University misunderstanding ofThere are, however,stylesheet\" href=\"/Columbia Universityexpanded to includeusually referred toindicating that thehave suggested thataffiliated with thecorrelation betweennumber of different></td></tr></table>Republic of Ireland\n</script>\n<script under the influencecontribution to theOfficial website ofheadquarters of thecentered around theimplications of thehave been developedFederal Republic ofbecame increasinglycontinuation of theNote, however, thatsimilar to that of capabilities of theaccordance with theparticipants in thefurther developmentunder the directionis often consideredhis younger brother</td></tr></table><a http-equiv=\"X-UA-physical propertiesof British Columbiahas been criticized(with the exceptionquestions about thepassing through the0\" cellpadding=\"0\" thousands of peopleredirects here. Forhave children under%3E%3C/script%3E\"));<a href=\"http://www.<li><a href=\"http://site_name\" content=\"text-decoration:nonestyle=\"display: none<meta http-equiv=\"X-new Date().getTime() type=\"image/x-icon\"</span><span class=\"language=\"javascriptwindow.location.href<a href=\"javascript:-->\r\n<script type=\"t<a href='http://www.hortcut icon\" href=\"</div>\r\n<div class=\"<script src=\"http://\" rel=\"stylesheet\" t</div>\n<script type=/a> <a href=\"http:// allowTransparency=\"X-UA-Compatible\" conrelationship between\n</script>\r\n<script </a></li></ul></div>associated with the programming language</a><a href=\"http://</a></li><li class=\"form action=\"http://<div style=\"display:type=\"text\" name=\"q\"<table width=\"100%\" background-position:\" border=\"0\" width=\"rel=\"shortcut icon\" h6><ul><li><a href=\" <meta http-equiv=\"css\" media=\"screen\" responsible for the \" type=\"application/\" style=\"background-html; charset=utf-8\" allowtransparency=\"stylesheet\" type=\"te\r\n<meta http-equiv=\"></span><span class=\"0\" cellspacing=\"0\">;\n</script>\n<script sometimes called thedoes not necessarilyFor more informationat the beginning of <!DOCTYPE html><htmlparticularly in the type=\"hidden\" name=\"javascript:void(0);\"effectiveness of the autocomplete=\"off\" generally considered><input type=\"text\" \"></script>\r\n<scriptthroughout the worldcommon misconceptionassociation with the</div>\n</div>\n<div cduring his lifetime,corresponding to thetype=\"image/x-icon\" an increasing numberdiplomatic relationsare often consideredmeta charset=\"utf-8\" <input type=\"text\" examples include the\"><img src=\"http://iparticipation in thethe establishment of\n</div>\n<div class=\"&amp;nbsp;&amp;nbsp;to determine whetherquite different frommarked the beginningdistance between thecontributions to theconflict between thewidely considered towas one of the firstwith varying degreeshave speculated that(document.getElementparticipating in theoriginally developedeta charset=\"utf-8\"> type=\"text/css\" />\ninterchangeably withmore closely relatedsocial and politicalthat would otherwiseperpendicular to thestyle type=\"text/csstype=\"submit\" name=\"families residing indeveloping countriescomputer programmingeconomic developmentdetermination of thefor more informationon several occasionsportuguC*s (Europeu)P#P:Q\u0000P0Q\u0017P=Q\u0001Q\u000CP:P0Q\u0003P:Q\u0000P0Q\u0017P=Q\u0001Q\u000CP:P0P P>Q\u0001Q\u0001P8P9Q\u0001P:P>P9P<P0Q\u0002P5Q\u0000P8P0P;P>P2P8P=Q\u0004P>Q\u0000P<P0Q\u0006P8P8Q\u0003P?Q\u0000P0P2P;P5P=P8Q\u000FP=P5P>P1Q\u0005P>P4P8P<P>P8P=Q\u0004P>Q\u0000P<P0Q\u0006P8Q\u000FP\u0018P=Q\u0004P>Q\u0000P<P0Q\u0006P8Q\u000FP P5Q\u0001P?Q\u0003P1P;P8P:P8P:P>P;P8Q\u0007P5Q\u0001Q\u0002P2P>P8P=Q\u0004P>Q\u0000P<P0Q\u0006P8Q\u000EQ\u0002P5Q\u0000Q\u0000P8Q\u0002P>Q\u0000P8P8P4P>Q\u0001Q\u0002P0Q\u0002P>Q\u0007P=P>X'Y\u0004Y\u0005X*Y\u0008X'X,X/Y\u0008Y\u0006X'Y\u0004X'X4X*X1X'Y\u0003X'X*X'Y\u0004X'Y\u0002X*X1X'X-X'X*html; charset=UTF-8\" setTimeout(function()display:inline-block;<input type=\"submit\" type = 'text/javascri<img src=\"http://www.\" \"http://www.w3.org/shortcut icon\" href=\"\" autocomplete=\"off\" </a></div><div class=</a></li>\n<li class=\"css\" type=\"text/css\" <form action=\"http://xt/css\" href=\"http://link rel=\"alternate\" \r\n<script type=\"text/ onclick=\"javascript:(new Date).getTime()}height=\"1\" width=\"1\" People's Republic of <a href=\"http://www.text-decoration:underthe beginning of the </div>\n</div>\n</div>\nestablishment of the </div></div></div></d#viewport{min-height:\n<script src=\"http://option><option value=often referred to as /option>\n<option valu<!DOCTYPE html>\n<!--[International Airport>\n<a href=\"http://www</a><a href=\"http://w`8 `82`8)`82`9\u0004`8\u0017`8\"a\u0003%a\u0003\u0010a\u0003 a\u0003\u0017a\u0003#a\u0003\u001Aa\u0003\u0018f-#i+\u0014d8-f\u0016\u0007 (g9\u0001i+\u0014)`$(`$?`$0`%\r`$&`%\u0007`$6`$!`$>`$\t`$(`$2`%\u000B`$!`$\u0015`%\r`$7`%\u0007`$$`%\r`$0`$\u001C`$>`$(`$\u0015`$>`$0`%\u0000`$8`$\u0002`$,`$\u0002`$'`$?`$$`$8`%\r`$%`$>`$*`$(`$>`$8`%\r`$5`%\u0000`$\u0015`$>`$0`$8`$\u0002`$8`%\r`$\u0015`$0`$#`$8`$>`$.`$\u0017`%\r`$0`%\u0000`$\u001A`$?`$\u001F`%\r`$ `%\u000B`$\u0002`$5`$?`$\u001C`%\r`$\u001E`$>`$(`$\u0005`$.`%\u0007`$0`$?`$\u0015`$>`$5`$?`$-`$?`$(`%\r`$(`$\u0017`$>`$!`$?`$/`$>`$\u0001`$\u0015`%\r`$/`%\u000B`$\u0002`$\u0015`$?`$8`%\u0001`$0`$\u0015`%\r`$7`$>`$*`$9`%\u0001`$\u0001`$\u001A`$$`%\u0000`$*`%\r`$0`$,`$\u0002`$'`$(`$\u001F`$?`$*`%\r`$*`$#`%\u0000`$\u0015`%\r`$0`$?`$\u0015`%\u0007`$\u001F`$*`%\r`$0`$>`$0`$\u0002`$-`$*`%\r`$0`$>`$*`%\r`$$`$.`$>`$2`$?`$\u0015`%\u000B`$\u0002`$0`$+`$<`%\r`$$`$>`$0`$(`$?`$0`%\r`$.`$>`$#`$2`$?`$.`$?`$\u001F`%\u0007`$!description\" content=\"document.location.prot.getElementsByTagName(<!DOCTYPE html>\n<html <meta charset=\"utf-8\">:url\" content=\"http://.css\" rel=\"stylesheet\"style type=\"text/css\">type=\"text/css\" href=\"w3.org/1999/xhtml\" xmltype=\"text/javascript\" method=\"get\" action=\"link rel=\"stylesheet\" = document.getElementtype=\"image/x-icon\" />cellpadding=\"0\" cellsp.css\" type=\"text/css\" </a></li><li><a href=\"\" width=\"1\" height=\"1\"\"><a href=\"http://www.style=\"display:none;\">alternate\" type=\"appli-//W3C//DTD XHTML 1.0 ellspacing=\"0\" cellpad type=\"hidden\" value=\"/a>&nbsp;<span role=\"s\n<input type=\"hidden\" language=\"JavaScript\" document.getElementsBg=\"0\" cellspacing=\"0\" ype=\"text/css\" media=\"type='text/javascript'with the exception of ype=\"text/css\" rel=\"st height=\"1\" width=\"1\" ='+encodeURIComponent(<link rel=\"alternate\" \nbody, tr, input, textmeta name=\"robots\" conmethod=\"post\" action=\">\n<a href=\"http://www.css\" rel=\"stylesheet\" </div></div><div classlanguage=\"javascript\">aria-hidden=\"true\">B7<ript\" type=\"text/javasl=0;})();\n(function(){background-image: url(/a></li><li><a href=\"h\t\t<li><a href=\"http://ator\" aria-hidden=\"tru> <a href=\"http://www.language=\"javascript\" /option>\n<option value/div></div><div class=rator\" aria-hidden=\"tre=(new Date).getTime()portuguC*s (do Brasil)P>Q\u0000P3P0P=P8P7P0Q\u0006P8P8P2P>P7P<P>P6P=P>Q\u0001Q\u0002Q\u000CP>P1Q\u0000P0P7P>P2P0P=P8Q\u000FQ\u0000P5P3P8Q\u0001Q\u0002Q\u0000P0Q\u0006P8P8P2P>P7P<P>P6P=P>Q\u0001Q\u0002P8P>P1Q\u000FP7P0Q\u0002P5P;Q\u000CP=P0<!DOCTYPE html PUBLIC \"nt-Type\" content=\"text/<meta http-equiv=\"Conteransitional//EN\" \"http:<html xmlns=\"http://www-//W3C//DTD XHTML 1.0 TDTD/xhtml1-transitional//www.w3.org/TR/xhtml1/pe = 'text/javascript';<meta name=\"descriptionparentNode.insertBefore<input type=\"hidden\" najs\" type=\"text/javascri(document).ready(functiscript type=\"text/javasimage\" content=\"http://UA-Compatible\" content=tml; charset=utf-8\" />\nlink rel=\"shortcut icon<link rel=\"stylesheet\" </script>\n<script type== document.createElemen<a target=\"_blank\" href= document.getElementsBinput type=\"text\" name=a.type = 'text/javascrinput type=\"hidden\" namehtml; charset=utf-8\" />dtd\">\n<html xmlns=\"http-//W3C//DTD HTML 4.01 TentsByTagName('script')input type=\"hidden\" nam<script type=\"text/javas\" style=\"display:none;\">document.getElementById(=document.createElement(' type='text/javascript'input type=\"text\" name=\"d.getElementsByTagName(snical\" href=\"http://www.C//DTD HTML 4.01 Transit<style type=\"text/css\">\n\n<style type=\"text/css\">ional.dtd\">\n<html xmlns=http-equiv=\"Content-Typeding=\"0\" cellspacing=\"0\"html; charset=utf-8\" />\n style=\"display:none;\"><<li><a href=\"http://www. type='text/javascript'>P4P5Q\u000FQ\u0002P5P;Q\u000CP=P>Q\u0001Q\u0002P8Q\u0001P>P>Q\u0002P2P5Q\u0002Q\u0001Q\u0002P2P8P8P?Q\u0000P>P8P7P2P>P4Q\u0001Q\u0002P2P0P1P5P7P>P?P0Q\u0001P=P>Q\u0001Q\u0002P8`$*`%\u0001`$8`%\r`$$`$?`$\u0015`$>`$\u0015`$>`$\u0002`$\u0017`%\r`$0`%\u0007`$8`$\t`$(`%\r`$9`%\u000B`$\u0002`$(`%\u0007`$5`$?`$'`$>`$(`$8`$-`$>`$+`$?`$\u0015`%\r`$8`$?`$\u0002`$\u0017`$8`%\u0001`$0`$\u0015`%\r`$7`$?`$$`$\u0015`%\t`$*`%\u0000`$0`$>`$\u0007`$\u001F`$5`$?`$\u001C`%\r`$\u001E`$>`$*`$(`$\u0015`$>`$0`%\r`$0`$5`$>`$\u0008`$8`$\u0015`%\r`$0`$?`$/`$$`$>";
+ private static final String SKIP_FLIP = "\u06F7%\u018C'T%\u0085'W%\u00D7%O%g%\u00A6&\u0193%\u01E5&>&*&'&^&\u0088\u0178\u0C3E&\u01AD&\u0192&)&^&%&'&\u0082&P&1&\u00B1&3&]&m&u&E&t&C&\u00CF&V&V&/&>&6&\u0F76\u177Co&p&@&E&M&P&x&@&F&e&\u00CC&7&:&(&D&0&C&)&.&F&-&1&(&L&F&1\u025E*\u03EA\u21F3&\u1372&K&;&)&E&H&P&0&?&9&V&\u0081&-&v&a&,&E&)&?&=&'&'&B&\u0D2E&\u0503&\u0316*&*8&%&%&&&%,)&\u009A&>&\u0086&7&]&F&2&>&J&6&n&2&%&?&\u008E&2&6&J&g&-&0&,&*&J&*&O&)&6&(&<&B&N&.&P&@&2&.&W&M&%\u053C\u0084(,(<&,&\u03DA&\u18C7&-&,(%&(&%&(\u013B0&X&D&\u0081&j&'&J&(&.&B&3&Z&R&h&3&E&E&<\u00C6-\u0360\u1EF3&%8?&@&,&Z&@&0&J&,&^&x&_&6&C&6&C\u072C\u2A25&f&-&-&-&-&,&J&2&8&z&8&C&Y&8&-&d&\u1E78\u00CC-&7&1&F&7&t&W&7&I&.&.&^&=\u0F9C\u19D3&8(>&/&/&\u077B')'\u1065')'%@/&0&%\u043E\u09C0*&*@&C\u053D\u05D4\u0274\u05EB4\u0DD7\u071A\u04D16\u0D84&/\u0178\u0303Z&*%\u0246\u03FF&\u0134&1\u00A8\u04B4\u0174";
+
+ private static void unpackDictionaryData(
+ ByteBuffer dictionary, String data0, String data1, String skipFlip) {
+ int n0 = data0.length();
+ int n1 = data1.length();
+ if (n0 + n1 != dictionary.capacity()) {
+ throw new RuntimeException("Corrupted brotli dictionary");
+ }
+ int offset = 0;
+ for (int i = 0; i < n0; ++i) {
+ dictionary.put(offset, (byte) data0.charAt(i));
+ offset++;
+ }
+ for (int i = 0; i < n1; ++i) {
+ dictionary.put(offset, (byte) data1.charAt(i));
+ offset++;
+ }
+ offset = 0;
+ int n = skipFlip.length();
+ for (int i = 0; i < n; i += 2) {
+ int skip = skipFlip.charAt(i) - 36;
+ int flip = skipFlip.charAt(i + 1) - 36;
+ offset += skip;
+ for (int j = 0; j < flip; ++j) {
+ dictionary.put(offset, (byte) (dictionary.get(offset) | 0x80));
+ offset++;
+ }
+ }
+ }
+
+ static {
+ ByteBuffer dictionary = ByteBuffer.allocateDirect(122784);
+ unpackDictionaryData(dictionary, DATA0, DATA1, SKIP_FLIP);
+ Dictionary.setData(dictionary.asReadOnlyBuffer());
+ }
+}
diff --git a/src/net/sourceforge/plantuml/brotli/Huffman.java b/src/net/sourceforge/plantuml/brotli/Huffman.java
new file mode 100644
index 0000000..17ac1b5
--- /dev/null
+++ b/src/net/sourceforge/plantuml/brotli/Huffman.java
@@ -0,0 +1,132 @@
+/* Copyright 2015 Google Inc. All Rights Reserved.
+
+ Distributed under MIT license.
+ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+
+package net.sourceforge.plantuml.brotli;
+
+/**
+ * Utilities for building Huffman decoding tables.
+ */
+final class Huffman {
+
+ private static final int MAX_LENGTH = 15;
+
+ /**
+ * Returns reverse(reverse(key, len) + 1, len).
+ *
+ * <p> reverse(key, len) is the bit-wise reversal of the len least significant bits of key.
+ */
+ private static int getNextKey(int key, int len) {
+ int step = 1 << (len - 1);
+ while ((key & step) != 0) {
+ step >>= 1;
+ }
+ return (key & (step - 1)) + step;
+ }
+
+ /**
+ * Stores {@code item} in {@code table[0], table[step], table[2 * step] .., table[end]}.
+ *
+ * <p> Assumes that end is an integer multiple of step.
+ */
+ private static void replicateValue(int[] table, int offset, int step, int end, int item) {
+ do {
+ end -= step;
+ table[offset + end] = item;
+ } while (end > 0);
+ }
+
+ /**
+ * @param count histogram of bit lengths for the remaining symbols,
+ * @param len code length of the next processed symbol.
+ * @return table width of the next 2nd level table.
+ */
+ private static int nextTableBitSize(int[] count, int len, int rootBits) {
+ int left = 1 << (len - rootBits);
+ while (len < MAX_LENGTH) {
+ left -= count[len];
+ if (left <= 0) {
+ break;
+ }
+ len++;
+ left <<= 1;
+ }
+ return len - rootBits;
+ }
+
+ /**
+ * Builds Huffman lookup table assuming code lengths are in symbol order.
+ */
+ static void buildHuffmanTable(int[] rootTable, int tableOffset, int rootBits, int[] codeLengths,
+ int codeLengthsSize) {
+ int key; // Reversed prefix code.
+ int[] sorted = new int[codeLengthsSize]; // Symbols sorted by code length.
+ // TODO: fill with zeroes?
+ int[] count = new int[MAX_LENGTH + 1]; // Number of codes of each length.
+ int[] offset = new int[MAX_LENGTH + 1]; // Offsets in sorted table for each length.
+ int symbol;
+
+ // Build histogram of code lengths.
+ for (symbol = 0; symbol < codeLengthsSize; symbol++) {
+ count[codeLengths[symbol]]++;
+ }
+
+ // Generate offsets into sorted symbol table by code length.
+ offset[1] = 0;
+ for (int len = 1; len < MAX_LENGTH; len++) {
+ offset[len + 1] = offset[len] + count[len];
+ }
+
+ // Sort symbols by length, by symbol order within each length.
+ for (symbol = 0; symbol < codeLengthsSize; symbol++) {
+ if (codeLengths[symbol] != 0) {
+ sorted[offset[codeLengths[symbol]]++] = symbol;
+ }
+ }
+
+ int tableBits = rootBits;
+ int tableSize = 1 << tableBits;
+ int totalSize = tableSize;
+
+ // Special case code with only one value.
+ if (offset[MAX_LENGTH] == 1) {
+ for (key = 0; key < totalSize; key++) {
+ rootTable[tableOffset + key] = sorted[0];
+ }
+ return;
+ }
+
+ // Fill in root table.
+ key = 0;
+ symbol = 0;
+ for (int len = 1, step = 2; len <= rootBits; len++, step <<= 1) {
+ for (; count[len] > 0; count[len]--) {
+ replicateValue(rootTable, tableOffset + key, step, tableSize, len << 16 | sorted[symbol++]);
+ key = getNextKey(key, len);
+ }
+ }
+
+ // Fill in 2nd level tables and add pointers to root table.
+ int mask = totalSize - 1;
+ int low = -1;
+ int currentOffset = tableOffset;
+ for (int len = rootBits + 1, step = 2; len <= MAX_LENGTH; len++, step <<= 1) {
+ for (; count[len] > 0; count[len]--) {
+ if ((key & mask) != low) {
+ currentOffset += tableSize;
+ tableBits = nextTableBitSize(count, len, rootBits);
+ tableSize = 1 << tableBits;
+ totalSize += tableSize;
+ low = key & mask;
+ rootTable[tableOffset + low] =
+ (tableBits + rootBits) << 16 | (currentOffset - tableOffset - low);
+ }
+ replicateValue(rootTable, currentOffset + (key >> rootBits), step, tableSize,
+ (len - rootBits) << 16 | sorted[symbol++]);
+ key = getNextKey(key, len);
+ }
+ }
+ }
+}
diff --git a/src/net/sourceforge/plantuml/brotli/State.java b/src/net/sourceforge/plantuml/brotli/State.java
new file mode 100644
index 0000000..db670bc
--- /dev/null
+++ b/src/net/sourceforge/plantuml/brotli/State.java
@@ -0,0 +1,87 @@
+/* Copyright 2015 Google Inc. All Rights Reserved.
+
+ Distributed under MIT license.
+ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+
+package net.sourceforge.plantuml.brotli;
+
+import java.io.InputStream;
+
+final class State {
+ byte[] ringBuffer;
+ byte[] contextModes;
+ byte[] contextMap;
+ byte[] distContextMap;
+ byte[] output;
+ byte[] byteBuffer; // BitReader
+
+ short[] shortBuffer; // BitReader
+
+ int[] intBuffer; // BitReader
+ int[] rings;
+ int[] blockTrees;
+ int[] hGroup0;
+ int[] hGroup1;
+ int[] hGroup2;
+
+ long accumulator64; // BitReader: pre-fetched bits.
+
+ int runningState; // Default value is 0 == Decode.UNINITIALIZED
+ int nextRunningState;
+ int accumulator32; // BitReader: pre-fetched bits.
+ int bitOffset; // BitReader: bit-reading position in accumulator.
+ int halfOffset; // BitReader: offset of next item in intBuffer/shortBuffer.
+ int tailBytes; // BitReader: number of bytes in unfinished half.
+ int endOfStreamReached; // BitReader: input stream is finished.
+ int metaBlockLength;
+ int inputEnd;
+ int isUncompressed;
+ int isMetadata;
+ int literalBlockLength;
+ int numLiteralBlockTypes;
+ int commandBlockLength;
+ int numCommandBlockTypes;
+ int distanceBlockLength;
+ int numDistanceBlockTypes;
+ int pos;
+ int maxDistance;
+ int distRbIdx;
+ int trivialLiteralContext;
+ int literalTreeIndex;
+ int literalTree;
+ int j;
+ int insertLength;
+ int contextMapSlice;
+ int distContextMapSlice;
+ int contextLookupOffset1;
+ int contextLookupOffset2;
+ int treeCommandOffset;
+ int distanceCode;
+ int numDirectDistanceCodes;
+ int distancePostfixMask;
+ int distancePostfixBits;
+ int distance;
+ int copyLength;
+ int copyDst;
+ int maxBackwardDistance;
+ int maxRingBufferSize;
+ int ringBufferSize;
+ int expectedTotalSize;
+ int outputOffset;
+ int outputLength;
+ int outputUsed;
+ int bytesWritten;
+ int bytesToWrite;
+
+ InputStream input; // BitReader
+
+ State() {
+ this.ringBuffer = new byte[0];
+ this.rings = new int[10];
+ this.rings[0] = 16;
+ this.rings[1] = 15;
+ this.rings[2] = 11;
+ this.rings[3] = 4;
+ }
+}
diff --git a/src/net/sourceforge/plantuml/brotli/Transform.java b/src/net/sourceforge/plantuml/brotli/Transform.java
new file mode 100644
index 0000000..b582b84
--- /dev/null
+++ b/src/net/sourceforge/plantuml/brotli/Transform.java
@@ -0,0 +1,115 @@
+/* Copyright 2015 Google Inc. All Rights Reserved.
+
+ Distributed under MIT license.
+ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+
+package net.sourceforge.plantuml.brotli;
+
+import java.nio.ByteBuffer;
+
+/**
+ * Transformations on dictionary words.
+ */
+final class Transform {
+
+ static final int NUM_TRANSFORMS = 121;
+ private static final int[] TRANSFORMS = new int[NUM_TRANSFORMS * 3];
+ private static final byte[] PREFIX_SUFFIX = new byte[217];
+ private static final int[] PREFIX_SUFFIX_HEADS = new int[51];
+
+ // Bundle of 0-terminated strings.
+ private static final String PREFIX_SUFFIX_SRC = "# #s #, #e #.# the #.com/#\u00C2\u00A0# of # and"
+ + " # in # to #\"#\">#\n#]# for # a # that #. # with #'# from # by #. The # on # as # is #ing"
+ + " #\n\t#:#ed #(# at #ly #=\"# of the #. This #,# not #er #al #='#ful #ive #less #est #ize #"
+ + "ous #";
+ private static final String TRANSFORMS_SRC = " !! ! , *! &! \" ! ) * * - ! # ! #!*! "
+ + "+ ,$ ! - % . / # 0 1 . \" 2 3!* 4% ! # / 5 6 7 8 0 1 & $ 9 + : "
+ + " ; < ' != > ?! 4 @ 4 2 & A *# ( B C& ) % ) !*# *-% A +! *. D! %' & E *6 F "
+ + " G% ! *A *% H! D I!+! J!+ K +- *4! A L!*4 M N +6 O!*% +.! K *G P +%( ! G *D +D "
+ + " Q +# *K!*G!+D!+# +G +A +4!+% +K!+4!*D!+K!*K";
+
+ private static void unpackTransforms(byte[] prefixSuffix, int[] prefixSuffixHeads,
+ int[] transforms, String prefixSuffixSrc, String transformsSrc) {
+ int n = prefixSuffixSrc.length();
+ int index = 1;
+ for (int i = 0; i < n; ++i) {
+ char c = prefixSuffixSrc.charAt(i);
+ prefixSuffix[i] = (byte) c;
+ if (c == 35) { // == #
+ prefixSuffixHeads[index++] = i + 1;
+ prefixSuffix[i] = 0;
+ }
+ }
+
+ for (int i = 0; i < NUM_TRANSFORMS * 3; ++i) {
+ transforms[i] = transformsSrc.charAt(i) - 32;
+ }
+ }
+
+ static {
+ unpackTransforms(PREFIX_SUFFIX, PREFIX_SUFFIX_HEADS, TRANSFORMS, PREFIX_SUFFIX_SRC,
+ TRANSFORMS_SRC);
+ }
+
+ static int transformDictionaryWord(byte[] dst, int dstOffset, ByteBuffer data, int wordOffset,
+ int len, int transformIndex) {
+ int offset = dstOffset;
+ int transformOffset = 3 * transformIndex;
+ int transformPrefix = PREFIX_SUFFIX_HEADS[TRANSFORMS[transformOffset]];
+ int transformType = TRANSFORMS[transformOffset + 1];
+ int transformSuffix = PREFIX_SUFFIX_HEADS[TRANSFORMS[transformOffset + 2]];
+
+ // Copy prefix.
+ while (PREFIX_SUFFIX[transformPrefix] != 0) {
+ dst[offset++] = PREFIX_SUFFIX[transformPrefix++];
+ }
+
+ // Copy trimmed word.
+ int omitFirst = transformType >= 12 ? (transformType - 11) : 0;
+ if (omitFirst > len) {
+ omitFirst = len;
+ }
+ wordOffset += omitFirst;
+ len -= omitFirst;
+ len -= transformType <= 9 ? transformType : 0; // Omit last.
+ int i = len;
+ while (i > 0) {
+ dst[offset++] = data.get(wordOffset++);
+ i--;
+ }
+
+ // Ferment.
+ if (transformType == 11 || transformType == 10) {
+ int uppercaseOffset = offset - len;
+ if (transformType == 10) {
+ len = 1;
+ }
+ while (len > 0) {
+ int tmp = dst[uppercaseOffset] & 0xFF;
+ if (tmp < 0xc0) {
+ if (tmp >= 97 && tmp <= 122) { // in [a..z] range
+ dst[uppercaseOffset] ^= (byte) 32;
+ }
+ uppercaseOffset += 1;
+ len -= 1;
+ } else if (tmp < 0xe0) {
+ dst[uppercaseOffset + 1] ^= (byte) 32;
+ uppercaseOffset += 2;
+ len -= 2;
+ } else {
+ dst[uppercaseOffset + 2] ^= (byte) 5;
+ uppercaseOffset += 3;
+ len -= 3;
+ }
+ }
+ }
+
+ // Copy suffix.
+ while (PREFIX_SUFFIX[transformSuffix] != 0) {
+ dst[offset++] = PREFIX_SUFFIX[transformSuffix++];
+ }
+
+ return offset - dstOffset;
+ }
+}
diff --git a/src/net/sourceforge/plantuml/brotli/Utils.java b/src/net/sourceforge/plantuml/brotli/Utils.java
new file mode 100644
index 0000000..35034d8
--- /dev/null
+++ b/src/net/sourceforge/plantuml/brotli/Utils.java
@@ -0,0 +1,74 @@
+/* Copyright 2015 Google Inc. All Rights Reserved.
+
+ Distributed under MIT license.
+ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+
+package net.sourceforge.plantuml.brotli;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * A set of utility methods.
+ */
+final class Utils {
+
+ private static final byte[] BYTE_ZEROES = new byte[1024];
+
+ private static final int[] INT_ZEROES = new int[1024];
+
+ /**
+ * Fills byte array with zeroes.
+ *
+ * <p> Current implementation uses {@link System#arraycopy}, so it should be used for length not
+ * less than 16.
+ *
+ * @param dest array to fill with zeroes
+ * @param offset the first byte to fill
+ * @param length number of bytes to change
+ */
+ static void fillBytesWithZeroes(byte[] dest, int start, int end) {
+ int cursor = start;
+ while (cursor < end) {
+ int step = Math.min(cursor + 1024, end) - cursor;
+ System.arraycopy(BYTE_ZEROES, 0, dest, cursor, step);
+ cursor += step;
+ }
+ }
+
+ /**
+ * Fills int array with zeroes.
+ *
+ * <p> Current implementation uses {@link System#arraycopy}, so it should be used for length not
+ * less than 16.
+ *
+ * @param dest array to fill with zeroes
+ * @param offset the first item to fill
+ * @param length number of item to change
+ */
+ static void fillIntsWithZeroes(int[] dest, int start, int end) {
+ int cursor = start;
+ while (cursor < end) {
+ int step = Math.min(cursor + 1024, end) - cursor;
+ System.arraycopy(INT_ZEROES, 0, dest, cursor, step);
+ cursor += step;
+ }
+ }
+
+ static void copyBytesWithin(byte[] bytes, int target, int start, int end) {
+ System.arraycopy(bytes, start, bytes, target, end - start);
+ }
+
+ static int readInput(InputStream src, byte[] dst, int offset, int length) {
+ try {
+ return src.read(dst, offset, length);
+ } catch (IOException e) {
+ throw new BrotliRuntimeException("Failed to read input", e);
+ }
+ }
+
+ static void closeInput(InputStream src) throws IOException {
+ src.close();
+ }
+}
diff --git a/src/net/sourceforge/plantuml/classdiagram/ClassDiagram.java b/src/net/sourceforge/plantuml/classdiagram/ClassDiagram.java
index 40e4312..6200a75 100644
--- a/src/net/sourceforge/plantuml/classdiagram/ClassDiagram.java
+++ b/src/net/sourceforge/plantuml/classdiagram/ClassDiagram.java
@@ -58,74 +58,78 @@ import net.sourceforge.plantuml.ugraphic.ImageBuilder;
public class ClassDiagram extends AbstractClassOrObjectDiagram {
- private String namespaceSeparator = ".";
+ private final String getNamespace(Code fullyCode) {
+ return getNamespace(fullyCode, fullyCode.getSeparator());
+ }
+
+ private final String getNamespace(Code fullyCode, String separator) {
+ String name = fullyCode.getFullName();
+ if (separator == null) {
+ throw new IllegalArgumentException(toString());
+ }
+ do {
+ final int x = name.lastIndexOf(separator);
+ if (x == -1) {
+ return null;
+ }
+ name = name.substring(0, x);
+ } while (entityFactory.getLeafsget(Code.of(name, separator)) != null);
+ return name;
+ }
+
+ public final Code getShortName(Code code) {
+ final String separator = code.getSeparator();
+ if (separator == null) {
+ throw new IllegalArgumentException();
+ }
+ final String codeString = code.getFullName();
+ final String namespace = getNamespace(code);
+ if (namespace == null) {
+ return Code.of(codeString, separator);
+ }
+ return Code.of(codeString.substring(namespace.length() + separator.length()), separator);
+ }
@Override
public ILeaf getOrCreateLeaf(Code code, LeafType type, USymbol symbol) {
- if (namespaceSeparator != null) {
- code = code.withSeparator(namespaceSeparator);
+ if (getNamespaceSeparator() != null) {
+ code = code.withSeparator(getNamespaceSeparator());
}
if (type == null) {
code = code.eventuallyRemoveStartingAndEndingDoubleQuote("\"([:");
- if (namespaceSeparator == null) {
+ if (getNamespaceSeparator() == null) {
return getOrCreateLeafDefault(code, LeafType.CLASS, symbol);
}
- code = code.getFullyQualifiedCode(getCurrentGroup());
+ code = getFullyQualifiedCode(code);
if (super.leafExist(code)) {
return getOrCreateLeafDefault(code, LeafType.CLASS, symbol);
}
- return createEntityWithNamespace(code, Display.getWithNewlines(code.getShortName(getLeafs())),
- LeafType.CLASS, symbol);
+ return createEntityWithNamespace(code, Display.getWithNewlines(getShortName(code)), LeafType.CLASS, symbol);
}
- if (namespaceSeparator == null) {
+ if (getNamespaceSeparator() == null) {
return getOrCreateLeafDefault(code, LeafType.CLASS, symbol);
}
- code = code.getFullyQualifiedCode(getCurrentGroup());
+ code = getFullyQualifiedCode(code);
if (super.leafExist(code)) {
return getOrCreateLeafDefault(code, type, symbol);
}
- return createEntityWithNamespace(code, Display.getWithNewlines(code.getShortName(getLeafs())), type, symbol);
- }
-
- public IGroup getOrCreateNamespace(Code namespace, Display display, GroupType type, IGroup parent) {
- if (namespaceSeparator != null) {
- namespace = namespace.withSeparator(namespaceSeparator).getFullyQualifiedCode(getCurrentGroup());
- }
- final IGroup g = getOrCreateNamespaceInternal(namespace, display, type, parent);
- currentGroup = g;
- return g;
- }
-
- private IGroup getOrCreateNamespaceInternal(Code namespace, Display display, GroupType type, IGroup parent) {
- IGroup result = entityFactory.getGroups().get(namespace);
- if (result != null) {
- return result;
- }
- if (entityFactory.getLeafs().containsKey(namespace)) {
- result = entityFactory.muteToGroup(namespace, namespace, type, parent);
- result.setDisplay(display);
- } else {
- result = entityFactory.createGroup(namespace, display, namespace, type, parent, getHides(),
- getNamespaceSeparator());
- }
- entityFactory.addGroup(result);
- return result;
+ return createEntityWithNamespace(code, Display.getWithNewlines(getShortName(code)), type, symbol);
}
@Override
public ILeaf createLeaf(Code code, Display display, LeafType type, USymbol symbol) {
- if (namespaceSeparator != null) {
- code = code.withSeparator(namespaceSeparator);
+ if (getNamespaceSeparator() != null) {
+ code = code.withSeparator(getNamespaceSeparator());
}
if (type != LeafType.ABSTRACT_CLASS && type != LeafType.ANNOTATION && type != LeafType.CLASS
&& type != LeafType.INTERFACE && type != LeafType.ENUM && type != LeafType.LOLLIPOP
&& type != LeafType.NOTE) {
return super.createLeaf(code, display, type, symbol);
}
- if (namespaceSeparator == null) {
+ if (getNamespaceSeparator() == null) {
return super.createLeaf(code, display, type, symbol);
}
- code = code.getFullyQualifiedCode(getCurrentGroup());
+ code = getFullyQualifiedCode(code);
if (super.leafExist(code)) {
throw new IllegalArgumentException("Already known: " + code);
}
@@ -133,39 +137,29 @@ public class ClassDiagram extends AbstractClassOrObjectDiagram {
}
private ILeaf createEntityWithNamespace(Code fullyCode, Display display, LeafType type, USymbol symbol) {
- IGroup group = getCurrentGroup();
- final String namespace = getNamespace(fullyCode);
+ final IGroup backupCurrentGroup = getCurrentGroup();
+ final IGroup group = backupCurrentGroup;
+ final String namespace = getNamespace(fullyCode, getNamespaceSeparator());
if (namespace != null
&& (EntityUtils.groupRoot(group) || group.getCode().getFullName().equals(namespace) == false)) {
final Code namespace2 = Code.of(namespace);
- group = getOrCreateNamespaceInternal(namespace2, Display.getWithNewlines(namespace), GroupType.PACKAGE,
- getRootGroup());
+ gotoGroupInternal(namespace2, Display.getWithNewlines(namespace), namespace2, GroupType.PACKAGE, getRootGroup());
}
- return createLeafInternal(
+ final ILeaf result = createLeafInternal(
fullyCode,
- Display.isNull(display) ? Display.getWithNewlines(fullyCode.getShortName(getLeafs())).withCreoleMode(
- CreoleMode.SIMPLE_LINE) : display, type, group, symbol);
- }
-
- private final String getNamespace(Code fullyCode) {
- String name = fullyCode.getFullName();
- do {
- final int x = name.lastIndexOf(namespaceSeparator);
- if (x == -1) {
- return null;
- }
- name = name.substring(0, x);
- } while (getLeafs().containsKey(Code.of(name, namespaceSeparator)));
- return name;
+ Display.isNull(display) ? Display.getWithNewlines(getShortName(fullyCode)).withCreoleMode(
+ CreoleMode.SIMPLE_LINE) : display, type, symbol);
+ gotoThisGroup(backupCurrentGroup);
+ return result;
}
@Override
public final boolean leafExist(Code code) {
- if (namespaceSeparator == null) {
+ if (getNamespaceSeparator() == null) {
return super.leafExist(code);
}
- code = code.withSeparator(namespaceSeparator);
- return super.leafExist(code.getFullyQualifiedCode(getCurrentGroup()));
+ code = code.withSeparator(getNamespaceSeparator());
+ return super.leafExist(getFullyQualifiedCode(code));
}
@Override
@@ -173,14 +167,6 @@ public class ClassDiagram extends AbstractClassOrObjectDiagram {
return UmlDiagramType.CLASS;
}
- public void setNamespaceSeparator(String namespaceSeparator) {
- this.namespaceSeparator = namespaceSeparator;
- }
-
- public String getNamespaceSeparator() {
- return namespaceSeparator;
- }
-
private boolean allowMixing;
public void setAllowMixing(boolean allowMixing) {
@@ -221,7 +207,7 @@ public class ClassDiagram extends AbstractClassOrObjectDiagram {
private RowLayout getRawLayout(int raw) {
final RowLayout rawLayout = new RowLayout();
- for (ILeaf leaf : getLeafs().values()) {
+ for (ILeaf leaf : entityFactory.getLeafsvalues()) {
if (leaf.getRawLayout() == raw) {
rawLayout.addLeaf(getEntityImageClass(leaf));
}
diff --git a/src/net/sourceforge/plantuml/classdiagram/ClassDiagramFactory.java b/src/net/sourceforge/plantuml/classdiagram/ClassDiagramFactory.java
index ffa50c6..b8021ed 100644
--- a/src/net/sourceforge/plantuml/classdiagram/ClassDiagramFactory.java
+++ b/src/net/sourceforge/plantuml/classdiagram/ClassDiagramFactory.java
@@ -46,6 +46,7 @@ import net.sourceforge.plantuml.classdiagram.command.CommandCreateClassMultiline
import net.sourceforge.plantuml.classdiagram.command.CommandCreateElementFull2;
import net.sourceforge.plantuml.classdiagram.command.CommandCreateElementFull2.Mode;
import net.sourceforge.plantuml.classdiagram.command.CommandDiamondAssociation;
+import net.sourceforge.plantuml.classdiagram.command.CommandHideShow2;
import net.sourceforge.plantuml.classdiagram.command.CommandHideShowSpecificClass;
import net.sourceforge.plantuml.classdiagram.command.CommandHideShowSpecificStereotype;
import net.sourceforge.plantuml.classdiagram.command.CommandImport;
@@ -53,6 +54,7 @@ import net.sourceforge.plantuml.classdiagram.command.CommandLayoutNewLine;
import net.sourceforge.plantuml.classdiagram.command.CommandLinkClass;
import net.sourceforge.plantuml.classdiagram.command.CommandLinkLollipop;
import net.sourceforge.plantuml.classdiagram.command.CommandNamespaceSeparator;
+import net.sourceforge.plantuml.classdiagram.command.CommandRemoveRestore;
import net.sourceforge.plantuml.classdiagram.command.CommandStereotype;
import net.sourceforge.plantuml.classdiagram.command.CommandUrl;
import net.sourceforge.plantuml.command.Command;
@@ -69,7 +71,9 @@ import net.sourceforge.plantuml.command.note.FactoryNoteOnEntityCommand;
import net.sourceforge.plantuml.command.note.FactoryNoteOnLinkCommand;
import net.sourceforge.plantuml.command.note.FactoryTipOnEntityCommand;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.descdiagram.command.CommandCreateElementMultilines;
import net.sourceforge.plantuml.descdiagram.command.CommandNewpage;
+import net.sourceforge.plantuml.descdiagram.command.CommandPackageWithUSymbol;
import net.sourceforge.plantuml.objectdiagram.command.CommandCreateEntityObject;
import net.sourceforge.plantuml.objectdiagram.command.CommandCreateEntityObjectMultilines;
@@ -89,25 +93,30 @@ public class ClassDiagramFactory extends UmlDiagramFactory {
cmds.add(new CommandRankDir());
cmds.add(new CommandNewpage(this));
- cmds.add(new CommandHideShowSpecificStereotype());
+// cmds.add(new CommandHideShowSpecificStereotype());
cmds.add(new CommandPage());
cmds.add(new CommandAddMethod());
+ cmds.add(new CommandHideShow2());
+ cmds.add(new CommandRemoveRestore());
+ cmds.add(new CommandCreateClassMultilines());
+ cmds.add(new CommandCreateEntityObjectMultilines());
cmds.add(new CommandCreateClass());
cmds.add(new CommandCreateEntityObject());
cmds.add(new CommandAllowMixing());
cmds.add(new CommandLayoutNewLine());
+ cmds.add(new CommandPackage());
+ cmds.add(new CommandEndPackage());
+ cmds.add(new CommandPackageEmpty());
+ cmds.add(new CommandPackageWithUSymbol());
+
cmds.add(new CommandCreateElementFull2(Mode.NORMAL_KEYWORD));
cmds.add(new CommandCreateElementFull2(Mode.WITH_MIX_PREFIX));
final FactoryNoteCommand factoryNoteCommand = new FactoryNoteCommand();
cmds.add(factoryNoteCommand.createSingleLine());
- cmds.add(new CommandPackage());
- cmds.add(new CommandEndPackage());
- cmds.add(new CommandPackageEmpty());
-
cmds.add(new CommandNamespace());
cmds.add(new CommandStereotype());
@@ -130,19 +139,19 @@ public class ClassDiagramFactory extends UmlDiagramFactory {
cmds.add(factoryNoteOnEntityCommand.createMultiLine(false));
cmds.add(factoryNoteCommand.createMultiLine(false));
- cmds.add(new CommandCreateClassMultilines());
- cmds.add(new CommandCreateEntityObjectMultilines());
-
final FactoryNoteOnLinkCommand factoryNoteOnLinkCommand = new FactoryNoteOnLinkCommand();
cmds.add(factoryNoteOnLinkCommand.createSingleLine());
cmds.add(factoryNoteOnLinkCommand.createMultiLine(false));
cmds.add(new CommandDiamondAssociation());
- cmds.add(new CommandHideShowSpecificClass());
+// cmds.add(new CommandHideShowSpecificClass());
cmds.add(new CommandNamespaceSeparator());
+ cmds.add(new CommandCreateElementMultilines(0));
+ cmds.add(new CommandCreateElementMultilines(1));
+
return cmds;
}
}
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java
index 4e4f20d..d047558 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java
@@ -51,6 +51,7 @@ import net.sourceforge.plantuml.cucadiagram.Code;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.LeafType;
+import net.sourceforge.plantuml.cucadiagram.Stereotag;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.color.ColorParser;
@@ -90,6 +91,8 @@ public class CommandCreateClass extends SingleLineCommand2<ClassDiagram> {
new RegexLeaf("[%s]*"), //
new RegexLeaf("STEREO", "(\\<{2}.*\\>{2})?"), //
new RegexLeaf("[%s]*"), //
+ new RegexLeaf("TAGS", Stereotag.pattern() + "?"), //
+ new RegexLeaf("[%s]*"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("[%s]*"), //
color().getRegex(), //
@@ -163,6 +166,7 @@ public class CommandCreateClass extends SingleLineCommand2<ClassDiagram> {
// manageExtends(diagram, arg, entity);
CommandCreateClassMultilines.manageExtends("EXTENDS", diagram, arg, entity);
CommandCreateClassMultilines.manageExtends("IMPLEMENTS", diagram, arg, entity);
+ CommandCreateClassMultilines.addTags(entity, arg.get("TAGS", 0));
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java
index cbdab30..87a9025 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java
@@ -57,6 +57,7 @@ import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.LinkDecor;
import net.sourceforge.plantuml.cucadiagram.LinkType;
+import net.sourceforge.plantuml.cucadiagram.Stereotag;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.color.ColorParser;
@@ -102,6 +103,8 @@ public class CommandCreateClassMultilines extends CommandMultilines2<ClassDiagra
new RegexLeaf("[%s]*"), //
new RegexLeaf("STEREO", "(\\<\\<.+\\>\\>)?"), //
new RegexLeaf("[%s]*"), //
+ new RegexLeaf("TAGS", Stereotag.pattern() + "?"), //
+ new RegexLeaf("[%s]*"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("[%s]*"), //
color().getRegex(), //
@@ -111,14 +114,19 @@ public class CommandCreateClassMultilines extends CommandMultilines2<ClassDiagra
new RegexLeaf("IMPLEMENTS", "([%s]+(implements)[%s]+(" + CODES + "))?"), //
new RegexLeaf("[%s]*\\{[%s]*$"));
}
+
+ @Override
+ public boolean syntaxWithFinalBracket() {
+ return true;
+ }
+
private static ColorParser color() {
return ColorParser.simpleColor(ColorType.BACK);
}
- public CommandExecutionResult executeNow(ClassDiagram diagram, BlocLines lines) {
+ protected CommandExecutionResult executeNow(ClassDiagram diagram, BlocLines lines) {
lines = lines.trimSmart(1);
- lines = lines.removeComments();
final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
final IEntity entity = executeArg0(diagram, line0);
if (entity == null) {
@@ -127,15 +135,15 @@ public class CommandCreateClassMultilines extends CommandMultilines2<ClassDiagra
if (lines.size() > 1) {
lines = lines.subExtract(1, 1);
final Url url = null;
-// if (lines.size() > 0) {
-// final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
-// url = urlBuilder.getUrl(lines.getFirst499().toString());
-// } else {
-// url = null;
-// }
-// if (url != null) {
-// lines = lines.subExtract(1, 0);
-// }
+ // if (lines.size() > 0) {
+ // final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
+ // url = urlBuilder.getUrl(lines.getFirst499().toString());
+ // } else {
+ // url = null;
+ // }
+ // if (url != null) {
+ // lines = lines.subExtract(1, 0);
+ // }
for (CharSequence s : lines) {
if (s.length() > 0 && VisibilityModifier.isVisibilityCharacter(s)) {
diagram.setVisibilityModifierPresent(true);
@@ -149,10 +157,22 @@ public class CommandCreateClassMultilines extends CommandMultilines2<ClassDiagra
manageExtends("EXTENDS", diagram, line0, entity);
manageExtends("IMPLEMENTS", diagram, line0, entity);
+ addTags(entity, line0.get("TAGS", 0));
return CommandExecutionResult.ok();
}
+ public static void addTags(IEntity entity, String tags) {
+ if (tags == null) {
+ return;
+ }
+ for (String tag : tags.split("[ ]+")) {
+ assert tag.startsWith("$");
+ tag = tag.substring(1);
+ entity.addStereotag(new Stereotag(tag));
+ }
+ }
+
public static void manageExtends(String keyword, ClassDiagram system, RegexResult arg, final IEntity entity) {
if (arg.get(keyword, 1) != null) {
final Mode mode = arg.get(keyword, 1).equalsIgnoreCase("extends") ? Mode.EXTENDS : Mode.IMPLEMENTS;
@@ -169,7 +189,7 @@ public class CommandCreateClassMultilines extends CommandMultilines2<ClassDiagra
final IEntity cl2 = system.getOrCreateLeaf(other, type2, null);
LinkType typeLink = new LinkType(LinkDecor.NONE, LinkDecor.EXTENDS);
if (type2 == LeafType.INTERFACE && entity.getLeafType() != LeafType.INTERFACE) {
- typeLink = typeLink.getDashed();
+ typeLink = typeLink.goDashed();
}
final Link link = new Link(cl2, entity, typeLink, Display.NULL, 2, null, null,
system.getLabeldistance(), system.getLabelangle());
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateElementFull2.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateElementFull2.java
index 6f0dbfc..b8d24b7 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateElementFull2.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateElementFull2.java
@@ -51,6 +51,7 @@ import net.sourceforge.plantuml.cucadiagram.Code;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.LeafType;
+import net.sourceforge.plantuml.cucadiagram.Stereotag;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.descdiagram.command.CommandCreateElementFull;
import net.sourceforge.plantuml.graphic.USymbol;
@@ -90,6 +91,8 @@ public class CommandCreateElementFull2 extends SingleLineCommand2<ClassDiagram>
), //
new RegexLeaf("STEREOTYPE", "(?:[%s]*(\\<\\<.+\\>\\>))?"), //
new RegexLeaf("[%s]*"), //
+ new RegexLeaf("TAGS", Stereotag.pattern() + "?"), //
+ new RegexLeaf("[%s]*"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("[%s]*"), //
ColorParser.exp1(), //
@@ -165,6 +168,7 @@ public class CommandCreateElementFull2 extends SingleLineCommand2<ClassDiagram>
.getSkinParam().getFont(null, false, FontParam.CIRCLED_CHARACTER), diagram.getSkinParam()
.getIHtmlColorSet()));
}
+ CommandCreateClassMultilines.addTags(entity, arg.get("TAGS", 0));
final String urlString = arg.get("URL", 0);
if (urlString != null) {
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShow2.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShow2.java
new file mode 100644
index 0000000..6df8885
--- /dev/null
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShow2.java
@@ -0,0 +1,67 @@
+/* ========================================================================
+ * 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.classdiagram.command;
+
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.SingleLineCommand2;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+import net.sourceforge.plantuml.cucadiagram.CucaDiagram;
+
+public class CommandHideShow2 extends SingleLineCommand2<CucaDiagram> {
+
+ public CommandHideShow2() {
+ super(getRegexConcat());
+ }
+
+ static RegexConcat getRegexConcat() {
+ return new RegexConcat(new RegexLeaf("^"), //
+ new RegexLeaf("COMMAND", "(hide|show)"), //
+ new RegexLeaf("[%s]+"), //
+ new RegexLeaf("WHAT", "(.+)"), //
+ new RegexLeaf("$"));
+ }
+
+ @Override
+ protected CommandExecutionResult executeArg(CucaDiagram diagram, RegexResult arg) {
+
+ final boolean show = arg.get("COMMAND", 0).equalsIgnoreCase("show");
+ final String what = arg.get("WHAT", 0).trim();
+ diagram.hideOrShow2(what, show);
+ return CommandExecutionResult.ok();
+ }
+}
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShowSpecificClass.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShowSpecificClass.java
index 3f52a8f..8ee8ded 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShowSpecificClass.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShowSpecificClass.java
@@ -62,22 +62,23 @@ public class CommandHideShowSpecificClass extends SingleLineCommand2<CucaDiagram
@Override
protected CommandExecutionResult executeArg(CucaDiagram diagram, RegexResult arg) {
- final String codeString = arg.get("CODE", 0);
- if (codeString.equals("class")) {
- diagram.hideOrShow(LeafType.CLASS, arg.get("COMMAND", 0).equalsIgnoreCase("show"));
- } else if (codeString.equals("interface")) {
- diagram.hideOrShow(LeafType.INTERFACE, arg.get("COMMAND", 0).equalsIgnoreCase("show"));
- } else {
- final Code code = Code.of(codeString);
- IEntity hidden = diagram.getEntityFactory().getLeafs().get(code);
- if (hidden == null) {
- hidden = diagram.getEntityFactory().getGroups().get(code);
- }
- if (hidden == null) {
- return CommandExecutionResult.error("Class/Package does not exist : " + code.getFullName());
- }
- diagram.hideOrShow(hidden, arg.get("COMMAND", 0).equalsIgnoreCase("show"));
- }
- return CommandExecutionResult.ok();
+// final String codeString = arg.get("CODE", 0);
+// if (codeString.equals("class")) {
+// diagram.hideOrShow(LeafType.CLASS, arg.get("COMMAND", 0).equalsIgnoreCase("show"));
+// } else if (codeString.equals("interface")) {
+// diagram.hideOrShow(LeafType.INTERFACE, arg.get("COMMAND", 0).equalsIgnoreCase("show"));
+// } else {
+// final Code code = Code.of(codeString);
+// IEntity hidden = diagram.getEntityFactory().getLeafsget(code);
+// if (hidden == null) {
+// hidden = diagram.getEntityFactory().getGroupsget(code);
+// }
+// if (hidden == null) {
+// return CommandExecutionResult.error("Class/Package does not exist : " + code.getFullName());
+// }
+// diagram.hideOrShow(hidden, arg.get("COMMAND", 0).equalsIgnoreCase("show"));
+// }
+// return CommandExecutionResult.ok();
+ throw new UnsupportedOperationException();
}
}
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShowSpecificStereotype.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShowSpecificStereotype.java
index 0fec714..96f8a94 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShowSpecificStereotype.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShowSpecificStereotype.java
@@ -60,9 +60,10 @@ public class CommandHideShowSpecificStereotype extends SingleLineCommand2<CucaDi
@Override
protected CommandExecutionResult executeArg(CucaDiagram diagram, RegexResult arg) {
- final String stereotype = arg.get("STEREOTYPE", 0);
- diagram.hideOrShow(new Stereotype(stereotype), arg.get("COMMAND", 0).equalsIgnoreCase("show"));
-
- return CommandExecutionResult.ok();
+// final String stereotype = arg.get("STEREOTYPE", 0);
+// diagram.hideOrShow(new Stereotype(stereotype), arg.get("COMMAND", 0).equalsIgnoreCase("show"));
+//
+// return CommandExecutionResult.ok();
+ throw new UnsupportedOperationException();
}
}
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java
index 6084f22..b4a2652 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java
@@ -35,8 +35,6 @@
*/
package net.sourceforge.plantuml.classdiagram.command;
-import java.util.StringTokenizer;
-
import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UmlDiagramType;
@@ -59,7 +57,7 @@ import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.LinkArrow;
import net.sourceforge.plantuml.cucadiagram.LinkDecor;
import net.sourceforge.plantuml.cucadiagram.LinkType;
-import net.sourceforge.plantuml.graphic.HtmlColorSet;
+import net.sourceforge.plantuml.descdiagram.command.CommandLinkElement;
import net.sourceforge.plantuml.graphic.color.ColorParser;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.graphic.color.Colors;
@@ -75,25 +73,21 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
}
static private RegexConcat getRegexConcat(UmlDiagramType umlDiagramType) {
- return new RegexConcat(
- new RegexLeaf("HEADER", "^(?:@([\\d.]+)[%s]+)?"), //
+ return new RegexConcat(new RegexLeaf("HEADER", "^(?:@([\\d.]+)[%s]+)?"), //
new RegexOr( //
new RegexLeaf("ENT1", getClassIdentifier()),//
- new RegexLeaf("COUPLE1", COUPLE)),
- new RegexLeaf("[%s]*"), //
+ new RegexLeaf("COUPLE1", COUPLE)), new RegexLeaf("[%s]*"), //
new RegexLeaf("FIRST_LABEL", "(?:[%g]([^%g]+)[%g])?"), //
new RegexLeaf("[%s]*"), //
new RegexConcat(
- //
+ //
new RegexLeaf("ARROW_HEAD1", "([%s]+[ox]|[)#\\[<*+^}]|[<\\[]\\||\\}o|\\}\\||\\|o|\\|\\|)?"), //
new RegexLeaf("ARROW_BODY1", "([-=.]+)"), //
- new RegexLeaf("ARROW_STYLE1",
- "(?:\\[((?:#\\w+|dotted|dashed|plain|bold|hidden|norank)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden|,norank)*)\\])?"),
+ new RegexLeaf("ARROW_STYLE1", "(?:\\[(" + CommandLinkElement.LINE_STYLE + ")\\])?"), //
new RegexLeaf("ARROW_DIRECTION", "(left|right|up|down|le?|ri?|up?|do?)?"), //
new RegexLeaf("INSIDE", "(?:(0|\\(0\\)|\\(0|0\\))(?=[-=.~]))?"), //
- new RegexLeaf("ARROW_STYLE2",
- "(?:\\[((?:#\\w+|dotted|dashed|plain|bold|hidden|norank)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden|,norank)*)\\])?"),
+ new RegexLeaf("ARROW_STYLE2", "(?:\\[(" + CommandLinkElement.LINE_STYLE + ")\\])?"), //
new RegexLeaf("ARROW_BODY2", "([-=.]*)"), //
new RegexLeaf("ARROW_HEAD2", "([ox][%s]+|[(#\\]>*+^\\{]|\\|[>\\]]|o\\{|\\|\\{|o\\||\\|\\|)?")), //
@@ -144,6 +138,9 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
Code ent1 = Code.of(arg.get("ENT1", 0));
Code ent2 = Code.of(arg.get("ENT2", 0));
+ if (ent1 == null && ent2 == null) {
+ return executeArgSpecial3(diagram, arg);
+ }
if (ent1 == null) {
return executeArgSpecial1(diagram, arg);
@@ -177,7 +174,7 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT2", 0), "\""))) : diagram.getOrCreateLeaf(
ent2, null, null);
- Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
+ // Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
final LinkType linkType = getLinkType(arg);
final Direction dir = getDirection(arg);
@@ -260,8 +257,8 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
link = link.getInv();
}
link.setLinkArrow(linkArrow);
- colors = applyStyle(arg.getLazzy("ARROW_STYLE", 0), link, colors);
- link.setColors(colors);
+ link.setColors(color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()));
+ link.applyStyle(arg.getLazzy("ARROW_STYLE", 0));
addLink(diagram, link, arg.get("HEADER", 0));
@@ -332,31 +329,29 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
queue = getQueueLength(arg);
}
- Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
-
final Display labelLink = Display.getWithNewlines(arg.get("LABEL_LINK", 0));
final String firstLabel = arg.get("FIRST_LABEL", 0);
final String secondLabel = arg.get("SECOND_LABEL", 0);
final Link link = new Link(cl1, cl2, linkType, labelLink, queue, firstLabel, secondLabel,
diagram.getLabeldistance(), diagram.getLabelangle());
+ link.setColors(color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()));
diagram.resetPragmaLabel();
- colors = applyStyle(arg.getLazzy("ARROW_STYLE", 0), link, colors);
- link.setColors(colors);
+ link.applyStyle(arg.getLazzy("ARROW_STYLE", 0));
addLink(diagram, link, arg.get("HEADER", 0));
return CommandExecutionResult.ok();
}
private CommandExecutionResult executeArgSpecial1(AbstractClassOrObjectDiagram diagram, RegexResult arg) {
- final Code clName1 = Code.of(arg.get("COUPLE1", 0));
- final Code clName2 = Code.of(arg.get("COUPLE1", 1));
- if (diagram.leafExist(clName1) == false) {
- return CommandExecutionResult.error("No class " + clName1);
+ final Code clName1A = Code.of(arg.get("COUPLE1", 0));
+ final Code clName1B = Code.of(arg.get("COUPLE1", 1));
+ if (diagram.leafExist(clName1A) == false) {
+ return CommandExecutionResult.error("No class " + clName1A);
}
- if (diagram.leafExist(clName2) == false) {
- return CommandExecutionResult.error("No class " + clName2);
+ if (diagram.leafExist(clName1B) == false) {
+ return CommandExecutionResult.error("No class " + clName1B);
}
final Code ent2 = Code.of(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT2", 0), "\""));
@@ -364,10 +359,8 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final LinkType linkType = getLinkType(arg);
final Display label = Display.getWithNewlines(arg.get("LABEL_LINK", 0));
- // final int length = getQueueLength(arg);
- // final String weight = arg.get("HEADER").get(0);
- final boolean result = diagram.associationClass(1, clName1, clName2, cl2, linkType, label);
+ final boolean result = diagram.associationClass(1, clName1A, clName1B, cl2, linkType, label);
if (result == false) {
return CommandExecutionResult.error("Cannot have more than 2 assocications");
}
@@ -375,14 +368,38 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
return CommandExecutionResult.ok();
}
+ private CommandExecutionResult executeArgSpecial3(AbstractClassOrObjectDiagram diagram, RegexResult arg) {
+ final Code clName1A = Code.of(arg.get("COUPLE1", 0));
+ final Code clName1B = Code.of(arg.get("COUPLE1", 1));
+ final Code clName2A = Code.of(arg.get("COUPLE2", 0));
+ final Code clName2B = Code.of(arg.get("COUPLE2", 1));
+ if (diagram.leafExist(clName1A) == false) {
+ return CommandExecutionResult.error("No class " + clName1A);
+ }
+ if (diagram.leafExist(clName1B) == false) {
+ return CommandExecutionResult.error("No class " + clName1B);
+ }
+ if (diagram.leafExist(clName2A) == false) {
+ return CommandExecutionResult.error("No class " + clName2A);
+ }
+ if (diagram.leafExist(clName2B) == false) {
+ return CommandExecutionResult.error("No class " + clName2B);
+ }
+
+ final LinkType linkType = getLinkType(arg);
+ final Display label = Display.getWithNewlines(arg.get("LABEL_LINK", 0));
+
+ return diagram.associationClass(clName1A, clName1B, clName2A, clName2B, linkType, label);
+ }
+
private CommandExecutionResult executeArgSpecial2(AbstractClassOrObjectDiagram diagram, RegexResult arg) {
- final Code clName1 = Code.of(arg.get("COUPLE2", 0));
- final Code clName2 = Code.of(arg.get("COUPLE2", 1));
- if (diagram.leafExist(clName1) == false) {
- return CommandExecutionResult.error("No class " + clName1);
+ final Code clName2A = Code.of(arg.get("COUPLE2", 0));
+ final Code clName2B = Code.of(arg.get("COUPLE2", 1));
+ if (diagram.leafExist(clName2A) == false) {
+ return CommandExecutionResult.error("No class " + clName2A);
}
- if (diagram.leafExist(clName2) == false) {
- return CommandExecutionResult.error("No class " + clName2);
+ if (diagram.leafExist(clName2B) == false) {
+ return CommandExecutionResult.error("No class " + clName2B);
}
final Code ent1 = Code.of(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT1", 0), "\""));
@@ -390,10 +407,8 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final LinkType linkType = getLinkType(arg);
final Display label = Display.getWithNewlines(arg.get("LABEL_LINK", 0));
- // final int length = getQueueLength(arg);
- // final String weight = arg.get("HEADER").get(0);
- final boolean result = diagram.associationClass(2, clName1, clName2, cl1, linkType, label);
+ final boolean result = diagram.associationClass(2, clName2A, clName2B, cl1, linkType, label);
if (result == false) {
return CommandExecutionResult.error("Cannot have more than 2 assocications");
}
@@ -507,7 +522,7 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
LinkType result = new LinkType(decors2, decors1);
if (arg.get("ARROW_BODY1", 0).contains(".") || arg.get("ARROW_BODY2", 0).contains(".")) {
- result = result.getDashed();
+ result = result.goDashed();
}
final String middle = arg.get("INSIDE", 0);
if ("0".equals(middle)) {
@@ -562,40 +577,6 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
return s;
}
- @Deprecated
- public static Colors applyStyle(String arrowStyle, Link link) {
- return applyStyle(arrowStyle, link, null);
- }
-
- public static Colors applyStyle(String arrowStyle, Link link, Colors colors) {
- if (arrowStyle == null) {
- return colors;
- }
- final StringTokenizer st = new StringTokenizer(arrowStyle, ",");
- while (st.hasMoreTokens()) {
- final String s = st.nextToken();
- if (s.equalsIgnoreCase("dashed")) {
- link.goDashed();
- } else if (s.equalsIgnoreCase("bold")) {
- link.goBold();
- } else if (s.equalsIgnoreCase("dotted")) {
- link.goDotted();
- } else if (s.equalsIgnoreCase("hidden")) {
- link.goHidden();
- } else if (s.equalsIgnoreCase("plain")) {
- // Do nothing
- } else if (s.equalsIgnoreCase("norank")) {
- link.goNorank();
- } else {
- link.setSpecificColor(s);
- if (colors != null) {
- colors = colors.add(ColorType.LINE, HtmlColorSet.getInstance().getColorIfValid(s));
- }
- }
- }
- return colors;
- }
-
private boolean isInversed(LinkDecor decors1, LinkDecor decors2) {
if (decors1 == LinkDecor.ARROW && decors2 != LinkDecor.ARROW) {
return true;
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandRemoveRestore.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandRemoveRestore.java
new file mode 100644
index 0000000..bece1f5
--- /dev/null
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandRemoveRestore.java
@@ -0,0 +1,67 @@
+/* ========================================================================
+ * 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.classdiagram.command;
+
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.SingleLineCommand2;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+import net.sourceforge.plantuml.cucadiagram.CucaDiagram;
+
+public class CommandRemoveRestore extends SingleLineCommand2<CucaDiagram> {
+
+ public CommandRemoveRestore() {
+ super(getRegexConcat());
+ }
+
+ static RegexConcat getRegexConcat() {
+ return new RegexConcat(new RegexLeaf("^"), //
+ new RegexLeaf("COMMAND", "(remove|restore)"), //
+ new RegexLeaf("[%s]+"), //
+ new RegexLeaf("WHAT", "(.+)"), //
+ new RegexLeaf("$"));
+ }
+
+ @Override
+ protected CommandExecutionResult executeArg(CucaDiagram diagram, RegexResult arg) {
+
+ final boolean show = arg.get("COMMAND", 0).equalsIgnoreCase("restore");
+ final String what = arg.get("WHAT", 0).trim();
+ diagram.removeOrRestore(what, show);
+ return CommandExecutionResult.ok();
+ }
+}
diff --git a/src/net/sourceforge/plantuml/code/ArobaseStringCompressor.java b/src/net/sourceforge/plantuml/code/ArobaseStringCompressor.java
index 3f6c40b..87884a3 100644
--- a/src/net/sourceforge/plantuml/code/ArobaseStringCompressor.java
+++ b/src/net/sourceforge/plantuml/code/ArobaseStringCompressor.java
@@ -52,7 +52,7 @@ public class ArobaseStringCompressor implements StringCompressor {
private final static Pattern2 p = MyPattern.cmpile("(?s)(?i)^[%s]*(@startuml[^\\n\\r]*)?[%s]*(.*?)[%s]*(@enduml)?[%s]*$");
public String compress(final String data) throws IOException {
- final ReadLine r = new UncommentReadLine(new ReadLineReader(new StringReader(data), "COMPRESS"));
+ final ReadLine r = new UncommentReadLine(ReadLineReader.create(new StringReader(data), "COMPRESS"));
final StringBuilder sb = new StringBuilder();
final StringBuilder full = new StringBuilder();
CharSequence2 s = null;
@@ -102,6 +102,7 @@ public class ArobaseStringCompressor implements StringCompressor {
}
private String clean(String s) {
+ s = s.replace("\0", "");
s = StringUtils.trin(s);
s = clean1(s);
s = s.replaceAll("@enduml[^\\n\\r]*", "");
diff --git a/src/net/sourceforge/plantuml/code/ArobaseStringCompressor2.java b/src/net/sourceforge/plantuml/code/ArobaseStringCompressor2.java
new file mode 100644
index 0000000..3433de7
--- /dev/null
+++ b/src/net/sourceforge/plantuml/code/ArobaseStringCompressor2.java
@@ -0,0 +1,62 @@
+/* ========================================================================
+ * 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;
+
+import java.io.IOException;
+
+import net.sourceforge.plantuml.StringUtils;
+
+public class ArobaseStringCompressor2 implements StringCompressor {
+
+ public String compress(String data) throws IOException {
+ return clean2(data);
+ }
+
+ public String decompress(String s) throws IOException {
+ return clean2(s);
+ }
+
+ private String clean2(String s) {
+ s = s.replace("\0", "");
+ s = StringUtils.trin(s);
+ s = s.replace("\r", "").replaceAll("\n+$", "");
+ if (s.startsWith("@start")) {
+ return s;
+ }
+ return "@startuml\n" + s + "\n@enduml";
+ }
+
+} \ No newline at end of file
diff --git a/src/net/sourceforge/plantuml/code/AsciiEncoder.java b/src/net/sourceforge/plantuml/code/AsciiEncoder.java
index c804508..34db87e 100644
--- a/src/net/sourceforge/plantuml/code/AsciiEncoder.java
+++ b/src/net/sourceforge/plantuml/code/AsciiEncoder.java
@@ -37,10 +37,11 @@ package net.sourceforge.plantuml.code;
public class AsciiEncoder implements URLEncoder {
- final private char encode6bit[] = new char[64];
- final private byte decode6bit[] = new byte[128];
+ // Temporary because of AsciiEncoderFinalZeros
+ final static/* private */char encode6bit[] = new char[64];
+ final static/* private */byte decode6bit[] = new byte[128];
- public AsciiEncoder() {
+ static {
for (byte b = 0; b < 64; b++) {
encode6bit[b] = encode6bit(b);
decode6bit[encode6bit[b]] = b;
@@ -51,32 +52,55 @@ public class AsciiEncoder implements URLEncoder {
if (data == null) {
return "";
}
- final StringBuilder resu = new StringBuilder((data.length * 4 + 2) / 3);
+ final StringBuilder result = new StringBuilder((data.length * 4 + 2) / 3);
for (int i = 0; i < data.length; i += 3) {
- append3bytes(resu, data[i] & 0xFF, i + 1 < data.length ? data[i + 1] & 0xFF : 0,
+ append3bytes(result, data[i] & 0xFF, i + 1 < data.length ? data[i + 1] & 0xFF : 0,
i + 2 < data.length ? data[i + 2] & 0xFF : 0);
}
- return resu.toString();
+ return result.toString();
}
public byte[] decode(String s) {
- if (s.length() % 4 != 0) {
- throw new IllegalArgumentException("Cannot decode " + s);
- }
- final byte data[] = new byte[(s.length() * 3 + 3) / 4];
+ // if (s.length() % 4 != 0) {
+ // throw new IllegalArgumentException("Cannot decode " + s);
+ // }
+ final byte data[] = new byte[computeSize(s.length())];
int pos = 0;
for (int i = 0; i < s.length(); i += 4) {
- decode3bytes(data, pos, s.charAt(i), s.charAt(i + 1), s.charAt(i + 2), s.charAt(i + 3));
+ decode3bytes(data, pos, scharAt(s, i), scharAt(s, i + 1), scharAt(s, i + 2), scharAt(s, i + 3));
pos += 3;
}
return data;
}
- public int decode6bit(char c) {
+ private int computeSize(int length) {
+ // while (length % 4 != 0) {
+ // length++;
+ // }
+ final int r = length % 4;
+ if (r != 0) {
+ length += 4 - r;
+ }
+ // System.err.println("length=" + length);
+ // System.err.println("length1=" + (length % 4));
+ // length += length % 4;
+ // System.err.println("length2=" + length);
+ assert length % 4 == 0 : "length=" + length;
+ return (length * 3 + 3) / 4;
+ }
+
+ private char scharAt(String s, int i) {
+ if (i >= s.length()) {
+ return '0';
+ }
+ return s.charAt(i);
+ }
+
+ public static int decode6bit(char c) {
return decode6bit[c];
}
- public char encode6bit(byte b) {
+ public static char encode6bit(byte b) {
assert b >= 0 && b < 64;
if (b < 10) {
return (char) ('0' + b);
diff --git a/src/net/sourceforge/plantuml/code/AsciiEncoderBase64.java b/src/net/sourceforge/plantuml/code/AsciiEncoderBase64.java
new file mode 100644
index 0000000..d897406
--- /dev/null
+++ b/src/net/sourceforge/plantuml/code/AsciiEncoderBase64.java
@@ -0,0 +1,147 @@
+/* ========================================================================
+ * 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 AsciiEncoderBase64 implements URLEncoder {
+
+ final static private char encode6bit[] = new char[64];
+ final static private byte decode6bit[] = new byte[128];
+
+ static {
+ for (byte b = 0; b < 64; b++) {
+ encode6bit[b] = encode6bit(b);
+ decode6bit[encode6bit[b]] = b;
+ }
+ }
+
+ public String encode(byte data[]) {
+ if (data == null) {
+ return "";
+ }
+ final StringBuilder result = new StringBuilder((data.length * 4 + 2) / 3);
+ for (int i = 0; i < data.length; i += 3) {
+ append3bytes(result, data[i] & 0xFF, i + 1 < data.length ? data[i + 1] & 0xFF : 0,
+ i + 2 < data.length ? data[i + 2] & 0xFF : 0);
+ }
+ return result.toString();
+ }
+
+ public byte[] decode(String s) {
+ // if (s.length() % 4 != 0) {
+ // throw new IllegalArgumentException("Cannot decode " + s);
+ // }
+ final byte data[] = new byte[computeSize(s.length())];
+ int pos = 0;
+ for (int i = 0; i < s.length(); i += 4) {
+ decode3bytes(data, pos, scharAt(s, i), scharAt(s, i + 1), scharAt(s, i + 2), scharAt(s, i + 3));
+ pos += 3;
+ }
+ return data;
+ }
+
+ private int computeSize(int length) {
+ // while (length % 4 != 0) {
+ // length++;
+ // }
+ final int r = length % 4;
+ if (r != 0) {
+ length += 4 - r;
+ }
+ // System.err.println("length=" + length);
+ // System.err.println("length1=" + (length % 4));
+ // length += length % 4;
+ // System.err.println("length2=" + length);
+ assert length % 4 == 0 : "length=" + length;
+ return (length * 3 + 3) / 4;
+ }
+
+ private char scharAt(String s, int i) {
+ if (i >= s.length()) {
+ return 'A';
+ }
+ return s.charAt(i);
+ }
+
+ public static int decode6bit(char c) {
+ return decode6bit[c];
+ }
+
+ public static char encode6bit(byte b) {
+ assert b >= 0 && b < 64;
+ if (b < 26) {
+ return (char) ('A' + b);
+ }
+ b -= 26;
+ if (b < 26) {
+ return (char) ('a' + b);
+ }
+ b -= 26;
+ if (b < 10) {
+ return (char) ('0' + b);
+ }
+ b -= 10;
+ if (b == 0) {
+ return '-';
+ }
+ if (b == 1) {
+ return '_';
+ }
+ assert false;
+ return '?';
+ }
+
+ private void append3bytes(StringBuilder sb, int b1, int b2, int b3) {
+ final int c1 = b1 >> 2;
+ final int c2 = ((b1 & 0x3) << 4) | (b2 >> 4);
+ final int c3 = ((b2 & 0xF) << 2) | (b3 >> 6);
+ final int c4 = b3 & 0x3F;
+ sb.append(encode6bit[c1 & 0x3F]);
+ sb.append(encode6bit[c2 & 0x3F]);
+ sb.append(encode6bit[c3 & 0x3F]);
+ sb.append(encode6bit[c4 & 0x3F]);
+ }
+
+ private void decode3bytes(byte r[], int pos, char cc1, char cc2, char cc3, char cc4) {
+ final int c1 = decode6bit[cc1];
+ final int c2 = decode6bit[cc2];
+ final int c3 = decode6bit[cc3];
+ final int c4 = decode6bit[cc4];
+ r[pos] = (byte) ((c1 << 2) | (c2 >> 4));
+ r[pos + 1] = (byte) (((c2 & 0x0F) << 4) | (c3 >> 2));
+ r[pos + 2] = (byte) (((c3 & 0x3) << 6) | c4);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/code/AsciiEncoderFinalZeros.java b/src/net/sourceforge/plantuml/code/AsciiEncoderFinalZeros.java
new file mode 100644
index 0000000..6b8d92f
--- /dev/null
+++ b/src/net/sourceforge/plantuml/code/AsciiEncoderFinalZeros.java
@@ -0,0 +1,66 @@
+/* ========================================================================
+ * 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 AsciiEncoderFinalZeros {
+
+ public String encode(byte data[]) {
+ if (data == null) {
+ return "";
+ }
+ final StringBuilder result = new StringBuilder((data.length * 4 + 2) / 3);
+ for (int i = 0; i < data.length; i += 3) {
+ append3bytes(result, data[i] & 0xFF, i + 1 < data.length ? data[i + 1] & 0xFF : 0,
+ i + 2 < data.length ? data[i + 2] & 0xFF : 0);
+ }
+ while (result.length() > 0 && result.charAt(result.length() - 1) == '0') {
+ result.setLength(result.length() - 1);
+ }
+ return result.toString();
+ }
+
+ private void append3bytes(StringBuilder sb, int b1, int b2, int b3) {
+ final int c1 = b1 >> 2;
+ final int c2 = ((b1 & 0x3) << 4) | (b2 >> 4);
+ final int c3 = ((b2 & 0xF) << 2) | (b3 >> 6);
+ final int c4 = b3 & 0x3F;
+ sb.append(AsciiEncoder.encode6bit[c1 & 0x3F]);
+ sb.append(AsciiEncoder.encode6bit[c2 & 0x3F]);
+ sb.append(AsciiEncoder.encode6bit[c3 & 0x3F]);
+ sb.append(AsciiEncoder.encode6bit[c4 & 0x3F]);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/code/AsciiEncoderHex.java b/src/net/sourceforge/plantuml/code/AsciiEncoderHex.java
new file mode 100644
index 0000000..56a2988
--- /dev/null
+++ b/src/net/sourceforge/plantuml/code/AsciiEncoderHex.java
@@ -0,0 +1,62 @@
+/* ========================================================================
+ * 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 AsciiEncoderHex implements URLEncoder {
+
+ public String encode(byte data[]) {
+ if (data == null) {
+ return "";
+ }
+ final StringBuilder result = new StringBuilder(data.length * 2);
+ for (byte b : data) {
+ final String val = Integer.toHexString(b & 0xFF);
+ if (val.length() == 1) {
+ result.append("0");
+ }
+ result.append(val);
+ }
+ return result.toString();
+ }
+
+ public byte[] decode(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;
+ }
+}
diff --git a/src/net/sourceforge/plantuml/code/CompressionBrotli.java b/src/net/sourceforge/plantuml/code/CompressionBrotli.java
new file mode 100644
index 0000000..96488f9
--- /dev/null
+++ b/src/net/sourceforge/plantuml/code/CompressionBrotli.java
@@ -0,0 +1,60 @@
+/* ========================================================================
+ * 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;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+import net.sourceforge.plantuml.FileUtils;
+import net.sourceforge.plantuml.brotli.BrotliInputStream;
+
+public class CompressionBrotli implements Compression {
+
+ public byte[] compress(byte[] in) {
+ throw new UnsupportedOperationException();
+ }
+
+ public byte[] decompress(byte[] in) throws IOException {
+ final BrotliInputStream brotli = new BrotliInputStream(new ByteArrayInputStream(in));
+ final ByteArrayOutputStream result = new ByteArrayOutputStream();
+ FileUtils.copyToStream(brotli, result);
+ brotli.close();
+ result.close();
+ return result.toByteArray();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/code/CompressionZlib.java b/src/net/sourceforge/plantuml/code/CompressionZlib.java
index 5d949ee..cb1fc0b 100644
--- a/src/net/sourceforge/plantuml/code/CompressionZlib.java
+++ b/src/net/sourceforge/plantuml/code/CompressionZlib.java
@@ -42,10 +42,13 @@ import java.util.zip.Inflater;
public class CompressionZlib implements Compression {
+ private static boolean USE_ZOPFLI = false;
private static final int COMPRESSION_LEVEL = 9;
- // private static final int COMPRESSION_LEVEL = 1;
public byte[] compress(byte[] in) {
+ if (USE_ZOPFLI) {
+ return new CompressionZopfliZlib().compress(in);
+ }
if (in.length == 0) {
return null;
}
@@ -93,6 +96,9 @@ public class CompressionZlib implements Compression {
}
private byte[] tryDecompress(byte[] in, final int len) throws IOException {
+ if (len > 200000) {
+ throw new IOException("OutOfMemory");
+ }
// Decompress the bytes
final byte[] tmp = new byte[len];
final Inflater decompresser = new Inflater(true);
diff --git a/src/net/sourceforge/plantuml/code/CompressionZopfliZlib.java b/src/net/sourceforge/plantuml/code/CompressionZopfliZlib.java
new file mode 100644
index 0000000..5ab2060
--- /dev/null
+++ b/src/net/sourceforge/plantuml/code/CompressionZopfliZlib.java
@@ -0,0 +1,65 @@
+/* ========================================================================
+ * 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;
+
+import java.io.IOException;
+
+import net.sourceforge.plantuml.zopfli.Options;
+import net.sourceforge.plantuml.zopfli.Options.BlockSplitting;
+import net.sourceforge.plantuml.zopfli.Options.OutputFormat;
+import net.sourceforge.plantuml.zopfli.Zopfli;
+
+public class CompressionZopfliZlib implements Compression {
+
+ public byte[] compress(byte[] in) {
+ if (in.length == 0) {
+ return null;
+ }
+ int len = in.length * 2;
+ if (len < 100) {
+ len = 100;
+ }
+ final Zopfli compressor = new Zopfli(len);
+ final Options options = new Options(OutputFormat.DEFLATE, BlockSplitting.FIRST, 30);
+
+ return compressor.compress(options, in).getResult();
+ }
+
+ public byte[] decompress(byte[] in) throws IOException {
+ return new CompressionZlib().decompress(in);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/code/PairInt.java b/src/net/sourceforge/plantuml/code/PairInt.java
new file mode 100644
index 0000000..0b74210
--- /dev/null
+++ b/src/net/sourceforge/plantuml/code/PairInt.java
@@ -0,0 +1,69 @@
+/* ========================================================================
+ * 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 PairInt {
+
+ private final int x;
+ private final int y;
+
+ public PairInt(int x, int y) {
+ this.x = x;
+ this.y = y;
+ }
+
+ public PairInt rotate() {
+ return new PairInt(-y, x);
+ }
+
+ @Override
+ public String toString() {
+ return "(" + x + "," + y + ")";
+ }
+
+ public int getX() {
+ return x;
+ }
+
+ public int getY() {
+ return y;
+ }
+
+ public PairInt plus(PairInt other) {
+ return new PairInt(x + other.x, y + other.y);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/code/Spiral.java b/src/net/sourceforge/plantuml/code/Spiral.java
new file mode 100644
index 0000000..0ba7d43
--- /dev/null
+++ b/src/net/sourceforge/plantuml/code/Spiral.java
@@ -0,0 +1,67 @@
+/* ========================================================================
+ * 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
new file mode 100644
index 0000000..5b3db4f
--- /dev/null
+++ b/src/net/sourceforge/plantuml/code/SpiralOnRectangle.java
@@ -0,0 +1,65 @@
+/* ========================================================================
+ * 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/code/TranscoderImpl.java b/src/net/sourceforge/plantuml/code/TranscoderImpl.java
index 8275be3..1d1f0d8 100644
--- a/src/net/sourceforge/plantuml/code/TranscoderImpl.java
+++ b/src/net/sourceforge/plantuml/code/TranscoderImpl.java
@@ -43,13 +43,17 @@ public class TranscoderImpl implements Transcoder {
private final URLEncoder urlEncoder;
private final StringCompressor stringCompressor;
- public TranscoderImpl() {
- this(new AsciiEncoder(), new StringCompressorNone(), new CompressionHuffman());
- }
-
- public TranscoderImpl(URLEncoder urlEncoder, Compression compression) {
- this(urlEncoder, new ArobaseStringCompressor(), compression);
- }
+// private TranscoderImpl() {
+// this(new AsciiEncoder(), new StringCompressorNone(), new CompressionHuffman());
+// }
+//
+// private TranscoderImpl(Compression compression) {
+// this(new AsciiEncoder(), new StringCompressorNone(), compression);
+// }
+//
+// private TranscoderImpl(URLEncoder urlEncoder, Compression compression) {
+// this(urlEncoder, new ArobaseStringCompressor(), compression);
+// }
public TranscoderImpl(URLEncoder urlEncoder, StringCompressor stringCompressor, Compression compression) {
this.compression = compression;
diff --git a/src/net/sourceforge/plantuml/code/TranscoderSmart.java b/src/net/sourceforge/plantuml/code/TranscoderSmart.java
index 2e9d33b..823a652 100644
--- a/src/net/sourceforge/plantuml/code/TranscoderSmart.java
+++ b/src/net/sourceforge/plantuml/code/TranscoderSmart.java
@@ -39,18 +39,71 @@ import java.io.IOException;
public class TranscoderSmart implements Transcoder {
- private final Transcoder oldOne = new TranscoderImpl(new AsciiEncoder(), new CompressionHuffman());
- private final Transcoder zlib = new TranscoderImpl(new AsciiEncoder(), new CompressionZlib());
+ // Legacy encoder
+ private final Transcoder oldOne = new TranscoderImpl(new AsciiEncoder(), new ArobaseStringCompressor(),
+ new CompressionHuffman());
+ private final Transcoder zlib = new TranscoderImpl(new AsciiEncoder(), new ArobaseStringCompressor(),
+ new CompressionZlib());
+ private final Transcoder brotli = new TranscoderImpl(new AsciiEncoder(), new ArobaseStringCompressor(),
+ new CompressionBrotli());
+ private final Transcoder zlibBase64 = new TranscoderImpl(new AsciiEncoderBase64(), new ArobaseStringCompressor(),
+ new CompressionZlib());
+ private final Transcoder brotliBase64 = new TranscoderImpl(new AsciiEncoderBase64(), new ArobaseStringCompressor(),
+ new CompressionBrotli());
+ private final Transcoder base64only = new TranscoderImpl(new AsciiEncoderBase64(), new ArobaseStringCompressor(),
+ new CompressionNone());
+ private final Transcoder hexOnly = new TranscoderImpl(new AsciiEncoderHex(), new ArobaseStringCompressor(),
+ new CompressionNone());
+
public String decode(String code) throws IOException {
+ // Work in progress
+ // See https://github.com/plantuml/plantuml/issues/117
+
+ // Two char headers
+ if (code.startsWith("0A")) {
+ return zlibBase64.decode(code.substring(2));
+ }
+ if (code.startsWith("0B")) {
+ return brotliBase64.decode(code.substring(2));
+ }
+ if (code.startsWith("0C")) {
+ return base64only.decode(code.substring(2));
+ }
+ if (code.startsWith("0D")) {
+ return hexOnly.decode(code.substring(2));
+ }
+ // Text prefix
+ // Just a wild try: use them only for testing
+ if (code.startsWith("-deflate-")) {
+ return zlibBase64.decode(code.substring("-deflate-".length()));
+ }
+ if (code.startsWith("-brotli-")) {
+ return brotliBase64.decode(code.substring("-brotli-".length()));
+ }
+ if (code.startsWith("-base64-")) {
+ return base64only.decode(code.substring("-base64-".length()));
+ }
+ if (code.startsWith("-hex-")) {
+ return hexOnly.decode(code.substring("-hex-".length()));
+ }
+
+ // Legacy decoding : you should not use it any more.
+ if (code.startsWith("0")) {
+ return brotli.decode(code.substring(1));
+ }
try {
return zlib.decode(code);
} catch (Exception ex) {
return oldOne.decode(code);
}
+ // return zlib.decode(code);
}
+
public String encode(String text) throws IOException {
+ // Right now, we still use the legacy encoding.
+ // This will be changed in the incoming months
return zlib.encode(text);
}
}
diff --git a/src/net/sourceforge/plantuml/code/TranscoderSmart2.java b/src/net/sourceforge/plantuml/code/TranscoderSmart2.java
new file mode 100644
index 0000000..cbdec7e
--- /dev/null
+++ b/src/net/sourceforge/plantuml/code/TranscoderSmart2.java
@@ -0,0 +1,109 @@
+/* ========================================================================
+ * 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;
+
+import java.io.IOException;
+
+public class TranscoderSmart2 implements Transcoder {
+
+ // Legacy encoder
+ private final Transcoder oldOne = new TranscoderImpl(new AsciiEncoder(), new ArobaseStringCompressor2(),
+ new CompressionHuffman());
+ private final Transcoder zlib = new TranscoderImpl(new AsciiEncoder(), new ArobaseStringCompressor2(),
+ new CompressionZlib());
+ private final Transcoder brotli = new TranscoderImpl(new AsciiEncoder(), new ArobaseStringCompressor2(),
+ new CompressionBrotli());
+
+
+ private final Transcoder zlibBase64 = new TranscoderImpl(new AsciiEncoderBase64(), new ArobaseStringCompressor2(),
+ new CompressionZlib());
+ private final Transcoder brotliBase64 = new TranscoderImpl(new AsciiEncoderBase64(), new ArobaseStringCompressor2(),
+ new CompressionBrotli());
+ private final Transcoder base64only = new TranscoderImpl(new AsciiEncoderBase64(), new ArobaseStringCompressor2(),
+ new CompressionNone());
+ private final Transcoder hexOnly = new TranscoderImpl(new AsciiEncoderHex(), new ArobaseStringCompressor2(),
+ new CompressionNone());
+
+ public String decode(String code) throws IOException {
+ // Work in progress
+ // See https://github.com/plantuml/plantuml/issues/117
+
+ // Two char headers
+ if (code.startsWith("0A")) {
+ return zlibBase64.decode(code.substring(2));
+ }
+ if (code.startsWith("0B")) {
+ return brotliBase64.decode(code.substring(2));
+ }
+ if (code.startsWith("0C")) {
+ return base64only.decode(code.substring(2));
+ }
+ if (code.startsWith("0D")) {
+ return hexOnly.decode(code.substring(2));
+ }
+ // Text prefix
+ // Just a wild try: use them only for testing
+ if (code.startsWith("-deflate-")) {
+ return zlibBase64.decode(code.substring("-deflate-".length()));
+ }
+ if (code.startsWith("-brotli-")) {
+ return brotliBase64.decode(code.substring("-brotli-".length()));
+ }
+ if (code.startsWith("-base64-")) {
+ return base64only.decode(code.substring("-base64-".length()));
+ }
+ if (code.startsWith("-hex-")) {
+ return hexOnly.decode(code.substring("-hex-".length()));
+ }
+
+ // Legacy decoding : you should not use it any more.
+ if (code.startsWith("0")) {
+ return brotli.decode(code.substring(1));
+ }
+ try {
+ return zlib.decode(code);
+ } catch (Exception ex) {
+ return oldOne.decode(code);
+ }
+ // return zlib.decode(code);
+ }
+
+ public String encode(String text) throws IOException {
+ // Right now, we still use the legacy encoding.
+ // This will be changed in the incoming months
+ return zlib.encode(text);
+ }
+}
diff --git a/src/net/sourceforge/plantuml/code/TranscoderUtil.java b/src/net/sourceforge/plantuml/code/TranscoderUtil.java
index 21734bf..0c04022 100644
--- a/src/net/sourceforge/plantuml/code/TranscoderUtil.java
+++ b/src/net/sourceforge/plantuml/code/TranscoderUtil.java
@@ -41,4 +41,8 @@ public class TranscoderUtil {
return new TranscoderSmart();
}
+ public static Transcoder getDefaultTranscoder2() {
+ return new TranscoderSmart2();
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/command/BlocLines.java b/src/net/sourceforge/plantuml/command/BlocLines.java
index 7dec869..6dd6c38 100644
--- a/src/net/sourceforge/plantuml/command/BlocLines.java
+++ b/src/net/sourceforge/plantuml/command/BlocLines.java
@@ -43,7 +43,6 @@ import java.util.List;
import net.sourceforge.plantuml.BackSlash;
import net.sourceforge.plantuml.StringUtils;
-import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.cucadiagram.Display;
public class BlocLines implements Iterable<CharSequence> {
@@ -94,6 +93,9 @@ public class BlocLines implements Iterable<CharSequence> {
}
public CharSequence getFirst499() {
+ if (lines.size() == 0) {
+ return null;
+ }
return lines.get(0);
}
@@ -229,34 +231,19 @@ public class BlocLines implements Iterable<CharSequence> {
return lines.iterator();
}
- public BlocLines removeComments() {
- final List<CharSequence> copy = new ArrayList<CharSequence>();
- boolean inComment = false;
- for (CharSequence cs : lines) {
- if (inComment == false && MyPattern.mtches(cs, CommandMultilinesComment.COMMENT_SINGLE_LINE)) {
- continue;
- }
- if (inComment == false && MyPattern.mtches(cs, CommandMultilinesComment.COMMENT_MULTILINE_START)) {
- inComment = true;
- continue;
- }
- if (inComment && MyPattern.mtches(cs, CommandMultilinesComment.COMMENT_MULTILINE_END)) {
- inComment = false;
- continue;
- }
- if (inComment == false) {
- copy.add(cs);
- }
+ public BlocLines eventuallyMoveBracket() {
+ if (size() < 2) {
+ return this;
}
- return new BlocLines(copy);
- }
-
- public BlocLines removeInnerComments() {
- final List<CharSequence> copy = new ArrayList<CharSequence>();
- for (CharSequence cs : lines) {
- copy.add(MyPattern.removeAll(cs, CommandMultilinesComment.INNER_COMMENT));
+ final String first = StringUtils.trin(getFirst499());
+ final String second = StringUtils.trin(get499(1));
+ if (first.endsWith("{") == false && second.equals("{")) {
+ final String vline = first + " {";
+ final List<CharSequence> result = new ArrayList<CharSequence>();
+ result.add(vline);
+ result.addAll(this.lines.subList(2, this.lines.size()));
+ return new BlocLines(result);
}
- return new BlocLines(copy);
+ return this;
}
-
}
diff --git a/src/net/sourceforge/plantuml/command/CommandCaption.java b/src/net/sourceforge/plantuml/command/CommandCaption.java
index 09290f7..7840a02 100644
--- a/src/net/sourceforge/plantuml/command/CommandCaption.java
+++ b/src/net/sourceforge/plantuml/command/CommandCaption.java
@@ -51,7 +51,7 @@ public class CommandCaption extends SingleLineCommand<UmlDiagram> {
@Override
protected CommandExecutionResult executeArg(UmlDiagram diagram, List<String> arg) {
- diagram.setCaption(new DisplayPositionned(Display.getWithNewlines(arg.get(0)), HorizontalAlignment.CENTER,
+ diagram.setCaption(DisplayPositionned.single(Display.getWithNewlines(arg.get(0)), HorizontalAlignment.CENTER,
VerticalAlignment.BOTTOM));
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/command/CommandComment.java b/src/net/sourceforge/plantuml/command/CommandComment.java
index 9ce651e..fb5c8cd 100644
--- a/src/net/sourceforge/plantuml/command/CommandComment.java
+++ b/src/net/sourceforge/plantuml/command/CommandComment.java
@@ -42,7 +42,7 @@ import net.sourceforge.plantuml.core.Diagram;
public class CommandComment extends SingleLineCommand<Diagram> {
- public CommandComment() {
+ private CommandComment() {
super(CommandMultilinesComment.COMMENT_SINGLE_LINE);
}
diff --git a/src/net/sourceforge/plantuml/command/CommandFooter.java b/src/net/sourceforge/plantuml/command/CommandFooter.java
index cde8602..16b7263 100644
--- a/src/net/sourceforge/plantuml/command/CommandFooter.java
+++ b/src/net/sourceforge/plantuml/command/CommandFooter.java
@@ -39,7 +39,7 @@ import java.util.List;
import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
+import net.sourceforge.plantuml.cucadiagram.DisplaySection;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
@@ -52,8 +52,8 @@ public class CommandFooter extends SingleLineCommand<UmlDiagram> {
@Override
protected CommandExecutionResult executeArg(UmlDiagram diagram, List<String> arg) {
final String align = arg.get(0);
- diagram.setFooter(new DisplayPositionned(Display.getWithNewlines(arg.get(1)), HorizontalAlignment.fromString(
- align, HorizontalAlignment.CENTER), VerticalAlignment.BOTTOM));
+ diagram.getFooter().put(Display.getWithNewlines(arg.get(1)),
+ HorizontalAlignment.fromString(align, HorizontalAlignment.CENTER));
return CommandExecutionResult.ok();
}
}
diff --git a/src/net/sourceforge/plantuml/command/CommandHeader.java b/src/net/sourceforge/plantuml/command/CommandHeader.java
index 80ef78b..8b97c28 100644
--- a/src/net/sourceforge/plantuml/command/CommandHeader.java
+++ b/src/net/sourceforge/plantuml/command/CommandHeader.java
@@ -39,9 +39,7 @@ import java.util.List;
import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.VerticalAlignment;
public class CommandHeader extends SingleLineCommand<UmlDiagram> {
@@ -52,8 +50,8 @@ public class CommandHeader extends SingleLineCommand<UmlDiagram> {
@Override
protected CommandExecutionResult executeArg(UmlDiagram diagram, List<String> arg) {
final String align = arg.get(0);
- diagram.setHeader(new DisplayPositionned(Display.getWithNewlines(arg.get(1)), HorizontalAlignment.fromString(
- align, HorizontalAlignment.RIGHT), VerticalAlignment.TOP));
+ diagram.getHeader().put(Display.getWithNewlines(arg.get(1)),
+ HorizontalAlignment.fromString(align, HorizontalAlignment.RIGHT));
return CommandExecutionResult.ok();
}
}
diff --git a/src/net/sourceforge/plantuml/command/CommandMultilines2.java b/src/net/sourceforge/plantuml/command/CommandMultilines2.java
index 59edbd7..9ee15b2 100644
--- a/src/net/sourceforge/plantuml/command/CommandMultilines2.java
+++ b/src/net/sourceforge/plantuml/command/CommandMultilines2.java
@@ -55,6 +55,10 @@ public abstract class CommandMultilines2<S extends Diagram> implements Command<S
this.starting = patternStart;
}
+ public boolean syntaxWithFinalBracket() {
+ return false;
+ }
+
public abstract String getPatternEnd();
public String[] getDescription() {
@@ -66,7 +70,21 @@ public abstract class CommandMultilines2<S extends Diagram> implements Command<S
if (isCommandForbidden()) {
return CommandControl.NOT_OK;
}
- final boolean result1 = starting.match(StringUtils.trin(lines.getFirst499()));
+ if (syntaxWithFinalBracket()) {
+ if (lines.size() == 1 && StringUtils.trin(lines.getFirst499()).endsWith("{") == false) {
+ final String vline = lines.get499(0).toString() + " {";
+ if (isValid(BlocLines.single(vline)) == CommandControl.OK_PARTIAL) {
+ return CommandControl.OK_PARTIAL;
+ }
+ return CommandControl.NOT_OK;
+ }
+ lines = lines.eventuallyMoveBracket();
+ }
+ final CharSequence first = lines.getFirst499();
+ if (first == null) {
+ return CommandControl.NOT_OK;
+ }
+ final boolean result1 = starting.match(StringUtils.trin(first));
if (result1 == false) {
return CommandControl.NOT_OK;
}
@@ -85,10 +103,13 @@ public abstract class CommandMultilines2<S extends Diagram> implements Command<S
public final CommandExecutionResult execute(S system, BlocLines lines) {
lines = lines.cleanList2(strategy);
+ if (syntaxWithFinalBracket()) {
+ lines = lines.eventuallyMoveBracket();
+ }
return executeNow(system, lines);
}
- public abstract CommandExecutionResult executeNow(S system, BlocLines lines);
+ protected abstract CommandExecutionResult executeNow(S system, BlocLines lines);
protected boolean isCommandForbidden() {
return false;
diff --git a/src/net/sourceforge/plantuml/command/CommandMultilines3.java b/src/net/sourceforge/plantuml/command/CommandMultilines3.java
index 1eca5f3..4ee1617 100644
--- a/src/net/sourceforge/plantuml/command/CommandMultilines3.java
+++ b/src/net/sourceforge/plantuml/command/CommandMultilines3.java
@@ -64,7 +64,11 @@ public abstract class CommandMultilines3<S extends Diagram> implements Command<S
if (isCommandForbidden()) {
return CommandControl.NOT_OK;
}
- final boolean result1 = starting.match(StringUtils.trin(lines.getFirst499()));
+ final CharSequence first = lines.getFirst499();
+ if (first == null) {
+ return CommandControl.NOT_OK;
+ }
+ final boolean result1 = starting.match(StringUtils.trin(first));
if (result1 == false) {
return CommandControl.NOT_OK;
}
@@ -87,7 +91,7 @@ public abstract class CommandMultilines3<S extends Diagram> implements Command<S
return executeNow(system, lines);
}
- public abstract CommandExecutionResult executeNow(S system, BlocLines lines);
+ protected abstract CommandExecutionResult executeNow(S system, BlocLines lines);
protected boolean isCommandForbidden() {
return false;
diff --git a/src/net/sourceforge/plantuml/command/CommandMultilinesComment.java b/src/net/sourceforge/plantuml/command/CommandMultilinesComment.java
index feefd9f..ea0a0fb 100644
--- a/src/net/sourceforge/plantuml/command/CommandMultilinesComment.java
+++ b/src/net/sourceforge/plantuml/command/CommandMultilinesComment.java
@@ -44,7 +44,7 @@ public class CommandMultilinesComment extends CommandMultilines<Diagram> {
public static final String COMMENT_SINGLE_LINE = "(?i)^[%s]*([%q].*||/[%q].*[%q]/[%s]*)$";
public static final String INNER_COMMENT = "/[%q].*?[%q]/";
- public CommandMultilinesComment() {
+ private CommandMultilinesComment() {
super(COMMENT_MULTILINE_START);
}
diff --git a/src/net/sourceforge/plantuml/command/CommandMultilinesFooter.java b/src/net/sourceforge/plantuml/command/CommandMultilinesFooter.java
index d02f99c..e3831c2 100644
--- a/src/net/sourceforge/plantuml/command/CommandMultilinesFooter.java
+++ b/src/net/sourceforge/plantuml/command/CommandMultilinesFooter.java
@@ -39,9 +39,7 @@ import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.VerticalAlignment;
public class CommandMultilinesFooter extends CommandMultilines<UmlDiagram> {
@@ -64,8 +62,7 @@ public class CommandMultilinesFooter extends CommandMultilines<UmlDiagram> {
lines = lines.subExtract(1, 1);
final Display strings = lines.toDisplay();
if (strings.size() > 0) {
- diagram.setFooter(new DisplayPositionned(strings, HorizontalAlignment.fromString(align,
- HorizontalAlignment.CENTER), VerticalAlignment.BOTTOM));
+ diagram.getFooter().put(strings, HorizontalAlignment.fromString(align, HorizontalAlignment.CENTER));
return CommandExecutionResult.ok();
}
return CommandExecutionResult.error("Empty footer");
diff --git a/src/net/sourceforge/plantuml/command/CommandMultilinesHeader.java b/src/net/sourceforge/plantuml/command/CommandMultilinesHeader.java
index ac13ddf..5b20599 100644
--- a/src/net/sourceforge/plantuml/command/CommandMultilinesHeader.java
+++ b/src/net/sourceforge/plantuml/command/CommandMultilinesHeader.java
@@ -39,9 +39,7 @@ import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.VerticalAlignment;
public class CommandMultilinesHeader extends CommandMultilines<UmlDiagram> {
@@ -64,8 +62,7 @@ public class CommandMultilinesHeader extends CommandMultilines<UmlDiagram> {
lines = lines.subExtract(1, 1);
final Display strings = lines.toDisplay();
if (strings.size() > 0) {
- diagram.setHeader(new DisplayPositionned(strings, HorizontalAlignment.fromString(align,
- HorizontalAlignment.RIGHT), VerticalAlignment.TOP));
+ diagram.getHeader().put(strings, HorizontalAlignment.fromString(align, HorizontalAlignment.RIGHT));
return CommandExecutionResult.ok();
}
return CommandExecutionResult.error("Empty header");
diff --git a/src/net/sourceforge/plantuml/command/CommandMultilinesLegend.java b/src/net/sourceforge/plantuml/command/CommandMultilinesLegend.java
index e926d78..e8944ea 100644
--- a/src/net/sourceforge/plantuml/command/CommandMultilinesLegend.java
+++ b/src/net/sourceforge/plantuml/command/CommandMultilinesLegend.java
@@ -65,7 +65,7 @@ public class CommandMultilinesLegend extends CommandMultilines2<UmlDiagram> {
}
@Override
- public CommandExecutionResult executeNow(UmlDiagram diagram, BlocLines lines) {
+ protected CommandExecutionResult executeNow(UmlDiagram diagram, BlocLines lines) {
lines = lines.trimSmart(1);
final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
final String align = line0.get("ALIGN", 0);
@@ -79,7 +79,7 @@ public class CommandMultilinesLegend extends CommandMultilines2<UmlDiagram> {
if (alignment == null) {
alignment = HorizontalAlignment.CENTER;
}
- diagram.setLegend(new DisplayPositionned(strings, alignment, valignment));
+ diagram.setLegend(DisplayPositionned.single(strings, alignment, valignment));
return CommandExecutionResult.ok();
}
return CommandExecutionResult.error("No legend defined");
diff --git a/src/net/sourceforge/plantuml/command/CommandMultilinesTitle.java b/src/net/sourceforge/plantuml/command/CommandMultilinesTitle.java
index 1135a45..60eb4a4 100644
--- a/src/net/sourceforge/plantuml/command/CommandMultilinesTitle.java
+++ b/src/net/sourceforge/plantuml/command/CommandMultilinesTitle.java
@@ -57,7 +57,7 @@ public class CommandMultilinesTitle extends CommandMultilines<UmlDiagram> {
lines = lines.removeEmptyColumns();
final Display strings = lines.toDisplay();
if (strings.size() > 0) {
- diagram.setTitle(new DisplayPositionned(strings, HorizontalAlignment.CENTER, VerticalAlignment.TOP));
+ diagram.setTitle(DisplayPositionned.single(strings, HorizontalAlignment.CENTER, VerticalAlignment.TOP));
return CommandExecutionResult.ok();
}
return CommandExecutionResult.error("No title defined");
diff --git a/src/net/sourceforge/plantuml/command/CommandNamespace.java b/src/net/sourceforge/plantuml/command/CommandNamespace.java
index 4584012..be9eb4e 100644
--- a/src/net/sourceforge/plantuml/command/CommandNamespace.java
+++ b/src/net/sourceforge/plantuml/command/CommandNamespace.java
@@ -47,6 +47,7 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.GroupType;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.IGroup;
+import net.sourceforge.plantuml.cucadiagram.NamespaceStrategy;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.color.ColorParser;
import net.sourceforge.plantuml.graphic.color.ColorType;
@@ -73,8 +74,8 @@ public class CommandNamespace extends SingleLineCommand2<ClassDiagram> {
protected CommandExecutionResult executeArg(ClassDiagram diagram, RegexResult arg) {
final Code code = Code.of(arg.get("NAME", 0));
final IGroup currentPackage = diagram.getCurrentGroup();
- final IEntity p = diagram.getOrCreateNamespace(code, Display.getWithNewlines(code), GroupType.PACKAGE,
- currentPackage);
+ diagram.gotoGroup2(code, Display.getWithNewlines(code), GroupType.PACKAGE, currentPackage, NamespaceStrategy.MULTIPLE);
+ final IEntity p = diagram.getCurrentGroup();
final String stereotype = arg.get("STEREOTYPE", 0);
if (stereotype != null) {
p.setStereotype(new Stereotype(stereotype));
diff --git a/src/net/sourceforge/plantuml/command/CommandPackage.java b/src/net/sourceforge/plantuml/command/CommandPackage.java
index a80b754..4e802ce 100644
--- a/src/net/sourceforge/plantuml/command/CommandPackage.java
+++ b/src/net/sourceforge/plantuml/command/CommandPackage.java
@@ -40,6 +40,7 @@ import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram;
+import net.sourceforge.plantuml.classdiagram.command.CommandCreateClassMultilines;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
@@ -48,6 +49,8 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.GroupType;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.IGroup;
+import net.sourceforge.plantuml.cucadiagram.NamespaceStrategy;
+import net.sourceforge.plantuml.cucadiagram.Stereotag;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.color.ColorParser;
@@ -71,12 +74,19 @@ public class CommandPackage extends SingleLineCommand2<AbstractEntityDiagram> {
new RegexLeaf("[%s]*"), //
new RegexLeaf("STEREOTYPE", "(\\<\\<.*\\>\\>)?"), //
new RegexLeaf("[%s]*"), //
+ new RegexLeaf("TAGS", Stereotag.pattern() + "?"), //
+ new RegexLeaf("[%s]*"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("[%s]*"), //
color().getRegex(), //
new RegexLeaf("[%s]*\\{$"));
}
+ @Override
+ public boolean syntaxWithFinalBracket() {
+ return true;
+ }
+
private static ColorParser color() {
return ColorParser.simpleColor(ColorType.BACK);
}
@@ -99,8 +109,9 @@ public class CommandPackage extends SingleLineCommand2<AbstractEntityDiagram> {
code = Code.of(arg.get("AS", 0));
}
final IGroup currentPackage = diagram.getCurrentGroup();
- final IEntity p = diagram.getOrCreateGroup(code, Display.getWithNewlines(display), GroupType.PACKAGE,
- currentPackage);
+ diagram.gotoGroup2(code, Display.getWithNewlines(display), GroupType.PACKAGE, currentPackage,
+ NamespaceStrategy.SINGLE);
+ final IEntity p = diagram.getCurrentGroup();
final String stereotype = arg.get("STEREOTYPE", 0);
final USymbol type = USymbol.getFromString(arg.get("TYPE", 0));
if (type == USymbol.TOGETHER) {
@@ -113,6 +124,7 @@ public class CommandPackage extends SingleLineCommand2<AbstractEntityDiagram> {
p.setUSymbol(usymbol);
}
}
+ CommandCreateClassMultilines.addTags(p, arg.get("TAGS", 0));
final String urlString = arg.get("URL", 0);
if (urlString != null) {
diff --git a/src/net/sourceforge/plantuml/command/CommandPackageEmpty.java b/src/net/sourceforge/plantuml/command/CommandPackageEmpty.java
index b58db42..aa7336b 100644
--- a/src/net/sourceforge/plantuml/command/CommandPackageEmpty.java
+++ b/src/net/sourceforge/plantuml/command/CommandPackageEmpty.java
@@ -44,6 +44,7 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.GroupType;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.IGroup;
+import net.sourceforge.plantuml.cucadiagram.NamespaceStrategy;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.utils.UniqueSequence;
@@ -71,11 +72,13 @@ public class CommandPackageEmpty extends SingleLineCommand<AbstractEntityDiagram
code = Code.of(arg.get(1));
}
final IGroup currentPackage = diagram.getCurrentGroup();
- final IEntity p = diagram.getOrCreateGroup(code, Display.getWithNewlines(display), GroupType.PACKAGE,
- currentPackage);
+ diagram.gotoGroup2(code, Display.getWithNewlines(display), GroupType.PACKAGE, currentPackage,
+ NamespaceStrategy.SINGLE);
+ final IEntity p = diagram.getCurrentGroup();
final String color = arg.get(2);
if (color != null) {
- p.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(color));
+ p.setSpecificColorTOBEREMOVED(ColorType.BACK,
+ diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(color));
}
diagram.endGroup();
return CommandExecutionResult.ok();
diff --git a/src/net/sourceforge/plantuml/command/CommandScale.java b/src/net/sourceforge/plantuml/command/CommandScale.java
index 84e790f..dc630ac 100644
--- a/src/net/sourceforge/plantuml/command/CommandScale.java
+++ b/src/net/sourceforge/plantuml/command/CommandScale.java
@@ -37,20 +37,27 @@ package net.sourceforge.plantuml.command;
import java.util.List;
+import net.sourceforge.plantuml.AbstractPSystem;
import net.sourceforge.plantuml.ScaleSimple;
-import net.sourceforge.plantuml.UmlDiagram;
-public class CommandScale extends SingleLineCommand<UmlDiagram> {
+public class CommandScale extends SingleLineCommand<AbstractPSystem> {
public CommandScale() {
super("(?i)^scale[%s]+([0-9.]+)(?:[%s]*/[%s]*([0-9.]+))?$");
}
@Override
- protected CommandExecutionResult executeArg(UmlDiagram diagram, List<String> arg) {
+ protected CommandExecutionResult executeArg(AbstractPSystem diagram, List<String> arg) {
double scale = Double.parseDouble(arg.get(0));
+ if (scale == 0) {
+ return CommandExecutionResult.error("Scale cannot be zero");
+ }
if (arg.get(1) != null) {
- scale /= Double.parseDouble(arg.get(1));
+ final double div = Double.parseDouble(arg.get(1));
+ if (div == 0) {
+ return CommandExecutionResult.error("Scale cannot be zero");
+ }
+ scale /= div;
}
diagram.setScale(new ScaleSimple(scale));
return CommandExecutionResult.ok();
diff --git a/src/net/sourceforge/plantuml/command/CommandScaleMaxHeight.java b/src/net/sourceforge/plantuml/command/CommandScaleMaxHeight.java
index 76b39ab..16b35de 100644
--- a/src/net/sourceforge/plantuml/command/CommandScaleMaxHeight.java
+++ b/src/net/sourceforge/plantuml/command/CommandScaleMaxHeight.java
@@ -37,17 +37,17 @@ package net.sourceforge.plantuml.command;
import java.util.List;
+import net.sourceforge.plantuml.AbstractPSystem;
import net.sourceforge.plantuml.ScaleMaxHeight;
-import net.sourceforge.plantuml.UmlDiagram;
-public class CommandScaleMaxHeight extends SingleLineCommand<UmlDiagram> {
+public class CommandScaleMaxHeight extends SingleLineCommand<AbstractPSystem> {
public CommandScaleMaxHeight() {
super("(?i)^scale[%s]+max[%s]+([0-9.]+)[%s]+height$");
}
@Override
- protected CommandExecutionResult executeArg(UmlDiagram diagram, List<String> arg) {
+ protected CommandExecutionResult executeArg(AbstractPSystem diagram, List<String> arg) {
final double height = Double.parseDouble(arg.get(0));
diagram.setScale(new ScaleMaxHeight(height));
return CommandExecutionResult.ok();
diff --git a/src/net/sourceforge/plantuml/command/CommandScaleMaxWidth.java b/src/net/sourceforge/plantuml/command/CommandScaleMaxWidth.java
index ee64c98..5434e49 100644
--- a/src/net/sourceforge/plantuml/command/CommandScaleMaxWidth.java
+++ b/src/net/sourceforge/plantuml/command/CommandScaleMaxWidth.java
@@ -37,17 +37,17 @@ package net.sourceforge.plantuml.command;
import java.util.List;
+import net.sourceforge.plantuml.AbstractPSystem;
import net.sourceforge.plantuml.ScaleMaxWidth;
-import net.sourceforge.plantuml.UmlDiagram;
-public class CommandScaleMaxWidth extends SingleLineCommand<UmlDiagram> {
+public class CommandScaleMaxWidth extends SingleLineCommand<AbstractPSystem> {
public CommandScaleMaxWidth() {
super("(?i)^scale[%s]+max[%s]+([0-9.]+)[%s]+width$");
}
@Override
- protected CommandExecutionResult executeArg(UmlDiagram diagram, List<String> arg) {
+ protected CommandExecutionResult executeArg(AbstractPSystem diagram, List<String> arg) {
final double width = Double.parseDouble(arg.get(0));
diagram.setScale(new ScaleMaxWidth(width));
return CommandExecutionResult.ok();
diff --git a/src/net/sourceforge/plantuml/command/CommandScaleMaxWidthAndHeight.java b/src/net/sourceforge/plantuml/command/CommandScaleMaxWidthAndHeight.java
index f7b8297..e777c3b 100644
--- a/src/net/sourceforge/plantuml/command/CommandScaleMaxWidthAndHeight.java
+++ b/src/net/sourceforge/plantuml/command/CommandScaleMaxWidthAndHeight.java
@@ -37,17 +37,17 @@ package net.sourceforge.plantuml.command;
import java.util.List;
+import net.sourceforge.plantuml.AbstractPSystem;
import net.sourceforge.plantuml.ScaleMaxWidthAndHeight;
-import net.sourceforge.plantuml.UmlDiagram;
-public class CommandScaleMaxWidthAndHeight extends SingleLineCommand<UmlDiagram> {
+public class CommandScaleMaxWidthAndHeight extends SingleLineCommand<AbstractPSystem> {
public CommandScaleMaxWidthAndHeight() {
super("(?i)^scale[%s]+max[%s]+([0-9.]+)[%s]*[*x][%s]*([0-9.]+)$");
}
@Override
- protected CommandExecutionResult executeArg(UmlDiagram diagram, List<String> arg) {
+ protected CommandExecutionResult executeArg(AbstractPSystem diagram, List<String> arg) {
final double width = Double.parseDouble(arg.get(0));
final double height = Double.parseDouble(arg.get(1));
diagram.setScale(new ScaleMaxWidthAndHeight(width, height));
diff --git a/src/net/sourceforge/plantuml/command/CommandScaleWidthAndHeight.java b/src/net/sourceforge/plantuml/command/CommandScaleWidthAndHeight.java
index 486468c..b041427 100644
--- a/src/net/sourceforge/plantuml/command/CommandScaleWidthAndHeight.java
+++ b/src/net/sourceforge/plantuml/command/CommandScaleWidthAndHeight.java
@@ -37,17 +37,17 @@ package net.sourceforge.plantuml.command;
import java.util.List;
+import net.sourceforge.plantuml.AbstractPSystem;
import net.sourceforge.plantuml.ScaleWidthAndHeight;
-import net.sourceforge.plantuml.UmlDiagram;
-public class CommandScaleWidthAndHeight extends SingleLineCommand<UmlDiagram> {
+public class CommandScaleWidthAndHeight extends SingleLineCommand<AbstractPSystem> {
public CommandScaleWidthAndHeight() {
super("(?i)^scale[%s]+([0-9.]+)[%s]*[*x][%s]*([0-9.]+)$");
}
@Override
- protected CommandExecutionResult executeArg(UmlDiagram diagram, List<String> arg) {
+ protected CommandExecutionResult executeArg(AbstractPSystem diagram, List<String> arg) {
final double width = Double.parseDouble(arg.get(0));
final double height = Double.parseDouble(arg.get(1));
diagram.setScale(new ScaleWidthAndHeight(width, height));
diff --git a/src/net/sourceforge/plantuml/command/CommandScaleWidthOrHeight.java b/src/net/sourceforge/plantuml/command/CommandScaleWidthOrHeight.java
index d2ec173..af8e603 100644
--- a/src/net/sourceforge/plantuml/command/CommandScaleWidthOrHeight.java
+++ b/src/net/sourceforge/plantuml/command/CommandScaleWidthOrHeight.java
@@ -37,18 +37,18 @@ package net.sourceforge.plantuml.command;
import java.util.List;
+import net.sourceforge.plantuml.AbstractPSystem;
import net.sourceforge.plantuml.ScaleHeight;
import net.sourceforge.plantuml.ScaleWidth;
-import net.sourceforge.plantuml.UmlDiagram;
-public class CommandScaleWidthOrHeight extends SingleLineCommand<UmlDiagram> {
+public class CommandScaleWidthOrHeight extends SingleLineCommand<AbstractPSystem> {
public CommandScaleWidthOrHeight() {
super("(?i)^scale[%s]+([0-9.]+)[%s]+(width|height)$");
}
@Override
- protected CommandExecutionResult executeArg(UmlDiagram diagram, List<String> arg) {
+ protected CommandExecutionResult executeArg(AbstractPSystem diagram, List<String> arg) {
final double size = Double.parseDouble(arg.get(0));
final boolean width = "width".equalsIgnoreCase(arg.get(1));
if (width) {
diff --git a/src/net/sourceforge/plantuml/command/CommandSkinParamMultilines.java b/src/net/sourceforge/plantuml/command/CommandSkinParamMultilines.java
index b9ae126..5becf41 100644
--- a/src/net/sourceforge/plantuml/command/CommandSkinParamMultilines.java
+++ b/src/net/sourceforge/plantuml/command/CommandSkinParamMultilines.java
@@ -98,7 +98,6 @@ public class CommandSkinParamMultilines extends CommandMultilinesBracket<UmlDiag
}
lines = lines.subExtract(1, 1);
- lines = lines.removeComments();
lines = lines.trim(true);
for (CharSequence s : lines) {
diff --git a/src/net/sourceforge/plantuml/command/CommandSpriteFile.java b/src/net/sourceforge/plantuml/command/CommandSpriteFile.java
index e9da442..28a7cc5 100644
--- a/src/net/sourceforge/plantuml/command/CommandSpriteFile.java
+++ b/src/net/sourceforge/plantuml/command/CommandSpriteFile.java
@@ -101,7 +101,7 @@ public class CommandSpriteFile extends SingleLineCommand2<UmlDiagram> {
if (isSvg(f.getName())) {
sprite = new SpriteSvg(f);
} else {
- sprite = new SpriteImage(ImageIO.read(f));
+ sprite = new SpriteImage(FileUtils.ImageIO_read(f));
}
}
} catch (IOException e) {
diff --git a/src/net/sourceforge/plantuml/command/CommandTitle.java b/src/net/sourceforge/plantuml/command/CommandTitle.java
index 0383325..20bc0bf 100644
--- a/src/net/sourceforge/plantuml/command/CommandTitle.java
+++ b/src/net/sourceforge/plantuml/command/CommandTitle.java
@@ -51,9 +51,8 @@ public class CommandTitle extends SingleLineCommand<UmlDiagram> {
@Override
protected CommandExecutionResult executeArg(UmlDiagram diagram, List<String> arg) {
- diagram.setTitle(new DisplayPositionned(Display.getWithNewlines(arg.get(0)), HorizontalAlignment.CENTER,
+ diagram.setTitle(DisplayPositionned.single(Display.getWithNewlines(arg.get(0)), HorizontalAlignment.CENTER,
VerticalAlignment.TOP));
return CommandExecutionResult.ok();
}
-
}
diff --git a/src/net/sourceforge/plantuml/command/FactorySpriteCommand.java b/src/net/sourceforge/plantuml/command/FactorySpriteCommand.java
index f869ee7..f2ddc42 100644
--- a/src/net/sourceforge/plantuml/command/FactorySpriteCommand.java
+++ b/src/net/sourceforge/plantuml/command/FactorySpriteCommand.java
@@ -40,21 +40,22 @@ import java.util.Arrays;
import java.util.List;
import net.sourceforge.plantuml.StringUtils;
-import net.sourceforge.plantuml.UmlDiagram;
+import net.sourceforge.plantuml.WithSprite;
import net.sourceforge.plantuml.command.note.SingleMultiFactoryCommand;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
+import net.sourceforge.plantuml.ugraphic.sprite.SpriteColorBuilder4096;
import net.sourceforge.plantuml.ugraphic.sprite.SpriteGrayLevel;
-public final class FactorySpriteCommand implements SingleMultiFactoryCommand<UmlDiagram> {
+public final class FactorySpriteCommand implements SingleMultiFactoryCommand<WithSprite> {
private RegexConcat getRegexConcatMultiLine() {
return new RegexConcat(new RegexLeaf("^"), //
new RegexLeaf("sprite[%s]+\\$?"), //
new RegexLeaf("NAME", "([\\p{L}0-9_]+)[%s]*"), //
- new RegexLeaf("DIM", "(?:\\[(\\d+)x(\\d+)/(\\d+)(z)?\\])?"), //
+ new RegexLeaf("DIM", "(?:\\[(\\d+)x(\\d+)/(?:(\\d+)(z)?|(color))\\])?"), //
new RegexLeaf("[%s]*\\{"), //
new RegexLeaf("$"));
}
@@ -63,32 +64,32 @@ public final class FactorySpriteCommand implements SingleMultiFactoryCommand<Uml
return new RegexConcat(new RegexLeaf("^"), //
new RegexLeaf("sprite[%s]+\\$?"), //
new RegexLeaf("NAME", "([\\p{L}0-9_]+)[%s]*"), //
- new RegexLeaf("DIM", "(?:\\[(\\d+)x(\\d+)/(\\d+)(z)\\])?"), //
+ new RegexLeaf("DIM", "(?:\\[(\\d+)x(\\d+)/(?:(\\d+)(z)|(color))\\])?"), //
new RegexLeaf("[%s]+"), //
new RegexLeaf("DATA", "([-_A-Za-z0-9]+)"), //
new RegexLeaf("$"));
}
- public Command<UmlDiagram> createSingleLine() {
- return new SingleLineCommand2<UmlDiagram>(getRegexConcatSingleLine()) {
+ public Command<WithSprite> createSingleLine() {
+ return new SingleLineCommand2<WithSprite>(getRegexConcatSingleLine()) {
@Override
- protected CommandExecutionResult executeArg(final UmlDiagram system, RegexResult arg) {
+ protected CommandExecutionResult executeArg(final WithSprite system, RegexResult arg) {
return executeInternal(system, arg, Arrays.asList((CharSequence) arg.get("DATA", 0)));
}
};
}
- public Command<UmlDiagram> createMultiLine(boolean withBracket) {
- return new CommandMultilines2<UmlDiagram>(getRegexConcatMultiLine(), MultilinesStrategy.REMOVE_STARTING_QUOTE) {
+ public Command<WithSprite> createMultiLine(boolean withBracket) {
+ return new CommandMultilines2<WithSprite>(getRegexConcatMultiLine(), MultilinesStrategy.REMOVE_STARTING_QUOTE) {
@Override
public String getPatternEnd() {
return "(?i)^end[%s]?sprite|\\}$";
}
- public CommandExecutionResult executeNow(final UmlDiagram system, BlocLines lines) {
+ protected CommandExecutionResult executeNow(final WithSprite system, BlocLines lines) {
lines = lines.trim(true);
final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
@@ -103,7 +104,7 @@ public final class FactorySpriteCommand implements SingleMultiFactoryCommand<Uml
};
}
- private CommandExecutionResult executeInternal(UmlDiagram system, RegexResult line0,
+ private CommandExecutionResult executeInternal(WithSprite system, RegexResult line0,
final List<CharSequence> strings) {
try {
final Sprite sprite;
@@ -112,15 +113,19 @@ public final class FactorySpriteCommand implements SingleMultiFactoryCommand<Uml
} else {
final int width = Integer.parseInt(line0.get("DIM", 0));
final int height = Integer.parseInt(line0.get("DIM", 1));
- final int nbColor = Integer.parseInt(line0.get("DIM", 2));
- if (nbColor != 4 && nbColor != 8 && nbColor != 16) {
- return CommandExecutionResult.error("Only 4, 8 or 16 graylevel are allowed.");
- }
- final SpriteGrayLevel level = SpriteGrayLevel.get(nbColor);
- if (line0.get("DIM", 3) == null) {
- sprite = level.buildSprite(width, height, strings);
+ if (line0.get("DIM", 4) == null) {
+ final int nbLevel = Integer.parseInt(line0.get("DIM", 2));
+ if (nbLevel != 4 && nbLevel != 8 && nbLevel != 16) {
+ return CommandExecutionResult.error("Only 4, 8 or 16 graylevel are allowed.");
+ }
+ final SpriteGrayLevel level = SpriteGrayLevel.get(nbLevel);
+ if (line0.get("DIM", 3) == null) {
+ sprite = level.buildSprite(width, height, strings);
+ } else {
+ sprite = level.buildSpriteZ(width, height, concat(strings));
+ }
} else {
- sprite = level.buildSpriteZ(width, height, concat(strings));
+ sprite = SpriteColorBuilder4096.buildSprite(strings);
}
}
system.addSprite(line0.get("NAME", 0), sprite);
diff --git a/src/net/sourceforge/plantuml/command/Position.java b/src/net/sourceforge/plantuml/command/Position.java
index ef91537..b7c140a 100644
--- a/src/net/sourceforge/plantuml/command/Position.java
+++ b/src/net/sourceforge/plantuml/command/Position.java
@@ -41,6 +41,10 @@ import net.sourceforge.plantuml.cucadiagram.Rankdir;
public enum Position {
RIGHT, LEFT, BOTTOM, TOP;
+ public static Position fromString(String s) {
+ return Position.valueOf(s.toUpperCase());
+ }
+
public Position withRankdir(Rankdir rankdir) {
if (rankdir == null) {
throw new IllegalArgumentException();
diff --git a/src/net/sourceforge/plantuml/command/ProtectedCommand.java b/src/net/sourceforge/plantuml/command/ProtectedCommand.java
index d6576ed..5610050 100644
--- a/src/net/sourceforge/plantuml/command/ProtectedCommand.java
+++ b/src/net/sourceforge/plantuml/command/ProtectedCommand.java
@@ -45,6 +45,9 @@ public class ProtectedCommand<S extends Diagram> implements Command<S> {
public ProtectedCommand(Command<S> cmd) {
this.cmd = cmd;
+ if (cmd == null) {
+ throw new IllegalArgumentException();
+ }
}
public CommandExecutionResult execute(S system, BlocLines lines) {
@@ -58,8 +61,8 @@ public class ProtectedCommand<S extends Diagram> implements Command<S> {
} catch (Throwable t) {
Log.error("Error " + t);
t.printStackTrace();
- String msg = "You should send a mail to plantuml@gmail.com or post to http://plantuml.com/qa with this log (V" + Version.versionString()
- + ")";
+ String msg = "You should send a mail to plantuml@gmail.com or post to http://plantuml.com/qa with this log (V"
+ + Version.versionString() + ")";
Log.error(msg);
msg += " " + t.toString();
return CommandExecutionResult.error(msg, t);
diff --git a/src/net/sourceforge/plantuml/command/SingleLineCommand.java b/src/net/sourceforge/plantuml/command/SingleLineCommand.java
index b65f9b8..84414ae 100644
--- a/src/net/sourceforge/plantuml/command/SingleLineCommand.java
+++ b/src/net/sourceforge/plantuml/command/SingleLineCommand.java
@@ -66,7 +66,6 @@ public abstract class SingleLineCommand<S extends Diagram> implements Command<S>
if (lines.size() != 1) {
return CommandControl.NOT_OK;
}
- lines = lines.removeInnerComments();
if (isCommandForbidden()) {
return CommandControl.NOT_OK;
}
@@ -90,7 +89,6 @@ public abstract class SingleLineCommand<S extends Diagram> implements Command<S>
if (lines.size() != 1) {
throw new IllegalArgumentException();
}
- lines = lines.removeInnerComments();
final String line = StringUtils.trin(lines.getFirst499());
if (isForbidden(line)) {
return CommandExecutionResult.error("Syntax error: " + line);
diff --git a/src/net/sourceforge/plantuml/command/SingleLineCommand2.java b/src/net/sourceforge/plantuml/command/SingleLineCommand2.java
index 39031d7..e5870f1 100644
--- a/src/net/sourceforge/plantuml/command/SingleLineCommand2.java
+++ b/src/net/sourceforge/plantuml/command/SingleLineCommand2.java
@@ -56,19 +56,32 @@ public abstract class SingleLineCommand2<S extends Diagram> implements Command<S
this.pattern = pattern;
}
+ public boolean syntaxWithFinalBracket() {
+ return false;
+ }
+
public String[] getDescription() {
return new String[] { pattern.getPattern() };
}
final public CommandControl isValid(BlocLines lines) {
+ if (lines.size() == 2 && syntaxWithFinalBracket()) {
+ return isValidBracket(lines);
+ }
if (lines.size() != 1) {
return CommandControl.NOT_OK;
}
- lines = lines.removeInnerComments();
if (isCommandForbidden()) {
return CommandControl.NOT_OK;
}
final String line = StringUtils.trin(lines.getFirst499());
+ if (syntaxWithFinalBracket() && line.endsWith("{") == false) {
+ final String vline = lines.get499(0).toString() + " {";
+ if (isValid(BlocLines.single(vline)) == CommandControl.OK) {
+ return CommandControl.OK_PARTIAL;
+ }
+ return CommandControl.NOT_OK;
+ }
final boolean result = pattern.match(line);
if (result) {
actionIfCommandValid();
@@ -76,6 +89,16 @@ public abstract class SingleLineCommand2<S extends Diagram> implements Command<S
return result ? CommandControl.OK : CommandControl.NOT_OK;
}
+ private CommandControl isValidBracket(BlocLines lines) {
+ assert lines.size() == 2;
+ assert syntaxWithFinalBracket();
+ if (StringUtils.trin(lines.get499(1)).equals("{") == false) {
+ return CommandControl.NOT_OK;
+ }
+ final String vline = lines.get499(0).toString() + " {";
+ return isValid(BlocLines.single(vline));
+ }
+
protected boolean isCommandForbidden() {
return false;
}
@@ -84,10 +107,13 @@ public abstract class SingleLineCommand2<S extends Diagram> implements Command<S
}
public final CommandExecutionResult execute(S system, BlocLines lines) {
+ if (syntaxWithFinalBracket() && lines.size() == 2) {
+ assert StringUtils.trin(lines.get499(1)).equals("{");
+ lines = BlocLines.single(lines.getFirst499() + " {");
+ }
if (lines.size() != 1) {
throw new IllegalArgumentException();
}
- lines = lines.removeInnerComments();
final String line = StringUtils.trin(lines.getFirst499());
if (isForbidden(line)) {
return CommandExecutionResult.error("Syntax error: " + line);
diff --git a/src/net/sourceforge/plantuml/command/UmlDiagramFactory.java b/src/net/sourceforge/plantuml/command/UmlDiagramFactory.java
index bbae26a..c323dac 100644
--- a/src/net/sourceforge/plantuml/command/UmlDiagramFactory.java
+++ b/src/net/sourceforge/plantuml/command/UmlDiagramFactory.java
@@ -45,7 +45,6 @@ import net.sourceforge.plantuml.CharSequence2;
import net.sourceforge.plantuml.ErrorUml;
import net.sourceforge.plantuml.ErrorUmlType;
import net.sourceforge.plantuml.NewpagedDiagram;
-import net.sourceforge.plantuml.OptionFlags;
import net.sourceforge.plantuml.PSystemError;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.classdiagram.command.CommandHideShowByGender;
@@ -53,9 +52,6 @@ import net.sourceforge.plantuml.classdiagram.command.CommandHideShowByVisibility
import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.core.DiagramType;
import net.sourceforge.plantuml.core.UmlSource;
-import net.sourceforge.plantuml.suggest.SuggestEngine;
-import net.sourceforge.plantuml.suggest.SuggestEngineResult;
-import net.sourceforge.plantuml.suggest.SuggestEngineStatus;
import net.sourceforge.plantuml.utils.StartUtils;
import net.sourceforge.plantuml.version.IteratorCounter2;
@@ -103,7 +99,7 @@ public abstract class UmlDiagramFactory extends PSystemAbstractFactory {
sys.setSource(source);
return sys;
}
- sys = executeOneLine(sys, source, it);
+ sys = executeFewLines(sys, source, it);
if (sys instanceof PSystemError) {
return sys;
}
@@ -113,90 +109,57 @@ public abstract class UmlDiagramFactory extends PSystemAbstractFactory {
}
- private AbstractPSystem executeOneLine(AbstractPSystem sys, UmlSource source, final IteratorCounter2 it) {
- final CommandControl commandControl = isValid2(it);
- if (commandControl == CommandControl.NOT_OK) {
- final ErrorUml err = new ErrorUml(ErrorUmlType.SYNTAX_ERROR, "Syntax Error?", /* it.currentNum(), */it.peek()
- .getLocation());
- if (OptionFlags.getInstance().isUseSuggestEngine()) {
- final SuggestEngine engine = new SuggestEngine(source, this);
- final SuggestEngineResult result = engine.tryToSuggest(sys);
- if (result.getStatus() == SuggestEngineStatus.ONE_SUGGESTION) {
- err.setSuggest(result);
- }
- }
- sys = new PSystemError(source, err, null);
- } else if (commandControl == CommandControl.OK_PARTIAL) {
- final IteratorCounter2 saved = it.cloneMe();
- final CommandExecutionResult result = manageMultiline2(it, sys);
- if (result.isOk() == false) {
- final ErrorUml err = new ErrorUml(ErrorUmlType.EXECUTION_ERROR, result.getError(),
- /* it.currentNum() - 1, */saved.next().getLocation());
- sys = new PSystemError(source, err, null);
+ private AbstractPSystem executeFewLines(AbstractPSystem sys, UmlSource source, final IteratorCounter2 it) {
+ final Step step = getCandidate(it);
+ if (step == null) {
+ final ErrorUml err = new ErrorUml(ErrorUmlType.SYNTAX_ERROR, "Syntax Error?", it.peek().getLocation());
+ return new PSystemError(source, err, null);
+ }
- }
- } else if (commandControl == CommandControl.OK) {
- final CharSequence line = it.next();
- final BlocLines lines = BlocLines.single(line);
- Command cmd = getFirstCommandOkForLines(lines);
- final CommandExecutionResult result = sys.executeCommand(cmd, lines);
- if (result.isOk() == false) {
- final ErrorUml err = new ErrorUml(ErrorUmlType.EXECUTION_ERROR, result.getError(),
- /* it.currentNum() - 1, */((CharSequence2) line).getLocation());
- sys = new PSystemError(source, err,
- result.getDebugLines());
- }
- if (result.getNewDiagram() != null) {
- sys = result.getNewDiagram();
- }
- } else {
- assert false;
+ final CommandExecutionResult result = sys.executeCommand(step.command, step.blocLines);
+ if (result.isOk() == false) {
+ final ErrorUml err = new ErrorUml(ErrorUmlType.EXECUTION_ERROR, result.getError(),
+ ((CharSequence2) step.blocLines.getFirst499()).getLocation());
+ sys = new PSystemError(source, err, result.getDebugLines());
+ }
+ if (result.getNewDiagram() != null) {
+ sys = result.getNewDiagram();
}
return sys;
+
}
- public CommandControl isValid2(final IteratorCounter2 it) {
- final BlocLines lines = BlocLines.single(it.peek());
- for (Command cmd : cmds) {
- final CommandControl result = cmd.isValid(lines);
- if (result == CommandControl.OK) {
- return result;
- }
- if (result == CommandControl.OK_PARTIAL && isMultilineCommandOk(it.cloneMe(), cmd) != null) {
- return result;
- }
+ static class Step {
+ final Command command;
+ final BlocLines blocLines;
+
+ Step(Command command, BlocLines blocLines) {
+ this.command = command;
+ this.blocLines = blocLines;
}
- return CommandControl.NOT_OK;
+
}
- public CommandControl goForwardMultiline(final IteratorCounter2 it) {
- final BlocLines lines = BlocLines.single(it.peek());
+ private Step getCandidate(final IteratorCounter2 it) {
+ final BlocLines single = BlocLines.single(it.peek());
for (Command cmd : cmds) {
- final CommandControl result = cmd.isValid(lines);
+ final CommandControl result = cmd.isValid(single);
if (result == CommandControl.OK) {
- throw new IllegalStateException();
+ it.next();
+ return new Step(cmd, single);
}
- if (result == CommandControl.OK_PARTIAL && isMultilineCommandOk(it, cmd) != null) {
- return result;
- }
- }
- return CommandControl.NOT_OK;
- // throw new IllegalStateException();
- }
-
- private CommandExecutionResult manageMultiline2(IteratorCounter2 it, AbstractPSystem system) {
- for (Command cmd : cmds) {
- if (isMultilineCommandOk(it.cloneMe(), cmd) != null) {
- final BlocLines lines = isMultilineCommandOk(it, cmd);
- if (system instanceof NewpagedDiagram) {
- final NewpagedDiagram newpagedDiagram = (NewpagedDiagram) system;
- return cmd.execute(newpagedDiagram.getLastDiagram(), lines);
-
+ if (result == CommandControl.OK_PARTIAL) {
+ final IteratorCounter2 cloned = it.cloneMe();
+ final BlocLines lines = isMultilineCommandOk(cloned, cmd);
+ if (lines == null) {
+ continue;
}
- return cmd.execute(system, lines);
+ it.copyStateFrom(cloned);
+ assert lines != null;
+ return new Step(cmd, lines);
}
}
- return CommandExecutionResult.ok();
+ return null;
}
private BlocLines isMultilineCommandOk(IteratorCounter2 it, Command cmd) {
@@ -236,38 +199,14 @@ public abstract class UmlDiagramFactory extends PSystemAbstractFactory {
// -----------------------------------
- final public CommandControl isValid(BlocLines lines) {
- for (Command cmd : cmds) {
- final CommandControl result = cmd.isValid(lines);
- if (result == CommandControl.OK) {
- return result;
- }
- if (result == CommandControl.OK_PARTIAL) {
- return result;
- }
- }
- return CommandControl.NOT_OK;
-
- }
-
- private Command getFirstCommandOkForLines(BlocLines lines) {
- for (Command cmd : cmds) {
- final CommandControl result = cmd.isValid(lines);
- if (result == CommandControl.OK) {
- return cmd;
- }
- }
- throw new IllegalArgumentException();
- }
-
protected abstract List<Command> createCommands();
public abstract AbstractPSystem createEmptyDiagram();
final protected void addCommonCommands(List<Command> cmds) {
cmds.add(new CommandNope());
- cmds.add(new CommandComment());
- cmds.add(new CommandMultilinesComment());
+ // cmds.add(new CommandComment());
+ // cmds.add(new CommandMultilinesComment());
cmds.add(new CommandPragma());
cmds.add(new CommandTitle());
cmds.add(new CommandCaption());
diff --git a/src/net/sourceforge/plantuml/command/UmlDiagramFactoryOld.java b/src/net/sourceforge/plantuml/command/UmlDiagramFactoryOld.java
new file mode 100644
index 0000000..d465093
--- /dev/null
+++ b/src/net/sourceforge/plantuml/command/UmlDiagramFactoryOld.java
@@ -0,0 +1,374 @@
+/* ========================================================================
+ * 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.command;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import net.sourceforge.plantuml.AbstractPSystem;
+import net.sourceforge.plantuml.CharSequence2;
+import net.sourceforge.plantuml.ErrorUml;
+import net.sourceforge.plantuml.ErrorUmlType;
+import net.sourceforge.plantuml.NewpagedDiagram;
+import net.sourceforge.plantuml.OptionFlags;
+import net.sourceforge.plantuml.PSystemError;
+import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.classdiagram.command.CommandHideShowByGender;
+import net.sourceforge.plantuml.classdiagram.command.CommandHideShowByVisibility;
+import net.sourceforge.plantuml.core.Diagram;
+import net.sourceforge.plantuml.core.DiagramType;
+import net.sourceforge.plantuml.core.UmlSource;
+import net.sourceforge.plantuml.suggest.SuggestEngine;
+import net.sourceforge.plantuml.suggest.SuggestEngineResult;
+import net.sourceforge.plantuml.suggest.SuggestEngineStatus;
+import net.sourceforge.plantuml.utils.StartUtils;
+import net.sourceforge.plantuml.version.IteratorCounter2;
+
+public abstract class UmlDiagramFactoryOld extends PSystemAbstractFactory {
+
+ private final List<Command> cmds;
+
+ protected UmlDiagramFactoryOld() {
+ this(DiagramType.UML);
+ }
+
+ protected UmlDiagramFactoryOld(DiagramType type) {
+ super(type);
+ cmds = createCommands();
+ }
+
+ final public Diagram createSystem(UmlSource source) {
+ final IteratorCounter2 it = source.iterator2();
+ final CharSequence2 startLine = it.next();
+ if (StartUtils.isArobaseStartDiagram(startLine) == false) {
+ throw new UnsupportedOperationException();
+ }
+
+ if (source.isEmpty()) {
+ return buildEmptyError(source, startLine.getLocation());
+ }
+ AbstractPSystem sys = createEmptyDiagram();
+
+ while (it.hasNext()) {
+ if (StartUtils.isArobaseEndDiagram(it.peek())) {
+ if (sys == null) {
+ return null;
+ }
+ final String err = sys.checkFinalError();
+ if (err != null) {
+ return buildExecutionError(source, err, it.peek().getLocation());
+ }
+ if (source.getTotalLineCount() == 2) {
+ return buildEmptyError(source, it.peek().getLocation());
+ }
+ sys.makeDiagramReady();
+ if (sys.isOk() == false) {
+ return null;
+ }
+ sys.setSource(source);
+ return sys;
+ }
+ sys = executeOneLine(sys, source, it);
+ if (sys instanceof PSystemError) {
+ return sys;
+ }
+ }
+ sys.setSource(source);
+ return sys;
+
+ }
+
+ private AbstractPSystem executeOneLine(AbstractPSystem sys, UmlSource source, final IteratorCounter2 it) {
+ final CommandControl commandControl = isValid2(it);
+ if (commandControl == CommandControl.NOT_OK) {
+ final ErrorUml err = new ErrorUml(ErrorUmlType.SYNTAX_ERROR, "Syntax Error?", /* it.currentNum(), */it.peek()
+ .getLocation());
+ if (OptionFlags.getInstance().isUseSuggestEngine2()) {
+ final SuggestEngine engine = new SuggestEngine(source, this);
+ final SuggestEngineResult result = engine.tryToSuggest(sys);
+ if (result.getStatus() == SuggestEngineStatus.ONE_SUGGESTION) {
+ err.setSuggest(result);
+ }
+ }
+ sys = new PSystemError(source, err, null);
+// } else if (commandControl == CommandControl.MISSING_FINAL_BRACKET) {
+// final IteratorCounter2 saved = it.cloneMe();
+// final CommandExecutionResult result = manageMissingBracket(it, sys);
+// if (result.isOk() == false) {
+// final ErrorUml err = new ErrorUml(ErrorUmlType.EXECUTION_ERROR, result.getError(),
+// /* it.currentNum() - 1, */saved.next().getLocation());
+// sys = new PSystemError(source, err, null);
+//
+// }
+ } else if (commandControl == CommandControl.OK_PARTIAL) {
+ final IteratorCounter2 saved = it.cloneMe();
+ final CommandExecutionResult result = manageMultiline2(it, sys);
+ if (result.isOk() == false) {
+ final ErrorUml err = new ErrorUml(ErrorUmlType.EXECUTION_ERROR, result.getError(),
+ /* it.currentNum() - 1, */saved.next().getLocation());
+ sys = new PSystemError(source, err, null);
+
+ }
+ } else if (commandControl == CommandControl.OK) {
+ final CharSequence line = it.next();
+ final BlocLines lines = BlocLines.single(line);
+ Command cmd = getFirstCommandOkForLines(lines);
+ final CommandExecutionResult result = sys.executeCommand(cmd, lines);
+ if (result.isOk() == false) {
+ final ErrorUml err = new ErrorUml(ErrorUmlType.EXECUTION_ERROR, result.getError(),
+ /* it.currentNum() - 1, */((CharSequence2) line).getLocation());
+ sys = new PSystemError(source, err, result.getDebugLines());
+ }
+ if (result.getNewDiagram() != null) {
+ sys = result.getNewDiagram();
+ }
+ } else {
+ assert false;
+ }
+ return sys;
+ }
+
+ public CommandControl isValid2(final IteratorCounter2 it) {
+ final BlocLines lines = BlocLines.single(it.peek());
+ for (Command cmd : cmds) {
+ final CommandControl result = cmd.isValid(lines);
+ if (result == CommandControl.OK) {
+ return result;
+ }
+// if (result == CommandControl.MISSING_FINAL_BRACKET && isNextLineBracket(it.cloneMe())) {
+// return result;
+// }
+ if (result == CommandControl.OK_PARTIAL && isMultilineCommandOk(it.cloneMe(), cmd) != null) {
+ return result;
+ }
+ }
+ return CommandControl.NOT_OK;
+ }
+
+ private boolean isNextLineBracket(final IteratorCounter2 it) {
+ it.next();
+ return (StringUtils.trin(it.peek()).equals("{"));
+ }
+
+ public CommandControl goForwardMultiline(final IteratorCounter2 it) {
+ final BlocLines lines = BlocLines.single(it.peek());
+ for (Command cmd : cmds) {
+ final CommandControl result = cmd.isValid(lines);
+ if (result == CommandControl.OK) {
+ throw new IllegalStateException();
+ }
+ if (result == CommandControl.OK_PARTIAL && isMultilineCommandOk(it, cmd) != null) {
+ return result;
+ }
+ }
+ return CommandControl.NOT_OK;
+ // throw new IllegalStateException();
+ }
+
+ private CommandExecutionResult manageMissingBracket(IteratorCounter2 it, AbstractPSystem system) {
+ for (Command cmd : cmds) {
+ if (cmd instanceof SingleLineCommand2 == false) {
+ continue;
+ }
+ SingleLineCommand2 cmd2 = (SingleLineCommand2) cmd;
+ if (cmd2.syntaxWithFinalBracket() == false) {
+ continue;
+ }
+ if (isMultilineBracketOk(it.cloneMe(), cmd) != null) {
+ final BlocLines lines = isMultilineBracketOk(it, cmd);
+ if (system instanceof NewpagedDiagram) {
+ final NewpagedDiagram newpagedDiagram = (NewpagedDiagram) system;
+ return cmd.execute(newpagedDiagram.getLastDiagram(), lines);
+
+ }
+ return cmd.execute(system, lines);
+ }
+ }
+ return CommandExecutionResult.error("No bracket");
+ }
+
+ private BlocLines isMultilineBracketOk(IteratorCounter2 it, Command cmd) {
+ BlocLines lines = new BlocLines();
+ int nb = 0;
+ while (it.hasNext()) {
+ // System.err.println("nb=" + nb);
+ lines = addOneSingleLineManageEmbedded2(it, lines);
+ final CommandControl result = cmd.isValid(lines);
+ if (result == CommandControl.NOT_OK) {
+ return null;
+ }
+ if (result == CommandControl.OK) {
+ return lines;
+ }
+ nb++;
+ if (nb > 1) {
+ return null;
+ }
+ }
+ return null;
+ }
+
+ private CommandExecutionResult manageMultiline2(IteratorCounter2 it, AbstractPSystem system) {
+ for (Command cmd : cmds) {
+ if (isMultilineCommandOk(it.cloneMe(), cmd) != null) {
+ final BlocLines lines = isMultilineCommandOk(it, cmd);
+ if (system instanceof NewpagedDiagram) {
+ final NewpagedDiagram newpagedDiagram = (NewpagedDiagram) system;
+ return cmd.execute(newpagedDiagram.getLastDiagram(), lines);
+
+ }
+ return cmd.execute(system, lines);
+ }
+ }
+ return CommandExecutionResult.ok();
+ }
+
+ private BlocLines isMultilineCommandOk(IteratorCounter2 it, Command cmd) {
+ BlocLines lines = new BlocLines();
+ int nb = 0;
+ while (it.hasNext()) {
+ lines = addOneSingleLineManageEmbedded2(it, lines);
+ final CommandControl result = cmd.isValid(lines);
+ if (result == CommandControl.NOT_OK) {
+ return null;
+ }
+ if (result == CommandControl.OK) {
+ return lines;
+ }
+ nb++;
+ if (cmd instanceof CommandDecoratorMultine && nb > ((CommandDecoratorMultine) cmd).getNbMaxLines()) {
+ return null;
+ }
+ }
+ return null;
+ }
+
+ private BlocLines addOneSingleLineManageEmbedded2(IteratorCounter2 it, BlocLines lines) {
+ final CharSequence linetoBeAdded = it.next();
+ lines = lines.add2(linetoBeAdded);
+ if (StringUtils.trinNoTrace(linetoBeAdded).equals("{{")) {
+ while (it.hasNext()) {
+ final CharSequence s = it.next();
+ lines = lines.add2(s);
+ if (StringUtils.trinNoTrace(s).equals("}}")) {
+ return lines;
+ }
+ }
+ }
+ return lines;
+ }
+
+ // -----------------------------------
+
+ final public CommandControl isValid(BlocLines lines) {
+ for (Command cmd : cmds) {
+ final CommandControl result = cmd.isValid(lines);
+ if (result == CommandControl.OK) {
+ return result;
+ }
+ if (result == CommandControl.OK_PARTIAL) {
+ return result;
+ }
+ }
+ return CommandControl.NOT_OK;
+
+ }
+
+ private Command getFirstCommandOkForLines(BlocLines lines) {
+ for (Command cmd : cmds) {
+ final CommandControl result = cmd.isValid(lines);
+ if (result == CommandControl.OK) {
+ return cmd;
+ }
+ }
+ throw new IllegalArgumentException();
+ }
+
+ protected abstract List<Command> createCommands();
+
+ public abstract AbstractPSystem createEmptyDiagram();
+
+ final protected void addCommonCommands(List<Command> cmds) {
+ cmds.add(new CommandNope());
+ // cmds.add(new CommandComment());
+ // cmds.add(new CommandMultilinesComment());
+ cmds.add(new CommandPragma());
+ cmds.add(new CommandTitle());
+ cmds.add(new CommandCaption());
+ cmds.add(new CommandMultilinesTitle());
+ cmds.add(new CommandMultilinesLegend());
+
+ cmds.add(new CommandFooter());
+ cmds.add(new CommandMultilinesFooter());
+
+ cmds.add(new CommandHeader());
+ cmds.add(new CommandMultilinesHeader());
+
+ cmds.add(new CommandSkinParam());
+ cmds.add(new CommandSkinParamMultilines());
+ cmds.add(new CommandMinwidth());
+ cmds.add(new CommandRotate());
+ cmds.add(new CommandScale());
+ cmds.add(new CommandScaleWidthAndHeight());
+ cmds.add(new CommandScaleWidthOrHeight());
+ cmds.add(new CommandScaleMaxWidth());
+ cmds.add(new CommandScaleMaxHeight());
+ cmds.add(new CommandScaleMaxWidthAndHeight());
+ cmds.add(new CommandAffineTransform());
+ cmds.add(new CommandAffineTransformMultiline());
+ cmds.add(new CommandHideUnlinked());
+ final FactorySpriteCommand factorySpriteCommand = new FactorySpriteCommand();
+ cmds.add(factorySpriteCommand.createMultiLine(false));
+ cmds.add(factorySpriteCommand.createSingleLine());
+ cmds.add(new CommandSpriteFile());
+
+ cmds.add(new CommandHideShowByVisibility());
+ cmds.add(new CommandHideShowByGender());
+
+ }
+
+ final public List<String> getDescription() {
+ final List<String> result = new ArrayList<String>();
+ for (Command cmd : createCommands()) {
+ result.addAll(Arrays.asList(cmd.getDescription()));
+ }
+ return Collections.unmodifiableList(result);
+
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/command/note/FactoryNoteActivityCommand.java b/src/net/sourceforge/plantuml/command/note/FactoryNoteActivityCommand.java
index 1f43f1b..64f1e5a 100644
--- a/src/net/sourceforge/plantuml/command/note/FactoryNoteActivityCommand.java
+++ b/src/net/sourceforge/plantuml/command/note/FactoryNoteActivityCommand.java
@@ -143,7 +143,7 @@ public final class FactoryNoteActivityCommand implements SingleMultiFactoryComma
final Position position = Position.valueOf(StringUtils.goUpperCase(arg.get("POSITION", 0))).withRankdir(
diagram.getSkinParam().getRankdir());
- final LinkType type = new LinkType(LinkDecor.NONE, LinkDecor.NONE).getDashed();
+ final LinkType type = new LinkType(LinkDecor.NONE, LinkDecor.NONE).goDashed();
if (position == Position.RIGHT) {
link = new Link(activity, note, type, Display.NULL, 1);
diff --git a/src/net/sourceforge/plantuml/command/note/FactoryNoteCommand.java b/src/net/sourceforge/plantuml/command/note/FactoryNoteCommand.java
index 65d75d0..ae9ea7d 100644
--- a/src/net/sourceforge/plantuml/command/note/FactoryNoteCommand.java
+++ b/src/net/sourceforge/plantuml/command/note/FactoryNoteCommand.java
@@ -37,6 +37,7 @@ package net.sourceforge.plantuml.command.note;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram;
+import net.sourceforge.plantuml.classdiagram.command.CommandCreateClassMultilines;
import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.Command;
import net.sourceforge.plantuml.command.CommandExecutionResult;
@@ -49,6 +50,7 @@ import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Code;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.LeafType;
+import net.sourceforge.plantuml.cucadiagram.Stereotag;
import net.sourceforge.plantuml.graphic.color.ColorParser;
import net.sourceforge.plantuml.graphic.color.ColorType;
@@ -58,6 +60,8 @@ public final class FactoryNoteCommand implements SingleMultiFactoryCommand<Abstr
return new RegexConcat(new RegexLeaf("^[%s]*(note)[%s]+"), //
new RegexLeaf("CODE", "as[%s]+([\\p{L}0-9_.]+)"), //
new RegexLeaf("[%s]*"), //
+ new RegexLeaf("TAGS", Stereotag.pattern() + "?"), //
+ new RegexLeaf("[%s]*"), //
ColorParser.exp1(), //
new RegexLeaf("$") //
);
@@ -67,6 +71,9 @@ public final class FactoryNoteCommand implements SingleMultiFactoryCommand<Abstr
return new RegexConcat(new RegexLeaf("^[%s]*note[%s]+"), //
new RegexLeaf("DISPLAY", "[%g]([^%g]+)[%g][%s]+as[%s]+"), //
new RegexLeaf("CODE", "([\\p{L}0-9_.]+)[%s]*"), //
+ new RegexLeaf("[%s]*"), //
+ new RegexLeaf("TAGS", Stereotag.pattern() + "?"), //
+ new RegexLeaf("[%s]*"), //
ColorParser.exp1(), //
new RegexLeaf("$") //
);
@@ -94,7 +101,7 @@ public final class FactoryNoteCommand implements SingleMultiFactoryCommand<Abstr
return "(?i)^[%s]*end[%s]?note$";
}
- public CommandExecutionResult executeNow(final AbstractEntityDiagram system, BlocLines lines) {
+ protected CommandExecutionResult executeNow(final AbstractEntityDiagram system, BlocLines lines) {
// StringUtils.trim(lines, false);
final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
lines = lines.subExtract(1, 1);
@@ -112,6 +119,7 @@ public final class FactoryNoteCommand implements SingleMultiFactoryCommand<Abstr
final IEntity entity = diagram.createLeaf(code, display.toDisplay(), LeafType.NOTE, null);
assert entity != null;
entity.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
+ CommandCreateClassMultilines.addTags(entity, arg.get("TAGS", 0));
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/command/note/FactoryNoteOnEntityCommand.java b/src/net/sourceforge/plantuml/command/note/FactoryNoteOnEntityCommand.java
index 816d99d..e015539 100644
--- a/src/net/sourceforge/plantuml/command/note/FactoryNoteOnEntityCommand.java
+++ b/src/net/sourceforge/plantuml/command/note/FactoryNoteOnEntityCommand.java
@@ -40,6 +40,7 @@ import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram;
+import net.sourceforge.plantuml.classdiagram.command.CommandCreateClassMultilines;
import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.Command;
import net.sourceforge.plantuml.command.CommandExecutionResult;
@@ -59,6 +60,7 @@ import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.LinkDecor;
import net.sourceforge.plantuml.cucadiagram.LinkType;
+import net.sourceforge.plantuml.cucadiagram.Stereotag;
import net.sourceforge.plantuml.graphic.color.ColorParser;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.graphic.color.Colors;
@@ -82,6 +84,8 @@ public final class FactoryNoteOnEntityCommand implements SingleMultiFactoryComma
new RegexConcat(new RegexLeaf("[%s]+of[%s]+"), partialPattern), //
new RegexLeaf("")), //
new RegexLeaf("[%s]*"), //
+ new RegexLeaf("TAGS", Stereotag.pattern() + "?"), //
+ new RegexLeaf("[%s]*"), //
color().getRegex(), //
new RegexLeaf("URL", "[%s]*(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("[%s]*:[%s]*"), //
@@ -101,6 +105,8 @@ public final class FactoryNoteOnEntityCommand implements SingleMultiFactoryComma
new RegexConcat(new RegexLeaf("[%s]+of[%s]+"), partialPattern), //
new RegexLeaf("")), //
new RegexLeaf("[%s]*"), //
+ new RegexLeaf("TAGS", Stereotag.pattern() + "?"), //
+ new RegexLeaf("[%s]*"), //
color().getRegex(), //
new RegexLeaf("URL", "[%s]*(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf(withBracket ? "[%s]*\\{" : "[%s]*"), //
@@ -131,15 +137,16 @@ public final class FactoryNoteOnEntityCommand implements SingleMultiFactoryComma
return "(?i)^[%s]*(end[%s]?note)$";
}
- public CommandExecutionResult executeNow(final AbstractEntityDiagram system, BlocLines lines) {
+ protected CommandExecutionResult executeNow(final AbstractEntityDiagram system, BlocLines lines) {
// StringUtils.trim(lines, false);
final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
lines = lines.subExtract(1, 1);
lines = lines.removeEmptyColumns();
-
+
Url url = null;
if (line0.get("URL", 0) != null) {
- final UrlBuilder urlBuilder = new UrlBuilder(system.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
+ final UrlBuilder urlBuilder = new UrlBuilder(system.getSkinParam().getValue("topurl"),
+ ModeUrl.STRICT);
url = urlBuilder.getUrl(line0.get("URL", 0));
}
@@ -174,12 +181,13 @@ public final class FactoryNoteOnEntityCommand implements SingleMultiFactoryComma
if (url != null) {
note.addUrl(url);
}
+ CommandCreateClassMultilines.addTags(note, line0.get("TAGS", 0));
final Position position = Position.valueOf(StringUtils.goUpperCase(pos)).withRankdir(
diagram.getSkinParam().getRankdir());
final Link link;
- final LinkType type = new LinkType(LinkDecor.NONE, LinkDecor.NONE).getDashed();
+ final LinkType type = new LinkType(LinkDecor.NONE, LinkDecor.NONE).goDashed();
if (position == Position.RIGHT) {
link = new Link(cl1, note, type, Display.NULL, 1);
link.setHorizontalSolitary(true);
diff --git a/src/net/sourceforge/plantuml/command/note/FactoryNoteOnLinkCommand.java b/src/net/sourceforge/plantuml/command/note/FactoryNoteOnLinkCommand.java
index f696fc3..6b3d532 100644
--- a/src/net/sourceforge/plantuml/command/note/FactoryNoteOnLinkCommand.java
+++ b/src/net/sourceforge/plantuml/command/note/FactoryNoteOnLinkCommand.java
@@ -87,7 +87,7 @@ public final class FactoryNoteOnLinkCommand implements SingleMultiFactoryCommand
return "(?i)^[%s]*end[%s]?note$";
}
- public CommandExecutionResult executeNow(final CucaDiagram system, BlocLines lines) {
+ protected CommandExecutionResult executeNow(final CucaDiagram system, BlocLines lines) {
final String line0 = lines.getFirst499().toString();
lines = lines.subExtract(1, 1);
lines = lines.removeEmptyColumns();
diff --git a/src/net/sourceforge/plantuml/command/note/FactoryTipOnEntityCommand.java b/src/net/sourceforge/plantuml/command/note/FactoryTipOnEntityCommand.java
index a70f5f2..192b354 100644
--- a/src/net/sourceforge/plantuml/command/note/FactoryTipOnEntityCommand.java
+++ b/src/net/sourceforge/plantuml/command/note/FactoryTipOnEntityCommand.java
@@ -98,7 +98,7 @@ public final class FactoryTipOnEntityCommand implements SingleMultiFactoryComman
return "(?i)^[%s]*(end[%s]?note)$";
}
- public CommandExecutionResult executeNow(final AbstractEntityDiagram system, BlocLines lines) {
+ protected CommandExecutionResult executeNow(final AbstractEntityDiagram system, BlocLines lines) {
// StringUtils.trim(lines, false);
final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
lines = lines.subExtract(1, 1);
diff --git a/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteCommand.java b/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteCommand.java
index fe213a2..0c26398 100644
--- a/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteCommand.java
+++ b/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteCommand.java
@@ -108,7 +108,7 @@ public final class FactorySequenceNoteCommand implements SingleMultiFactoryComma
return "(?i)^end[%s]?(note|hnote|rnote)$";
}
- public CommandExecutionResult executeNow(final SequenceDiagram system, BlocLines lines) {
+ protected CommandExecutionResult executeNow(final SequenceDiagram system, BlocLines lines) {
final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
lines = lines.subExtract(1, 1);
lines = lines.removeEmptyColumns();
@@ -141,7 +141,6 @@ public final class FactorySequenceNoteCommand implements SingleMultiFactoryComma
final String stereotypeString = arg.get("STEREO", 0);
if (stereotypeString != null) {
final Stereotype stereotype = new Stereotype(stereotypeString);
- note.setStereotype(stereotype);
colors = colors.applyStereotypeForNote(stereotype, diagram.getSkinParam(), FontParam.NOTE,
ColorParam.noteBackground, ColorParam.noteBorder);
}
diff --git a/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteOnArrowCommand.java b/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteOnArrowCommand.java
index e8ee5aa..c442c4f 100644
--- a/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteOnArrowCommand.java
+++ b/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteOnArrowCommand.java
@@ -35,6 +35,8 @@
*/
package net.sourceforge.plantuml.command.note.sequence;
+import net.sourceforge.plantuml.ColorParam;
+import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
@@ -49,10 +51,16 @@ import net.sourceforge.plantuml.command.note.SingleMultiFactoryCommand;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
+import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.cucadiagram.Stereotype;
+import net.sourceforge.plantuml.graphic.HtmlColorSet;
import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.AbstractMessage;
import net.sourceforge.plantuml.sequencediagram.EventWithDeactivate;
import net.sourceforge.plantuml.sequencediagram.GroupingLeaf;
+import net.sourceforge.plantuml.sequencediagram.Note;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.NoteStyle;
import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
@@ -62,6 +70,8 @@ public final class FactorySequenceNoteOnArrowCommand implements SingleMultiFacto
private RegexConcat getRegexConcatMultiLine() {
return new RegexConcat(new RegexLeaf("^[%s]*"), //
new RegexLeaf("STYLE", "(note|hnote|rnote)"), //
+ new RegexLeaf("[%s]*"), //
+ new RegexLeaf("STEREO", "(\\<{2}.*\\>{2})?"), //
new RegexLeaf("[%s]+"), //
new RegexLeaf("POSITION", "(right|left)[%s]*"), //
ColorParser.exp1(), //
@@ -72,6 +82,8 @@ public final class FactorySequenceNoteOnArrowCommand implements SingleMultiFacto
private RegexConcat getRegexConcatSingleLine() {
return new RegexConcat(new RegexLeaf("^[%s]*"), //
new RegexLeaf("STYLE", "(note|hnote|rnote)"), //
+ new RegexLeaf("[%s]*"), //
+ new RegexLeaf("STEREO", "(\\<{2}.*\\>{2})?"), //
new RegexLeaf("[%s]+"), //
new RegexLeaf("POSITION", "(right|left)[%s]*"), //
ColorParser.exp1(), //
@@ -101,7 +113,7 @@ public final class FactorySequenceNoteOnArrowCommand implements SingleMultiFacto
return "(?i)^[%s]*end[%s]?note$";
}
- public CommandExecutionResult executeNow(final SequenceDiagram system, BlocLines lines) {
+ protected CommandExecutionResult executeNow(final SequenceDiagram system, BlocLines lines) {
final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
lines = lines.subExtract(1, 1);
lines = lines.removeEmptyColumns();
@@ -122,10 +134,22 @@ public final class FactorySequenceNoteOnArrowCommand implements SingleMultiFacto
}
final NoteStyle style = NoteStyle.getNoteStyle(line0.get("STYLE", 0));
+ final Display display = system.manageVariable(lines.toDisplay());
+ final String backcolor0 = line0.get("COLOR", 0);
+ Colors colors = Colors.empty().add(ColorType.BACK, HtmlColorSet.getInstance().getColorIfValid(backcolor0));
+ final String stereotypeString = line0.get("STEREO", 0);
+ if (stereotypeString != null) {
+ final Stereotype stereotype = new Stereotype(stereotypeString);
+ colors = colors.applyStereotypeForNote(stereotype, system.getSkinParam(), FontParam.NOTE,
+ ColorParam.noteBackground, ColorParam.noteBorder);
+ }
+ final Note note = new Note(display, position, style);
+ note.setUrl(url);
+ note.setColors(colors);
if (m instanceof AbstractMessage) {
- ((AbstractMessage) m).setNote(lines.toDisplay(), position, style, line0.get("COLOR", 0), url);
+ ((AbstractMessage) m).setNote(note);
} else {
- ((GroupingLeaf) m).setNote(lines.toDisplay(), position, style, line0.get("COLOR", 0), url);
+ ((GroupingLeaf) m).setNote(note);
}
}
diff --git a/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteOverSeveralCommand.java b/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteOverSeveralCommand.java
index 9f051e9..659a2cc 100644
--- a/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteOverSeveralCommand.java
+++ b/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteOverSeveralCommand.java
@@ -113,7 +113,7 @@ public final class FactorySequenceNoteOverSeveralCommand implements SingleMultiF
return "(?i)^end[%s]?(note|hnote|rnote)$";
}
- public CommandExecutionResult executeNow(final SequenceDiagram system, BlocLines lines) {
+ protected CommandExecutionResult executeNow(final SequenceDiagram system, BlocLines lines) {
final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
lines = lines.subExtract(1, 1);
lines = lines.removeEmptyColumns();
diff --git a/src/net/sourceforge/plantuml/command/regex/Matcher2.java b/src/net/sourceforge/plantuml/command/regex/Matcher2.java
index 7368020..742e2b6 100644
--- a/src/net/sourceforge/plantuml/command/regex/Matcher2.java
+++ b/src/net/sourceforge/plantuml/command/regex/Matcher2.java
@@ -40,6 +40,8 @@ import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import net.sourceforge.plantuml.Log;
+
public class Matcher2 {
private final static boolean INSTRUMENT = false;
@@ -80,6 +82,7 @@ public class Matcher2 {
}
private static final Map<String, Long> durations = new HashMap<String, Long>();
+ private static long printed;
private static synchronized void addTime(String id, long duration) {
Long total = durations.get(id);
@@ -88,12 +91,29 @@ public class Matcher2 {
}
total += duration;
durations.put(id, total);
- if (total > 200) {
- System.err.println("foo " + total + " " + id);
+ final String longest = getLongest();
+ if (longest == null) {
+ return;
+ }
+ if (durations.get(longest) > printed) {
+ Log.info("---------- Regex " + longest + " " + durations.get(longest) + "ms (" + durations.size() + ")");
+ printed = durations.get(longest);
}
}
+ private static String getLongest() {
+ long max = 0;
+ String result = null;
+ for (Map.Entry<String, Long> ent : durations.entrySet()) {
+ if (ent.getValue() > max) {
+ max = ent.getValue();
+ result = ent.getKey();
+ }
+ }
+ return result;
+ }
+
public String group(int n) {
final long now = System.currentTimeMillis();
try {
diff --git a/src/net/sourceforge/plantuml/compositediagram/command/CommandCreatePackageBlock.java b/src/net/sourceforge/plantuml/compositediagram/command/CommandCreatePackageBlock.java
index be0ea16..6ec46ec 100644
--- a/src/net/sourceforge/plantuml/compositediagram/command/CommandCreatePackageBlock.java
+++ b/src/net/sourceforge/plantuml/compositediagram/command/CommandCreatePackageBlock.java
@@ -44,6 +44,7 @@ import net.sourceforge.plantuml.cucadiagram.Code;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.GroupType;
import net.sourceforge.plantuml.cucadiagram.IGroup;
+import net.sourceforge.plantuml.cucadiagram.NamespaceStrategy;
public class CommandCreatePackageBlock extends SingleLineCommand<CompositeDiagram> {
@@ -59,7 +60,8 @@ public class CommandCreatePackageBlock extends SingleLineCommand<CompositeDiagra
if (display == null) {
display = code.getFullName();
}
- diagram.getOrCreateGroup(code, Display.getWithNewlines(display), GroupType.PACKAGE, currentPackage);
+ diagram.gotoGroup2(code, Display.getWithNewlines(display), GroupType.PACKAGE, currentPackage,
+ NamespaceStrategy.SINGLE);
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/compositediagram/command/CommandLinkBlock.java b/src/net/sourceforge/plantuml/compositediagram/command/CommandLinkBlock.java
index 511dfd2..a601470 100644
--- a/src/net/sourceforge/plantuml/compositediagram/command/CommandLinkBlock.java
+++ b/src/net/sourceforge/plantuml/compositediagram/command/CommandLinkBlock.java
@@ -61,11 +61,11 @@ public class CommandLinkBlock extends SingleLineCommand<CompositeDiagram> {
final String deco2 = arg.get(3);
LinkType linkType = new LinkType(getLinkDecor(deco1), getLinkDecor(deco2));
- if ("*)".equals(deco1)) {
- linkType = linkType.getInterfaceProvider();
- } else if ("(*".equals(deco2)) {
- linkType = linkType.getInterfaceUser();
- }
+// if ("*)".equals(deco1)) {
+// linkType = linkType.getInterfaceProvider();
+// } else if ("(*".equals(deco2)) {
+// linkType = linkType.getInterfaceUser();
+// }
final String queue = arg.get(2);
diff --git a/src/net/sourceforge/plantuml/core/DiagramType.java b/src/net/sourceforge/plantuml/core/DiagramType.java
index 3b6de58..8da57c9 100644
--- a/src/net/sourceforge/plantuml/core/DiagramType.java
+++ b/src/net/sourceforge/plantuml/core/DiagramType.java
@@ -38,7 +38,7 @@ package net.sourceforge.plantuml.core;
import net.sourceforge.plantuml.utils.StartUtils;
public enum DiagramType {
- UML, BPM, DITAA, DOT, PROJECT, JCCKIT, SALT, FLOW, CREOLE, JUNGLE, CUTE, MATH, LATEX, DEFINITION, UNKNOWN;
+ UML, BPM, DITAA, DOT, PROJECT, JCCKIT, SALT, FLOW, CREOLE, JUNGLE, CUTE, MATH, LATEX, DEFINITION, GANTT, UNKNOWN;
static public DiagramType getTypeFromArobaseStart(String s) {
s = s.toLowerCase();
@@ -87,6 +87,9 @@ public enum DiagramType {
if (StartUtils.startsWithSymbolAnd("startdef", s)) {
return DEFINITION;
}
+ if (StartUtils.startsWithSymbolAnd("startgantt", s)) {
+ return GANTT;
+ }
return UNKNOWN;
}
}
diff --git a/src/net/sourceforge/plantuml/core/ImageData.java b/src/net/sourceforge/plantuml/core/ImageData.java
index d83f845..22fbe4d 100644
--- a/src/net/sourceforge/plantuml/core/ImageData.java
+++ b/src/net/sourceforge/plantuml/core/ImageData.java
@@ -84,6 +84,8 @@ public interface ImageData {
public String getCMapData(String nameId);
public String getWarningOrError();
+
+ public int getStatus();
}
diff --git a/src/net/sourceforge/plantuml/creole/AtomEmbededSystem.java b/src/net/sourceforge/plantuml/creole/AtomEmbededSystem.java
index 04b0e27..d06c66d 100644
--- a/src/net/sourceforge/plantuml/creole/AtomEmbededSystem.java
+++ b/src/net/sourceforge/plantuml/creole/AtomEmbededSystem.java
@@ -50,11 +50,13 @@ import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.EmbededDiagram;
import net.sourceforge.plantuml.FileFormat;
import net.sourceforge.plantuml.FileFormatOption;
+import net.sourceforge.plantuml.SvgString;
import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.preproc.Defines;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UImage;
+import net.sourceforge.plantuml.ugraphic.UImageSvg;
import net.sourceforge.plantuml.ugraphic.UShape;
class AtomEmbededSystem implements Atom {
@@ -83,6 +85,13 @@ class AtomEmbededSystem implements Atom {
public void drawU(UGraphic ug) {
try {
+ final boolean isSvg = ug.matchesProperty("SVG");
+ if (isSvg) {
+ final String imageSvg = getImageSvg();
+ final SvgString svg = new SvgString(imageSvg, 1);
+ ug.draw(new UImageSvg(svg));
+ return;
+ }
final BufferedImage im = getImage();
final UShape image = new UImage(im);
ug.draw(image);
@@ -94,6 +103,14 @@ class AtomEmbededSystem implements Atom {
}
+ private String getImageSvg() throws IOException, InterruptedException {
+ final Diagram system = getSystem();
+ final ByteArrayOutputStream os = new ByteArrayOutputStream();
+ system.exportDiagram(os, 0, new FileFormatOption(FileFormat.SVG));
+ os.close();
+ return new String(os.toByteArray());
+ }
+
private BufferedImage getImage() throws IOException, InterruptedException {
final Diagram system = getSystem();
final ByteArrayOutputStream os = new ByteArrayOutputStream();
@@ -113,5 +130,5 @@ class AtomEmbededSystem implements Atom {
final BlockUml blockUml = new BlockUml(lines2, 0, Defines.createEmpty());
return blockUml.getDiagram();
}
-
+
}
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockCompressed2.java b/src/net/sourceforge/plantuml/creole/AtomHorizontalTexts.java
index 2a8e7a4..1b0ce21 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockCompressed2.java
+++ b/src/net/sourceforge/plantuml/creole/AtomHorizontalTexts.java
@@ -33,31 +33,48 @@
*
*
*/
-package net.sourceforge.plantuml.graphic;
+package net.sourceforge.plantuml.creole;
import java.awt.geom.Dimension2D;
+import java.util.List;
import net.sourceforge.plantuml.Dimension2DDouble;
-import net.sourceforge.plantuml.ugraphic.CompressionTransform;
+import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic;
-import net.sourceforge.plantuml.ugraphic.UGraphicCompress2;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class TextBlockCompressed2 extends AbstractTextBlock implements TextBlock {
+public class AtomHorizontalTexts implements Atom {
+ private final List<Atom> all;
- private final TextBlock textBlock;
- private final CompressionTransform compressionTransform;
+ public AtomHorizontalTexts(List<Atom> texts) {
+ this.all = texts;
+ }
- public TextBlockCompressed2(TextBlock textBlock, CompressionTransform compressionTransform) {
- this.textBlock = textBlock;
- this.compressionTransform = compressionTransform;
+ public Dimension2D calculateDimension(StringBounder stringBounder) {
+ double width = 0;
+ double height = 0;
+ for (Atom text : all) {
+ final Dimension2D dim = text.calculateDimension(stringBounder);
+ height = Math.max(height, dim.getHeight());
+ width += dim.getWidth();
+ }
+ return new Dimension2DDouble(width, height);
}
- public void drawU(final UGraphic ug) {
- textBlock.drawU(new UGraphicCompress2(ug, compressionTransform));
+ public double getStartingAltitude(StringBounder stringBounder) {
+ if (all.size() == 0) {
+ return 0;
+ }
+ return all.get(0).getStartingAltitude(stringBounder);
}
- public Dimension2D calculateDimension(StringBounder stringBounder) {
- final Dimension2D dim = textBlock.calculateDimension(stringBounder);
- return new Dimension2DDouble(compressionTransform.transform(dim.getWidth()), dim.getHeight());
+ public void drawU(UGraphic ug) {
+ double x = 0;
+ for (Atom text : all) {
+ final Dimension2D dim = text.calculateDimension(ug.getStringBounder());
+ text.drawU(ug.apply(new UTranslate(x, 0)));
+ x += dim.getWidth();
+ }
}
-} \ No newline at end of file
+
+}
diff --git a/src/net/sourceforge/plantuml/creole/AtomImg.java b/src/net/sourceforge/plantuml/creole/AtomImg.java
index b72defa..3fe2aaa 100644
--- a/src/net/sourceforge/plantuml/creole/AtomImg.java
+++ b/src/net/sourceforge/plantuml/creole/AtomImg.java
@@ -35,7 +35,6 @@
*/
package net.sourceforge.plantuml.creole;
-import java.awt.Font;
import java.awt.geom.Dimension2D;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
@@ -50,6 +49,7 @@ import javax.imageio.ImageIO;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FileSystem;
+import net.sourceforge.plantuml.FileUtils;
import net.sourceforge.plantuml.code.Base64Coder;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.ImgValign;
@@ -89,19 +89,19 @@ public class AtomImg implements Atom {
if (f.exists() == false) {
// Check if valid URL
if (src.startsWith("http:") || src.startsWith("https:")) {
- final byte image[] = getFile(src);
- return build(src, fc, image, scale);
+ // final byte image[] = getFile(src);
+ return build(src, fc, new URL(src), scale);
}
- return AtomText.create("(File not found: " + f + ")", fc);
+ return AtomText.create("(File not found: " + f.getCanonicalPath() + ")", fc);
}
if (f.getName().endsWith(".svg")) {
return new AtomImgSvg(new TileImageSvg(f));
}
- final BufferedImage read = ImageIO.read(f);
+ final BufferedImage read = FileUtils.ImageIO_read(f);
if (read == null) {
- return AtomText.create("(Cannot decode: " + f + ")", fc);
+ return AtomText.create("(Cannot decode: " + f.getCanonicalPath() + ")", fc);
}
- return new AtomImg(ImageIO.read(f), scale);
+ return new AtomImg(FileUtils.ImageIO_read(f), scale);
} catch (IOException e) {
return AtomText.create("ERROR " + e.toString(), fc);
}
@@ -116,8 +116,16 @@ public class AtomImg implements Atom {
return new AtomImg(read, scale);
}
+ private static Atom build(String source, final FontConfiguration fc, URL url, double scale) throws IOException {
+ final BufferedImage read = FileUtils.ImageIO_read(url);
+ if (read == null) {
+ return AtomText.create("(Cannot decode: " + source + ")", fc);
+ }
+ return new AtomImg(read, scale);
+ }
+
// Added by Alain Corbiere
- static byte[] getFile(String host) throws IOException {
+ private static byte[] getFile(String host) throws IOException {
final ByteArrayOutputStream image = new ByteArrayOutputStream();
InputStream input = null;
try {
@@ -150,7 +158,7 @@ public class AtomImg implements Atom {
public void drawU(UGraphic ug) {
// final double h = calculateDimension(ug.getStringBounder()).getHeight();
- ug.draw(new UImage(image, scale));
+ ug.draw(new UImage(image).scale(scale * ug.dpiFactor()));
// tileImage.drawU(ug.apply(new UTranslate(0, -h)));
}
diff --git a/src/net/sourceforge/plantuml/creole/AtomMath.java b/src/net/sourceforge/plantuml/creole/AtomMath.java
index fb10251..59ed324 100644
--- a/src/net/sourceforge/plantuml/creole/AtomMath.java
+++ b/src/net/sourceforge/plantuml/creole/AtomMath.java
@@ -90,11 +90,12 @@ public class AtomMath implements Atom {
back = getColor(background == null ? ug.getParam().getBackcolor() : background, Color.WHITE);
}
final Color fore = getColor(foreground, Color.BLACK);
+ final double dpiFactor = ug.dpiFactor();
if (isSvg) {
final SvgString svg = math.getSvg(scale, fore, back);
ug.draw(new UImageSvg(svg));
} else {
- ug.draw(new UImage(math.getImage(scale, fore, back)));
+ ug.draw(new UImage(math.getImage(scale * dpiFactor, fore, back)));
}
}
diff --git a/src/net/sourceforge/plantuml/creole/AtomOpenIcon.java b/src/net/sourceforge/plantuml/creole/AtomOpenIcon.java
index 4486a9c..c98cc0a 100644
--- a/src/net/sourceforge/plantuml/creole/AtomOpenIcon.java
+++ b/src/net/sourceforge/plantuml/creole/AtomOpenIcon.java
@@ -37,6 +37,7 @@ package net.sourceforge.plantuml.creole;
import java.awt.geom.Dimension2D;
+import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -49,8 +50,14 @@ public class AtomOpenIcon implements Atom {
private final OpenIcon openIcon;
private final FontConfiguration fontConfiguration;
private final double factor;
+ private final Url url;
public AtomOpenIcon(OpenIcon openIcon, FontConfiguration fontConfiguration) {
+ this(openIcon, fontConfiguration, null);
+ }
+
+ public AtomOpenIcon(OpenIcon openIcon, FontConfiguration fontConfiguration, Url url) {
+ this.url = url;
this.openIcon = openIcon;
this.fontConfiguration = fontConfiguration;
this.factor = fontConfiguration.getSize2D() / 12;
@@ -69,7 +76,13 @@ public class AtomOpenIcon implements Atom {
}
public void drawU(UGraphic ug) {
+ if (url != null) {
+ ug.startUrl(url);
+ }
asTextBlock().drawU(ug);
+ if (url != null) {
+ ug.closeAction();
+ }
}
-
+
}
diff --git a/src/net/sourceforge/plantuml/creole/AtomSprite.java b/src/net/sourceforge/plantuml/creole/AtomSprite.java
index fd041d2..ceb52d6 100644
--- a/src/net/sourceforge/plantuml/creole/AtomSprite.java
+++ b/src/net/sourceforge/plantuml/creole/AtomSprite.java
@@ -39,29 +39,31 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.StringBounder;
-import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
public class AtomSprite implements Atom {
- private final TextBlock sprite;
private final FontConfiguration fontConfiguration;
+ private final Sprite sprite;
+ private final double scale;
- public AtomSprite(TextBlock sprite, FontConfiguration fontConfiguration) {
- this.sprite = sprite;
+ public AtomSprite(double scale, FontConfiguration fontConfiguration, Sprite sprite) {
+ this.scale = scale;
this.fontConfiguration = fontConfiguration;
+ this.sprite = sprite;
}
public Dimension2D calculateDimension(StringBounder stringBounder) {
- return sprite.calculateDimension(stringBounder);
+ return sprite.asTextBlock(fontConfiguration.getColor(), scale).calculateDimension(stringBounder);
}
public double getStartingAltitude(StringBounder stringBounder) {
- return -3;
+ return 0;
}
public void drawU(UGraphic ug) {
- sprite.drawU(ug);
+ sprite.asTextBlock(fontConfiguration.getColor(), scale * ug.dpiFactor()).drawU(ug);
}
-
+
}
diff --git a/src/net/sourceforge/plantuml/creole/AtomText.java b/src/net/sourceforge/plantuml/creole/AtomText.java
index 7d21ff5..47d51ec 100644
--- a/src/net/sourceforge/plantuml/creole/AtomText.java
+++ b/src/net/sourceforge/plantuml/creole/AtomText.java
@@ -41,6 +41,8 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.StringTokenizer;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import net.sourceforge.plantuml.BackSlash;
import net.sourceforge.plantuml.Dimension2DDouble;
@@ -50,9 +52,13 @@ import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.HtmlColorAutomatic;
+import net.sourceforge.plantuml.graphic.HtmlColorSimple;
+import net.sourceforge.plantuml.graphic.Splitter;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
-import net.sourceforge.plantuml.ugraphic.UChangeColor;
+import net.sourceforge.plantuml.openiconic.OpenIcon;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UText;
import net.sourceforge.plantuml.ugraphic.UTranslate;
@@ -84,14 +90,46 @@ public class AtomText implements Atom {
fontConfiguration = fontConfiguration.hyperlink();
final Display display = Display.getWithNewlines(url.getLabel());
if (display.size() > 1) {
- final List<AtomText> all = new ArrayList<AtomText>();
+ final List<Atom> all = new ArrayList<Atom>();
for (CharSequence s : display.as()) {
- all.add(new AtomText(s.toString(), fontConfiguration, url, ZERO, ZERO));
+ all.add(createAtomText(s.toString(), url, fontConfiguration));
}
- return new AtomTexts(all);
+ return new AtomVerticalTexts(all);
}
- return new AtomText(url.getLabel(), fontConfiguration, url, ZERO, ZERO);
+ return createAtomText(url.getLabel(), url, fontConfiguration);
+ }
+
+ private static Atom createAtomText(final String text, Url url, FontConfiguration fontConfiguration) {
+ final Pattern p = Pattern.compile(Splitter.openiconPattern);
+ final Matcher m = p.matcher(text);
+ final List<Atom> result = new ArrayList<Atom>();
+
+ while (m.find()) {
+ final String val = m.group(1);
+ final StringBuffer sb = new StringBuffer();
+ m.appendReplacement(sb, "");
+ if (sb.length() > 0) {
+ result.add(new AtomText(sb.toString(), fontConfiguration, url, ZERO, ZERO));
+ }
+ final OpenIcon openIcon = OpenIcon.retrieve(val);
+ if (openIcon != null) {
+ result.add(new AtomOpenIcon(openIcon, fontConfiguration, url));
+ }
+ }
+ final StringBuffer sb = new StringBuffer();
+ m.appendTail(sb);
+ if (sb.length() > 0) {
+ result.add(new AtomText(sb.toString(), fontConfiguration, url, ZERO, ZERO));
+ }
+ if (result.size() == 1) {
+ return result.get(0);
+ }
+ return new AtomHorizontalTexts(result);
+ }
+
+ private static Atom createAtomTextOld(final String text, Url url, FontConfiguration fontConfiguration) {
+ return new AtomText(text, fontConfiguration, url, ZERO, ZERO);
}
public static AtomText createHeading(String text, FontConfiguration fontConfiguration, int order) {
@@ -194,7 +232,12 @@ public class AtomText implements Atom {
if (url != null) {
ug.startUrl(url);
}
- ug = ug.apply(new UChangeColor(fontConfiguration.getColor()));
+ HtmlColor textColor = fontConfiguration.getColor();
+ FontConfiguration useFontConfiguration = fontConfiguration;
+ if (textColor instanceof HtmlColorAutomatic && ug.getParam().getBackcolor() != null) {
+ textColor = ((HtmlColorSimple) ug.getParam().getBackcolor()).opposite();
+ useFontConfiguration = fontConfiguration.changeColor(textColor);
+ }
if (marginLeft != ZERO) {
ug = ug.apply(new UTranslate(marginLeft.getDouble(ug.getStringBounder()), 0));
}
@@ -214,7 +257,7 @@ public class AtomText implements Atom {
final double remainder = x % tabSize;
x += tabSize - remainder;
} else {
- final UText utext = new UText(s, fontConfiguration);
+ final UText utext = new UText(s, useFontConfiguration);
final Dimension2D dim = ug.getStringBounder().calculateDimension(fontConfiguration.getFont(), s);
ug.apply(new UTranslate(x, ypos)).draw(utext);
x += dim.getWidth();
@@ -248,7 +291,7 @@ public class AtomText implements Atom {
}
public List<AtomText> getSplitted(StringBounder stringBounder, LineBreakStrategy maxWidthAsString) {
- final double maxWidth = maxWidthAsString.getMathWidth();
+ final double maxWidth = maxWidthAsString.getMaxWidth();
final List<AtomText> result = new ArrayList<AtomText>();
final StringTokenizer st = new StringTokenizer(text, " ", true);
final StringBuilder currentLine = new StringBuilder();
diff --git a/src/net/sourceforge/plantuml/creole/AtomTexts.java b/src/net/sourceforge/plantuml/creole/AtomVerticalTexts.java
index 0dbc53c..b9cffd6 100644
--- a/src/net/sourceforge/plantuml/creole/AtomTexts.java
+++ b/src/net/sourceforge/plantuml/creole/AtomVerticalTexts.java
@@ -43,17 +43,17 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class AtomTexts implements Atom {
- private final List<AtomText> all;
+public class AtomVerticalTexts implements Atom {
+ private final List<Atom> all;
- public AtomTexts(List<AtomText> texts) {
+ public AtomVerticalTexts(List<Atom> texts) {
this.all = texts;
}
public Dimension2D calculateDimension(StringBounder stringBounder) {
double width = 0;
double height = 0;
- for (AtomText text : all) {
+ for (Atom text : all) {
final Dimension2D dim = text.calculateDimension(stringBounder);
width = Math.max(width, dim.getWidth());
height += dim.getHeight();
@@ -67,7 +67,7 @@ public class AtomTexts implements Atom {
public void drawU(UGraphic ug) {
double y = 0;
- for (AtomText text : all) {
+ for (Atom text : all) {
final Dimension2D dim = text.calculateDimension(ug.getStringBounder());
text.drawU(ug.apply(new UTranslate(0, y)));
y += dim.getHeight();
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleImg.java b/src/net/sourceforge/plantuml/creole/CommandCreoleImg.java
index 06ef99a..7bbc0b9 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleImg.java
+++ b/src/net/sourceforge/plantuml/creole/CommandCreoleImg.java
@@ -83,7 +83,7 @@ public class CommandCreoleImg implements Command {
if (s == null) {
return 1;
}
- final Pattern p = Pattern.compile("scale=([0-9.]+)");
+ final Pattern p = Pattern.compile("(?:scale=|\\*)([0-9.]+)");
final Matcher m = p.matcher(s);
if (m.find()) {
return Double.parseDouble(m.group(1));
diff --git a/src/net/sourceforge/plantuml/creole/CreoleParser.java b/src/net/sourceforge/plantuml/creole/CreoleParser.java
index 365fde5..5ec38ce 100644
--- a/src/net/sourceforge/plantuml/creole/CreoleParser.java
+++ b/src/net/sourceforge/plantuml/creole/CreoleParser.java
@@ -82,11 +82,11 @@ public class CreoleParser {
}
private static boolean isTableLine(String line) {
- return line.matches("^(\\<#\\w+\\>)?\\|(\\=)?.*\\|$");
+ return line.matches("^(\\<#\\w+(,#?\\w+)?\\>)?\\|(\\=)?.*\\|$");
}
public static boolean doesStartByColor(String line) {
- return line.matches("^(\\<#\\w+\\>).*");
+ return line.matches("^(\\<#\\w+(,#?\\w+)?\\>).*");
}
public static boolean isTreeStart(String line) {
diff --git a/src/net/sourceforge/plantuml/creole/Fission.java b/src/net/sourceforge/plantuml/creole/Fission.java
index 0cdf3d4..bfb84a0 100644
--- a/src/net/sourceforge/plantuml/creole/Fission.java
+++ b/src/net/sourceforge/plantuml/creole/Fission.java
@@ -58,7 +58,7 @@ public class Fission {
}
public List<Stripe> getSplitted(StringBounder stringBounder) {
- final double valueMaxWidth = maxWidth.getMathWidth();
+ final double valueMaxWidth = maxWidth.getMaxWidth();
if (valueMaxWidth == 0) {
return Arrays.asList(stripe);
}
diff --git a/src/net/sourceforge/plantuml/creole/StripeSimple.java b/src/net/sourceforge/plantuml/creole/StripeSimple.java
index abec3c3..3e18e81 100644
--- a/src/net/sourceforge/plantuml/creole/StripeSimple.java
+++ b/src/net/sourceforge/plantuml/creole/StripeSimple.java
@@ -179,7 +179,7 @@ public class StripeSimple implements Stripe {
public void addSprite(String src, double scale) {
final Sprite sprite = skinParam.getSprite(src);
if (sprite != null) {
- atoms.add(new AtomSprite(sprite.asTextBlock(fontConfiguration.getColor(), scale), fontConfiguration));
+ atoms.add(new AtomSprite(scale, fontConfiguration, sprite));
}
}
diff --git a/src/net/sourceforge/plantuml/creole/StripeTable.java b/src/net/sourceforge/plantuml/creole/StripeTable.java
index ce0d58b..d99a396 100644
--- a/src/net/sourceforge/plantuml/creole/StripeTable.java
+++ b/src/net/sourceforge/plantuml/creole/StripeTable.java
@@ -60,9 +60,13 @@ public class StripeTable implements Stripe {
final private StripeStyle stripeStyle = new StripeStyle(StripeStyleType.NORMAL, 0, '\0');
public StripeTable(FontConfiguration fontConfiguration, ISkinSimple skinParam, String line) {
- this.fontConfiguration = fontConfiguration;
this.skinParam = skinParam;
- this.table = new AtomTable(fontConfiguration.getColor());
+ this.fontConfiguration = fontConfiguration;
+ HtmlColor lineColor = getBackOrFrontColor(line, 1);
+ if (lineColor == null) {
+ lineColor = fontConfiguration.getColor();
+ }
+ this.table = new AtomTable(lineColor);
this.marged = new AtomWithMargin(table, 2, 2);
analyzeAndAddInternal(line, Mode.HEADER);
}
@@ -79,15 +83,17 @@ public class StripeTable implements Stripe {
return new SheetBlock1(sheet, LineBreakStrategy.NONE, padding);
}
- private HtmlColor getBackColor(String line) {
+ private HtmlColor getBackOrFrontColor(String line, int idx) {
if (CreoleParser.doesStartByColor(line)) {
final int idx1 = line.indexOf('#');
final int idx2 = line.indexOf('>');
if (idx2 == -1) {
throw new IllegalStateException();
}
- final String color = line.substring(idx1, idx2);
- return skinParam.getIHtmlColorSet().getColorIfValid(color);
+ final String[] color = line.substring(idx1, idx2).split(",");
+ if (idx < color.length) {
+ return skinParam.getIHtmlColorSet().getColorIfValid(color[idx]);
+ }
}
return null;
}
@@ -100,15 +106,18 @@ public class StripeTable implements Stripe {
return line.substring(idx2 + 1);
}
+ private static final String hiddenBar = "\uE000";
+
private void analyzeAndAddInternal(String line, Mode mode) {
- HtmlColor lineBackColor = getBackColor(line);
+ line = line.replace("\\|", hiddenBar);
+ HtmlColor lineBackColor = getBackOrFrontColor(line, 0);
if (lineBackColor != null) {
line = withouBackColor(line);
}
table.newLine(lineBackColor);
for (final StringTokenizer st = new StringTokenizer(line, "|"); st.hasMoreTokens();) {
- String v = st.nextToken();
- HtmlColor cellBackColor = getBackColor(v);
+ String v = st.nextToken().replace(hiddenBar.charAt(0), '|');
+ HtmlColor cellBackColor = getBackOrFrontColor(v, 0);
if (cellBackColor != null) {
v = withouBackColor(v);
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/Bodier.java b/src/net/sourceforge/plantuml/cucadiagram/Bodier.java
index 2748045..bbe69e6 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/Bodier.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/Bodier.java
@@ -71,6 +71,14 @@ public class Bodier {
this.manageModifier = type == null ? false : type.manageModifier();
}
+ public void setLeaf(ILeaf leaf) {
+ if (leaf == null) {
+ throw new IllegalArgumentException();
+ }
+ this.leaf = leaf;
+
+ }
+
public void addFieldOrMethod(String s, IEntity leaf) {
if (leaf == null) {
throw new IllegalArgumentException();
@@ -170,7 +178,7 @@ public class Bodier {
return true;
}
}
- return true;
+ return false;
}
private List<String> rawBodyWithoutHidden() {
@@ -196,6 +204,9 @@ public class Bodier {
}
return null;
}
+ if (leaf == null) {
+ throw new IllegalStateException();
+ }
final MethodsOrFieldsArea fields = new MethodsOrFieldsArea(getFieldsToDisplay(), fontParam, skinParam,
stereotype, leaf);
if (type == LeafType.OBJECT) {
diff --git a/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced.java b/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced.java
index 28ec670..8fb8b2b 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced.java
@@ -45,6 +45,7 @@ import java.util.ListIterator;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.ISkinSimple;
+import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.creole.CreoleMode;
@@ -76,6 +77,7 @@ public class BodyEnhanced extends AbstractTextBlock implements TextBlock, WithPo
private final List<Url> urls = new ArrayList<Url>();
private final Stereotype stereotype;
private final ILeaf entity;
+ private final boolean inEllipse;
public BodyEnhanced(List<String> rawBody, FontParam fontParam, ISkinParam skinParam, boolean manageModifier,
Stereotype stereotype, ILeaf entity) {
@@ -90,6 +92,7 @@ public class BodyEnhanced extends AbstractTextBlock implements TextBlock, WithPo
this.manageHorizontalLine = true;
this.manageModifier = manageModifier;
this.entity = entity;
+ this.inEllipse = false;
}
public BodyEnhanced(Display display, FontParam fontParam, ISkinParam skinParam, HorizontalAlignment align,
@@ -97,9 +100,6 @@ public class BodyEnhanced extends AbstractTextBlock implements TextBlock, WithPo
this.entity = entity;
this.stereotype = stereotype;
this.rawBody = new ArrayList<String>();
- for (CharSequence s : display) {
- this.rawBody.add(s.toString());
- }
this.fontParam = fontParam;
this.skinParam = skinParam;
@@ -108,6 +108,14 @@ public class BodyEnhanced extends AbstractTextBlock implements TextBlock, WithPo
this.align = skinParam.getDefaultTextAlignment(align);
this.manageHorizontalLine = manageHorizontalLine;
this.manageModifier = manageModifier;
+ this.inEllipse = fontParam == FontParam.USECASE;
+
+ if (manageHorizontalLine && inEllipse && display.size() > 0 && isBlockSeparator(display.get(0).toString())) {
+ this.rawBody.add("");
+ }
+ for (CharSequence s : display) {
+ this.rawBody.add(s.toString());
+ }
}
@@ -138,6 +146,7 @@ public class BodyEnhanced extends AbstractTextBlock implements TextBlock, WithPo
char separator = lineFirst ? '_' : 0;
TextBlock title = null;
List<Member> members = new ArrayList<Member>();
+ // final LineBreakStrategy lineBreakStrategy = skinParam.wrapWidth();
for (ListIterator<String> it = rawBody.listIterator(); it.hasNext();) {
final String s = it.next();
if (manageHorizontalLine && isBlockSeparator(s)) {
@@ -164,6 +173,9 @@ public class BodyEnhanced extends AbstractTextBlock implements TextBlock, WithPo
}
}
}
+ if (inEllipse && members.size() == 0) {
+ members.add(new MemberImpl("", false, false));
+ }
blocks.add(decorate(stringBounder, new MethodsOrFieldsArea(members, fontParam, skinParam, align, stereotype,
entity), separator, title));
diff --git a/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced2.java b/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced2.java
index 1d98d59..c7e9604 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced2.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced2.java
@@ -41,6 +41,7 @@ import java.util.List;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinSimple;
+import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.FontConfiguration;
@@ -60,12 +61,14 @@ public class BodyEnhanced2 extends AbstractTextBlock implements TextBlock {
private final ISkinSimple spriteContainer;
private final HorizontalAlignment align;
+ private final LineBreakStrategy lineBreakStrategy;
// private final List<Url> urls = new ArrayList<Url>();
public BodyEnhanced2(Display rawBody, FontParam fontParam, ISkinSimple spriteContainer, HorizontalAlignment align,
- FontConfiguration titleConfig) {
+ FontConfiguration titleConfig, LineBreakStrategy lineBreakStrategy) {
this.rawBody2 = rawBody;
+ this.lineBreakStrategy = lineBreakStrategy;
this.spriteContainer = spriteContainer;
this.titleConfig = titleConfig;
@@ -121,7 +124,7 @@ public class BodyEnhanced2 extends AbstractTextBlock implements TextBlock {
}
private TextBlock getTextBlock(Display members2, StringBounder stringBounder) {
- final TextBlock result = members2.create(titleConfig, align, spriteContainer);
+ final TextBlock result = members2.create(titleConfig, align, spriteContainer, lineBreakStrategy);
return result;
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/Code.java b/src/net/sourceforge/plantuml/cucadiagram/Code.java
index 445c1eb..cb7e266 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/Code.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/Code.java
@@ -35,8 +35,6 @@
*/
package net.sourceforge.plantuml.cucadiagram;
-import java.util.Map;
-
import net.sourceforge.plantuml.StringUtils;
public class Code implements Comparable<Code> {
@@ -68,10 +66,6 @@ public class Code implements Comparable<Code> {
return fullName.substring(x + 2);
}
- // public String getNamespaceSeparator() {
- // return separator;
- // }
-
public Code withSeparator(String separator) {
if (separator == null) {
throw new IllegalArgumentException();
@@ -125,52 +119,8 @@ public class Code implements Comparable<Code> {
return Code.of(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(fullName, format), separator);
}
- private final String getNamespace(Map<Code, ILeaf> leafs) {
- String name = this.getFullName();
- if (separator == null) {
- throw new IllegalArgumentException(toString());
- }
- do {
- final int x = name.lastIndexOf(separator);
- if (x == -1) {
- return null;
- }
- name = name.substring(0, x);
- } while (leafs.containsKey(Code.of(name, separator)));
- return name;
- }
-
- public final Code getShortName(Map<Code, ILeaf> leafs) {
- if (separator == null) {
- throw new IllegalArgumentException();
- }
- final String code = this.getFullName();
- final String namespace = getNamespace(leafs);
- if (namespace == null) {
- return Code.of(code, separator);
- }
- return Code.of(code.substring(namespace.length() + separator.length()), separator);
- }
-
- public final Code getFullyQualifiedCode(IGroup g) {
- if (separator == null) {
- throw new IllegalArgumentException();
- }
- final String full = this.getFullName();
- if (full.startsWith(separator)) {
- return Code.of(full.substring(separator.length()), separator);
- }
- if (full.contains(separator)) {
- return Code.of(full, separator);
- }
- if (EntityUtils.groupRoot(g)) {
- return Code.of(full, separator);
- }
- final Code namespace2 = g.getNamespace2();
- if (namespace2 == null) {
- return Code.of(full, separator);
- }
- return Code.of(namespace2.fullName + separator + full, separator);
+ public final String getSeparator() {
+ return separator;
}
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java b/src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java
index 3601301..3a861ae 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java
@@ -43,7 +43,6 @@ import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
-import java.util.Map;
import java.util.Set;
import net.sourceforge.plantuml.BackSlash;
@@ -70,18 +69,24 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
private int horizontalPages = 1;
private int verticalPages = 1;
- private final Set<LeafType> hiddenType = new HashSet<LeafType>();
- private final Set<String> hiddenStereotype = new HashSet<String>();
- protected final EntityFactory entityFactory = new EntityFactory(hiddenType, hiddenStereotype);
- protected IGroup currentGroup = entityFactory.getRootGroup();
+ private final List<HideOrShow2> hides2 = new ArrayList<HideOrShow2>();
+ private final List<HideOrShow2> removed = new ArrayList<HideOrShow2>();
+ protected final EntityFactory entityFactory = new EntityFactory(hides2, removed);
+ private IGroup currentGroup = entityFactory.getRootGroup();
private boolean visibilityModifierPresent;
public abstract IEntity getOrCreateLeaf(Code code, LeafType type, USymbol symbol);
- public String getNamespaceSeparator() {
- return null;
+ private String namespaceSeparator = ".";
+
+ final public void setNamespaceSeparator(String namespaceSeparator) {
+ this.namespaceSeparator = namespaceSeparator;
+ }
+
+ final public String getNamespaceSeparator() {
+ return namespaceSeparator;
}
@Override
@@ -91,7 +96,7 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
return true;
}
}
- for (IEntity entity : getLeafs().values()) {
+ for (IEntity entity : entityFactory.getLeafsvalues()) {
if (entity.hasUrl()) {
return true;
}
@@ -104,17 +109,13 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
return false;
}
- // public ILeaf getOrCreateLeaf1(Code code, LeafType type) {
- // return getOrCreateLeaf1Default(code, type);
- // }
-
final protected ILeaf getOrCreateLeafDefault(Code code, LeafType type, USymbol symbol) {
if (type == null) {
throw new IllegalArgumentException();
}
- ILeaf result = getLeafs().get(code);
+ ILeaf result = entityFactory.getLeafsget(code);
if (result == null) {
- result = createLeafInternal(code, Display.getWithNewlines(code), type, getCurrentGroup(), symbol);
+ result = createLeafInternal(code, Display.getWithNewlines(code), type, symbol);
result.setUSymbol(symbol);
}
if (result.getLeafType() == LeafType.CLASS && type == LeafType.OBJECT) {
@@ -127,17 +128,19 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
}
public ILeaf createLeaf(Code code, Display display, LeafType type, USymbol symbol) {
- if (getLeafs().containsKey(code)) {
- throw new IllegalArgumentException("Already known: " + code);
+ if (entityFactory.getLeafsget(code) != null) {
+ return null;
+ // throw new IllegalArgumentException("Already known: " + code);
}
- return createLeafInternal(code, display, type, getCurrentGroup(), symbol);
+ return createLeafInternal(code, display, type, symbol);
}
- final protected ILeaf createLeafInternal(Code code, Display display, LeafType type, IGroup group, USymbol symbol) {
+ final protected ILeaf createLeafInternal(Code code, Display display, LeafType type, USymbol symbol) {
if (Display.isNull(display)) {
display = Display.getWithNewlines(code);
}
- final ILeaf leaf = entityFactory.createLeaf(code, display, type, group, getHides(), getNamespaceSeparator());
+ final ILeaf leaf = entityFactory.createLeaf(code, display, type, getCurrentGroup(), getHides(),
+ getNamespaceSeparator());
entityFactory.addLeaf(leaf);
this.lastEntity = leaf;
leaf.setUSymbol(symbol);
@@ -145,7 +148,7 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
}
public boolean leafExist(Code code) {
- return getLeafs().containsKey(code);
+ return entityFactory.getLeafsget(code) != null;
}
final public Collection<IGroup> getChildrenGroups(IGroup parent) {
@@ -158,18 +161,27 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
return Collections.unmodifiableCollection(result);
}
- final public IGroup getOrCreateGroup(Code code, Display display, GroupType type, IGroup parent) {
- final IGroup g = getOrCreateGroupInternal(code, display, null, type, parent);
- currentGroup = g;
- return g;
+ final public void gotoGroup2(Code code, Display display, GroupType type, IGroup parent, NamespaceStrategy strategy) {
+ if (strategy == NamespaceStrategy.MULTIPLE) {
+ if (getNamespaceSeparator() != null) {
+ code = getFullyQualifiedCode(code.withSeparator(getNamespaceSeparator()));
+ }
+ gotoGroupInternal(code, display, code, type, parent);
+ } else if (strategy == NamespaceStrategy.SINGLE) {
+ gotoGroupInternal(code, display, null, type, parent);
+ } else {
+ throw new IllegalArgumentException();
+ }
}
- private IGroup getOrCreateGroupInternal(Code code, Display display, Code namespace2, GroupType type, IGroup parent) {
- IGroup result = entityFactory.getGroups().get(code);
+ final protected void gotoGroupInternal(final Code code, Display display, final Code namespace2, GroupType type,
+ IGroup parent) {
+ IGroup result = entityFactory.getGroupsget(code);
if (result != null) {
- return result;
+ currentGroup = result;
+ return;
}
- if (entityFactory.getLeafs().containsKey(code)) {
+ if (entityFactory.getLeafsget(code) != null) {
result = entityFactory.muteToGroup(code, namespace2, type, parent);
result.setDisplay(display);
} else {
@@ -177,7 +189,33 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
getNamespaceSeparator());
}
entityFactory.addGroup(result);
- return result;
+ currentGroup = result;
+ }
+
+ public final void gotoThisGroup(IGroup group) {
+ currentGroup = group;
+ }
+
+ final protected Code getFullyQualifiedCode(Code code) {
+ final String separator = code.getSeparator();
+ if (separator == null) {
+ throw new IllegalArgumentException();
+ }
+ final String full = code.getFullName();
+ if (full.startsWith(separator)) {
+ return Code.of(full.substring(separator.length()), separator);
+ }
+ if (full.contains(separator)) {
+ return Code.of(full, separator);
+ }
+ if (EntityUtils.groupRoot(currentGroup)) {
+ return Code.of(full, separator);
+ }
+ final Code namespace2 = currentGroup.getNamespace2();
+ if (namespace2 == null) {
+ return Code.of(full, separator);
+ }
+ return Code.of(namespace2.getFullName() + separator + full, separator);
}
public final IGroup getCurrentGroup() {
@@ -185,7 +223,7 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
}
public final IGroup getGroup(Code code) {
- final IGroup p = entityFactory.getGroups().get(code);
+ final IGroup p = entityFactory.getGroupsget(code);
if (p == null) {
throw new IllegalArgumentException();
// return null;
@@ -202,38 +240,33 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
}
public final boolean isGroup(Code code) {
- return leafExist(code) == false && entityFactory.getGroups().containsKey(code);
+ return leafExist(code) == false && entityFactory.getGroupsget(code) != null;
}
public final Collection<IGroup> getGroups(boolean withRootGroup) {
if (withRootGroup == false) {
- return entityFactory.getGroups().values();
+ return entityFactory.getGroupsvalues();
}
final Collection<IGroup> result = new ArrayList<IGroup>();
result.add(getRootGroup());
- result.addAll(entityFactory.getGroups().values());
+ result.addAll(entityFactory.getGroupsvalues());
return Collections.unmodifiableCollection(result);
}
public IGroup getRootGroup() {
return entityFactory.getRootGroup();
-
- }
-
- final protected Map<Code, ILeaf> getLeafs() {
- return entityFactory.getLeafs();
}
public Collection<ILeaf> getLeafsvalues() {
- return getLeafs().values();
+ return entityFactory.getLeafsvalues();
}
public final int getLeafssize() {
- return getLeafs().size();
+ return getLeafsvalues().size();
}
public final ILeaf getLeafsget(Code code) {
- return getLeafs().get(code);
+ return entityFactory.getLeafsget(code);
}
final public void addLink(Link link) {
@@ -264,7 +297,13 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
this.verticalPages = verticalPages;
}
- // final public List<File> createPng2(File pngFile) throws IOException, InterruptedException {
+ @Override
+ public int getNbImages() {
+ return this.horizontalPages * this.verticalPages;
+ }
+
+ // final public List<File> createPng2(File pngFile) throws IOException,
+ // InterruptedException {
// final CucaDiagramPngMaker3 maker = new CucaDiagramPngMaker3(this);
// return maker.createPng(pngFile);
// }
@@ -315,31 +354,32 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
} catch (Throwable t) {
t.printStackTrace(new PrintStream(os));
}
- return new ImageDataSimple();
+ return ImageDataSimple.ok();
}
if (fileFormat.name().startsWith("XMI")) {
createFilesXmi(os, fileFormat);
- return new ImageDataSimple();
+ return ImageDataSimple.ok();
}
if (fileFormat == FileFormat.SCXML) {
createFilesScxml(os);
- return new ImageDataSimple();
+ return ImageDataSimple.ok();
}
if (getUmlDiagramType() == UmlDiagramType.COMPOSITE) {
throw new UnsupportedOperationException();
}
- // final CucaDiagramFileMaker maker = OptionFlags.USE_HECTOR ? new CucaDiagramFileMakerHectorC1(this)
+ // final CucaDiagramFileMaker maker = OptionFlags.USE_HECTOR ? new
+ // CucaDiagramFileMakerHectorC1(this)
// : new CucaDiagramFileMakerSvek(this);
final CucaDiagramFileMaker maker = this.isUseJDot() ? new CucaDiagramFileMakerJDot(this,
- fileFormat.getDefaultStringBounder()) : new CucaDiagramFileMakerSvek(this);
+ fileFormatOption.getDefaultStringBounder()) : new CucaDiagramFileMakerSvek(this);
final ImageData result = maker.createFile(os, getDotStrings(), fileFormatOption);
if (result == null) {
- return new ImageDataSimple();
+ return ImageDataSimple.error();
}
this.warningOrError = result.getWarningOrError();
return result;
@@ -491,24 +531,32 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
}
}
- public void hideOrShow(IEntity leaf, boolean show) {
- leaf.setRemoved(!show);
- }
+ // public void hideOrShow(IEntity leaf, boolean show) {
+ // leaf.setRemoved(!show);
+ // }
- public void hideOrShow(Stereotype stereotype, boolean show) {
- if (show) {
- hiddenStereotype.remove(stereotype.getLabel(false));
- } else {
- hiddenStereotype.add(stereotype.getLabel(false));
- }
+ // public void hideOrShow(Stereotype stereotype, boolean show) {
+ // if (show) {
+ // hiddenStereotype.remove(stereotype.getLabel(false));
+ // } else {
+ // hiddenStereotype.add(stereotype.getLabel(false));
+ // }
+ // }
+ //
+ // public void hideOrShow(LeafType leafType, boolean show) {
+ // if (show) {
+ // hiddenType.remove(leafType);
+ // } else {
+ // hiddenType.add(leafType);
+ // }
+ // }
+
+ public void hideOrShow2(String what, boolean show) {
+ this.hides2.add(new HideOrShow2(what, show));
}
- public void hideOrShow(LeafType leafType, boolean show) {
- if (show) {
- hiddenType.remove(leafType);
- } else {
- hiddenType.add(leafType);
- }
+ public void removeOrRestore(String what, boolean show) {
+ this.removed.add(new HideOrShow2(what, show));
}
private final List<HideOrShow> hideOrShows = new ArrayList<HideOrShow>();
@@ -526,11 +574,6 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
}
}
- @Override
- public int getNbImages() {
- return this.horizontalPages * this.verticalPages;
- }
-
public final Set<VisibilityModifier> getHides() {
return Collections.unmodifiableSet(hides);
}
@@ -562,7 +605,8 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
private ILeaf lastEntity = null;
final public ILeaf getLastEntity() {
- // for (final Iterator<ILeaf> it = getLeafs().values().iterator(); it.hasNext();) {
+ // for (final Iterator<ILeaf> it = getLeafs().values().iterator();
+ // it.hasNext();) {
// final ILeaf ent = it.next();
// if (it.hasNext() == false) {
// return ent;
diff --git a/src/net/sourceforge/plantuml/cucadiagram/Display.java b/src/net/sourceforge/plantuml/cucadiagram/Display.java
index a9b91f8..4e6e169 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/Display.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/Display.java
@@ -83,8 +83,20 @@ public class Display implements Iterable<CharSequence> {
public final static Display NULL = new Display(null, null, true, CreoleMode.FULL);
+ public Display replace(String src, String dest) {
+ final List<CharSequence> newDisplay = new ArrayList<CharSequence>();
+ for (CharSequence cs : display) {
+ if (cs.toString().contains(src)) {
+ cs = cs.toString().replace(src, dest);
+ }
+ newDisplay.add(cs);
+ }
+ return new Display(newDisplay, naturalHorizontalAlignment, isNull, defaultCreoleMode);
+ }
+
public boolean isWhite() {
- return display.size() == 0 || (display.size() == 1 && display.get(0).toString().matches("\\s*"));
+ return display == null || display.size() == 0
+ || (display.size() == 1 && display.get(0).toString().matches("\\s*"));
}
public static Display empty() {
@@ -206,6 +218,19 @@ public class Display implements Iterable<CharSequence> {
return new Display(result, this.naturalHorizontalAlignment, this.isNull, this.defaultCreoleMode);
}
+ public Display withPage(int page, int lastpage) {
+ if (display == null) {
+ return this;
+ }
+ final List<CharSequence> result = new ArrayList<CharSequence>();
+ for (CharSequence line : display) {
+ line = line.toString().replace("%page%", "" + page);
+ line = line.toString().replace("%lastpage%", "" + lastpage);
+ result.add(line);
+ }
+ return new Display(result, this.naturalHorizontalAlignment, this.isNull, this.defaultCreoleMode);
+ }
+
public Display underlined() {
final List<CharSequence> result = new ArrayList<CharSequence>();
for (CharSequence line : display) {
@@ -268,6 +293,17 @@ public class Display implements Iterable<CharSequence> {
return result;
}
+ public Display addGeneric(CharSequence s) {
+ final Display result = new Display(this, this.defaultCreoleMode);
+ final int size = display.size();
+ if (size == 0) {
+ result.display.add("<" + s + ">");
+ } else {
+ result.display.set(size - 1, display.get(size - 1) + "<" + s + ">");
+ }
+ return result;
+ }
+
public int size() {
if (isNull) {
return 0;
@@ -362,6 +398,12 @@ public class Display implements Iterable<CharSequence> {
}
public TextBlock create(FontConfiguration fontConfiguration, HorizontalAlignment horizontalAlignment,
+ ISkinSimple spriteContainer, CreoleMode modeSimpleLine, LineBreakStrategy maxMessageSize) {
+ return create(fontConfiguration, horizontalAlignment, spriteContainer, maxMessageSize, modeSimpleLine, null,
+ null);
+ }
+
+ public TextBlock create(FontConfiguration fontConfiguration, HorizontalAlignment horizontalAlignment,
ISkinSimple spriteContainer, LineBreakStrategy maxMessageSize) {
return create(fontConfiguration, horizontalAlignment, spriteContainer, maxMessageSize, defaultCreoleMode, null,
null);
diff --git a/src/net/sourceforge/plantuml/cucadiagram/DisplayPositionned.java b/src/net/sourceforge/plantuml/cucadiagram/DisplayPositionned.java
index 87eb632..bfb5e86 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/DisplayPositionned.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/DisplayPositionned.java
@@ -44,13 +44,18 @@ public class DisplayPositionned {
private final HorizontalAlignment horizontalAlignment;
private final VerticalAlignment verticalAlignment;
- public DisplayPositionned(Display display, HorizontalAlignment horizontalAlignment,
+ private DisplayPositionned(Display display, HorizontalAlignment horizontalAlignment,
VerticalAlignment verticalAlignment) {
this.display = display;
this.horizontalAlignment = horizontalAlignment;
this.verticalAlignment = verticalAlignment;
}
+ public static DisplayPositionned single(Display display, HorizontalAlignment horizontalAlignment,
+ VerticalAlignment verticalAlignment) {
+ return new DisplayPositionned(display, horizontalAlignment, verticalAlignment);
+ }
+
public static DisplayPositionned none(HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment) {
return new DisplayPositionned(Display.NULL, horizontalAlignment, verticalAlignment);
}
@@ -67,8 +72,8 @@ public class DisplayPositionned {
return verticalAlignment;
}
- public static boolean isNull(DisplayPositionned data) {
- return data == null || Display.isNull(data.display);
+ public boolean isNull() {
+ return Display.isNull(display);
}
public boolean hasUrl() {
diff --git a/src/net/sourceforge/plantuml/cucadiagram/DisplaySection.java b/src/net/sourceforge/plantuml/cucadiagram/DisplaySection.java
new file mode 100644
index 0000000..02ddca9
--- /dev/null
+++ b/src/net/sourceforge/plantuml/cucadiagram/DisplaySection.java
@@ -0,0 +1,105 @@
+/* ========================================================================
+ * 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.cucadiagram;
+
+import java.util.EnumMap;
+import java.util.Map;
+
+import net.sourceforge.plantuml.ISkinSimple;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
+import net.sourceforge.plantuml.graphic.TextBlock;
+
+public class DisplaySection {
+
+ // private final Display display;
+ // private final HorizontalAlignment horizontalAlignment;
+
+ private final Map<HorizontalAlignment, Display> map = new EnumMap<HorizontalAlignment, Display>(
+ HorizontalAlignment.class);
+
+ private DisplaySection() {
+ }
+
+ public DisplaySection withPage(int page, int lastpage) {
+ final DisplaySection result = new DisplaySection();
+ for (Map.Entry<HorizontalAlignment, Display> ent : this.map.entrySet()) {
+ result.map.put(ent.getKey(), ent.getValue().withPage(page, lastpage));
+ }
+ return result;
+ }
+
+ // public static DisplaySection single(Display display, HorizontalAlignment horizontalAlignment) {
+ // return new DisplaySection(display, horizontalAlignment);
+ // }
+
+ public static DisplaySection none() {
+ return new DisplaySection();
+ // return new DisplaySection(Display.NULL, horizontalAlignment);
+ }
+
+ public final HorizontalAlignment getHorizontalAlignment() {
+ if (map.size() == 0) {
+ return HorizontalAlignment.CENTER;
+ }
+ return map.keySet().iterator().next();
+ }
+
+ public boolean isNull() {
+ if (map.size() == 0) {
+ return true;
+ }
+ final Display display = map.values().iterator().next();
+ return Display.isNull(display);
+ }
+
+ public TextBlock createRibbon(FontConfiguration fontConfiguration, ISkinSimple spriteContainer) {
+ if (map.size() == 0) {
+ return null;
+ }
+ final Display display = map.values().iterator().next();
+ if (Display.isNull(display) || display.size() == 0) {
+ return null;
+ }
+ return display.create(fontConfiguration, getHorizontalAlignment(), spriteContainer);
+ }
+
+ public void put(Display display, HorizontalAlignment horizontalAlignment) {
+ this.map.put(horizontalAlignment, display);
+
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/GroupRoot.java b/src/net/sourceforge/plantuml/cucadiagram/GroupRoot.java
index 674a732..2873f64 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/GroupRoot.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/GroupRoot.java
@@ -40,6 +40,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
@@ -66,7 +67,7 @@ public class GroupRoot implements IGroup {
public Collection<ILeaf> getLeafsDirect() {
final List<ILeaf> result = new ArrayList<ILeaf>();
- for (ILeaf ent : entityFactory.getLeafs().values()) {
+ for (ILeaf ent : entityFactory.getLeafsvalues()) {
if (ent.getParentContainer() == this) {
result.add(ent);
}
@@ -142,7 +143,7 @@ public class GroupRoot implements IGroup {
public Collection<IGroup> getChildren() {
final List<IGroup> result = new ArrayList<IGroup>();
- for (IGroup ent : entityFactory.getGroups().values()) {
+ for (IGroup ent : entityFactory.getGroupsvalues()) {
if (ent.getParentContainer() == this) {
result.add(ent);
}
@@ -253,7 +254,11 @@ public class GroupRoot implements IGroup {
throw new UnsupportedOperationException();
}
- public void setRemoved(boolean removed) {
+ public void addStereotag(Stereotag tag) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Set<Stereotag> stereotags() {
throw new UnsupportedOperationException();
}
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/GroupType.java b/src/net/sourceforge/plantuml/cucadiagram/GroupType.java
index bc07b5f..8aa16ed 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/GroupType.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/GroupType.java
@@ -36,6 +36,7 @@
package net.sourceforge.plantuml.cucadiagram;
public enum GroupType {
-
- PACKAGE, STATE, CONCURRENT_STATE, INNER_ACTIVITY, CONCURRENT_ACTIVITY
+
+ PACKAGE, STATE, CONCURRENT_STATE, INNER_ACTIVITY, CONCURRENT_ACTIVITY, DOMAIN, REQUIREMENT
+
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/HideOrShow2.java b/src/net/sourceforge/plantuml/cucadiagram/HideOrShow2.java
new file mode 100644
index 0000000..3a6f1d2
--- /dev/null
+++ b/src/net/sourceforge/plantuml/cucadiagram/HideOrShow2.java
@@ -0,0 +1,102 @@
+/* ========================================================================
+ * 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.cucadiagram;
+
+public class HideOrShow2 {
+
+ private final String what;
+ private final boolean show;
+
+ private boolean isApplyable(ILeaf leaf) {
+ if (what.startsWith("$")) {
+ return isApplyableTag(leaf, what.substring(1));
+ }
+ if (what.startsWith("<<") && what.endsWith(">>")) {
+ return isApplyableStereotype(leaf, what.substring(2, what.length() - 2).trim());
+ }
+ final String fullName = leaf.getCode().getFullName();
+ // System.err.println("fullName=" + fullName);
+ return match(fullName, what);
+ }
+
+ private boolean isApplyableStereotype(ILeaf leaf, String pattern) {
+ final Stereotype stereotype = leaf.getStereotype();
+ if (stereotype == null) {
+ return false;
+ }
+ for (String label : stereotype.getMultipleLabels()) {
+ if (match(label, pattern)) {
+ return true;
+ }
+
+ }
+ return false;
+ }
+
+ private boolean isApplyableTag(ILeaf leaf, String pattern) {
+ for (Stereotag tag : leaf.stereotags()) {
+ if (match(tag.getName(), pattern)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean match(String s, String pattern) {
+ if (pattern.contains("*")) {
+ // System.err.println("f1=" + pattern);
+ // System.err.println("f2=" + Pattern.quote(pattern));
+ // System.err.println("f3=" + Matcher.quoteReplacement(pattern));
+ String reg = "^" + pattern.replace("*", ".*") + "$";
+ return s.matches(reg);
+
+ }
+ return s.equals(pattern);
+ }
+
+ public HideOrShow2(String what, boolean show) {
+ this.what = what;
+ this.show = show;
+ }
+
+ public boolean apply(boolean hidden, ILeaf leaf) {
+ if (isApplyable(leaf)) {
+ return !show;
+ }
+ return hidden;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/IEntity.java b/src/net/sourceforge/plantuml/cucadiagram/IEntity.java
index 938cc4e..ac751d4 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/IEntity.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/IEntity.java
@@ -36,6 +36,7 @@
package net.sourceforge.plantuml.cucadiagram;
import java.util.Map;
+import java.util.Set;
import net.sourceforge.plantuml.Hideable;
import net.sourceforge.plantuml.LineConfigurable;
@@ -88,5 +89,8 @@ public interface IEntity extends SpecificBackcolorable, Hideable, Removeable, Li
public Map<String, Display> getTips();
- public void setRemoved(boolean removed);
+ public void addStereotag(Stereotag tag);
+
+ public Set<Stereotag> stereotags();
+
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/LeafType.java b/src/net/sourceforge/plantuml/cucadiagram/LeafType.java
index c5b8bac..452e874 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/LeafType.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/LeafType.java
@@ -54,6 +54,8 @@ public enum LeafType {
STATE, STATE_CONCURRENT, PSEUDO_STATE, STATE_CHOICE, STATE_FORK_JOIN,
BLOCK, ENTITY,
+
+ DOMAIN, REQUIREMENT,
STILL_UNKNOWN;
diff --git a/src/net/sourceforge/plantuml/cucadiagram/Link.java b/src/net/sourceforge/plantuml/cucadiagram/Link.java
index 38653fe..992bd6a 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/Link.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/Link.java
@@ -55,7 +55,7 @@ import net.sourceforge.plantuml.svek.Bibliotekon;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.utils.UniqueSequence;
-public class Link implements Hideable, Removeable {
+public class Link extends WithLinkType implements Hideable, Removeable {
final private IEntity cl1;
final private IEntity cl2;
@@ -63,7 +63,6 @@ public class Link implements Hideable, Removeable {
private String port1;
private String port2;
- private LinkType type;
final private Display label;
private int length;
@@ -82,7 +81,6 @@ public class Link implements Hideable, Removeable {
private final String labeldistance;
private final String labelangle;
- private HtmlColor specificColor;
private boolean constraint = true;
private boolean inverted = false;
private LinkArrow linkArrow = LinkArrow.NONE;
@@ -119,9 +117,9 @@ public class Link implements Hideable, Removeable {
this.type = type;
if (Display.isNull(label)) {
this.label = Display.NULL;
-// } else if (doWeHaveToRemoveUrlAtStart(label)) {
-// this.url = label.initUrl();
-// this.label = label.removeHeadingUrl(url).manageGuillemet();
+ // } else if (doWeHaveToRemoveUrlAtStart(label)) {
+ // this.url = label.initUrl();
+ // this.label = label.removeHeadingUrl(url).manageGuillemet();
} else {
this.label = label.manageGuillemet();
}
@@ -130,7 +128,7 @@ public class Link implements Hideable, Removeable {
this.qualifier2 = qualifier2;
this.labeldistance = labeldistance;
this.labelangle = labelangle;
- this.specificColor = specificColor;
+ this.setSpecificColor(specificColor);
if (qualifier1 != null) {
((ILeaf) cl1).setNearDecoration(true);
}
@@ -142,16 +140,16 @@ public class Link implements Hideable, Removeable {
// }
}
-// private static boolean doWeHaveToRemoveUrlAtStart(Display label) {
-// if (label.size() == 0) {
-// return false;
-// }
-// final String s = label.get(0).toString();
-// if (s.matches("^\\[\\[\\S+\\]\\].+$")) {
-// return true;
-// }
-// return false;
-// }
+ // private static boolean doWeHaveToRemoveUrlAtStart(Display label) {
+ // if (label.size() == 0) {
+ // return false;
+ // }
+ // final String s = label.get(0).toString();
+ // if (s.matches("^\\[\\[\\S+\\]\\].+$")) {
+ // return true;
+ // }
+ // return false;
+ // }
public Link getInv() {
// if (getLength() == 1) {
@@ -159,35 +157,19 @@ public class Link implements Hideable, Removeable {
// cl2.setXposition(x-1);
// }
final Link result = new Link(cl2, cl1, getType().getInversed(), label, length, qualifier2, qualifier1,
- labeldistance, labelangle, specificColor);
- result.inverted = true;
+ labeldistance, labelangle, getSpecificColor());
+ result.inverted = !this.inverted;
result.port1 = this.port2;
result.port2 = this.port1;
+ result.url = this.url;
return result;
}
- public void goDashed() {
- type = type.getDashed();
- }
-
- public void goDotted() {
- type = type.getDotted();
- }
-
- private boolean hidden = false;
-
- public void goHidden() {
- this.hidden = true;
- }
-
+ @Override
public void goNorank() {
setConstraint(false);
}
- public void goBold() {
- type = type.getBold();
- }
-
public String getLabeldistance() {
// Default in dot 1.0
return labeldistance;
@@ -244,6 +226,7 @@ public class Link implements Hideable, Removeable {
return new EntityPort(bibliotekon.getShapeUid((ILeaf) cl2), port2);
}
+ @Override
public LinkType getType() {
if (opale) {
return new LinkType(LinkDecor.NONE, LinkDecor.NONE);
@@ -420,14 +403,6 @@ public class Link implements Hideable, Removeable {
return 0;
}
- public HtmlColor getSpecificColor() {
- return specificColor;
- }
-
- public void setSpecificColor(String s) {
- this.specificColor = HtmlColorSet.getInstance().getColorIfValid(s);
- }
-
public final boolean isConstraint() {
return constraint;
}
@@ -536,16 +511,6 @@ public class Link implements Hideable, Removeable {
this.sametail = sametail;
}
- private Colors colors;
-
- public void setColors(Colors colors) {
- this.colors = colors;
- }
-
- public final Colors getColors() {
- return colors;
- }
-
public void setPortMembers(String port1, String port2) {
this.port1 = port1;
this.port2 = port2;
diff --git a/src/net/sourceforge/plantuml/cucadiagram/LinkMiddleDecor.java b/src/net/sourceforge/plantuml/cucadiagram/LinkMiddleDecor.java
index 63b3b13..5b746fd 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/LinkMiddleDecor.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/LinkMiddleDecor.java
@@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.cucadiagram;
+import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.svek.extremity.MiddleCircleCircledMode;
import net.sourceforge.plantuml.svek.extremity.MiddleFactory;
import net.sourceforge.plantuml.svek.extremity.MiddleFactoryCircle;
@@ -44,18 +45,18 @@ public enum LinkMiddleDecor {
NONE, CIRCLE, CIRCLE_CIRCLED, CIRCLE_CIRCLED1, CIRCLE_CIRCLED2;
- public MiddleFactory getMiddleFactory() {
+ public MiddleFactory getMiddleFactory(HtmlColor backColor) {
if (this == CIRCLE) {
- return new MiddleFactoryCircle();
+ return new MiddleFactoryCircle(backColor);
}
if (this == CIRCLE_CIRCLED) {
- return new MiddleFactoryCircleCircled(MiddleCircleCircledMode.BOTH);
+ return new MiddleFactoryCircleCircled(MiddleCircleCircledMode.BOTH, backColor);
}
if (this == CIRCLE_CIRCLED1) {
- return new MiddleFactoryCircleCircled(MiddleCircleCircledMode.MODE1);
+ return new MiddleFactoryCircleCircled(MiddleCircleCircledMode.MODE1, backColor);
}
if (this == CIRCLE_CIRCLED2) {
- return new MiddleFactoryCircleCircled(MiddleCircleCircledMode.MODE2);
+ return new MiddleFactoryCircleCircled(MiddleCircleCircledMode.MODE2, backColor);
}
throw new UnsupportedOperationException();
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/LinkStyle.java b/src/net/sourceforge/plantuml/cucadiagram/LinkStyle.java
index a5e1e3c..3ebd0f4 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/LinkStyle.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/LinkStyle.java
@@ -37,43 +37,117 @@ package net.sourceforge.plantuml.cucadiagram;
import net.sourceforge.plantuml.ugraphic.UStroke;
-public enum LinkStyle {
+public class LinkStyle {
- NORMAL, DASHED, DOTTED, BOLD, INVISIBLE,
+ static enum Type {
+ NORMAL, DASHED, DOTTED, BOLD, INVISIBLE;
+ }
- DOUBLE_tobedone, __toremove_INTERFACE_PROVIDER, __toremove_INTERFACE_USER;
+ private LinkStyle(Type type, Double thickness) {
+ this.type = type;
+ this.thickness = thickness;
- public static UStroke getStroke(LinkStyle style) {
- return getStroke(style, 1);
}
- public static UStroke getStroke(LinkStyle style, double thickness) {
- if (style == LinkStyle.DASHED) {
- return new UStroke(6, 6, thickness);
+ private final Type type;
+ private final Double thickness;
+
+ @Override
+ public String toString() {
+ return type.toString() + "(" + thickness + ")";
+ }
+
+ // DOUBLE_tobedone, __toremove_INTERFACE_PROVIDER, __toremove_INTERFACE_USER;
+
+ // private UStroke getStroke2() {
+ // return getStroke2(1);
+ // }
+
+ public boolean isNormal() {
+ return type == Type.NORMAL;
+ }
+
+ public boolean isInvisible() {
+ return type == Type.INVISIBLE;
+ }
+
+ public static LinkStyle NORMAL() {
+ return new LinkStyle(Type.NORMAL, null);
+ }
+
+ public static LinkStyle INVISIBLE() {
+ return new LinkStyle(Type.INVISIBLE, null);
+ }
+
+ public static LinkStyle BOLD() {
+ return new LinkStyle(Type.BOLD, null);
+ }
+
+ public static LinkStyle DOTTED() {
+ return new LinkStyle(Type.DOTTED, null);
+ }
+
+ public static LinkStyle DASHED() {
+ return new LinkStyle(Type.DASHED, null);
+ }
+
+ public LinkStyle goThickness(double thickness) {
+ return new LinkStyle(type, thickness);
+ }
+
+ public UStroke getStroke3() {
+ if (type == Type.DASHED) {
+ return new UStroke(7, 7, nonZeroThickness());
+ }
+ if (type == Type.DOTTED) {
+ return new UStroke(1, 3, nonZeroThickness());
+ }
+ if (type == Type.BOLD) {
+ return new UStroke(2);
+ }
+ return new UStroke(nonZeroThickness());
+ }
+
+ public UStroke muteStroke(UStroke stroke) {
+ if (type == Type.DASHED || type == Type.DOTTED || type == Type.BOLD) {
+ return getStroke3();
}
- if (style == LinkStyle.DOTTED) {
- return new UStroke(1, 3, thickness);
+ return stroke;
+ }
+
+ private double nonZeroThickness() {
+ if (thickness == null) {
+ return 1;
}
- if (style == LinkStyle.BOLD) {
- return new UStroke(2.5);
+ return thickness;
+ }
+
+ public static LinkStyle fromString1(String s) {
+ final LinkStyle result = fromString2(s);
+ if (result == null) {
+ return LinkStyle.NORMAL();
}
- return new UStroke();
+ return result;
}
- public static LinkStyle fromString(String s) {
+ public static LinkStyle fromString2(String s) {
if ("dashed".equalsIgnoreCase(s)) {
- return DASHED;
+ return DASHED();
}
if ("dotted".equalsIgnoreCase(s)) {
- return DOTTED;
+ return DOTTED();
}
if ("bold".equalsIgnoreCase(s)) {
- return BOLD;
+ return BOLD();
}
if ("hidden".equalsIgnoreCase(s)) {
- return INVISIBLE;
+ return INVISIBLE();
}
- return LinkStyle.NORMAL;
+ return null;
+ }
+
+ public boolean isThicknessOverrided() {
+ return thickness != null;
}
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/LinkType.java b/src/net/sourceforge/plantuml/cucadiagram/LinkType.java
index 177e239..0edc970 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/LinkType.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/LinkType.java
@@ -46,12 +46,16 @@ public class LinkType {
private final LinkHat hat2;
private final LinkMiddleDecor middleDecor;
+ public boolean isDoubleDecorated() {
+ return decor1 != LinkDecor.NONE && decor2 != LinkDecor.NONE;
+ }
+
public LinkType(LinkDecor decor1, LinkDecor decor2) {
this(LinkHat.NONE, decor1, decor2, LinkHat.NONE);
}
public LinkType(LinkHat hat1, LinkDecor decor1, LinkDecor decor2, LinkHat hat2) {
- this(hat1, decor1, LinkStyle.NORMAL, LinkMiddleDecor.NONE, decor2, hat2);
+ this(hat1, decor1, LinkStyle.NORMAL(), LinkMiddleDecor.NONE, decor2, hat2);
}
public LinkType withoutDecors1() {
@@ -84,6 +88,9 @@ public class LinkType {
private LinkType(LinkHat hat1, LinkDecor decor1, LinkStyle style, LinkMiddleDecor middleDecor, LinkDecor decor2,
LinkHat hat2) {
+ if (style == null) {
+ throw new IllegalArgumentException();
+ }
this.decor1 = decor1;
this.style = style;
this.decor2 = decor2;
@@ -92,41 +99,45 @@ public class LinkType {
this.hat2 = hat2;
}
- public boolean isDashed() {
- return style == LinkStyle.DASHED;
- }
-
- public boolean isDotted() {
- return style == LinkStyle.DOTTED;
- }
-
- public boolean isBold() {
- return style == LinkStyle.BOLD;
- }
+ // private boolean isDashed() {
+ // return style == LinkStyle.DASHED;
+ // }
+ //
+ // private boolean isDotted() {
+ // return style == LinkStyle.DOTTED;
+ // }
+ //
+ // private boolean isBold() {
+ // return style == LinkStyle.BOLD;
+ // }
public boolean isInvisible() {
- return style == LinkStyle.INVISIBLE;
+ return style.isInvisible();
}
- public LinkType getDashed() {
- return new LinkType(hat1, decor1, LinkStyle.DASHED, middleDecor, decor2, hat2);
+ public LinkType goDashed() {
+ return new LinkType(hat1, decor1, LinkStyle.DASHED(), middleDecor, decor2, hat2);
}
- public LinkType getDotted() {
- return new LinkType(hat1, decor1, LinkStyle.DOTTED, middleDecor, decor2, hat2);
+ public LinkType goDotted() {
+ return new LinkType(hat1, decor1, LinkStyle.DOTTED(), middleDecor, decor2, hat2);
}
- public LinkType getBold() {
- return new LinkType(hat1, decor1, LinkStyle.BOLD, middleDecor, decor2, hat2);
+ public LinkType goThickness(double thickness) {
+ return new LinkType(hat1, decor1, style.goThickness(thickness), middleDecor, decor2, hat2);
}
- public LinkType getInterfaceProvider() {
- return new LinkType(hat1, decor1, LinkStyle.__toremove_INTERFACE_PROVIDER, middleDecor, decor2, hat2);
+ public LinkType goBold() {
+ return new LinkType(hat1, decor1, LinkStyle.BOLD(), middleDecor, decor2, hat2);
}
- public LinkType getInterfaceUser() {
- return new LinkType(hat1, decor1, LinkStyle.__toremove_INTERFACE_USER, middleDecor, decor2, hat2);
- }
+ // public LinkType getInterfaceProvider() {
+ // return new LinkType(hat1, decor1, LinkStyle.__toremove_INTERFACE_PROVIDER, middleDecor, decor2, hat2);
+ // }
+ //
+ // public LinkType getInterfaceUser() {
+ // return new LinkType(hat1, decor1, LinkStyle.__toremove_INTERFACE_USER, middleDecor, decor2, hat2);
+ // }
public LinkType getInversed() {
return new LinkType(hat2, decor2, style, middleDecor, decor1, hat1);
@@ -149,7 +160,7 @@ public class LinkType {
}
public LinkType getInvisible() {
- return new LinkType(hat1, decor1, LinkStyle.INVISIBLE, middleDecor, decor2, hat2);
+ return new LinkType(hat1, decor1, LinkStyle.INVISIBLE(), middleDecor, decor2, hat2);
}
public String getSpecificDecorationSvek() {
@@ -221,17 +232,14 @@ public class LinkType {
return new LinkType(LinkHat.NONE, LinkDecor.NONE, style, middleDecor, decor2, hat2);
}
- public UStroke getStroke() {
- if (style == LinkStyle.DASHED) {
- return new UStroke(7, 7, 1);
- }
- if (style == LinkStyle.DOTTED) {
- return new UStroke(1, 3, 1);
+ public UStroke getStroke3(UStroke defaultThickness) {
+ if (style.isThicknessOverrided()) {
+ return style.getStroke3();
}
- if (style == LinkStyle.BOLD) {
- return new UStroke(2);
+ if (defaultThickness == null) {
+ return style.getStroke3();
}
- return new UStroke();
+ return style.goThickness(defaultThickness.getThickness()).getStroke3();
}
public LinkMiddleDecor getMiddleDecor() {
diff --git a/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java b/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java
index 385edc6..f59bb9d 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java
@@ -166,7 +166,8 @@ public class MethodsOrFieldsArea extends AbstractTextBlock implements TextBlockW
if (m.isStatic()) {
config = config.underline();
}
- TextBlock bloc = Display.getWithNewlines(s).create(config, align, skinParam, CreoleMode.SIMPLE_LINE);
+ TextBlock bloc = Display.getWithNewlines(s).create(config, align, skinParam, CreoleMode.SIMPLE_LINE,
+ skinParam.wrapWidth());
bloc = TextBlockUtils.fullInnerPosition(bloc, m.getDisplay(false));
return new TextBlockTracer(m, bloc);
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/Namespace.java b/src/net/sourceforge/plantuml/cucadiagram/Namespace.java
index 71f306c..cf3fafa 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/Namespace.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/Namespace.java
@@ -37,36 +37,4 @@ package net.sourceforge.plantuml.cucadiagram;
public class Namespace {
- private final String namespace;
-
- private Namespace(String namespace) {
- if (namespace == null) {
- throw new IllegalArgumentException();
- }
- this.namespace = namespace;
- }
-
- public final String getNamespace() {
- return namespace;
- }
-
- public static Namespace of(String namespace) {
- return new Namespace(namespace);
- }
-
- @Override
- public int hashCode() {
- return namespace.hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- final Namespace other = (Namespace) obj;
- return this.namespace.equals(other.namespace);
- }
-
- public boolean isMain() {
- return namespace.length() == 0;
- }
-
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/NamespaceStrategy.java b/src/net/sourceforge/plantuml/cucadiagram/NamespaceStrategy.java
new file mode 100644
index 0000000..a5bd89b
--- /dev/null
+++ b/src/net/sourceforge/plantuml/cucadiagram/NamespaceStrategy.java
@@ -0,0 +1,42 @@
+/* ========================================================================
+ * 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.cucadiagram;
+
+public enum NamespaceStrategy {
+
+ SINGLE, MULTIPLE;
+
+}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/Stereotag.java b/src/net/sourceforge/plantuml/cucadiagram/Stereotag.java
new file mode 100644
index 0000000..2d8885d
--- /dev/null
+++ b/src/net/sourceforge/plantuml/cucadiagram/Stereotag.java
@@ -0,0 +1,77 @@
+/* ========================================================================
+ * 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.cucadiagram;
+
+public class Stereotag {
+
+ private static final String SINGLE = "(\\$[^%s{}%g<>$]+)";
+
+ public static String pattern() {
+ return "(" + SINGLE + "([%s]+" + SINGLE + ")*)";
+ }
+
+ private String name;
+
+ public Stereotag(String name) {
+ if (name == null) {
+ throw new IllegalArgumentException();
+ }
+ if (name.startsWith("$")) {
+ throw new IllegalArgumentException(name);
+ }
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public int hashCode() {
+ return name.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object arg0) {
+ return name.equals(((Stereotag) arg0).name);
+ }
+
+ @Override
+ public String toString() {
+ return "$" + name;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/Stereotype.java b/src/net/sourceforge/plantuml/cucadiagram/Stereotype.java
index 23880de..887b59b 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/Stereotype.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/Stereotype.java
@@ -42,7 +42,6 @@ import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import net.sourceforge.plantuml.Hideable;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
@@ -54,7 +53,7 @@ import net.sourceforge.plantuml.svek.PackageStyle;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.sprite.SpriteUtils;
-public class Stereotype implements CharSequence, Hideable {
+public class Stereotype implements CharSequence {
private final static Pattern2 circleChar = MyPattern
.cmpile("\\<\\<[%s]*\\(?(\\S)[%s]*,[%s]*(#[0-9a-fA-F]{6}|\\w+)[%s]*(?:[),](.*?))?\\>\\>");
private final static Pattern2 circleSprite = MyPattern.cmpile("\\<\\<[%s]*\\(?\\$(" + SpriteUtils.SPRITE_NAME
@@ -248,8 +247,28 @@ public class Stereotype implements CharSequence, Hideable {
return null;
}
- public boolean isHidden() {
- return "<<hidden>>".equalsIgnoreCase(label);
+ public boolean isBiddableOrUncertain() {
+ return label.equalsIgnoreCase("<<B>>") || label.equalsIgnoreCase("<<Biddable>>")
+ || label.equalsIgnoreCase("<<Uncertain>>");
+ }
+
+ public boolean isCausal() {
+ return label.equalsIgnoreCase("<<C>>") || label.equalsIgnoreCase("<<Causal>>");
+ }
+
+ public boolean isLexicalOrGiven() {
+ return label.equalsIgnoreCase("<<L>>") || label.equalsIgnoreCase("<<Lexical>>")
+ || label.equalsIgnoreCase("<<X>>") || label.equalsIgnoreCase("<<Given>>");
+ }
+
+ public boolean isDesignedOrSolved() {
+ return label.equalsIgnoreCase("<<D>>") || label.equalsIgnoreCase("<<Designed>>")
+ || label.equalsIgnoreCase("<<Nested>>") || label.equalsIgnoreCase("<<Solved>>");
+ }
+
+ public boolean isMachineOrSpecification() {
+ return label.equalsIgnoreCase("M") || label.equalsIgnoreCase("<<Machine>>") || label.equalsIgnoreCase("<<S>>")
+ || label.equalsIgnoreCase("<<Spec>>") || label.equalsIgnoreCase("<<Specification>>");
}
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/WithLinkType.java b/src/net/sourceforge/plantuml/cucadiagram/WithLinkType.java
new file mode 100644
index 0000000..6e85c7a
--- /dev/null
+++ b/src/net/sourceforge/plantuml/cucadiagram/WithLinkType.java
@@ -0,0 +1,122 @@
+/* ========================================================================
+ * 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.cucadiagram;
+
+import java.util.StringTokenizer;
+
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.HtmlColorSet;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
+
+public abstract class WithLinkType {
+
+ protected LinkType type;
+ protected boolean hidden = false;
+
+ private Colors colors = Colors.empty();
+
+ public final HtmlColor getSpecificColor() {
+ return colors.getColor(ColorType.LINE);
+ }
+
+ public final void setSpecificColor(HtmlColor specificColor) {
+ colors = colors.add(ColorType.LINE, specificColor);
+ }
+
+ public void setColors(Colors colors) {
+ this.colors = colors;
+ }
+
+ public final Colors getColors() {
+ return colors;
+ }
+
+ final public void goDashed() {
+ type = type.goDashed();
+ }
+
+ final public void goDotted() {
+ type = type.goDotted();
+ }
+
+ final public void goThickness(double thickness) {
+ type = type.goThickness(thickness);
+ }
+
+ final public void goHidden() {
+ this.hidden = true;
+ }
+
+ public abstract void goNorank();
+
+ final public void goBold() {
+ type = type.goBold();
+ }
+
+ public void applyStyle(String arrowStyle) {
+ if (arrowStyle == null) {
+ return;
+ }
+ final StringTokenizer st = new StringTokenizer(arrowStyle, ",");
+ while (st.hasMoreTokens()) {
+ final String s = st.nextToken();
+ if (s.equalsIgnoreCase("dashed")) {
+ this.goDashed();
+ } else if (s.equalsIgnoreCase("bold")) {
+ this.goBold();
+ } else if (s.equalsIgnoreCase("dotted")) {
+ this.goDotted();
+ } else if (s.equalsIgnoreCase("hidden")) {
+ this.goHidden();
+ } else if (s.equalsIgnoreCase("plain")) {
+ // Do nothing
+ } else if (s.equalsIgnoreCase("norank")) {
+ this.goNorank();
+ } else if (s.startsWith("thickness=")) {
+ this.goThickness(Double.parseDouble(s.substring("thickness=".length())));
+ } else {
+ final HtmlColor tmp = HtmlColorSet.getInstance().getColorIfValid(s);
+ setSpecificColor(tmp);
+ }
+ }
+ }
+
+ public LinkType getType() {
+ return type;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramTxtMaker.java b/src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramTxtMaker.java
index b4c41e2..eb2b1f4 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramTxtMaker.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramTxtMaker.java
@@ -52,9 +52,12 @@ import net.sourceforge.plantuml.FileFormat;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.cucadiagram.CucaDiagram;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.cucadiagram.EntityPortion;
import net.sourceforge.plantuml.cucadiagram.IEntity;
+import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.Member;
+import net.sourceforge.plantuml.cucadiagram.PortionShower;
import net.sourceforge.plantuml.posimo.Block;
import net.sourceforge.plantuml.posimo.Cluster;
import net.sourceforge.plantuml.posimo.GraphvizSolverB;
@@ -67,6 +70,7 @@ public final class CucaDiagramTxtMaker {
// private final CucaDiagram diagram;
private final FileFormat fileFormat;
private final UGraphicTxt globalUg = new UGraphicTxt();
+ private final PortionShower portionShower;
private static double getXPixelPerChar() {
return 5;
@@ -76,9 +80,15 @@ public final class CucaDiagramTxtMaker {
return 10;
}
+ private boolean showMember(IEntity entity) {
+ final boolean showMethods = portionShower.showPortion(EntityPortion.METHOD, entity);
+ final boolean showFields = portionShower.showPortion(EntityPortion.FIELD, entity);
+ return showMethods || showFields;
+ }
+
public CucaDiagramTxtMaker(CucaDiagram diagram, FileFormat fileFormat) throws IOException {
- // this.diagram = diagram;
this.fileFormat = fileFormat;
+ this.portionShower = diagram;
final Cluster root = new Cluster(null, 0, 0);
int uid = 0;
@@ -123,20 +133,22 @@ public final class CucaDiagramTxtMaker {
final int h = getHeight(ent);
ug.getCharArea().drawBoxSimple(0, 0, w, h);
ug.getCharArea().drawStringsLR(ent.getDisplay().as(), 1, 1);
- int y = 2;
- ug.getCharArea().drawHLine('-', y, 1, w - 1);
- y++;
- for (Member att : ent.getBodier().getFieldsToDisplay()) {
- final List<String> disp = BackSlash.getWithNewlines(att.getDisplay(true));
- ug.getCharArea().drawStringsLR(disp, 1, y);
- y += StringUtils.getHeight(disp);
- }
- ug.getCharArea().drawHLine('-', y, 1, w - 1);
- y++;
- for (Member att : ent.getBodier().getMethodsToDisplay()) {
- final List<String> disp = BackSlash.getWithNewlines(att.getDisplay(true));
- ug.getCharArea().drawStringsLR(disp, 1, y);
- y += StringUtils.getHeight(disp);
+ if (showMember(ent)) {
+ int y = 2;
+ ug.getCharArea().drawHLine('-', y, 1, w - 1);
+ y++;
+ for (Member att : ent.getBodier().getFieldsToDisplay()) {
+ final List<String> disp = BackSlash.getWithNewlines(att.getDisplay(true));
+ ug.getCharArea().drawStringsLR(disp, 1, y);
+ y += StringUtils.getHeight(disp);
+ }
+ ug.getCharArea().drawHLine('-', y, 1, w - 1);
+ y++;
+ for (Member att : ent.getBodier().getMethodsToDisplay()) {
+ final List<String> disp = BackSlash.getWithNewlines(att.getDisplay(true));
+ ug.getCharArea().drawStringsLR(disp, 1, y);
+ y += StringUtils.getHeight(disp);
+ }
}
}
@@ -151,27 +163,33 @@ public final class CucaDiagramTxtMaker {
private int getHeight(IEntity entity) {
int result = StringUtils.getHeight(entity.getDisplay());
- for (Member att : entity.getBodier().getMethodsToDisplay()) {
- result += StringUtils.getHeight(Display.getWithNewlines(att.getDisplay(true)));
- }
- for (Member att : entity.getBodier().getFieldsToDisplay()) {
- result += StringUtils.getHeight(Display.getWithNewlines(att.getDisplay(true)));
+ if (showMember(entity)) {
+ for (Member att : entity.getBodier().getMethodsToDisplay()) {
+ result += StringUtils.getHeight(Display.getWithNewlines(att.getDisplay(true)));
+ }
+ result++;
+ for (Member att : entity.getBodier().getFieldsToDisplay()) {
+ result += StringUtils.getHeight(Display.getWithNewlines(att.getDisplay(true)));
+ }
+ result++;
}
- return result + 4;
+ return result + 2;
}
private int getWidth(IEntity entity) {
- int result = StringUtils.getWidth(entity.getDisplay());
- for (Member att : entity.getBodier().getMethodsToDisplay()) {
- final int w = StringUtils.getWidth(Display.getWithNewlines(att.getDisplay(true)));
- if (w > result) {
- result = w;
+ int result = StringUtils.getWcWidth(entity.getDisplay());
+ if (showMember(entity)) {
+ for (Member att : entity.getBodier().getMethodsToDisplay()) {
+ final int w = StringUtils.getWcWidth(Display.getWithNewlines(att.getDisplay(true)));
+ if (w > result) {
+ result = w;
+ }
}
- }
- for (Member att : entity.getBodier().getFieldsToDisplay()) {
- final int w = StringUtils.getWidth(Display.getWithNewlines(att.getDisplay(true)));
- if (w > result) {
- result = w;
+ for (Member att : entity.getBodier().getFieldsToDisplay()) {
+ final int w = StringUtils.getWcWidth(Display.getWithNewlines(att.getDisplay(true)));
+ if (w > result) {
+ result = w;
+ }
}
}
return result + 2;
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizLinux.java b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizLinux.java
index 94b4d9f..d50500b 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizLinux.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizLinux.java
@@ -48,12 +48,15 @@ class GraphvizLinux extends AbstractGraphviz {
@Override
protected File specificDotExe() {
final File usrLocalBinDot = new File("/usr/local/bin/dot");
-
if (usrLocalBinDot.exists()) {
return usrLocalBinDot;
}
final File usrBinDot = new File("/usr/bin/dot");
- return usrBinDot;
+ if (usrBinDot.exists()) {
+ return usrBinDot;
+ }
+ final File optLocalBinDot = new File("/opt/local/bin/dot");
+ return optLocalBinDot;
}
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizUtils.java b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizUtils.java
index 408c3ba..4e6c0da 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizUtils.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizUtils.java
@@ -117,7 +117,21 @@ public class GraphvizUtils {
return null;
}
+ private static final ThreadLocal<Integer> limitSize = new ThreadLocal<Integer>();
+
+ public static void removeLocalLimitSize() {
+ limitSize.remove();
+ }
+
+ public static void setLocalImageLimit(int value) {
+ limitSize.set(value);
+ }
+
public static int getenvImageLimit() {
+ final Integer local = limitSize.get();
+ if (local != null) {
+ return local;
+ }
final String env = System.getProperty("PLANTUML_LIMIT_SIZE");
if (StringUtils.isNotEmpty(env) && env.matches("\\d+")) {
return Integer.parseInt(env);
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersion.java b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersion.java
index 4b9f049..6f0b549 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersion.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersion.java
@@ -40,10 +40,10 @@ public interface GraphvizVersion {
public boolean useProtectionWhenThereALinkFromOrToGroup();
- public boolean modeSafe();
+ public boolean useXLabelInsteadOfLabel();
public boolean isVizjs();
-
- // COMMON, V2_34_0
+
+ public boolean ignoreHorizontalLinks();
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersionFinder.java b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersionFinder.java
index b8df542..968134e 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersionFinder.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersionFinder.java
@@ -53,13 +53,17 @@ public class GraphvizVersionFinder {
return true;
}
- public boolean modeSafe() {
+ public boolean useXLabelInsteadOfLabel() {
return false;
}
public boolean isVizjs() {
return false;
}
+
+ public boolean ignoreHorizontalLinks() {
+ return false;
+ }
};
public GraphvizVersionFinder(File dotExe) {
@@ -89,7 +93,7 @@ public class GraphvizVersionFinder {
return true;
}
- public boolean modeSafe() {
+ public boolean useXLabelInsteadOfLabel() {
return false;
}
@@ -97,6 +101,13 @@ public class GraphvizVersionFinder {
return false;
}
+ public boolean ignoreHorizontalLinks() {
+ if (v == 230) {
+ return true;
+ }
+ return false;
+ }
+
};
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java b/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java
index 26f0da7..99d6d28 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java
@@ -48,6 +48,7 @@ import net.sourceforge.plantuml.cucadiagram.Code;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.GroupRoot;
import net.sourceforge.plantuml.cucadiagram.GroupType;
+import net.sourceforge.plantuml.cucadiagram.HideOrShow2;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.IGroup;
import net.sourceforge.plantuml.cucadiagram.ILeaf;
@@ -65,24 +66,28 @@ public class EntityFactory {
private int rawLayout;
private final IGroup rootGroup = new GroupRoot(this);
- private final Set<LeafType> hiddenTypes;
- private final Set<String> hiddenStereotype;
+ private final List<HideOrShow2> hides2;
+ private final List<HideOrShow2> removed;
- public EntityFactory(Set<LeafType> hiddenTypes, Set<String> hiddenStereotype) {
- this.hiddenTypes = hiddenTypes;
- this.hiddenStereotype = hiddenStereotype;
+ public EntityFactory(List<HideOrShow2> hides2, List<HideOrShow2> removed) {
+ this.hides2 = hides2;
+ this.removed = removed;
}
public boolean isHidden(ILeaf leaf) {
- if (hiddenTypes.contains(leaf.getLeafType())) {
- return true;
+ boolean hidden = false;
+ for (HideOrShow2 hide : hides2) {
+ hidden = hide.apply(hidden, leaf);
}
- final Stereotype stereotype = leaf.getStereotype();
- if (stereotype != null && hiddenStereotype.contains(stereotype.getLabel(false))) {
- return true;
- }
- return false;
+ return hidden;
+ }
+ public boolean isRemoved(ILeaf leaf) {
+ boolean result = false;
+ for (HideOrShow2 hide : removed) {
+ result = hide.apply(result, leaf);
+ }
+ return result;
}
public ILeaf createLeaf(Code code, Display display, LeafType entityType, IGroup parentContainer,
@@ -94,6 +99,7 @@ public class EntityFactory {
final LongCode longCode = getLongCode(code, namespaceSeparator);
final EntityImpl result = new EntityImpl(this, code, bodier, parentContainer, entityType, longCode,
namespaceSeparator, rawLayout);
+ bodier.setLeaf(result);
result.setDisplay(display);
return result;
}
@@ -127,8 +133,12 @@ public class EntityFactory {
return rootGroup;
}
- public final Map<Code, ILeaf> getLeafs() {
- return Collections.unmodifiableMap(leafs);
+ public final ILeaf getLeafsget(Code code) {
+ return leafs.get(code);
+ }
+
+ public final Collection<ILeaf> getLeafsvalues() {
+ return Collections.unmodifiableCollection(leafs.values());
}
public void addLeaf(ILeaf entity) {
@@ -157,8 +167,12 @@ public class EntityFactory {
}
}
- public final Map<Code, IGroup> getGroups() {
- return Collections.unmodifiableMap(groups);
+ public final Collection<IGroup> getGroupsvalues() {
+ return Collections.unmodifiableCollection(groups.values());
+ }
+
+ public final IGroup getGroupsget(Code code) {
+ return groups.get(code);
}
public final List<Link> getLinks() {
@@ -177,7 +191,7 @@ public class EntityFactory {
}
public IGroup muteToGroup(Code code, Code namespace2, GroupType type, IGroup parent) {
- final ILeaf leaf = getLeafs().get(code);
+ final ILeaf leaf = leafs.get(code);
((EntityImpl) leaf).muteToGroup(namespace2, type, parent);
final IGroup result = (IGroup) leaf;
removeLeaf(code);
diff --git a/src/net/sourceforge/plantuml/cucadiagram/entity/EntityImpl.java b/src/net/sourceforge/plantuml/cucadiagram/entity/EntityImpl.java
index e9e8b09..a039512 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/entity/EntityImpl.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/entity/EntityImpl.java
@@ -40,8 +40,10 @@ import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
@@ -59,6 +61,7 @@ import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.LongCode;
+import net.sourceforge.plantuml.cucadiagram.Stereotag;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.cucadiagram.dot.Neighborhood;
import net.sourceforge.plantuml.graphic.FontConfiguration;
@@ -106,11 +109,20 @@ final class EntityImpl implements ILeaf, IGroup {
private int xposition;
private IEntityImage svekImage;
- private boolean removed = false;
private USymbol symbol;
private final int rawLayout;
private char concurrentSeparator;
+ private Set<Stereotag> tags = new LinkedHashSet<Stereotag>();
+
+ public void addStereotag(Stereotag tag) {
+ this.tags.add(tag);
+ }
+
+ public Set<Stereotag> stereotags() {
+ return Collections.unmodifiableSet(tags);
+ }
+
// Back to Entity
public final boolean isTop() {
checkNotGroup();
@@ -166,6 +178,9 @@ final class EntityImpl implements ILeaf, IGroup {
throw new IllegalArgumentException();
}
if (leafType != LeafType.STILL_UNKNOWN) {
+ if (newType == this.leafType) {
+ return true;
+ }
if (leafType != LeafType.ANNOTATION && leafType != LeafType.ABSTRACT_CLASS && leafType != LeafType.CLASS
&& leafType != LeafType.ENUM && leafType != LeafType.INTERFACE) {
return false;
@@ -335,7 +350,7 @@ final class EntityImpl implements ILeaf, IGroup {
public Collection<ILeaf> getLeafsDirect() {
checkGroup();
final List<ILeaf> result = new ArrayList<ILeaf>();
- for (ILeaf ent : entityFactory.getLeafs().values()) {
+ for (ILeaf ent : entityFactory.getLeafsvalues()) {
if (ent.isGroup()) {
throw new IllegalStateException();
}
@@ -349,7 +364,7 @@ final class EntityImpl implements ILeaf, IGroup {
public Collection<IGroup> getChildren() {
checkGroup();
final Collection<IGroup> result = new ArrayList<IGroup>();
- for (IGroup g : entityFactory.getGroups().values()) {
+ for (IGroup g : entityFactory.getGroupsvalues()) {
if (g != this && g.getParentContainer() == this) {
result.add(g);
}
@@ -429,7 +444,7 @@ final class EntityImpl implements ILeaf, IGroup {
}
entityFactory.removeGroup(this.getCode());
- for (ILeaf ent : new ArrayList<ILeaf>(entityFactory.getLeafs().values())) {
+ for (ILeaf ent : new ArrayList<ILeaf>(entityFactory.getLeafsvalues())) {
if (this != ent && this == ent.getParentContainer()) {
entityFactory.removeLeaf(ent.getCode());
}
@@ -451,16 +466,6 @@ final class EntityImpl implements ILeaf, IGroup {
this.parentContainer = parentContainer;
}
- public boolean isHidden() {
- if (entityFactory.isHidden(this)) {
- return true;
- }
- if (stereotype != null) {
- return stereotype.isHidden();
- }
- return false;
- }
-
public USymbol getUSymbol() {
if (getLeafType() == LeafType.CIRCLE) {
return USymbol.INTERFACE;
@@ -479,32 +484,67 @@ final class EntityImpl implements ILeaf, IGroup {
return SingleStrategy.SQUARRE;
}
- public boolean isRemoved() {
+ public boolean isHidden() {
+ if (parentContainer != null && parentContainer.isHidden()) {
+ return true;
+ }
+ return isHiddenInternal();
+ }
+
+ private boolean isHiddenInternal() {
if (isGroup()) {
- if (removed) {
+ if (entityFactory.isHidden(this)) {
return true;
}
if (getLeafsDirect().size() == 0) {
return false;
}
for (ILeaf leaf : getLeafsDirect()) {
- if (leaf.isRemoved() == false) {
+ if (((EntityImpl) leaf).isHiddenInternal() == false) {
return false;
}
}
for (IGroup g : getChildren()) {
- if (g.isRemoved() == false) {
+ if (((EntityImpl) g).isHiddenInternal() == false) {
return false;
}
}
return true;
}
- return removed;
+ return entityFactory.isHidden(this);
}
- public void setRemoved(boolean removed) {
- this.removed = removed;
+ public boolean isRemoved() {
+ if (parentContainer != null && parentContainer.isRemoved()) {
+ return true;
+ }
+ return isRemovedInternal();
}
+
+ private boolean isRemovedInternal() {
+ if (isGroup()) {
+ if (entityFactory.isRemoved(this)) {
+ return true;
+ }
+ if (getLeafsDirect().size() == 0) {
+ return false;
+ }
+ for (ILeaf leaf : getLeafsDirect()) {
+ if (((EntityImpl) leaf).isRemovedInternal() == false) {
+ return false;
+ }
+ }
+ for (IGroup g : getChildren()) {
+ if (((EntityImpl) g).isRemovedInternal() == false) {
+ return false;
+ }
+ }
+ return true;
+ }
+ return entityFactory.isRemoved(this);
+ }
+
+
private int layer;
@@ -587,10 +627,6 @@ final class EntityImpl implements ILeaf, IGroup {
}
}
- // public void setSpecificLineStroke(UStroke specificLineStroke) {
- // colors = colors.addSpecificLineStroke(specificLineStroke);
- // }
-
public Collection<String> getPortShortNames() {
checkNotGroup();
return Collections.unmodifiableCollection(portShortNames);
diff --git a/src/net/sourceforge/plantuml/dedication/1.png b/src/net/sourceforge/plantuml/dedication/1.png
new file mode 100644
index 0000000..91edd9a
--- /dev/null
+++ b/src/net/sourceforge/plantuml/dedication/1.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/dedication/Dedication.java b/src/net/sourceforge/plantuml/dedication/Dedication.java
index 1888f85..01685eb 100644
--- a/src/net/sourceforge/plantuml/dedication/Dedication.java
+++ b/src/net/sourceforge/plantuml/dedication/Dedication.java
@@ -40,13 +40,12 @@ import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.lang.reflect.Method;
import java.math.BigInteger;
import javax.imageio.ImageIO;
import javax.imageio.stream.ImageInputStream;
-import net.sourceforge.plantuml.webp.VP8Decoder;
-
public class Dedication {
private final String name;
@@ -73,13 +72,21 @@ public class Dedication {
public BufferedImage getBufferedImage(String keepLetter) {
try {
+ final Class<?> clVP8Decoder = Class.forName("net.sourceforge.plantuml.webp.VP8Decoder");
+ final Object vp8Decoder = clVP8Decoder.newInstance();
+ // final VP8Decoder vp8Decoder = new VP8Decoder();
+ final Method decodeFrame = clVP8Decoder.getMethod("decodeFrame", ImageInputStream.class);
final InputStream is = getInputStream(keepLetter);
final ImageInputStream iis = ImageIO.createImageInputStream(is);
- final VP8Decoder vp8Decoder = new VP8Decoder();
- vp8Decoder.decodeFrame(iis, false);
+ decodeFrame.invoke(vp8Decoder, iis);
+ // vp8Decoder.decodeFrame(iis);
iis.close();
- return vp8Decoder.getFrame().getBufferedImage();
+ final Object frame = clVP8Decoder.getMethod("getFrame").invoke(vp8Decoder);
+ return (BufferedImage) frame.getClass().getMethod("getBufferedImage").invoke(frame);
+ // final VP8Frame frame = vp8Decoder.getFrame();
+ // return frame.getBufferedImage();
} catch (Exception e) {
+ e.printStackTrace();
return null;
}
}
diff --git a/src/net/sourceforge/plantuml/dedication/Dedications.java b/src/net/sourceforge/plantuml/dedication/Dedications.java
index 11d9aa6..d6cb711 100644
--- a/src/net/sourceforge/plantuml/dedication/Dedications.java
+++ b/src/net/sourceforge/plantuml/dedication/Dedications.java
@@ -51,6 +51,7 @@ public class Dedications {
addNormal("Write your own dedication!", "dedication");
addNormal("linux_china", "linux_china");
addCrypted("0", "pOhci6rKgPXw32AeYXhOpSY0suoauHq5VUSwFqHLHsLYgSO6WaJ7BW5vtHBAoU6ePbcW7d8Flx99MWjPSKQTDm00");
+ addCrypted("1", "LTxN3hdnhSJ515qcA7IQ841axt4GXfUd3n2wgNirYCdLnyX2360Gv1OEOnJ1-gwFzRW5B3HAqLBkR6Ge0WW_Z000");
}
private static void addNormal(String sentence, String name) {
diff --git a/src/net/sourceforge/plantuml/dedication/QBlock.java b/src/net/sourceforge/plantuml/dedication/QBlock.java
index 3fed0bc..98f0c78 100644
--- a/src/net/sourceforge/plantuml/dedication/QBlock.java
+++ b/src/net/sourceforge/plantuml/dedication/QBlock.java
@@ -40,6 +40,8 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.math.BigInteger;
+import net.sourceforge.plantuml.version.Magic;
+
public class QBlock {
private final BigInteger big;
@@ -59,6 +61,20 @@ public class QBlock {
return new QBlock(new BigInteger(block));
}
+ public static QBlock fromMagic(Magic magic) {
+ final byte[] buffer = magic.getBuffer();
+ final byte[] block = new byte[buffer.length + 1];
+ System.arraycopy(buffer, 0, block, 1, buffer.length);
+ final BigInteger big = new BigInteger(block);
+ return new QBlock(big);
+ }
+
+ public Magic toMagic() {
+ final Magic magic = new Magic();
+ magic.set(0, getData512());
+ return magic;
+ }
+
public QBlock(BigInteger number) {
this.big = number;
}
@@ -68,13 +84,27 @@ public class QBlock {
return new QBlock(changed);
}
- public byte[] getData() {
+ private byte[] getData512() {
+ final byte[] nb = big.toByteArray();
+ if (nb.length == 512) {
+ return nb;
+ }
+ final byte[] result = new byte[512];
+ if (nb.length < 512) {
+ System.arraycopy(nb, 0, result, 512 - nb.length, nb.length);
+ } else {
+ System.arraycopy(nb, nb.length - 512, result, 0, 512);
+ }
+ return result;
+ }
+
+ public byte[] getDataRaw() {
return big.toByteArray();
}
@Override
public String toString() {
- return big.toByteArray().length + " " + big.toString();
+ return big.toByteArray().length + " " + big.toString(36);
}
public void write(OutputStream os, int size) throws IOException {
diff --git a/src/net/sourceforge/plantuml/dedication/QBlocks.java b/src/net/sourceforge/plantuml/dedication/QBlocks.java
index 6f052dc..586c4e4 100644
--- a/src/net/sourceforge/plantuml/dedication/QBlocks.java
+++ b/src/net/sourceforge/plantuml/dedication/QBlocks.java
@@ -77,24 +77,24 @@ public class QBlocks {
}
}
- public String encodeAscii() {
- final StringBuilder sb = new StringBuilder();
- final AsciiEncoder encoder = new AsciiEncoder();
- for (QBlock rsa : all) {
- sb.append(encoder.encode(rsa.getData()));
- sb.append("!");
- }
- return sb.toString();
- }
-
- public static QBlocks descodeAscii(String s) {
- final QBlocks result = new QBlocks();
- final AsciiEncoder encoder = new AsciiEncoder();
- for (String bl : s.split("!")) {
- final BigInteger bigInteger = new BigInteger(encoder.decode(bl));
- result.all.add(new QBlock(bigInteger));
+// public String encodeAscii() {
+// final StringBuilder sb = new StringBuilder();
+// final AsciiEncoder encoder = new AsciiEncoder();
+// for (QBlock rsa : all) {
+// sb.append(encoder.encode(rsa.getDataRaw()));
+// sb.append("!");
+// }
+// return sb.toString();
+// }
- }
- return result;
- }
+// public static QBlocks descodeAscii(String s) {
+// final QBlocks result = new QBlocks();
+// final AsciiEncoder encoder = new AsciiEncoder();
+// for (String bl : s.split("!")) {
+// final BigInteger bigInteger = new BigInteger(encoder.decode(bl));
+// result.all.add(new QBlock(bigInteger));
+//
+// }
+// return result;
+// }
}
diff --git a/src/net/sourceforge/plantuml/dedication/TurningBytes.java b/src/net/sourceforge/plantuml/dedication/TurningBytes.java
index 9627c93..fa79642 100644
--- a/src/net/sourceforge/plantuml/dedication/TurningBytes.java
+++ b/src/net/sourceforge/plantuml/dedication/TurningBytes.java
@@ -35,7 +35,7 @@
*/
package net.sourceforge.plantuml.dedication;
-class TurningBytes {
+public class TurningBytes {
private final byte key[];
private int idx;
diff --git a/src/net/sourceforge/plantuml/descdiagram/BoxedCharacter.java b/src/net/sourceforge/plantuml/descdiagram/BoxedCharacter.java
new file mode 100644
index 0000000..234c466
--- /dev/null
+++ b/src/net/sourceforge/plantuml/descdiagram/BoxedCharacter.java
@@ -0,0 +1,94 @@
+/* ========================================================================
+ * 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.descdiagram;
+
+import java.awt.geom.Dimension2D;
+
+import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.ugraphic.UCenteredCharacter;
+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;
+
+public class BoxedCharacter extends AbstractTextBlock implements TextBlock {
+
+ private final String c;
+ private final UFont font;
+ private final HtmlColor innerCircle;
+ private final HtmlColor circle;
+ private final HtmlColor fontColor;
+ private final double radius;
+
+ public BoxedCharacter(char c, double size, UFont font, HtmlColor innerCircle, HtmlColor circle, HtmlColor fontColor) {
+ this.c = "" + c;
+ this.font = font;
+ this.innerCircle = innerCircle;
+ this.circle = circle;
+ this.fontColor = fontColor;
+ this.radius = size;
+ }
+
+ public void drawU(UGraphic ug) {
+ if (circle != null) {
+ ug = ug.apply(new UChangeColor(circle));
+ }
+ // final HtmlColor back = ug.getParam().getBackcolor();
+ ug = ug.apply(new UChangeBackColor(innerCircle));
+ ug.draw(new URectangle(2 * radius, 2 * radius));
+ ug = ug.apply(new UChangeColor(fontColor));
+ ug = ug.apply(new UTranslate(radius, radius));
+ ug.draw(new UCenteredCharacter(c.charAt(0), font));
+ }
+
+ final public double getPreferredWidth(StringBounder stringBounder) {
+ return 2 * radius;
+ }
+
+ final public double getPreferredHeight(StringBounder stringBounder) {
+ return 2 * radius;
+ }
+
+ public Dimension2D calculateDimension(StringBounder stringBounder) {
+ return new Dimension2DDouble(getPreferredWidth(stringBounder), getPreferredHeight(stringBounder));
+ }
+}
diff --git a/src/net/sourceforge/plantuml/descdiagram/CommandCreateDomain.java b/src/net/sourceforge/plantuml/descdiagram/CommandCreateDomain.java
new file mode 100644
index 0000000..05c5a79
--- /dev/null
+++ b/src/net/sourceforge/plantuml/descdiagram/CommandCreateDomain.java
@@ -0,0 +1,144 @@
+/* ========================================================================
+ * 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: Yijun Yu
+ *
+ *
+ */
+package net.sourceforge.plantuml.descdiagram;
+
+import net.sourceforge.plantuml.FontParam;
+import net.sourceforge.plantuml.Url;
+import net.sourceforge.plantuml.UrlBuilder;
+import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
+import net.sourceforge.plantuml.classdiagram.command.GenericRegexProducer;
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.SingleLineCommand2;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+import net.sourceforge.plantuml.cucadiagram.Code;
+import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.cucadiagram.GroupType;
+import net.sourceforge.plantuml.cucadiagram.IEntity;
+import net.sourceforge.plantuml.cucadiagram.IGroup;
+import net.sourceforge.plantuml.cucadiagram.LeafType;
+import net.sourceforge.plantuml.cucadiagram.NamespaceStrategy;
+import net.sourceforge.plantuml.cucadiagram.Stereotype;
+import net.sourceforge.plantuml.graphic.USymbol;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+
+public class CommandCreateDomain extends SingleLineCommand2<DescriptionDiagram> {
+ public static final String DISPLAY_WITH_GENERIC = "[%g](.+?)(?:\\<(" + GenericRegexProducer.PATTERN + ")\\>)?[%g]";
+ public static final String CODE = "[^%s{}%g<>]+";
+
+ public CommandCreateDomain() {
+ super(getRegexConcat());
+ }
+
+ private static RegexConcat getRegexConcat() {
+ return new RegexConcat(new RegexLeaf("^"), //
+ new RegexLeaf("TYPE", // TODO yy
+ "(requirement|domain)[%s]+"), //
+ new RegexLeaf("DISPLAY", DISPLAY_WITH_GENERIC), new RegexLeaf("[%s]+as[%s]+"), //
+ new RegexLeaf("CODE", "([a-zA-Z0-9]+)"), new RegexLeaf("[%s]*"), new RegexLeaf("STEREO",
+ "(\\<\\<.+\\>\\>)?"), //
+ // domain: lexical, causal, biddable
+ // requirement: FR, NFR, quality
+ new RegexLeaf("[%s]*"), //
+ new RegexLeaf("GROUP", "(\\{)?"), //
+ new RegexLeaf("$"));
+ }
+
+ @Override
+ protected CommandExecutionResult executeArg(DescriptionDiagram diagram, RegexResult arg) {
+ String type = arg.get("TYPE", 0);
+ String display = arg.getLazzy("DISPLAY", 0);
+ String code = arg.getLazzy("CODE", 0);
+ if (code == null) {
+ code = display;
+ }
+ final String genericOption = arg.getLazzy("DISPLAY", 1);
+ final String generic = genericOption != null ? genericOption : arg.get("GENERIC", 0);
+
+ final String stereotype = arg.get("STEREO", 0);
+
+ if (diagram.leafExist(Code.of(code))) {
+ return CommandExecutionResult.error("Object already exists : " + code);
+ }
+ Display d = Display.getWithNewlines(display);
+ final String urlString = arg.get("URL", 0);
+ final String group = arg.get("GROUP", 0);
+ IEntity entity;
+ if (group != null) {
+ final IGroup currentGroup = diagram.getCurrentGroup();
+ diagram.gotoGroup2(Code.of(code), d, type.equalsIgnoreCase("domain") ? GroupType.DOMAIN
+ : GroupType.REQUIREMENT, currentGroup, NamespaceStrategy.SINGLE);
+ entity = diagram.getCurrentGroup();
+ } else {
+ entity = diagram.createLeaf(Code.of(code), d, type.equalsIgnoreCase("domain") ? LeafType.DOMAIN
+ : LeafType.REQUIREMENT, null);
+ }
+ if (stereotype != null) {
+ entity.setStereotype(new Stereotype(stereotype, diagram.getSkinParam().getCircledCharacterRadius(), diagram
+ .getSkinParam().getFont(null, false, FontParam.CIRCLED_CHARACTER), diagram.getSkinParam()
+ .getIHtmlColorSet()));
+ }
+ if (urlString != null) {
+ final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
+ final Url url = urlBuilder.getUrl(urlString);
+ entity.addUrl(url);
+ }
+ entity.setSpecificColorTOBEREMOVED(ColorType.BACK,
+ diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
+ if (type.equalsIgnoreCase("domain")) {
+ if (stereotype != null && stereotype.equalsIgnoreCase("<<Machine>>")) {
+ type = "machine";
+ }
+ if (stereotype != null && stereotype.equalsIgnoreCase("<<Causal>>")) {
+ type = "causal";
+ }
+ if (stereotype != null && stereotype.equalsIgnoreCase("<<Designed>>")) {
+ type = "designed";
+ }
+ if (stereotype != null && stereotype.equalsIgnoreCase("<<Lexical>>")) {
+ type = "lexical";
+ }
+ if (stereotype != null && stereotype.equalsIgnoreCase("<<Biddable>>")) {
+ type = "biddable";
+ }
+ }
+ USymbol usymbol = USymbol.getFromString(type, diagram.getSkinParam().useUml2ForComponent());
+ entity.setUSymbol(usymbol);
+ return CommandExecutionResult.ok();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/descdiagram/DescriptionDiagram.java b/src/net/sourceforge/plantuml/descdiagram/DescriptionDiagram.java
index 487c3e9..34c53be 100644
--- a/src/net/sourceforge/plantuml/descdiagram/DescriptionDiagram.java
+++ b/src/net/sourceforge/plantuml/descdiagram/DescriptionDiagram.java
@@ -45,14 +45,12 @@ import net.sourceforge.plantuml.graphic.USymbol;
public class DescriptionDiagram extends AbstractEntityDiagram {
- private String namespaceSeparator = null;
-
@Override
public ILeaf getOrCreateLeaf(Code code, LeafType type, USymbol symbol) {
- if (namespaceSeparator != null) {
- code = code.withSeparator(namespaceSeparator);
+ if (getNamespaceSeparator() != null) {
+ code = code.withSeparator(getNamespaceSeparator());
}
- if (namespaceSeparator != null && code.getFullName().contains(namespaceSeparator)) {
+ if (getNamespaceSeparator() != null && code.getFullName().contains(getNamespaceSeparator())) {
// System.err.println("code=" + code);
final Code fullyCode = code;
// final String namespace = fullyCode.getNamespace(getLeafs());
@@ -138,12 +136,4 @@ public class DescriptionDiagram extends AbstractEntityDiagram {
return UmlDiagramType.DESCRIPTION;
}
- public void setNamespaceSeparator(String namespaceSeparator) {
- this.namespaceSeparator = namespaceSeparator;
- }
-
- public String getNamespaceSeparator() {
- return namespaceSeparator;
- }
-
}
diff --git a/src/net/sourceforge/plantuml/descdiagram/DescriptionDiagramFactory.java b/src/net/sourceforge/plantuml/descdiagram/DescriptionDiagramFactory.java
index 75b380b..2c058ba 100644
--- a/src/net/sourceforge/plantuml/descdiagram/DescriptionDiagramFactory.java
+++ b/src/net/sourceforge/plantuml/descdiagram/DescriptionDiagramFactory.java
@@ -38,7 +38,8 @@ package net.sourceforge.plantuml.descdiagram;
import java.util.ArrayList;
import java.util.List;
-import net.sourceforge.plantuml.classdiagram.command.CommandHideShowSpecificClass;
+import net.sourceforge.plantuml.classdiagram.command.CommandHideShow2;
+import net.sourceforge.plantuml.classdiagram.command.CommandRemoveRestore;
import net.sourceforge.plantuml.classdiagram.command.CommandUrl;
import net.sourceforge.plantuml.command.Command;
import net.sourceforge.plantuml.command.CommandEndPackage;
@@ -78,6 +79,8 @@ public class DescriptionDiagramFactory extends UmlDiagramFactory {
cmds.add(new CommandPage());
cmds.add(new CommandLinkElement());
+ cmds.add(new CommandHideShow2());
+ cmds.add(new CommandRemoveRestore());
//
cmds.add(new CommandPackageWithUSymbol());
cmds.add(new CommandEndPackage());
@@ -110,9 +113,10 @@ public class DescriptionDiagramFactory extends UmlDiagramFactory {
cmds.add(factoryNoteOnLinkCommand.createSingleLine());
cmds.add(factoryNoteOnLinkCommand.createMultiLine(false));
- cmds.add(new CommandHideShowSpecificClass());
+ // cmds.add(new CommandHideShowSpecificClass());
cmds.add(new CommandArchimate());
+ cmds.add(new CommandCreateDomain());
return cmds;
}
diff --git a/src/net/sourceforge/plantuml/descdiagram/EntityImageDesignedDomain.java b/src/net/sourceforge/plantuml/descdiagram/EntityImageDesignedDomain.java
new file mode 100644
index 0000000..cc400a0
--- /dev/null
+++ b/src/net/sourceforge/plantuml/descdiagram/EntityImageDesignedDomain.java
@@ -0,0 +1,164 @@
+/* ========================================================================
+ * 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: Yijun Yu
+ *
+ *
+ */
+package net.sourceforge.plantuml.descdiagram;
+
+import java.awt.geom.Dimension2D;
+
+import net.sourceforge.plantuml.ColorParam;
+import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.FontParam;
+import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.LineParam;
+import net.sourceforge.plantuml.SkinParamUtils;
+import net.sourceforge.plantuml.Url;
+import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.cucadiagram.ILeaf;
+import net.sourceforge.plantuml.cucadiagram.Stereotype;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.graphic.TextBlockUtils;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.svek.AbstractEntityImage;
+import net.sourceforge.plantuml.svek.ShapeType;
+import net.sourceforge.plantuml.ugraphic.PlacementStrategyY1Y2;
+import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
+import net.sourceforge.plantuml.ugraphic.UChangeColor;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.ULayoutGroup;
+import net.sourceforge.plantuml.ugraphic.URectangle;
+import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class EntityImageDesignedDomain extends AbstractEntityImage {
+ final private TextBlock name;
+ final private TextBlock stereo;
+ final private Url url;
+
+ public EntityImageDesignedDomain(ILeaf entity, ISkinParam skinParam) {
+ super(entity, skinParam);
+ final Stereotype stereotype = entity.getStereotype();
+ this.name = TextBlockUtils.withMargin(
+ entity.getDisplay().create(new FontConfiguration(getSkinParam(), FontParam.DESIGNED_DOMAIN, stereotype),
+ HorizontalAlignment.CENTER, skinParam), 2, 2);
+ if (stereotype == null || stereotype.getLabel(false) == null) {
+ this.stereo = null;
+ } else {
+ this.stereo = Display.create(stereotype.getLabels(skinParam.useGuillemet())).create(
+ new FontConfiguration(getSkinParam(), FontParam.DESIGNED_DOMAIN_STEREOTYPE, stereotype),
+ HorizontalAlignment.CENTER, skinParam);
+ }
+ this.url = entity.getUrl99();
+ // System.out.println(entity.getStereotype());
+ }
+
+ private UStroke getStroke() {
+ UStroke stroke = getSkinParam().getThickness(LineParam.designedDomainBorder, getStereo());
+
+ if (stroke == null) {
+ stroke = new UStroke(1.5);
+ }
+ return stroke;
+ }
+
+ private Dimension2D getTitleDimension(StringBounder stringBounder) {
+ return getNameAndSteretypeDimension(stringBounder);
+ }
+
+ private Dimension2D getNameAndSteretypeDimension(StringBounder stringBounder) {
+ final Dimension2D nameDim = name.calculateDimension(stringBounder);
+ final Dimension2D stereoDim = stereo == null ? new Dimension2DDouble(0, 0) : stereo
+ .calculateDimension(stringBounder);
+ final Dimension2D nameAndStereo = new Dimension2DDouble(Math.max(nameDim.getWidth(), stereoDim.getWidth()),
+ nameDim.getHeight() + stereoDim.getHeight());
+ return nameAndStereo;
+ }
+
+ public double getStartingX(StringBounder stringBounder, double y) {
+ return 0;
+ }
+
+ public double getEndingX(StringBounder stringBounder, double y) {
+ return calculateDimension(stringBounder).getWidth();
+ }
+
+ final public void drawU(UGraphic ug) {
+ final StringBounder stringBounder = ug.getStringBounder();
+ final Dimension2D dimTotal = calculateDimension(stringBounder);
+ final Dimension2D dimTitle = getTitleDimension(stringBounder);
+
+ final double widthTotal = dimTotal.getWidth();
+ final double heightTotal = dimTotal.getHeight();
+ final URectangle rect = new URectangle(widthTotal, heightTotal, 0, 0);
+ URectangle rect2 = new URectangle(4, heightTotal, 0, 0);
+
+ ug = ug.apply(new UChangeColor(SkinParamUtils.getColor(getSkinParam(), ColorParam.designedBorder, getStereo())));
+ HtmlColor backcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.BACK);
+ if (backcolor == null) {
+ backcolor = SkinParamUtils.getColor(getSkinParam(), ColorParam.designedBackground, getStereo());
+ }
+ ug = ug.apply(new UChangeBackColor(backcolor));
+ if (url != null) {
+ ug.startUrl(url);
+ }
+
+ final UStroke stroke = getStroke();
+ ug.apply(stroke).draw(rect);
+ ug.apply(stroke).draw(rect2);
+
+ final ULayoutGroup header = new ULayoutGroup(new PlacementStrategyY1Y2(ug.getStringBounder()));
+ header.add(name);
+ header.drawU(ug.apply(new UTranslate(4, 0)), dimTotal.getWidth(), dimTitle.getHeight());
+
+ if (url != null) {
+ ug.closeAction();
+ }
+ }
+
+ public ShapeType getShapeType() {
+ return ShapeType.RECTANGLE;
+ }
+
+ public Dimension2D calculateDimension(StringBounder stringBounder) {
+ final Dimension2D dimTitle = getTitleDimension(stringBounder);
+ final double width = dimTitle.getWidth();
+ final double height = dimTitle.getHeight();
+ return new Dimension2DDouble(width + 5, height);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/descdiagram/EntityImageDomain.java b/src/net/sourceforge/plantuml/descdiagram/EntityImageDomain.java
new file mode 100644
index 0000000..8b875b1
--- /dev/null
+++ b/src/net/sourceforge/plantuml/descdiagram/EntityImageDomain.java
@@ -0,0 +1,174 @@
+/* ========================================================================
+ * 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: Yijun Yu
+ *
+ *
+ */
+package net.sourceforge.plantuml.descdiagram;
+
+import java.awt.geom.Dimension2D;
+
+import net.sourceforge.plantuml.ColorParam;
+import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.FontParam;
+import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.LineParam;
+import net.sourceforge.plantuml.SkinParamUtils;
+import net.sourceforge.plantuml.Url;
+import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.cucadiagram.ILeaf;
+import net.sourceforge.plantuml.cucadiagram.Stereotype;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.graphic.TextBlockUtils;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.svek.AbstractEntityImage;
+import net.sourceforge.plantuml.svek.ShapeType;
+import net.sourceforge.plantuml.ugraphic.PlacementStrategyY1Y2;
+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.ULayoutGroup;
+import net.sourceforge.plantuml.ugraphic.URectangle;
+import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class EntityImageDomain extends AbstractEntityImage {
+ final private TextBlock name;
+ final private TextBlock tag;
+ final private TextBlock stereo;
+ final private Url url;
+
+ public EntityImageDomain(ILeaf entity, ISkinParam skinParam, char typeLetter) {
+ super(entity, skinParam);
+ final Stereotype stereotype = entity.getStereotype();
+ FontConfiguration fc = new FontConfiguration(getSkinParam(), FontParam.DESIGNED_DOMAIN, stereotype);
+ this.name = TextBlockUtils.withMargin(entity.getDisplay().create(fc, HorizontalAlignment.CENTER, skinParam), 2,
+ 2);
+ if (stereotype == null || stereotype.getLabel(false) == null) {
+ this.stereo = null;
+ } else {
+ this.stereo = Display.create(stereotype.getLabels(skinParam.useGuillemet())).create(
+ new FontConfiguration(getSkinParam(), FontParam.DESIGNED_DOMAIN_STEREOTYPE, stereotype),
+ HorizontalAlignment.CENTER, skinParam);
+ }
+ this.tag = new BoxedCharacter(typeLetter, 8, UFont.byDefault(8), stereotype.getHtmlColor(), null, fc.getColor());
+
+ this.url = entity.getUrl99();
+ }
+
+ private UStroke getStroke() {
+ UStroke stroke = getSkinParam().getThickness(LineParam.domainBorder, getStereo());
+
+ if (stroke == null) {
+ stroke = new UStroke(1.5);
+ }
+ return stroke;
+ }
+
+ private Dimension2D getTitleDimension(StringBounder stringBounder) {
+ return getNameAndSteretypeDimension(stringBounder);
+ }
+
+ private Dimension2D getNameAndSteretypeDimension(StringBounder stringBounder) {
+ final Dimension2D nameDim = name.calculateDimension(stringBounder);
+ final Dimension2D stereoDim = stereo == null ? new Dimension2DDouble(0, 0) : stereo
+ .calculateDimension(stringBounder);
+ final Dimension2D nameAndStereo = new Dimension2DDouble(Math.max(nameDim.getWidth(), stereoDim.getWidth()),
+ nameDim.getHeight() + stereoDim.getHeight());
+ return nameAndStereo;
+ }
+
+ public double getStartingX(StringBounder stringBounder, double y) {
+ return 0;
+ }
+
+ public double getEndingX(StringBounder stringBounder, double y) {
+ return calculateDimension(stringBounder).getWidth();
+ }
+
+ final public void drawU(UGraphic ug) {
+ final StringBounder stringBounder = ug.getStringBounder();
+ final Dimension2D dimTotal = calculateDimension(stringBounder);
+ final Dimension2D dimTitle = getTitleDimension(stringBounder);
+ final Dimension2D dimTag = getTagDimension(stringBounder);
+ final double widthTotal = dimTotal.getWidth();
+ final double heightTotal = dimTotal.getHeight();
+ final URectangle rect = new URectangle(widthTotal, heightTotal, 0, 0);
+
+ ug = ug.apply(new UChangeColor(SkinParamUtils.getColor(getSkinParam(), ColorParam.domainBorder, getStereo())));
+ HtmlColor backcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.BACK);
+ if (backcolor == null) {
+ backcolor = SkinParamUtils.getColor(getSkinParam(), ColorParam.domainBackground, getStereo());
+ }
+ ug = ug.apply(new UChangeBackColor(backcolor));
+ if (url != null) {
+ ug.startUrl(url);
+ }
+
+ final UStroke stroke = getStroke();
+ ug.apply(stroke).draw(rect);
+
+ final ULayoutGroup header = new ULayoutGroup(new PlacementStrategyY1Y2(ug.getStringBounder()));
+ header.add(name);
+ header.drawU(ug, dimTotal.getWidth(), dimTitle.getHeight());
+ final ULayoutGroup footer = new ULayoutGroup(new PlacementStrategyY1Y2(ug.getStringBounder()));
+ footer.add(tag);
+ footer.drawU(ug.apply(new UTranslate(dimTotal.getWidth() - dimTag.getWidth(), dimTitle.getHeight())),
+ dimTag.getWidth(), dimTag.getHeight());
+ if (url != null) {
+ ug.closeAction();
+ }
+ }
+
+ private Dimension2D getTagDimension(StringBounder stringBounder) {
+ final Dimension2D tagDim = tag == null ? new Dimension2DDouble(0, 0) : tag.calculateDimension(stringBounder);
+ return tagDim;
+ }
+
+ public ShapeType getShapeType() {
+ return ShapeType.RECTANGLE;
+ }
+
+ public Dimension2D calculateDimension(StringBounder stringBounder) {
+ final Dimension2D dimTitle = getTitleDimension(stringBounder);
+ final double width = dimTitle.getWidth();
+ final double height = dimTitle.getHeight();
+ final Dimension2D dimTag = getTagDimension(stringBounder);
+ return new Dimension2DDouble(width, height + dimTag.getHeight());
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/descdiagram/EntityImageMachine.java b/src/net/sourceforge/plantuml/descdiagram/EntityImageMachine.java
new file mode 100644
index 0000000..6524798
--- /dev/null
+++ b/src/net/sourceforge/plantuml/descdiagram/EntityImageMachine.java
@@ -0,0 +1,163 @@
+/* ========================================================================
+ * 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: Yijun Yu
+ *
+ *
+ */
+package net.sourceforge.plantuml.descdiagram;
+
+import java.awt.geom.Dimension2D;
+
+import net.sourceforge.plantuml.ColorParam;
+import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.FontParam;
+import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.LineParam;
+import net.sourceforge.plantuml.SkinParamUtils;
+import net.sourceforge.plantuml.Url;
+import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.cucadiagram.ILeaf;
+import net.sourceforge.plantuml.cucadiagram.Stereotype;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.graphic.TextBlockUtils;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.svek.AbstractEntityImage;
+import net.sourceforge.plantuml.svek.ShapeType;
+import net.sourceforge.plantuml.ugraphic.PlacementStrategyY1Y2;
+import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
+import net.sourceforge.plantuml.ugraphic.UChangeColor;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.ULayoutGroup;
+import net.sourceforge.plantuml.ugraphic.URectangle;
+import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class EntityImageMachine extends AbstractEntityImage {
+ final private TextBlock name;
+ final private TextBlock stereo;
+ final private Url url;
+
+ public EntityImageMachine(ILeaf entity, ISkinParam skinParam) {
+ super(entity, skinParam);
+ final Stereotype stereotype = entity.getStereotype();
+ this.name = TextBlockUtils.withMargin(
+ entity.getDisplay().create(new FontConfiguration(getSkinParam(), FontParam.MACHINE, stereotype),
+ HorizontalAlignment.CENTER, skinParam), 2, 2);
+ if (stereotype == null || stereotype.getLabel(false) == null) {
+ this.stereo = null;
+ } else {
+ this.stereo = Display.create(stereotype.getLabels(skinParam.useGuillemet())).create(
+ new FontConfiguration(getSkinParam(), FontParam.MACHINE_STEREOTYPE, stereotype),
+ HorizontalAlignment.CENTER, skinParam);
+ }
+ this.url = entity.getUrl99();
+ }
+
+ private UStroke getStroke() {
+ UStroke stroke = getSkinParam().getThickness(LineParam.machineBorder, getStereo());
+
+ if (stroke == null) {
+ stroke = new UStroke(1.5);
+ }
+ return stroke;
+ }
+
+ private Dimension2D getTitleDimension(StringBounder stringBounder) {
+ return getNameAndSteretypeDimension(stringBounder);
+ }
+
+ private Dimension2D getNameAndSteretypeDimension(StringBounder stringBounder) {
+ final Dimension2D nameDim = name.calculateDimension(stringBounder);
+ final Dimension2D stereoDim = stereo == null ? new Dimension2DDouble(0, 0) : stereo
+ .calculateDimension(stringBounder);
+ final Dimension2D nameAndStereo = new Dimension2DDouble(Math.max(nameDim.getWidth(), stereoDim.getWidth()),
+ nameDim.getHeight() + stereoDim.getHeight());
+ return nameAndStereo;
+ }
+
+ public double getStartingX(StringBounder stringBounder, double y) {
+ return 0;
+ }
+
+ public double getEndingX(StringBounder stringBounder, double y) {
+ return calculateDimension(stringBounder).getWidth();
+ }
+
+ final public void drawU(UGraphic ug) {
+ final StringBounder stringBounder = ug.getStringBounder();
+ final Dimension2D dimTotal = calculateDimension(stringBounder);
+ final Dimension2D dimTitle = getTitleDimension(stringBounder);
+
+ final double widthTotal = dimTotal.getWidth();
+ final double heightTotal = dimTotal.getHeight();
+ final URectangle rect = new URectangle(widthTotal, heightTotal, 0, 0);
+ URectangle rect2 = new URectangle(4, heightTotal, 0, 0);
+
+ ug = ug.apply(new UChangeColor(SkinParamUtils.getColor(getSkinParam(), ColorParam.machineBorder, getStereo())));
+ HtmlColor backcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.BACK);
+ if (backcolor == null) {
+ backcolor = SkinParamUtils.getColor(getSkinParam(), ColorParam.machineBackground, getStereo());
+ }
+ ug = ug.apply(new UChangeBackColor(backcolor));
+ if (url != null) {
+ ug.startUrl(url);
+ }
+
+ final UStroke stroke = getStroke();
+ ug.apply(stroke).draw(rect);
+ ug.apply(new UTranslate(4, 0)).apply(stroke).draw(rect2);
+
+ final ULayoutGroup header = new ULayoutGroup(new PlacementStrategyY1Y2(ug.getStringBounder()));
+ header.add(name);
+ header.drawU(ug.apply(new UTranslate(5, 0)), dimTotal.getWidth(), dimTitle.getHeight());
+
+ if (url != null) {
+ ug.closeAction();
+ }
+ }
+
+ public ShapeType getShapeType() {
+ return ShapeType.RECTANGLE;
+ }
+
+ public Dimension2D calculateDimension(StringBounder stringBounder) {
+ final Dimension2D dimTitle = getTitleDimension(stringBounder);
+ final double width = dimTitle.getWidth();
+ final double height = dimTitle.getHeight();
+ return new Dimension2DDouble(width + 10, height);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/descdiagram/EntityImageRequirement.java b/src/net/sourceforge/plantuml/descdiagram/EntityImageRequirement.java
new file mode 100644
index 0000000..c63d0a0
--- /dev/null
+++ b/src/net/sourceforge/plantuml/descdiagram/EntityImageRequirement.java
@@ -0,0 +1,203 @@
+/* ========================================================================
+ * 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: Yijun Yu
+ *
+ *
+ */
+package net.sourceforge.plantuml.descdiagram;
+
+import java.awt.geom.Dimension2D;
+
+import net.sourceforge.plantuml.ColorParam;
+import net.sourceforge.plantuml.FontParam;
+import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.LineParam;
+import net.sourceforge.plantuml.SkinParamUtils;
+import net.sourceforge.plantuml.Url;
+import net.sourceforge.plantuml.creole.Stencil;
+import net.sourceforge.plantuml.cucadiagram.BodyEnhanced;
+import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.cucadiagram.ILeaf;
+import net.sourceforge.plantuml.cucadiagram.Stereotype;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.SkinParameter;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.graphic.TextBlockUtils;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.svek.AbstractEntityImage;
+import net.sourceforge.plantuml.svek.ShapeType;
+import net.sourceforge.plantuml.ugraphic.AbstractUGraphicHorizontalLine;
+import net.sourceforge.plantuml.ugraphic.TextBlockInEllipse;
+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.UHorizontalLine;
+import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class EntityImageRequirement extends AbstractEntityImage {
+
+ final private TextBlock desc;
+
+ final private Url url;
+
+ public EntityImageRequirement(ILeaf entity, ISkinParam skinParam) {
+ super(entity, skinParam);
+ final Stereotype stereotype = entity.getStereotype();
+
+ final TextBlock tmp = new BodyEnhanced(entity.getDisplay(), FontParam.REQUIREMENT, skinParam,
+ HorizontalAlignment.CENTER, stereotype, true, false, entity);
+
+ if (stereotype == null || stereotype.getLabel(false) == null) {
+ this.desc = tmp;
+ } else {
+ final TextBlock stereo = Display.getWithNewlines(stereotype.getLabel(getSkinParam().useGuillemet()))
+ .create(new FontConfiguration(getSkinParam(), FontParam.REQUIREMENT_STEREOTYPE, stereotype),
+ HorizontalAlignment.CENTER, skinParam);
+ this.desc = TextBlockUtils.mergeTB(stereo, tmp, HorizontalAlignment.CENTER);
+ }
+ this.url = entity.getUrl99();
+
+ }
+
+ private UStroke getStroke() {
+ UStroke stroke = getSkinParam().getThickness(LineParam.requirementBorder, getStereo());
+ if (stroke == null) {
+ stroke = new UStroke(7, 7, 1.5);
+// stroke = new UStroke(1.5);
+ }
+ return stroke;
+ }
+
+ public Dimension2D calculateDimension(StringBounder stringBounder) {
+ return new TextBlockInEllipse(desc, stringBounder).calculateDimension(stringBounder);
+ }
+
+ final public void drawU(UGraphic ug) {
+ final StringBounder stringBounder = ug.getStringBounder();
+ final TextBlockInEllipse ellipse = new TextBlockInEllipse(desc, stringBounder);
+ if (getSkinParam().shadowing2(SkinParameter.USECASE)) {
+ ellipse.setDeltaShadow(3);
+ }
+
+ if (url != null) {
+ ug.startUrl(url);
+ }
+
+ ug = ug.apply(getStroke());
+ HtmlColor linecolor = getEntity().getColors(getSkinParam()).getColor(ColorType.LINE);
+ if (linecolor == null) {
+ linecolor = SkinParamUtils.getColor(getSkinParam(), ColorParam.requirementBorder, getStereo());
+ }
+ ug = ug.apply(new UChangeColor(linecolor));
+ HtmlColor backcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.BACK);
+ if (backcolor == null) {
+ backcolor = SkinParamUtils.getColor(getSkinParam(), ColorParam.requirementBackground, getStereo());
+ }
+ ug = ug.apply(new UChangeBackColor(backcolor));
+ final UGraphic ug2 = new MyUGraphicEllipse(ug, 0, 0, ellipse.getUEllipse());
+
+ ellipse.drawU(ug2);
+
+ if (url != null) {
+ ug.closeAction();
+ }
+ }
+
+ public ShapeType getShapeType() {
+ return ShapeType.OVAL;
+ }
+
+ static class MyUGraphicEllipse extends AbstractUGraphicHorizontalLine {
+
+ private final double startingX;
+ private final double yTheoricalPosition;
+ private final UEllipse ellipse;
+
+ @Override
+ protected AbstractUGraphicHorizontalLine copy(UGraphic ug) {
+ return new MyUGraphicEllipse(ug, startingX, yTheoricalPosition, ellipse);
+ }
+
+ MyUGraphicEllipse(UGraphic ug, double startingX, double yTheoricalPosition, UEllipse ellipse) {
+ super(ug);
+ this.startingX = startingX;
+ this.ellipse = ellipse;
+ this.yTheoricalPosition = yTheoricalPosition;
+ }
+
+ private double getNormalized(double y) {
+ if (y < yTheoricalPosition) {
+ throw new IllegalArgumentException();
+ }
+ y = y - yTheoricalPosition;
+ if (y > ellipse.getHeight()) {
+ throw new IllegalArgumentException();
+ }
+ return y;
+ }
+
+ private double getStartingXInternal(double y) {
+ return startingX + ellipse.getStartingX(getNormalized(y));
+ }
+
+ private double getEndingXInternal(double y) {
+ return startingX + ellipse.getEndingX(getNormalized(y));
+ }
+
+ private Stencil getStencil2(UTranslate translate) {
+ final double dy = translate.getDy();
+ return new Stencil() {
+
+ public double getStartingX(StringBounder stringBounder, double y) {
+ return getStartingXInternal(y + dy);
+ }
+
+ public double getEndingX(StringBounder stringBounder, double y) {
+ return getEndingXInternal(y + dy);
+ }
+ };
+ }
+
+ @Override
+ protected void drawHline(UGraphic ug, UHorizontalLine line, UTranslate translate) {
+ final UStroke stroke = new UStroke(1.5);
+ line.drawLineInternal(ug.apply(translate), getStencil2(translate), 0, stroke);
+ }
+
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementFull.java b/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementFull.java
index 7ca1125..467b3e9 100644
--- a/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementFull.java
+++ b/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementFull.java
@@ -40,6 +40,7 @@ import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
+import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.command.regex.RegexConcat;
@@ -61,7 +62,7 @@ import net.sourceforge.plantuml.graphic.color.Colors;
public class CommandCreateElementFull extends SingleLineCommand2<DescriptionDiagram> {
- public static final String ALL_TYPES = "artifact|actor|folder|card|file|package|rectangle|node|frame|cloud|database|queue|stack|storage|agent|usecase|component|boundary|control|entity|interface|circle";
+ public static final String ALL_TYPES = "artifact|actor|folder|card|file|package|rectangle|node|frame|cloud|database|queue|stack|storage|agent|usecase|component|boundary|control|entity|interface|circle|collections";
public CommandCreateElementFull() {
super(getRegexConcat());
@@ -108,9 +109,9 @@ public class CommandCreateElementFull extends SingleLineCommand2<DescriptionDiag
private static final String CODE_CORE = "[\\p{L}0-9_.]+|\\(\\)[%s]*[\\p{L}0-9_.]+|\\(\\)[%s]*[%g][^%g]+[%g]|:[^:]+:|\\([^()]+\\)|\\[[^\\[\\]]+\\]";
public static final String CODE = "(" + CODE_CORE + ")";
- public static final String CODE_WITH_QUOTE = "(" + CODE_CORE + "|[%g][^%g]+[%g])";
+ public static final String CODE_WITH_QUOTE = "(" + CODE_CORE + "|[%g].+?[%g])";
- private static final String DISPLAY_CORE = "[%g][^%g]+[%g]|:[^:]+:|\\([^()]+\\)|\\[[^\\[\\]]+\\]";
+ private static final String DISPLAY_CORE = "[%g].+?[%g]|:[^:]+:|\\([^()]+\\)|\\[[^\\[\\]]+\\]";
public static final String DISPLAY = "(" + DISPLAY_CORE + ")";
public static final String DISPLAY_WITHOUT_QUOTE = "(" + DISPLAY_CORE + "|[\\p{L}0-9_.]+)";
@@ -204,7 +205,8 @@ public class CommandCreateElementFull extends SingleLineCommand2<DescriptionDiag
return CommandExecutionResult.ok();
}
- public static boolean existsWithBadType(DescriptionDiagram diagram, final Code code, LeafType type, USymbol usymbol) {
+ public static boolean existsWithBadType(AbstractEntityDiagram diagram, final Code code, LeafType type,
+ USymbol usymbol) {
if (diagram.leafExist(code) == false) {
return false;
}
@@ -212,7 +214,7 @@ public class CommandCreateElementFull extends SingleLineCommand2<DescriptionDiag
if (other.getLeafType() != type) {
return true;
}
- if (other.getUSymbol() != usymbol) {
+ if (usymbol != null && other.getUSymbol() != usymbol) {
return true;
}
return false;
diff --git a/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementMultilines.java b/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementMultilines.java
index cbead18..27213b8 100644
--- a/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementMultilines.java
+++ b/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementMultilines.java
@@ -39,6 +39,10 @@ import java.util.List;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.Url;
+import net.sourceforge.plantuml.UrlBuilder;
+import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
+import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram;
import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.CommandMultilines2;
@@ -52,12 +56,11 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.descdiagram.DescriptionDiagram;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.color.ColorParser;
import net.sourceforge.plantuml.graphic.color.ColorType;
-public class CommandCreateElementMultilines extends CommandMultilines2<DescriptionDiagram> {
+public class CommandCreateElementMultilines extends CommandMultilines2<AbstractEntityDiagram> {
private final int type;
@@ -89,9 +92,11 @@ public class CommandCreateElementMultilines extends CommandMultilines2<Descripti
new RegexLeaf("[%s]*"), //
new RegexLeaf("STEREO", "(\\<\\<.+\\>\\>)?"), //
new RegexLeaf("[%s]*"), //
+ new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
+ new RegexLeaf("[%s]*"), //
ColorParser.exp1(), //
new RegexLeaf("[%s]*"), //
- new RegexLeaf("DESC", "as[%s]*[%g](.*)$"));
+ new RegexLeaf("DESC", "as[%s]*[%g]([^%g]*)$"));
}
if (type == 1) {
return new RegexConcat(new RegexLeaf("^"), //
@@ -100,6 +105,8 @@ public class CommandCreateElementMultilines extends CommandMultilines2<Descripti
new RegexLeaf("[%s]*"), //
new RegexLeaf("STEREO", "(\\<\\<.+\\>\\>)?"), //
new RegexLeaf("[%s]*"), //
+ new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
+ new RegexLeaf("[%s]*"), //
ColorParser.exp1(), //
new RegexLeaf("[%s]*"), //
new RegexLeaf("DESC", "\\[(.*)$"));
@@ -107,7 +114,7 @@ public class CommandCreateElementMultilines extends CommandMultilines2<Descripti
throw new IllegalArgumentException();
}
- public CommandExecutionResult executeNow(DescriptionDiagram diagram, BlocLines lines) {
+ protected CommandExecutionResult executeNow(AbstractEntityDiagram diagram, BlocLines lines) {
lines = lines.trim(false);
final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
final String symbol = StringUtils.goUpperCase(line0.get("TYPE", 0));
@@ -145,12 +152,23 @@ public class CommandCreateElementMultilines extends CommandMultilines2<Descripti
return CommandExecutionResult.error("This element (" + code.getFullName() + ") is already defined");
}
final ILeaf result = diagram.createLeaf(code, display, type, usymbol);
+ if (result == null) {
+ return CommandExecutionResult.error("This element (" + code.getFullName() + ") is already defined");
+ }
result.setUSymbol(usymbol);
if (stereotype != null) {
result.setStereotype(new Stereotype(stereotype, diagram.getSkinParam().getCircledCharacterRadius(), diagram
.getSkinParam().getFont(null, false, FontParam.CIRCLED_CHARACTER), diagram.getSkinParam()
.getIHtmlColorSet()));
}
+
+ final String urlString = line0.get("URL", 0);
+ if (urlString != null) {
+ final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
+ final Url url = urlBuilder.getUrl(urlString);
+ result.addUrl(url);
+ }
+
result.setSpecificColorTOBEREMOVED(ColorType.BACK,
diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR", 0)));
diff --git a/src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java b/src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java
index b48ab3b..ab83b15 100644
--- a/src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java
+++ b/src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java
@@ -37,7 +37,6 @@ package net.sourceforge.plantuml.descdiagram.command;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.StringUtils;
-import net.sourceforge.plantuml.classdiagram.command.CommandLinkClass;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.command.regex.Matcher2;
@@ -52,6 +51,7 @@ import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Link;
+import net.sourceforge.plantuml.cucadiagram.LinkArrow;
import net.sourceforge.plantuml.cucadiagram.LinkDecor;
import net.sourceforge.plantuml.cucadiagram.LinkType;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
@@ -59,29 +59,30 @@ import net.sourceforge.plantuml.descdiagram.DescriptionDiagram;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.color.ColorParser;
import net.sourceforge.plantuml.graphic.color.ColorType;
-import net.sourceforge.plantuml.graphic.color.Colors;
public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
+ static private final String KEY1 = "dotted|dashed|plain|bold|hidden|norank|thickness=\\d+";
+ static private final String KEY2 = ",dotted|,dashed|,plain|,bold|,hidden|,norank|,thickness=\\d+";
+ static public final String LINE_STYLE = "(?:#\\w+|" + CommandLinkElement.KEY1 + ")(?:,#\\w+|"
+ + CommandLinkElement.KEY2 + ")*";
+
public CommandLinkElement() {
super(getRegexConcat());
}
static RegexConcat getRegexConcat() {
- return new RegexConcat(
- new RegexLeaf("^"), //
+ return new RegexConcat(new RegexLeaf("^"), //
getGroup("ENT1"), //
new RegexLeaf("[%s]*"), //
new RegexLeaf("LABEL1", "(?:[%g]([^%g]+)[%g])?"), //
new RegexLeaf("[%s]*"), //
new RegexLeaf("HEAD2", "(0\\)|<<|[<^*+#0)]|<\\||[%s]+o)?"), //
new RegexLeaf("BODY1", "([-=.~]+)"), //
- new RegexLeaf("ARROW_STYLE1",
- "(?:\\[((?:#\\w+|dotted|dashed|plain|bold|hidden|norank)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden|,norank)*)\\])?"),
+ new RegexLeaf("ARROW_STYLE1", "(?:\\[(" + CommandLinkElement.LINE_STYLE + ")\\])?"), //
new RegexLeaf("DIRECTION", "(?:(left|right|up|down|le?|ri?|up?|do?)(?=[-=.~0()]))?"), //
new RegexLeaf("INSIDE", "(?:(0|\\(0\\)|\\(0|0\\))(?=[-=.~]))?"), //
- new RegexLeaf("ARROW_STYLE2",
- "(?:\\[((?:#\\w+|dotted|dashed|plain|bold|hidden|norank)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden|,norank)*)\\])?"),
+ new RegexLeaf("ARROW_STYLE2", "(?:\\[(" + CommandLinkElement.LINE_STYLE + ")\\])?"), //
new RegexLeaf("BODY2", "([-=.~]*)"), //
new RegexLeaf("HEAD1", "(\\(0|>>|[>^*+#0(]|\\|>|o[%s]+)?"), //
new RegexLeaf("[%s]*"), //
@@ -157,11 +158,11 @@ public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
LinkType result = new LinkType(d1, d2);
final String queue = getQueue(arg);
if (queue.contains(".")) {
- result = result.getDashed();
+ result = result.goDashed();
} else if (queue.contains("~")) {
- result = result.getDotted();
+ result = result.goDotted();
} else if (queue.contains("=")) {
- result = result.getBold();
+ result = result.goBold();
}
final String middle = arg.get("INSIDE", 0);
@@ -207,6 +208,7 @@ public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
private String firstLabel;
private String secondLabel;
private String labelLink;
+ private LinkArrow linkArrow = LinkArrow.NONE;
Labels(RegexResult arg) {
firstLabel = arg.get("LABEL1", 0);
@@ -218,6 +220,27 @@ public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
init();
}
labelLink = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(labelLink);
+
+ if ("<".equals(labelLink)) {
+ linkArrow = LinkArrow.BACKWARD;
+ labelLink = null;
+ } else if (">".equals(labelLink)) {
+ linkArrow = LinkArrow.DIRECT_NORMAL;
+ labelLink = null;
+ } else if (labelLink != null && labelLink.startsWith("< ")) {
+ linkArrow = LinkArrow.BACKWARD;
+ labelLink = StringUtils.trin(labelLink.substring(2));
+ } else if (labelLink != null && labelLink.startsWith("> ")) {
+ linkArrow = LinkArrow.DIRECT_NORMAL;
+ labelLink = StringUtils.trin(labelLink.substring(2));
+ } else if (labelLink != null && labelLink.endsWith(" >")) {
+ linkArrow = LinkArrow.DIRECT_NORMAL;
+ labelLink = StringUtils.trin(labelLink.substring(0, labelLink.length() - 2));
+ } else if (labelLink != null && labelLink.endsWith(" <")) {
+ linkArrow = LinkArrow.BACKWARD;
+ labelLink = StringUtils.trin(labelLink.substring(0, labelLink.length() - 2));
+ }
+
}
}
@@ -287,18 +310,16 @@ public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
Link link = new Link(cl1, cl2, linkType, Display.getWithNewlines(labels.labelLink), queue.length(),
labels.firstLabel, labels.secondLabel, diagram.getLabeldistance(), diagram.getLabelangle());
-
+ link.setLinkArrow(labels.linkArrow);
if (dir == Direction.LEFT || dir == Direction.UP) {
link = link.getInv();
}
- Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
- colors = CommandLinkClass.applyStyle(arg.getLazzy("ARROW_STYLE", 0), link, colors);
+ link.setColors(color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()));
+ link.applyStyle(arg.getLazzy("ARROW_STYLE", 0));
if (arg.get("STEREOTYPE", 0) != null) {
final Stereotype stereotype = new Stereotype(arg.get("STEREOTYPE", 0));
- colors = colors.applyStereotype(stereotype, diagram.getSkinParam(), ColorParam.arrow);
+ link.setColors(link.getColors().applyStereotype(stereotype, diagram.getSkinParam(), ColorParam.arrow));
}
-
- link.setColors(colors);
diagram.addLink(link);
return CommandExecutionResult.ok();
}
@@ -342,7 +363,7 @@ public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
if (dir == Direction.LEFT || dir == Direction.UP) {
link = link.getInv();
}
- CommandLinkClass.applyStyle(arg.getLazzy("ARROW_STYLE", 0), link);
+ link.applyStyle(arg.getLazzy("ARROW_STYLE", 0));
diagram.addLink(link);
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/descdiagram/command/CommandPackageWithUSymbol.java b/src/net/sourceforge/plantuml/descdiagram/command/CommandPackageWithUSymbol.java
index a3a2a01..9243509 100644
--- a/src/net/sourceforge/plantuml/descdiagram/command/CommandPackageWithUSymbol.java
+++ b/src/net/sourceforge/plantuml/descdiagram/command/CommandPackageWithUSymbol.java
@@ -38,6 +38,7 @@ package net.sourceforge.plantuml.descdiagram.command;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram;
+import net.sourceforge.plantuml.classdiagram.command.CommandCreateClassMultilines;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.command.regex.RegexConcat;
@@ -49,10 +50,13 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.GroupType;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.IGroup;
+import net.sourceforge.plantuml.cucadiagram.NamespaceStrategy;
+import net.sourceforge.plantuml.cucadiagram.Stereotag;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.color.ColorParser;
import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.utils.UniqueSequence;
public class CommandPackageWithUSymbol extends SingleLineCommand2<AbstractEntityDiagram> {
@@ -68,7 +72,7 @@ public class CommandPackageWithUSymbol extends SingleLineCommand2<AbstractEntity
new RegexLeaf("[%s]+"), //
new RegexOr(//
new RegexConcat( //
- new RegexLeaf("DISPLAY1", "([%g][^%g]+[%g])"), //
+ new RegexLeaf("DISPLAY1", "([%g].+?[%g])"), //
new RegexLeaf("STEREOTYPE1", "(?:[%s]+(\\<\\<.+\\>\\>))?"), //
new RegexLeaf("[%s]*as[%s]+"), //
new RegexLeaf("CODE1", "([^#%s{}]+)") //
@@ -77,7 +81,7 @@ public class CommandPackageWithUSymbol extends SingleLineCommand2<AbstractEntity
new RegexLeaf("CODE2", "([^#%s{}%g]+)"), //
new RegexLeaf("STEREOTYPE2", "(?:[%s]+(\\<\\<.+\\>\\>))?"), //
new RegexLeaf("[%s]*as[%s]+"), //
- new RegexLeaf("DISPLAY2", "([%g][^%g]+[%g])") //
+ new RegexLeaf("DISPLAY2", "([%g].+?[%g])") //
), //
new RegexConcat( //
new RegexLeaf("DISPLAY3", "([^#%s{}%g]+)"), //
@@ -91,12 +95,18 @@ public class CommandPackageWithUSymbol extends SingleLineCommand2<AbstractEntity
new RegexLeaf("[%s]*"), //
new RegexLeaf("STEREOTYPE", "(\\<\\<.*\\>\\>)?"), //
new RegexLeaf("[%s]*"), //
+ new RegexLeaf("TAGS", Stereotag.pattern() + "?"), //
+ new RegexLeaf("[%s]*"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("[%s]*"), //
- ColorParser.exp1(), //
+ color().getRegex(), //
new RegexLeaf("[%s]*\\{$"));
}
+ private static ColorParser color() {
+ return ColorParser.simpleColor(ColorType.BACK);
+ }
+
@Override
protected CommandExecutionResult executeArg(AbstractEntityDiagram diagram, RegexResult arg) {
final String codeRaw = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.getLazzy("CODE", 0));
@@ -116,18 +126,17 @@ public class CommandPackageWithUSymbol extends SingleLineCommand2<AbstractEntity
}
final IGroup currentPackage = diagram.getCurrentGroup();
- final IEntity p = diagram.getOrCreateGroup(code, Display.getWithNewlines(display), GroupType.PACKAGE,
- currentPackage);
+ diagram.gotoGroup2(code, Display.getWithNewlines(display), GroupType.PACKAGE, currentPackage,
+ NamespaceStrategy.SINGLE);
+ final IEntity p = diagram.getCurrentGroup();
p.setUSymbol(USymbol.getFromString(arg.get("SYMBOL", 0)));
- final String stereotype = arg.get("STEREOTYPE", 0);
+ final String stereotype = arg.getLazzy("STEREOTYPE", 0);
if (stereotype != null) {
p.setStereotype(new Stereotype(stereotype, false));
}
- final String color = arg.get("COLOR", 0);
- if (color != null) {
- p.setSpecificColorTOBEREMOVED(ColorType.BACK,
- diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(color));
- }
+ CommandCreateClassMultilines.addTags(p, arg.get("TAGS", 0));
+ final Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
+ p.setColors(colors);
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/directdot/PSystemDot.java b/src/net/sourceforge/plantuml/directdot/PSystemDot.java
index 5c77840..ae0971a 100644
--- a/src/net/sourceforge/plantuml/directdot/PSystemDot.java
+++ b/src/net/sourceforge/plantuml/directdot/PSystemDot.java
@@ -75,21 +75,22 @@ public class PSystemDot extends AbstractPSystem {
if (graphviz.getExeState() != ExeState.OK) {
final TextBlock result = GraphicStrings.createForError(
Arrays.asList("There is an issue with your Dot/Graphviz installation"), false);
- UGraphicUtils.writeImage(os, null, fileFormat, seed(), new ColorMapperIdentity(),
- HtmlColorUtils.WHITE, result);
- return new ImageDataSimple();
+ UGraphicUtils.writeImage(os, null, fileFormat, seed(), new ColorMapperIdentity(), HtmlColorUtils.WHITE,
+ result);
+ return ImageDataSimple.error();
}
final CounterOutputStream counter = new CounterOutputStream(os);
final ProcessState state = graphviz.createFile3(counter);
- if (state.differs(ProcessState.TERMINATED_OK())) {
- throw new IllegalStateException("Timeout1 " + state);
- }
- if (counter.getLength() == 0) {
+ // if (state.differs(ProcessState.TERMINATED_OK())) {
+ // throw new IllegalStateException("Timeout1 " + state);
+ // }
+ if (counter.getLength() == 0 || state.differs(ProcessState.TERMINATED_OK())) {
final TextBlock result = GraphicStrings.createForError(Arrays.asList("Graphivz has crashed"), false);
- UGraphicUtils.writeImage(os, null, fileFormat, seed(), new ColorMapperIdentity(),
- HtmlColorUtils.WHITE, result);
+ UGraphicUtils.writeImage(os, null, fileFormat, seed(), new ColorMapperIdentity(), HtmlColorUtils.WHITE,
+ result);
+ return ImageDataSimple.error();
}
- return new ImageDataSimple();
+ return ImageDataSimple.ok();
}
}
diff --git a/src/net/sourceforge/plantuml/ditaa/PSystemDitaa.java b/src/net/sourceforge/plantuml/ditaa/PSystemDitaa.java
index 3a4caa8..6c16445 100644
--- a/src/net/sourceforge/plantuml/ditaa/PSystemDitaa.java
+++ b/src/net/sourceforge/plantuml/ditaa/PSystemDitaa.java
@@ -69,8 +69,8 @@ public class PSystemDitaa extends AbstractPSystem {
}
PSystemDitaa add(String line) {
- return new PSystemDitaa(data + line + BackSlash.NEWLINE, processingOptions.performSeparationOfCommonEdges(), dropShadows,
- scale);
+ return new PSystemDitaa(data + line + BackSlash.NEWLINE, processingOptions.performSeparationOfCommonEdges(),
+ dropShadows, scale);
}
public DiagramDescription getDescription() {
@@ -82,7 +82,7 @@ public class PSystemDitaa extends AbstractPSystem {
throws IOException {
if (fileFormat.getFileFormat() == FileFormat.ATXT) {
os.write(getSource().getPlainString().getBytes());
- return new ImageDataSimple();
+ return ImageDataSimple.ok();
}
// ditaa can only export png so file format is mostly ignored
final ConversionOptions options = new ConversionOptions();
diff --git a/src/net/sourceforge/plantuml/donors/PSystemDonors.java b/src/net/sourceforge/plantuml/donors/PSystemDonors.java
index 477fb3f..c69ed06 100644
--- a/src/net/sourceforge/plantuml/donors/PSystemDonors.java
+++ b/src/net/sourceforge/plantuml/donors/PSystemDonors.java
@@ -46,6 +46,9 @@ import java.util.StringTokenizer;
import net.sourceforge.plantuml.AbstractPSystem;
import net.sourceforge.plantuml.BackSlash;
import net.sourceforge.plantuml.FileFormatOption;
+import net.sourceforge.plantuml.code.AsciiEncoder;
+import net.sourceforge.plantuml.code.CompressionBrotli;
+import net.sourceforge.plantuml.code.StringCompressorNone;
import net.sourceforge.plantuml.code.Transcoder;
import net.sourceforge.plantuml.code.TranscoderImpl;
import net.sourceforge.plantuml.core.DiagramDescription;
@@ -65,18 +68,20 @@ import net.sourceforge.plantuml.version.PSystemVersion;
public class PSystemDonors extends AbstractPSystem {
- public static final String DONORS = "UDfbL4jksp0GtSyfk1RIGoXsujI_17QQ0jcDvR75c29Tad8ghuBUe421hdk3eaKMHOjiUW7bHXsvbKcb"
- + "10oOud3clPdtcAhato8BL-J9YbHxeoLcS4r9MAQ0iGbRwo1jh-821ZOSKGLpMg3p4hMOcbn3gfV6Ye4X"
- + "lwVcxsh54MquQXXZL4XxwCjs8nMa8RNPmRmC42eOoAIxj85XYx9qCFUqpKcBdZ5RvjTlwv23KV7Ygh7G"
- + "CqfgCJEb8nYMBywJEyD4sirMmYH2ZKMyvLAfelUebzpENYuvwnfjnKndHzfw3TCOlT_3fP8xlj2NsOQH"
- + "7q-aXZDtJAqZ40djeBylfBUL66DkbWZ3fkctENBwA2uX5SR5QrDncpHwZcDyZ6lu5pnjEgpqahSsuvwS"
- + "uy9M6tFlDf8JARvsQRtSmqM8NXgOo2md9KvHgYfceFOn6ETWIAXV3J5xLv8J_N9XaMUf0jyRS-SfoyN8"
- + "eiC0QKqiqMXYzusoE4ICp4x6GZb8vKqWB15caNYR4Z7Fv8vlRoDPcKtJcLDZKQFQdeXRycYs3cPC4ErI"
- + "Z6GpMZXNnZRzdlp-fTHXw44GAX8dosbyb9F5jjlDrFCk8mTNsCfZ9Zk0KoN57779rh5h4cz9hycUY4bw"
- + "_NgU1cadHiE0EfQ9cUkC9LA86qRTPz6EGgIbPh9ibZ4HdErYvUyGfY495It89A8nA2NheYn8d9kIVEXl"
- + "vk0ydio1Ir23tiTjOxXJkMODpMKHBCY0sCchfjF8hev09qf1_Qb-ZDBNZ_KFwEKTQrTil79nU0YiPYzS"
- + "c0wS0PdLob8bfhBWmGtn_rTbXYjKOb8vnHwflzIFpm_rzwQKg3_NJ_NF-kdv0_yU-DCtEBEq5oDK1Jlh"
- + "8fvr8rTYlPwIQWvrD3Qk8gDNCKduaUooO87TqCj7AIaLlnij5G_pGqBdeVvOVpssX86nvqAUQxEG3AEF" + "jeXzoY8my0TY-gPS";
+ public static final String DONORS = "6wW70AmEU9ELAuNYZT_MZn6AGOgeeHNOWjgQuZoZA1P0SxnDhXdMoRgDdR45mND5SGKL8Az2C-THCiPX"
+ + "qGYJjjcQVk6-VTu2CLLilsL2UtyTQ4BoLZ2km4tbpF_b0XiJv0R8GZti1NIZZNlZcZIc_NyMPXz_WHRm"
+ + "DBfiMLGwq5cTNHLD233np1odb9A7OjnVaSBNZIs0buu7kTfO7U4RgRFlr0AQj6RJa9are5X6YaJpiT7Q"
+ + "SO3jOnWuqM5T7JOGEvGuw1kC0-eRCKh65JJ8ZE9cRAZcdIS4J3YXmavyKPAQeuLaHXawq65jWGAyFnC4"
+ + "n3uffoHdAsy32hR85ZKDahhmkZDTx1-MKe7yqd0ATB0Sj0Ae0F8Vw8O_PvkvnBcENL4pv5qPvx9no6kz"
+ + "Lx6_UQ2liwuCb9VDYvdnMdvKjnRIEUMwng-k1lcX8IjxUnXhlBA4yFnlBeNsnG8wFe2EjOQAyVV3-Sr2"
+ + "6eJ7bBgGWtFopdOJ0R7AKbZeNLnIBV3pBccnkbWUpLayH_lNXLOoi8Ch5fkXZsi5irldZ9AgeVvvoQkk"
+ + "urFacg1PtfVeHx9fIFp_BSqCqXsqteGFrwM8KgMlhAh5HHU1qw1_Gsu1kGFLq-JHTLg-9Bxt1-JUUv50"
+ + "53OJx9-wPjIdtBo4UM9Bfwfu01Zl4kr6X_CWCuYg0rq7bMTas5s_tQHdsBGnTcxqYdhJRWnT7zDfoitq"
+ + "tLpWCmo3icWE7DRUuYZWFfnG3gsMRwleDjVmRbkanZiPxAzXpWYapuXo76bBfazrb9dbiUHDNUBTt2x-"
+ + "F7JnJ-yMjT1vT_j7wljDVYMrr2F6esimz9PTrczjikXOG6prZ0Kk0tPgjnkJ0vNSGgSsd1KznGbOzxRE"
+ + "mN4jWukcTREIdQcT73Dh1nskINx8qO1HqPr83hwsEoFFU1G5zYVddLZrKD-757yNK2o62PvIeMmZfEWA"
+ + "czF9f76hPzmTl8zRcozKj_7DXIS4XH-RQDDoWzUd0FSK-a5J1v0wgrNoqiR42E1tVFq6FS-j3ZpAQ6cL"
+ + "SNQv8PRIf_S8y1ioyahsjhkX10q0";
@Override
final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed)
@@ -125,7 +130,7 @@ public class PSystemDonors extends AbstractPSystem {
private List<String> getDonors() throws IOException {
final List<String> lines = new ArrayList<String>();
- final Transcoder t = new TranscoderImpl();
+ final Transcoder t = new TranscoderImpl(new AsciiEncoder(), new StringCompressorNone(), new CompressionBrotli());
final String s = t.decode(DONORS).replace('*', '.');
final StringTokenizer st = new StringTokenizer(s, BackSlash.NEWLINE);
while (st.hasMoreTokens()) {
diff --git a/src/net/sourceforge/plantuml/donors/PSystemSkinparameterList.java b/src/net/sourceforge/plantuml/donors/PSystemSkinparameterList.java
new file mode 100644
index 0000000..0ebbcab
--- /dev/null
+++ b/src/net/sourceforge/plantuml/donors/PSystemSkinparameterList.java
@@ -0,0 +1,111 @@
+/* ========================================================================
+ * 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.donors;
+
+import java.awt.geom.Dimension2D;
+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.SkinParam;
+import net.sourceforge.plantuml.core.DiagramDescription;
+import net.sourceforge.plantuml.core.ImageData;
+import net.sourceforge.plantuml.graphic.GraphicStrings;
+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.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class PSystemSkinparameterList extends AbstractPSystem {
+
+ @Override
+ final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed)
+ throws IOException {
+ final UDrawable result = getGraphicStrings();
+ final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, HtmlColorUtils.WHITE,
+ getMetadata(), null, 0, 0, null, false);
+ imageBuilder.setUDrawable(result);
+ return imageBuilder.writeImageTOBEMOVED(fileFormat, seed, os);
+ }
+
+ private UDrawable getGraphicStrings() throws IOException {
+ final List<TextBlock> cols = getCols(getDonors(), 5);
+ return new UDrawable() {
+ public void drawU(UGraphic ug) {
+ final StringBounder stringBounder = ug.getStringBounder();
+ double x = 0;
+ double y = 0;
+ for (TextBlock tb : cols) {
+ final Dimension2D dim = tb.calculateDimension(stringBounder);
+ tb.drawU(ug.apply(new UTranslate(x, 0)));
+ x += dim.getWidth() + 10;
+ y = Math.max(y, dim.getHeight());
+ }
+ }
+ };
+ }
+
+ public static List<TextBlock> getCols(List<String> lines, final int nbCol) throws IOException {
+ final List<TextBlock> result = new ArrayList<TextBlock>();
+ final int maxLine = (lines.size() + (nbCol - 1)) / nbCol;
+ for (int i = 0; i < lines.size(); i += maxLine) {
+ final List<String> current = lines.subList(i, Math.min(lines.size(), i + maxLine));
+ result.add(GraphicStrings.createBlackOnWhite(current));
+ }
+ return result;
+ }
+
+ private List<String> getDonors() throws IOException {
+ final List<String> lines = new ArrayList<String>(SkinParam.getPossibleValues());
+ return lines;
+ }
+
+ public DiagramDescription getDescription() {
+ return new DiagramDescription("(Parameters)");
+ }
+
+ public static PSystemSkinparameterList create() {
+ return new PSystemSkinparameterList();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/donors/PSystemSkinparameterListFactory.java b/src/net/sourceforge/plantuml/donors/PSystemSkinparameterListFactory.java
new file mode 100644
index 0000000..c128762
--- /dev/null
+++ b/src/net/sourceforge/plantuml/donors/PSystemSkinparameterListFactory.java
@@ -0,0 +1,51 @@
+/* ========================================================================
+ * 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.donors;
+
+import net.sourceforge.plantuml.AbstractPSystem;
+import net.sourceforge.plantuml.command.PSystemSingleLineFactory;
+
+public class PSystemSkinparameterListFactory extends PSystemSingleLineFactory {
+
+ @Override
+ protected AbstractPSystem executeLine(String line) {
+ if (line.matches("(?i)^(skinparameters)\\s*$")) {
+ return PSystemSkinparameterList.create();
+ }
+ return null;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/eps/EpsGraphics.java b/src/net/sourceforge/plantuml/eps/EpsGraphics.java
index bafd3ac..cf95432 100644
--- a/src/net/sourceforge/plantuml/eps/EpsGraphics.java
+++ b/src/net/sourceforge/plantuml/eps/EpsGraphics.java
@@ -364,6 +364,10 @@ public class EpsGraphics {
appendColor(fillcolor);
epsRectangleInternal(x, y, width, height, rx, ry, true);
append("closepath eofill", true);
+ if (dashSpace != 0 && dashVisible != 0) {
+ append("[] 0 setdash", true);
+ }
+
}
if (color != null) {
@@ -371,6 +375,9 @@ public class EpsGraphics {
appendColor(color);
epsRectangleInternal(x, y, width, height, rx, ry, false);
append("closepath stroke", true);
+ if (dashSpace != 0 && dashVisible != 0) {
+ append("[] 0 setdash", true);
+ }
}
}
@@ -441,20 +448,26 @@ public class EpsGraphics {
}
private void roundRectangle(double x, double y, double width, double height, double rx, double ry) {
+ if (dashSpace != 0 && dashVisible != 0) {
+ append("[" + (int) dashSpace + " " + (int) dashVisible + "] 0 setdash", true);
+ }
append(format(width) + " " + format(height) + " " + format(x) + " " + format(y) + " " + format((rx + ry) / 2)
+ " roundrect", true);
roundrectUsed = true;
}
private void simpleRectangle(double x, double y, double width, double height, boolean fill) {
+ if (dashSpace != 0 && dashVisible != 0) {
+ append("[" + (int) dashSpace + " " + (int) dashVisible + "] 0 setdash", true);
+ }
if ((dashSpace == 0 && dashVisible == 0) || fill) {
append(format(width) + " " + format(height) + " " + format(x) + " " + format(y) + " simplerect", true);
simplerectUsed = true;
- } else {
- epsVLine(y, x, x + width);
- epsVLine(y + height, x, x + width);
- epsHLine(x, y, y + height);
- epsHLine(x + width, y, y + height);
+ // } else {
+ // epsVLine(y, x, x + width);
+ // epsVLine(y + height, x, x + width);
+ // epsHLine(x, y, y + height);
+ // epsHLine(x + width, y, y + height);
}
}
diff --git a/src/net/sourceforge/plantuml/flashcode/FlashCodeUtilsZxing.java b/src/net/sourceforge/plantuml/flashcode/FlashCodeUtilsZxing.java
index 55b3add..d108b85 100644
--- a/src/net/sourceforge/plantuml/flashcode/FlashCodeUtilsZxing.java
+++ b/src/net/sourceforge/plantuml/flashcode/FlashCodeUtilsZxing.java
@@ -40,13 +40,13 @@ import java.util.Hashtable;
import net.sourceforge.plantuml.Log;
-import com.google.zxing.BarcodeFormat;
-import com.google.zxing.EncodeHintType;
-import com.google.zxing.WriterException;
-import com.google.zxing.client.j2se.MatrixToImageWriter;
-import com.google.zxing.common.BitMatrix;
-import com.google.zxing.qrcode.QRCodeWriter;
-import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
+import ext.plantuml.com.google.zxing.BarcodeFormat;
+import ext.plantuml.com.google.zxing.EncodeHintType;
+import ext.plantuml.com.google.zxing.WriterException;
+import ext.plantuml.com.google.zxing.client.j2se.MatrixToImageWriter;
+import ext.plantuml.com.google.zxing.common.BitMatrix;
+import ext.plantuml.com.google.zxing.qrcode.QRCodeWriter;
+import ext.plantuml.com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
public class FlashCodeUtilsZxing implements FlashCodeUtils {
diff --git a/src/net/sourceforge/plantuml/flowdiagram/FlowDiagram.java b/src/net/sourceforge/plantuml/flowdiagram/FlowDiagram.java
index 8078eb8..4b857a7 100644
--- a/src/net/sourceforge/plantuml/flowdiagram/FlowDiagram.java
+++ b/src/net/sourceforge/plantuml/flowdiagram/FlowDiagram.java
@@ -62,6 +62,7 @@ import net.sourceforge.plantuml.graphic.InnerStrategy;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
+import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UEllipse;
@@ -125,9 +126,9 @@ public class FlowDiagram extends UmlDiagram implements TextBlock {
@Override
protected ImageData exportDiagramInternal(OutputStream os, int index, FileFormatOption fileFormatOption)
throws IOException {
- UGraphicUtils.writeImage(os, null, fileFormatOption, seed(), new ColorMapperIdentity(),
- HtmlColorUtils.WHITE, this);
- return new ImageDataSimple();
+ UGraphicUtils.writeImage(os, null, fileFormatOption, seed(), new ColorMapperIdentity(), HtmlColorUtils.WHITE,
+ this);
+ return ImageDataSimple.ok();
}
public void drawU(UGraphic ug) {
@@ -209,4 +210,9 @@ public class FlowDiagram extends UmlDiagram implements TextBlock {
final MinMaxGolem minMax = getMinMax();
return new Dimension2DDouble(minMax.getWidth() * SINGLE_SIZE_X, minMax.getHeight() * SINGLE_SIZE_Y);
}
+
+ public MinMax getMinMax(StringBounder stringBounder) {
+ throw new UnsupportedOperationException();
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/fun/IconLoader.java b/src/net/sourceforge/plantuml/fun/IconLoader.java
index d656a78..0319a26 100644
--- a/src/net/sourceforge/plantuml/fun/IconLoader.java
+++ b/src/net/sourceforge/plantuml/fun/IconLoader.java
@@ -44,7 +44,7 @@ import javax.imageio.ImageIO;
public class IconLoader {
- private static final int NUMBER_OF_ICONS = 21;
+ private static final int NUMBER_OF_ICONS = 25;
private final static Map<String, BufferedImage> all = new ConcurrentHashMap<String, BufferedImage>();
diff --git a/src/net/sourceforge/plantuml/fun/sprite000.png b/src/net/sourceforge/plantuml/fun/sprite000.png
index 48ab597..1f5af4e 100644
--- a/src/net/sourceforge/plantuml/fun/sprite000.png
+++ b/src/net/sourceforge/plantuml/fun/sprite000.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/fun/sprite001.png b/src/net/sourceforge/plantuml/fun/sprite001.png
index 32f121d..751a7a7 100644
--- a/src/net/sourceforge/plantuml/fun/sprite001.png
+++ b/src/net/sourceforge/plantuml/fun/sprite001.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/fun/sprite002.png b/src/net/sourceforge/plantuml/fun/sprite002.png
index dd18318..1c49d82 100644
--- a/src/net/sourceforge/plantuml/fun/sprite002.png
+++ b/src/net/sourceforge/plantuml/fun/sprite002.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/fun/sprite003.png b/src/net/sourceforge/plantuml/fun/sprite003.png
index 429dced..109508f 100644
--- a/src/net/sourceforge/plantuml/fun/sprite003.png
+++ b/src/net/sourceforge/plantuml/fun/sprite003.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/fun/sprite004.png b/src/net/sourceforge/plantuml/fun/sprite004.png
index 6d925f7..bcfb057 100644
--- a/src/net/sourceforge/plantuml/fun/sprite004.png
+++ b/src/net/sourceforge/plantuml/fun/sprite004.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/fun/sprite005.png b/src/net/sourceforge/plantuml/fun/sprite005.png
index fd5f6e7..7516147 100644
--- a/src/net/sourceforge/plantuml/fun/sprite005.png
+++ b/src/net/sourceforge/plantuml/fun/sprite005.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/fun/sprite006.png b/src/net/sourceforge/plantuml/fun/sprite006.png
index f9605ad..37392a6 100644
--- a/src/net/sourceforge/plantuml/fun/sprite006.png
+++ b/src/net/sourceforge/plantuml/fun/sprite006.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/fun/sprite007.png b/src/net/sourceforge/plantuml/fun/sprite007.png
index 817df6c..f277be2 100644
--- a/src/net/sourceforge/plantuml/fun/sprite007.png
+++ b/src/net/sourceforge/plantuml/fun/sprite007.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/fun/sprite008.png b/src/net/sourceforge/plantuml/fun/sprite008.png
index 5b3e95a..354b069 100644
--- a/src/net/sourceforge/plantuml/fun/sprite008.png
+++ b/src/net/sourceforge/plantuml/fun/sprite008.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/fun/sprite009.png b/src/net/sourceforge/plantuml/fun/sprite009.png
index 0a647ba..27852d6 100644
--- a/src/net/sourceforge/plantuml/fun/sprite009.png
+++ b/src/net/sourceforge/plantuml/fun/sprite009.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/fun/sprite010.png b/src/net/sourceforge/plantuml/fun/sprite010.png
index 35a355a..85e9cda 100644
--- a/src/net/sourceforge/plantuml/fun/sprite010.png
+++ b/src/net/sourceforge/plantuml/fun/sprite010.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/fun/sprite011.png b/src/net/sourceforge/plantuml/fun/sprite011.png
index 27e1b63..14af213 100644
--- a/src/net/sourceforge/plantuml/fun/sprite011.png
+++ b/src/net/sourceforge/plantuml/fun/sprite011.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/fun/sprite012.png b/src/net/sourceforge/plantuml/fun/sprite012.png
index d838292..da090f7 100644
--- a/src/net/sourceforge/plantuml/fun/sprite012.png
+++ b/src/net/sourceforge/plantuml/fun/sprite012.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/fun/sprite013.png b/src/net/sourceforge/plantuml/fun/sprite013.png
index 0f65d96..08db06a 100644
--- a/src/net/sourceforge/plantuml/fun/sprite013.png
+++ b/src/net/sourceforge/plantuml/fun/sprite013.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/fun/sprite014.png b/src/net/sourceforge/plantuml/fun/sprite014.png
index 82cb170..95e9361 100644
--- a/src/net/sourceforge/plantuml/fun/sprite014.png
+++ b/src/net/sourceforge/plantuml/fun/sprite014.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/fun/sprite015.png b/src/net/sourceforge/plantuml/fun/sprite015.png
index c30e607..4793b2e 100644
--- a/src/net/sourceforge/plantuml/fun/sprite015.png
+++ b/src/net/sourceforge/plantuml/fun/sprite015.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/fun/sprite016.png b/src/net/sourceforge/plantuml/fun/sprite016.png
index 9f0ceba..da056b1 100644
--- a/src/net/sourceforge/plantuml/fun/sprite016.png
+++ b/src/net/sourceforge/plantuml/fun/sprite016.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/fun/sprite017.png b/src/net/sourceforge/plantuml/fun/sprite017.png
index 40e34ac..0db2bcc 100644
--- a/src/net/sourceforge/plantuml/fun/sprite017.png
+++ b/src/net/sourceforge/plantuml/fun/sprite017.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/fun/sprite018.png b/src/net/sourceforge/plantuml/fun/sprite018.png
index 21e9eaa..879a086 100644
--- a/src/net/sourceforge/plantuml/fun/sprite018.png
+++ b/src/net/sourceforge/plantuml/fun/sprite018.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/fun/sprite019.png b/src/net/sourceforge/plantuml/fun/sprite019.png
index a32ac40..88d94a2 100644
--- a/src/net/sourceforge/plantuml/fun/sprite019.png
+++ b/src/net/sourceforge/plantuml/fun/sprite019.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/fun/sprite020.png b/src/net/sourceforge/plantuml/fun/sprite020.png
index dfd7b5c..01ee77b 100644
--- a/src/net/sourceforge/plantuml/fun/sprite020.png
+++ b/src/net/sourceforge/plantuml/fun/sprite020.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/fun/sprite021.png b/src/net/sourceforge/plantuml/fun/sprite021.png
new file mode 100644
index 0000000..efc0b86
--- /dev/null
+++ b/src/net/sourceforge/plantuml/fun/sprite021.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/fun/sprite022.png b/src/net/sourceforge/plantuml/fun/sprite022.png
new file mode 100644
index 0000000..6640512
--- /dev/null
+++ b/src/net/sourceforge/plantuml/fun/sprite022.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/fun/sprite023.png b/src/net/sourceforge/plantuml/fun/sprite023.png
new file mode 100644
index 0000000..1af6a88
--- /dev/null
+++ b/src/net/sourceforge/plantuml/fun/sprite023.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/fun/sprite024.png b/src/net/sourceforge/plantuml/fun/sprite024.png
new file mode 100644
index 0000000..0a7599d
--- /dev/null
+++ b/src/net/sourceforge/plantuml/fun/sprite024.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/graphic/AbstractTextBlock.java b/src/net/sourceforge/plantuml/graphic/AbstractTextBlock.java
index c935281..5e79926 100644
--- a/src/net/sourceforge/plantuml/graphic/AbstractTextBlock.java
+++ b/src/net/sourceforge/plantuml/graphic/AbstractTextBlock.java
@@ -37,9 +37,15 @@ package net.sourceforge.plantuml.graphic;
import java.awt.geom.Rectangle2D;
+import net.sourceforge.plantuml.ugraphic.MinMax;
+
public abstract class AbstractTextBlock implements TextBlock {
public Rectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
throw new UnsupportedOperationException("member=" + member + " " + getClass().toString());
}
+
+ public MinMax getMinMax(StringBounder stringBounder) {
+ throw new UnsupportedOperationException(getClass().toString());
+ }
} \ No newline at end of file
diff --git a/src/net/sourceforge/plantuml/graphic/DateEventUtils.java b/src/net/sourceforge/plantuml/graphic/DateEventUtils.java
deleted file mode 100644
index 1b3f28e..0000000
--- a/src/net/sourceforge/plantuml/graphic/DateEventUtils.java
+++ /dev/null
@@ -1,165 +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.graphic;
-
-
-public class DateEventUtils {
-
-// private static final String PARIS = "A thought for those who died in Paris the 13th November 2015.";
-//
-// private static TextBlock addEvent(final TextBlock textBlock, final HtmlColor color) {
-// try {
-// final String today = new SimpleDateFormat("MM-dd", Locale.US).format(new Date());
-// if ("11-05".equals(today)) {
-// final List<String> asList = Arrays.asList("<u>November 5th, 1955",
-// "Doc Brown's discovery of the Flux Capacitor, that makes time-travel possible.");
-// return TextBlockUtils.mergeTB(textBlock, getComment(asList, color), HorizontalAlignment.LEFT);
-// } else if ("08-29".equals(today)) {
-// final List<String> asList = Arrays.asList("<u>August 29th, 1997",
-// "Skynet becomes self-aware at 02:14 AM Eastern Time.");
-// return TextBlockUtils.mergeTB(textBlock, getComment(asList, color), HorizontalAlignment.LEFT);
-// } else if ("06-29".equals(today)) {
-// final List<String> asList = Arrays.asList("<u>June 29th, 1975",
-// "\"It was the first time in history that anyone had typed",
-// "a character on a keyboard and seen it show up on their",
-// "own computer's screen right in front of them.\"", "\t\t\t\t\t\t\t\t\t\t<i>Steve Wozniak");
-// return TextBlockUtils.mergeTB(textBlock, getComment(asList, color), HorizontalAlignment.LEFT);
-// } else if ("01-07".equals(today) || ("01-08".equals(today) && getDayOfWeek() == Calendar.MONDAY)) {
-// return addCharlie(textBlock);
-// } else if ("11-13".equals(today) || ("11-14".equals(today) && getDayOfWeek() == Calendar.MONDAY)) {
-// return addMemorial(textBlock, color);
-// }
-// } catch (Throwable t) {
-// Log.debug("Error " + t);
-// }
-// return textBlock;
-// }
-//
-// private synchronized static int getDayOfWeek() {
-// return Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
-// }
-//
-// private static TextBlock addMemorial(TextBlock textBlock, HtmlColor color) {
-// final Portrait portrait = Portraits.getOne();
-// if (portrait == null) {
-// return textBlock;
-// }
-// final BufferedImage im = portrait.getBufferedImage();
-// if (im == null) {
-// return textBlock;
-// }
-//
-// final String name = portrait.getName();
-// final String quote = portrait.getQuote();
-// final String age = "" + portrait.getAge() + " years old";
-// final UFont font12 = new UFont("SansSerif", Font.BOLD, 12);
-// TextBlock comment = Display.create(name, age, quote).create(
-// new FontConfiguration(font12, color, HtmlColorUtils.BLUE, true), HorizontalAlignment.LEFT,
-// new SpriteContainerEmpty());
-// comment = TextBlockUtils.withMinWidth(TextBlockUtils.withMargin(comment, 4, 4), 800, HorizontalAlignment.LEFT);
-//
-// final TextBlock bottom0 = getComment(Arrays.asList(PARIS), color);
-// final TextBlock bottom1 = new AbstractTextBlock() {
-// private double margin = 10;
-//
-// public void drawU(UGraphic ug) {
-// ug = ug.apply(new UTranslate(0, margin));
-// ug.draw(new UImage(im));
-// if (ug instanceof LimitFinder) {
-// return;
-// }
-// Portraits.nextOne();
-// }
-//
-// public Dimension2D calculateDimension(StringBounder stringBounder) {
-// return new Dimension2DDouble(im.getWidth(), margin + im.getHeight());
-// }
-// };
-// final TextBlock bottom = TextBlockUtils.mergeTB(bottom0,
-// TextBlockUtils.mergeLR(bottom1, comment, VerticalAlignment.CENTER), HorizontalAlignment.LEFT);
-// final TextBlock mergeTB = TextBlockUtils.mergeTB(textBlock, bottom, HorizontalAlignment.LEFT);
-// return addMajesty(mergeTB, color);
-// }
-//
-// public static TextBlock addMajesty(TextBlock block, HtmlColor color) {
-// final UFont font12 = new UFont("SansSerif", Font.BOLD, 12);
-// final String arabic1 = "<size:16>\u0625\u0646 \u0627\u0644\u0625\u0631\u0647\u0627\u0628\u064A\u064A\u0646 \u0628\u0627\u0633\u0645 \u0627\u0644\u0625\u0633\u0644\u0627\u0645 \u0644\u064A\u0633\u0648\u0627 \u0645\u0633\u0644\u0645\u064A\u0646\u060C \u0648\u0644\u0627 \u064A\u0631\u0628\u0637\u0647\u0645 \u0628\u0627\u0644\u0625\u0633\u0644\u0627\u0645 \u0625\u0644\u0627 \u0627\u0644\u062F\u0648\u0627\u0641\u0639 \u0627\u0644\u062A\u064A \u064A\u0631\u0643\u0628\u0648\u0646 \u0639\u0644\u064A\u0647\u0627 \u0644\u062A\u0628\u0631\u064A\u0631 \u062C\u0631\u0627\u0626\u0645\u0647\u0645 \u0648\u062D\u0645\u0627\u0642\u0627\u062A\u0647\u0645.";
-// final String arabic2 = "<size:16>\u0641\u0647\u0645 \u0642\u0648\u0645 \u0636\u0627\u0644\u0648\u0646\u060C \u0645\u0635\u064A\u0631\u0647\u0645 \u062C\u0647\u0646\u0645 \u062E\u0627\u0644\u062F\u064A\u0646 \u0641\u064A\u0647\u0627 \u0623\u0628\u062F\u0627.";
-// final String english1 = "<size:10>Those who engage in terrorism, in the name of Islam, are not Muslims.";
-// final String english2 = "<size:10>Their only link to Islam is the pretexts they use to justify their crimes and their folly.";
-// final String english3 = "<size:10>They have strayed from the right path, and their fate is to dwell forever in hell.";
-// final TextBlock arabic = Display
-// .create(" ",
-// arabic1,
-// arabic2,
-// "<size:16>\u0635\u0627\u062D\u0628 \u0627\u0644\u062C\u0644\u0627\u0644\u0629 \u0627\u0644\u0645\u0644\u0643 \u0645\u062D\u0645\u062F \u0627\u0644\u0633\u0627\u062F\u0633 \u0623\u0645\u064A\u0631 \u0627\u0644\u0645\u0624\u0645\u0646\u064A\u0646 \u0646\u0635\u0631\u0647 \u0627\u0644\u0644\u0647")
-// .create(new FontConfiguration(font12, color, HtmlColorUtils.BLUE, true), HorizontalAlignment.RIGHT,
-// new SpriteContainerEmpty());
-// final TextBlock english = Display.create(english1, english2, english3,
-// "<size:10>-- His Majesty the King Mohammed the Sixth, Commander of the Faithful").create(
-// new FontConfiguration(font12, color, HtmlColorUtils.BLUE, true), HorizontalAlignment.LEFT,
-// new SpriteContainerEmpty());
-// return TextBlockUtils.mergeTB(block, TextBlockUtils.mergeTB(arabic, english, HorizontalAlignment.LEFT),
-// HorizontalAlignment.LEFT);
-// }
-//
-// private static TextBlock addCharlie(TextBlock textBlock) {
-// final TextBlock charlie = new AbstractTextBlock() {
-// private final BufferedImage charlie = PSystemVersion.getCharlieImage();
-//
-// public void drawU(UGraphic ug) {
-// ug.draw(new UImage(charlie));
-// }
-//
-// public Dimension2D calculateDimension(StringBounder stringBounder) {
-// return new Dimension2DDouble(charlie.getWidth(), charlie.getHeight());
-// }
-// };
-// return TextBlockUtils.mergeTB(charlie, textBlock, HorizontalAlignment.LEFT);
-//
-// }
-//
-// public static TextBlock getComment(final List<String> asList, HtmlColor color) {
-// final UFont font = UFont.sansSerif(14).bold();
-// TextBlock comment = Display.create(asList).create(
-// new FontConfiguration(font, color, HtmlColorUtils.BLUE, true), HorizontalAlignment.LEFT,
-// new SpriteContainerEmpty());
-// comment = TextBlockUtils.withMargin(comment, 4, 4);
-// comment = new SimpleTextBlockBordered(comment, color);
-// comment = TextBlockUtils.withMargin(comment, 10, 10);
-// return comment;
-// }
-}
diff --git a/src/net/sourceforge/plantuml/graphic/GraphicStrings.java b/src/net/sourceforge/plantuml/graphic/GraphicStrings.java
index bca81dc..2af9e79 100644
--- a/src/net/sourceforge/plantuml/graphic/GraphicStrings.java
+++ b/src/net/sourceforge/plantuml/graphic/GraphicStrings.java
@@ -35,7 +35,6 @@
*/
package net.sourceforge.plantuml.graphic;
-import java.awt.Font;
import java.awt.geom.Dimension2D;
import java.awt.image.BufferedImage;
import java.util.List;
diff --git a/src/net/sourceforge/plantuml/graphic/HorizontalAlignment.java b/src/net/sourceforge/plantuml/graphic/HorizontalAlignment.java
index 90edda7..01d3616 100644
--- a/src/net/sourceforge/plantuml/graphic/HorizontalAlignment.java
+++ b/src/net/sourceforge/plantuml/graphic/HorizontalAlignment.java
@@ -69,4 +69,8 @@ public enum HorizontalAlignment {
return result;
}
+ public String getGraphVizValue() {
+ return toString().substring(0, 1).toLowerCase();
+ }
+
} \ No newline at end of file
diff --git a/src/net/sourceforge/plantuml/graphic/HtmlColorAndStyle.java b/src/net/sourceforge/plantuml/graphic/HtmlColorAndStyle.java
index 8fa061b..8780028 100644
--- a/src/net/sourceforge/plantuml/graphic/HtmlColorAndStyle.java
+++ b/src/net/sourceforge/plantuml/graphic/HtmlColorAndStyle.java
@@ -64,7 +64,7 @@ public class HtmlColorAndStyle {
}
private HtmlColorAndStyle(HtmlColor color) {
- this(color, LinkStyle.NORMAL);
+ this(color, LinkStyle.NORMAL());
}
public HtmlColorAndStyle(HtmlColor color, LinkStyle style) {
@@ -85,11 +85,11 @@ public class HtmlColorAndStyle {
public static HtmlColorAndStyle build(ISkinParam skinParam, String definition) {
HtmlColor color = build(skinParam).getColors().get(0).color;
- LinkStyle style = LinkStyle.NORMAL;
+ LinkStyle style = LinkStyle.NORMAL();
final IHtmlColorSet set = skinParam.getIHtmlColorSet();
for (String s : definition.split(",")) {
- final LinkStyle tmpStyle = LinkStyle.fromString(s);
- if (tmpStyle != LinkStyle.NORMAL) {
+ final LinkStyle tmpStyle = LinkStyle.fromString1(s);
+ if (tmpStyle.isNormal() == false) {
style = tmpStyle;
continue;
}
diff --git a/src/net/sourceforge/plantuml/graphic/HtmlColorAutomatic.java b/src/net/sourceforge/plantuml/graphic/HtmlColorAutomatic.java
new file mode 100644
index 0000000..c1e1783
--- /dev/null
+++ b/src/net/sourceforge/plantuml/graphic/HtmlColorAutomatic.java
@@ -0,0 +1,39 @@
+/* ========================================================================
+ * 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.graphic;
+
+public class HtmlColorAutomatic implements HtmlColor {
+
+}
diff --git a/src/net/sourceforge/plantuml/graphic/HtmlColorSetSimple.java b/src/net/sourceforge/plantuml/graphic/HtmlColorSetSimple.java
index 26cecca..27e9019 100644
--- a/src/net/sourceforge/plantuml/graphic/HtmlColorSetSimple.java
+++ b/src/net/sourceforge/plantuml/graphic/HtmlColorSetSimple.java
@@ -255,6 +255,8 @@ public class HtmlColorSetSimple implements IHtmlColorSet {
final Color color;
if (s.equalsIgnoreCase("transparent")) {
return new HtmlColorTransparent();
+ } else if (s.equalsIgnoreCase("automatic")) {
+ return new HtmlColorAutomatic();
} else if (s.matches("[0-9A-Fa-f]{3}")) {
s = "" + s.charAt(0) + s.charAt(0) + s.charAt(1) + s.charAt(1) + s.charAt(2) + s.charAt(2);
color = new Color(Integer.parseInt(s, 16));
@@ -278,6 +280,9 @@ public class HtmlColorSetSimple implements IHtmlColorSet {
if (s.matches("[0-9A-Fa-f]{6}")) {
return true;
}
+ if (s.equalsIgnoreCase("automatic")) {
+ return true;
+ }
if (acceptTransparent && s.equalsIgnoreCase("transparent")) {
return true;
}
diff --git a/src/net/sourceforge/plantuml/graphic/Img.java b/src/net/sourceforge/plantuml/graphic/Img.java
index d9c75f9..32aa113 100644
--- a/src/net/sourceforge/plantuml/graphic/Img.java
+++ b/src/net/sourceforge/plantuml/graphic/Img.java
@@ -36,7 +36,6 @@
package net.sourceforge.plantuml.graphic;
import java.awt.image.BufferedImage;
-import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
@@ -44,9 +43,8 @@ import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
-import javax.imageio.ImageIO;
-
import net.sourceforge.plantuml.FileSystem;
+import net.sourceforge.plantuml.FileUtils;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
@@ -102,8 +100,9 @@ public class Img implements HtmlCommand {
if (f.exists() == false) {
// Check if valid URL
if (src.startsWith("http:") || src.startsWith("https:")) {
- final byte image[] = getFile(src);
- final BufferedImage read = ImageIO.read(new ByteArrayInputStream(image));
+// final byte image[] = getFile(src);
+// final BufferedImage read = ImageIO.read(new ByteArrayInputStream(image));
+ final BufferedImage read = FileUtils.ImageIO_read(new URL(src));
if (read == null) {
return new Text("(Cannot decode: " + src + ")");
}
@@ -114,11 +113,11 @@ public class Img implements HtmlCommand {
if (f.getName().endsWith(".svg")) {
return new Img(new TileImageSvg(f));
}
- final BufferedImage read = ImageIO.read(f);
+ final BufferedImage read = FileUtils.ImageIO_read(f);
if (read == null) {
return new Text("(Cannot decode: " + f + ")");
}
- return new Img(new TileImage(ImageIO.read(f), valign, vspace));
+ return new Img(new TileImage(FileUtils.ImageIO_read(f), valign, vspace));
} catch (IOException e) {
return new Text("ERROR " + e.toString());
}
diff --git a/src/net/sourceforge/plantuml/graphic/QuoteUtils.java b/src/net/sourceforge/plantuml/graphic/QuoteUtils.java
index b9024b9..a335490 100644
--- a/src/net/sourceforge/plantuml/graphic/QuoteUtils.java
+++ b/src/net/sourceforge/plantuml/graphic/QuoteUtils.java
@@ -177,7 +177,6 @@ public class QuoteUtils {
"Fbzrgvzrf jr pbzr ynfg ohg jr qvq bhe orfg",
"Vs lbh frr fbzrguvat, fnl fbzrguvat",
"Va gurbel gurer vf ab qvssrerapr orgjrra gurbel naq cenpgvpr. Ohg, va cenpgvpr, gurer vf.",
- "Qnlyvtug, V zhfg jnvg sbe gur fhaevfr. V zhfg guvax bs n arj yvsr. Naq V zhfga'g tvir va.",
"Vs V pnaabg oevat lbh pbzsbeg gura ng yrnfg V oevat lbh ubcr",
"Jr nyy zhfg yrnea sebz fznyy zvfsbeghar, pbhag gur oyrffvatf gung ner erny",
"Cercner Guerr Frnyrq Rairybcrf...",
@@ -231,10 +230,34 @@ public class QuoteUtils {
"Vtabenapr oevatf punbf, abg xabjyrqtr.", "Yrneavat vf nyjnlf n cnvashy cebprff.",
"V'z fbeel, ner lbh sebz gur cnfg ?", "Unir lbh gevrq gheavat vg bss naq ba ntnva ?",
"Vs lbh qba'g xabj jurer lbh ner tbvat nal ebnq pna gnxr lbh gurer",
- "Ortva ng gur ortvaavat, naq tb ba gvyy lbh pbzr gb gur raq: gura fgbc",
"Xrrc pnyz naq cerff Pgey-Nyg-Qry", "Vs lbh glcr Tbbtyr vagb Tbbtyr, lbh pna oernx gur Vagrearg.",
"V unir cneg bs n cyna.", "V'z cerggl fher gur nafjre vf: V nz Tebbg.",
- "Nalguvat gung pna cbffvoyl tb jebat, qbrf", "Cyhf pn engr, cyhf ba n qr punapr dhr pn znepur");
+ "Nalguvat gung pna cbffvoyl tb jebat, qbrf", "Cyhf pn engr, cyhf ba n qr punapr dhr pn znepur",
+ "Fb V thrff gur sbeghar gryyre'f evtug...", "Jura rirelguvat'f tbar jebat fbzrubj...",
+ "V qba'g jnag gb yvir ba guvf cynarg nalzber",
+ "Oba, p'rfg y'urher bh yrf fbhiravef fr enzrarag...",
+ "Fhpprff pbafvfgf bs tbvat sebz snvyher gb snvyher jvgubhg ybff bs raguhfvnfz",
+ "Vs lbh'er tbvat guebhtu uryy, xrrc tbvat",
+ "Jre xnzcsg, xnaa ireyvrera. Jre avpug xnzcsg, ung fpuba ireybera.",
+ "P'rfg nh cvrq qh zhe dhr y'ba ibvg yr zvrhk yr zhe.",
+ "Jr xabj ubj uhznaf jbex. Gurl ner nyy fb cerqvpgnoyr.",
+ "Gur qbtznf bs gur dhvrg cnfg ner vanqrdhngr gb gur fgbezl cerfrag",
+ "Ab jnl gb cerirag guvf, fnlf bayl angvba jurer guvf erthyneyl unccraf",
+ "L'n dhrydhrf dhrfgvbaf dhv erfgrag fbhf fvyrapr...",
+ "Vs gurer vf ab fbyhgvba, gurer vf ab ceboyrz",
+ "V unir zrzbevrf, ohg V pna'g gryy vs gurl'er erny.", "L n pbzzr ha tbhg nzre ra abhf",
+ "L n qrf fvyraprf dhv qvfrag ornhpbhc", "V frr lbh'ir unq fbzr qvfpvcyvanel ceboyrzf va gur cnfg.",
+ "Cercnengvba vf gur xrl gb fhpprffshy, vapbafcvphbhf gvzr geniry.",
+ "Vg'f arire gbb yngr gb or jub lbh zvtug unir orra.",
+ "Rg cbhe nyyre purm Zvpxrl vyf ibag fherzrag cnf pbafgehver har tner gbhf yrf 100 zrgerf",
+ "Nyy lbhe onfr ner orybat gb hf", "Znqr ba Rnegu ol uhznaf", "Jvaaref Qba'g Hfr Qehtf",
+ "Lbh xabj jung fhecevfrq zr gur zbfg? Vg jnfa'g zrrgvat gurz. Vg jnf zrrgvat lbh.",
+ "Va jne gurer ner ab jvaaref, bayl jvqbjf",
+ "Vs lbh guvax guvf Havirefr vf onq, lbh fubhyq frr fbzr bs gur bguref", "Cnp-Zna'f n onq thl?",
+ "Zl ernyvgl vf whfg qvssrerag guna lbhef",
+ "Uvfgbel vf n avtugzner sebz juvpu V nz gelvat gb njnxr",
+ "L'ra n dh'bag rffnlr, vyf bag rh qrf ceboyrzrf",
+ "Gb ree vf uhzna, ohg gb ernyyl sbhy guvatf hc erdhverf n pbzchgre.");
private QuoteUtils() {
}
diff --git a/src/net/sourceforge/plantuml/graphic/SkinParameter.java b/src/net/sourceforge/plantuml/graphic/SkinParameter.java
index f55cecd..86f1d5d 100644
--- a/src/net/sourceforge/plantuml/graphic/SkinParameter.java
+++ b/src/net/sourceforge/plantuml/graphic/SkinParameter.java
@@ -36,6 +36,7 @@
package net.sourceforge.plantuml.graphic;
import net.sourceforge.plantuml.ColorParam;
+import net.sourceforge.plantuml.CornerParam;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineParam;
@@ -51,7 +52,8 @@ public class SkinParameter {
ColorParam.artifactBorder, FontParam.ARTIFACT, FontParam.ARTIFACT_STEREOTYPE);
public static final SkinParameter COMPONENT1 = new SkinParameter("COMPONENT1", ColorParam.componentBackground,
- ColorParam.componentBorder, FontParam.COMPONENT, FontParam.COMPONENT_STEREOTYPE);
+ ColorParam.componentBorder, FontParam.COMPONENT, FontParam.COMPONENT_STEREOTYPE, LineParam.componentBorder,
+ CornerParam.component);
public static final SkinParameter NODE = new SkinParameter("NODE", ColorParam.nodeBackground,
ColorParam.nodeBorder, FontParam.NODE, FontParam.NODE_STEREOTYPE);
@@ -72,10 +74,11 @@ public class SkinParameter {
ColorParam.frameBorder, FontParam.FRAME, FontParam.FRAME_STEREOTYPE);
public static final SkinParameter COMPONENT2 = new SkinParameter("COMPONENT2", ColorParam.componentBackground,
- ColorParam.componentBorder, FontParam.COMPONENT, FontParam.COMPONENT_STEREOTYPE);
+ ColorParam.componentBorder, FontParam.COMPONENT, FontParam.COMPONENT_STEREOTYPE, LineParam.componentBorder,
+ CornerParam.component);
public static final SkinParameter AGENT = new SkinParameter("AGENT", ColorParam.agentBackground,
- ColorParam.agentBorder, FontParam.AGENT, FontParam.AGENT_STEREOTYPE);
+ ColorParam.agentBorder, FontParam.AGENT, FontParam.AGENT_STEREOTYPE, LineParam.agentBorder, CornerParam.agent);
public static final SkinParameter FOLDER = new SkinParameter("FOLDER", ColorParam.folderBackground,
ColorParam.folderBorder, FontParam.FOLDER, FontParam.FOLDER_STEREOTYPE);
@@ -86,15 +89,23 @@ public class SkinParameter {
public static final SkinParameter PACKAGE = new SkinParameter("PACKAGE", ColorParam.packageBackground,
ColorParam.packageBorder, FontParam.FOLDER, FontParam.FOLDER_STEREOTYPE);
- public static final SkinParameter CARD = new SkinParameter("CARD", ColorParam.rectangleBackground,
- ColorParam.rectangleBorder, FontParam.RECTANGLE, FontParam.RECTANGLE_STEREOTYPE);
+ public static final SkinParameter CARD = new SkinParameter("CARD", ColorParam.cardBackground,
+ ColorParam.cardBorder, FontParam.CARD, FontParam.CARD_STEREOTYPE, LineParam.cardBorder,
+ CornerParam.card);
public static final SkinParameter RECTANGLE = new SkinParameter("RECTANGLE", ColorParam.rectangleBackground,
- ColorParam.rectangleBorder, FontParam.RECTANGLE, FontParam.RECTANGLE_STEREOTYPE);
+ ColorParam.rectangleBorder, FontParam.RECTANGLE, FontParam.RECTANGLE_STEREOTYPE, LineParam.rectangleBorder,
+ CornerParam.rectangle);
+
+ public static final SkinParameter COLLECTIONS = new SkinParameter("COLLECTIONS", ColorParam.collectionsBackground,
+ ColorParam.collectionsBorder, FontParam.RECTANGLE, FontParam.RECTANGLE_STEREOTYPE);
public static final SkinParameter ACTOR = new SkinParameter("ACTOR", ColorParam.actorBackground,
ColorParam.actorBorder, FontParam.ACTOR, FontParam.ACTOR_STEREOTYPE);
+ public static final SkinParameter USECASE = new SkinParameter("USECASE", ColorParam.usecaseBackground,
+ ColorParam.usecaseBorder, FontParam.USECASE, FontParam.USECASE_STEREOTYPE);
+
public static final SkinParameter BOUNDARY = new SkinParameter("BOUNDARY", ColorParam.boundaryBackground,
ColorParam.boundaryBorder, FontParam.BOUNDARY, FontParam.BOUNDARY_STEREOTYPE);
@@ -112,14 +123,23 @@ public class SkinParameter {
private final FontParam fontParam;
private final FontParam fontParamStereotype;
private final String name;
+ private final LineParam lineParam;
+ private final CornerParam roundParam;
private SkinParameter(String name, ColorParam colorParamBack, ColorParam colorParamBorder, FontParam fontParam,
- FontParam fontParamStereotype) {
+ FontParam fontParamStereotype, LineParam lineParam, CornerParam roundParam) {
this.name = name;
this.colorParamBack = colorParamBack;
this.colorParamBorder = colorParamBorder;
this.fontParam = fontParam;
this.fontParamStereotype = fontParamStereotype;
+ this.lineParam = lineParam;
+ this.roundParam = roundParam;
+ }
+
+ private SkinParameter(String name, ColorParam colorParamBack, ColorParam colorParamBorder, FontParam fontParam,
+ FontParam fontParamStereotype) {
+ this(name, colorParamBack, colorParamBorder, fontParam, fontParamStereotype, null, CornerParam.DEFAULT);
}
public String getUpperCaseName() {
@@ -146,13 +166,17 @@ public class SkinParameter {
}
public double getRoundCorner(ISkinParam skinParam, Stereotype stereotype) {
- return skinParam.getRoundCorner(name.toLowerCase(), stereotype);
+ return skinParam.getRoundCorner(roundParam, stereotype);
+ }
+
+ public double getDiagonalCorner(ISkinParam skinParam, Stereotype stereotype) {
+ return skinParam.getDiagonalCorner(roundParam, stereotype);
}
public UStroke getStroke(ISkinParam skinParam, Stereotype stereotype) {
UStroke result = null;
- if (name.equals("RECTANGLE")) {
- result = skinParam.getThickness(LineParam.rectangleBorder, stereotype);
+ if (lineParam != null) {
+ result = skinParam.getThickness(lineParam, stereotype);
}
if (result == null) {
result = new UStroke(1.5);
diff --git a/src/net/sourceforge/plantuml/graphic/Splitter.java b/src/net/sourceforge/plantuml/graphic/Splitter.java
index a58a2c6..8eca8ab 100644
--- a/src/net/sourceforge/plantuml/graphic/Splitter.java
+++ b/src/net/sourceforge/plantuml/graphic/Splitter.java
@@ -65,7 +65,7 @@ public class Splitter {
public static final String spritePattern = "\\<\\$" + SpriteUtils.SPRITE_NAME + "(?:\\{scale=(?:[0-9.]+)\\})?"
+ "\\>";
public static final String spritePattern2 = "\\<\\$(" + SpriteUtils.SPRITE_NAME + ")"
- + "(\\{scale=(?:[0-9.]+)\\})?" + "\\>";
+ + "((?:\\{scale=|\\*)(?:[0-9.]+)\\}?)?" + "\\>";
static final String htmlTag;
static final String linkPattern = "\\[\\[([^\\[\\]]+)\\]\\]";
diff --git a/src/net/sourceforge/plantuml/graphic/SymbolContext.java b/src/net/sourceforge/plantuml/graphic/SymbolContext.java
index ad0d32f..b6e0c1e 100644
--- a/src/net/sourceforge/plantuml/graphic/SymbolContext.java
+++ b/src/net/sourceforge/plantuml/graphic/SymbolContext.java
@@ -48,18 +48,17 @@ public class SymbolContext {
private final boolean shadowing;
private final double deltaShadow;
private final double roundCorner;
+ private final double diagonalCorner;
private SymbolContext(HtmlColor backColor, HtmlColor foreColor, UStroke stroke, boolean shadowing,
- double deltaShadow, double roundCorner) {
+ double deltaShadow, double roundCorner, double diagonalCorner) {
this.backColor = backColor;
this.foreColor = foreColor;
this.stroke = stroke;
this.shadowing = shadowing;
this.deltaShadow = deltaShadow;
this.roundCorner = roundCorner;
- // if (backColor instanceof HtmlColorTransparent) {
- // throw new UnsupportedOperationException();
- // }
+ this.diagonalCorner = diagonalCorner;
}
@Override
@@ -68,43 +67,54 @@ public class SymbolContext {
}
final public UGraphic apply(UGraphic ug) {
- return applyStroke(applyColors(ug));
+ ug = applyColors(ug);
+ ug = applyStroke(ug);
+ return ug;
}
public UGraphic applyColors(UGraphic ug) {
- return ug.apply(new UChangeColor(foreColor)).apply(new UChangeBackColor(backColor));
+ ug = ug.apply(new UChangeColor(foreColor));
+ ug = ug.apply(new UChangeBackColor(backColor));
+ return ug;
}
public UGraphic applyStroke(UGraphic ug) {
return ug.apply(stroke);
}
+ public SymbolContext transparentBackColorToNull() {
+ if (backColor instanceof HtmlColorTransparent) {
+ return new SymbolContext(null, foreColor, stroke, shadowing, deltaShadow, roundCorner, diagonalCorner);
+ }
+ return this;
+ }
+
public SymbolContext(HtmlColor backColor, HtmlColor foreColor) {
- this(backColor, foreColor, new UStroke(), false, 0, 0);
+ this(backColor, foreColor, new UStroke(), false, 0, 0, 0);
}
public SymbolContext withShadow(boolean newShadow) {
- return new SymbolContext(backColor, foreColor, stroke, newShadow, deltaShadow, roundCorner);
+ return new SymbolContext(backColor, foreColor, stroke, newShadow, deltaShadow, roundCorner, diagonalCorner);
}
public SymbolContext withDeltaShadow(double deltaShadow) {
- return new SymbolContext(backColor, foreColor, stroke, shadowing, deltaShadow, roundCorner);
+ return new SymbolContext(backColor, foreColor, stroke, shadowing, deltaShadow, roundCorner, diagonalCorner);
}
public SymbolContext withStroke(UStroke newStroke) {
- return new SymbolContext(backColor, foreColor, newStroke, shadowing, deltaShadow, roundCorner);
+ return new SymbolContext(backColor, foreColor, newStroke, shadowing, deltaShadow, roundCorner, diagonalCorner);
}
public SymbolContext withBackColor(HtmlColor backColor) {
- return new SymbolContext(backColor, foreColor, stroke, shadowing, deltaShadow, roundCorner);
+ return new SymbolContext(backColor, foreColor, stroke, shadowing, deltaShadow, roundCorner, diagonalCorner);
}
public SymbolContext withForeColor(HtmlColor foreColor) {
- return new SymbolContext(backColor, foreColor, stroke, shadowing, deltaShadow, roundCorner);
+ return new SymbolContext(backColor, foreColor, stroke, shadowing, deltaShadow, roundCorner, diagonalCorner);
}
- public SymbolContext withRoundCorner(double roundCorner) {
- return new SymbolContext(backColor, foreColor, stroke, shadowing, deltaShadow, roundCorner);
+ public SymbolContext withCorner(double roundCorner, double diagonalCorner) {
+ return new SymbolContext(backColor, foreColor, stroke, shadowing, deltaShadow, roundCorner, diagonalCorner);
}
public HtmlColor getBackColor() {
@@ -131,4 +141,8 @@ public class SymbolContext {
return roundCorner;
}
+ public double getDiagonalCorner() {
+ return diagonalCorner;
+ }
+
} \ No newline at end of file
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlock.java b/src/net/sourceforge/plantuml/graphic/TextBlock.java
index 2ff628f..c21a0da 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlock.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlock.java
@@ -38,13 +38,15 @@ package net.sourceforge.plantuml.graphic;
import java.awt.geom.Dimension2D;
import java.awt.geom.Rectangle2D;
+import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UShape;
public interface TextBlock extends UDrawable, UShape {
public Dimension2D calculateDimension(StringBounder stringBounder);
-
- public Rectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy);
+ public MinMax getMinMax(StringBounder stringBounder);
+
+ public Rectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy);
} \ No newline at end of file
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockBordered.java b/src/net/sourceforge/plantuml/graphic/TextBlockBordered.java
index dadebaa..e9e6a41 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockBordered.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockBordered.java
@@ -95,16 +95,28 @@ public class TextBlockBordered extends AbstractTextBlock implements TextBlock {
return ug.apply(stroke);
}
+ private boolean noBorder() {
+ if (stroke == null) {
+ return false;
+ }
+ return stroke.getThickness() == 0;
+ }
+
public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder();
final Shadowable polygon = getPolygonNormal(stringBounder);
+ final UGraphic ugOriginal = ug;
if (withShadow) {
polygon.setDeltaShadow(4);
}
- ug = ug.apply(new UChangeBackColor(backgroundColor)).apply(new UChangeColor(borderColor));
- ug = applyStroke(ug);
+ if (noBorder()) {
+ ug = ug.apply(new UChangeBackColor(backgroundColor)).apply(new UChangeColor(backgroundColor));
+ } else {
+ ug = ug.apply(new UChangeBackColor(backgroundColor)).apply(new UChangeColor(borderColor));
+ ug = applyStroke(ug);
+ }
ug.draw(polygon);
- textBlock.drawU(ug.apply(new UTranslate(marginX, marginY)));
+ textBlock.drawU(ugOriginal.apply(new UTranslate(marginX, marginY)));
}
private Shadowable getPolygonNormal(final StringBounder stringBounder) {
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java b/src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java
index 94fd268..6bbe9fd 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java
@@ -51,12 +51,29 @@ public class TextBlockRecentred extends AbstractTextBlock implements TextBlockBa
}
public void drawU(final UGraphic ug) {
- final MinMax minMax = TextBlockUtils.getMinMax(textBlock, ug.getStringBounder());
+ StringBounder stringBounder = ug.getStringBounder();
+ final MinMax minMax = getMinMax(stringBounder);
textBlock.drawU(ug.apply(new UTranslate(-minMax.getMinX(), -minMax.getMinY())));
}
+ // private MinMax cachedMinMax;
+
+ public MinMax getMinMax(StringBounder stringBounder) {
+ return textBlock.getMinMax(stringBounder);
+ // if (cachedMinMax == null) {
+ // cachedMinMax = getMinMaxSlow(stringBounder);
+ // }
+ // // assert cachedMinMax.toString().equals(getMinMaxSlow(stringBounder).toString());
+ // return cachedMinMax;
+ }
+
+ // private MinMax getMinMaxSlow(StringBounder stringBounder) {
+ // final MinMax result = TextBlockUtils.getMinMax(textBlock, stringBounder);
+ // return result;
+ // }
+
public Dimension2D calculateDimension(StringBounder stringBounder) {
- final MinMax minMax = TextBlockUtils.getMinMax(textBlock, stringBounder);
+ final MinMax minMax = getMinMax(stringBounder);
return minMax.getDimension();
}
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockTitle.java b/src/net/sourceforge/plantuml/graphic/TextBlockTitle.java
index 0c449db..175322d 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockTitle.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockTitle.java
@@ -43,6 +43,7 @@ import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
@@ -56,7 +57,8 @@ public class TextBlockTitle implements TextBlock {
if (stringsToDisplay.size() == 1 && stringsToDisplay.get(0).length() == 0) {
throw new IllegalArgumentException();
}
- textBlock = stringsToDisplay.create(font, HorizontalAlignment.CENTER, spriteContainer, LineBreakStrategy.NONE,
+ final LineBreakStrategy lineBreak = LineBreakStrategy.NONE;
+ textBlock = stringsToDisplay.create(font, HorizontalAlignment.CENTER, spriteContainer, lineBreak,
CreoleMode.FULL, null, null);
}
@@ -71,6 +73,10 @@ public class TextBlockTitle implements TextBlock {
return new Dimension2DDouble(width, height);
}
+ public MinMax getMinMax(StringBounder stringBounder) {
+ throw new UnsupportedOperationException();
+ }
+
public Rectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
return null;
}
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockUtils.java b/src/net/sourceforge/plantuml/graphic/TextBlockUtils.java
index a668434..4dd8e2c 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockUtils.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockUtils.java
@@ -46,6 +46,7 @@ import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import net.sourceforge.plantuml.ColorParam;
+import net.sourceforge.plantuml.CornerParam;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineParam;
@@ -81,7 +82,7 @@ public class TextBlockUtils {
if (borderColor == null) {
borderColor = HtmlColorUtils.BLACK;
}
- final double corner = skinParam.getRoundCorner("titleBorder", null);
+ final double corner = skinParam.getRoundCorner(CornerParam.titleBorder, null);
return withMargin(bordered(result, stroke, borderColor, backgroundColor, corner), 2, 2);
}
@@ -164,6 +165,10 @@ public class TextBlockUtils {
public Dimension2D calculateDimension(StringBounder stringBounder) {
return bloc.calculateDimension(stringBounder);
}
+
+ public MinMax getMinMax(StringBounder stringBounder) {
+ return bloc.getMinMax(stringBounder);
+ }
public Rectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
if (strategy.check(display, member)) {
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockWithUrl.java b/src/net/sourceforge/plantuml/graphic/TextBlockWithUrl.java
index cf20159..5c32a4c 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockWithUrl.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockWithUrl.java
@@ -39,6 +39,7 @@ import java.awt.geom.Dimension2D;
import java.awt.geom.Rectangle2D;
import net.sourceforge.plantuml.Url;
+import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UGraphic;
public class TextBlockWithUrl implements TextBlock {
@@ -68,6 +69,10 @@ public class TextBlockWithUrl implements TextBlock {
public Dimension2D calculateDimension(StringBounder stringBounder) {
return block.calculateDimension(stringBounder);
}
+
+ public MinMax getMinMax(StringBounder stringBounder) {
+ return block.getMinMax(stringBounder);
+ }
public Rectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
return block.getInnerPosition(member, stringBounder, strategy);
diff --git a/src/net/sourceforge/plantuml/graphic/UGraphicAddAriaLabel.java b/src/net/sourceforge/plantuml/graphic/UGraphicAddAriaLabel.java
new file mode 100644
index 0000000..80478f1
--- /dev/null
+++ b/src/net/sourceforge/plantuml/graphic/UGraphicAddAriaLabel.java
@@ -0,0 +1,64 @@
+/* ========================================================================
+ * 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.graphic;
+
+import net.sourceforge.plantuml.ugraphic.UChange;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UShape;
+import net.sourceforge.plantuml.ugraphic.UText;
+
+public class UGraphicAddAriaLabel extends UGraphicDelegator {
+
+ private final String ariaLabel;
+
+ public UGraphicAddAriaLabel(UGraphic ug, String ariaLabel) {
+ super(ug);
+ this.ariaLabel = ariaLabel;
+ }
+
+ public UGraphic apply(UChange change) {
+ return new UGraphicAddAriaLabel(getUg().apply(change), ariaLabel);
+ }
+
+ @Override
+ public void draw(UShape shape) {
+ if (shape instanceof UText) {
+ shape = ((UText) shape).withAriaLabel(ariaLabel);
+ }
+ super.draw(shape);
+ }
+
+} \ No newline at end of file
diff --git a/src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java b/src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java
index eeec805..cea1dbb 100644
--- a/src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java
+++ b/src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java
@@ -49,6 +49,9 @@ public abstract class UGraphicDelegator implements UGraphic {
return ug.matchesProperty(propertyName);
}
+ public double dpiFactor() {
+ return ug.dpiFactor();
+ }
public UGraphicDelegator(UGraphic ug) {
this.ug = ug;
diff --git a/src/net/sourceforge/plantuml/graphic/USymbol.java b/src/net/sourceforge/plantuml/graphic/USymbol.java
index 013c935..0962733 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbol.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbol.java
@@ -62,6 +62,8 @@ public abstract class USymbol {
public final static USymbol FILE = record("FILE", SkinParameter.FILE, new USymbolFile());
public final static USymbol RECTANGLE = record("RECTANGLE", SkinParameter.RECTANGLE, new USymbolRect(
SkinParameter.RECTANGLE, HorizontalAlignment.CENTER));
+ public final static USymbol COLLECTIONS = record("COLLECTIONS", SkinParameter.COLLECTIONS, new USymbolCollections(
+ SkinParameter.RECTANGLE, HorizontalAlignment.CENTER));
public final static USymbol AGENT = record("AGENT", SkinParameter.AGENT, new USymbolRect(SkinParameter.AGENT,
HorizontalAlignment.CENTER));
public final static USymbol ACTOR = record("ACTOR", SkinParameter.ACTOR, new USymbolActor());
@@ -124,8 +126,8 @@ public abstract class USymbol {
public abstract TextBlock asSmall(TextBlock name, TextBlock label, TextBlock stereotype, SymbolContext symbolContext);
- public abstract TextBlock asBig(TextBlock label, TextBlock stereotype, double width, double height,
- SymbolContext symbolContext);
+ public abstract TextBlock asBig(TextBlock label, HorizontalAlignment labelAlignment, TextBlock stereotype,
+ double width, double height, SymbolContext symbolContext);
static class Margin {
private final double x1;
@@ -197,6 +199,8 @@ public abstract class USymbol {
usymbol = USymbol.PACKAGE;
} else if (symbol.equalsIgnoreCase("rectangle")) {
usymbol = USymbol.RECTANGLE;
+ } else if (symbol.equalsIgnoreCase("collections")) {
+ usymbol = USymbol.COLLECTIONS;
} else if (symbol.equalsIgnoreCase("node")) {
usymbol = USymbol.NODE;
} else if (symbol.equalsIgnoreCase("frame")) {
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolArtifact.java b/src/net/sourceforge/plantuml/graphic/USymbolArtifact.java
index fa1e1c3..a74f1bd 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolArtifact.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolArtifact.java
@@ -53,9 +53,9 @@ class USymbolArtifact extends USymbol {
return SkinParameter.ARTIFACT;
}
- private void drawArtifact(UGraphic ug, double widthTotal, double heightTotal, boolean shadowing) {
+ private void drawArtifact(UGraphic ug, double widthTotal, double heightTotal, boolean shadowing, double roundCorner) {
- final URectangle form = new URectangle(widthTotal, heightTotal);
+ final URectangle form = new URectangle(widthTotal, heightTotal, roundCorner, roundCorner);
if (shadowing) {
form.setDeltaShadow(4);
}
@@ -88,20 +88,22 @@ class USymbolArtifact extends USymbol {
private Margin getMargin() {
return new Margin(10, 10 + 10, 10 + 3, 10);
}
-
+
public boolean manageHorizontalLine() {
return true;
}
-
- public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
+ @Override
+ public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype,
+ final SymbolContext symbolContext) {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
ug = UGraphicStencil.create(ug, getRectangleStencil(dim), new UStroke());
ug = symbolContext.apply(ug);
- drawArtifact(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing());
+ drawArtifact(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing(),
+ symbolContext.getRoundCorner());
final Margin margin = getMargin();
final TextBlock tb = TextBlockUtils.mergeTB(stereotype, label, HorizontalAlignment.CENTER);
tb.drawU(ug.apply(new UTranslate(margin.getX1(), margin.getY1())));
@@ -115,14 +117,16 @@ class USymbolArtifact extends USymbol {
};
}
- public TextBlock asBig(final TextBlock title, final TextBlock stereotype, final double width, final double height,
- final SymbolContext symbolContext) {
+ @Override
+ public TextBlock asBig(final TextBlock title, HorizontalAlignment labelAlignment, final TextBlock stereotype,
+ final double width, final double height, final SymbolContext symbolContext) {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
ug = symbolContext.apply(ug);
- drawArtifact(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing());
+ drawArtifact(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing(),
+ symbolContext.getRoundCorner());
final Dimension2D dimStereo = stereotype.calculateDimension(ug.getStringBounder());
final double posStereo = (width - dimStereo.getWidth()) / 2;
stereotype.drawU(ug.apply(new UTranslate(posStereo, 2)));
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolCard.java b/src/net/sourceforge/plantuml/graphic/USymbolCard.java
index 314e4d1..e82d7d7 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolCard.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolCard.java
@@ -44,21 +44,20 @@ import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
class USymbolCard extends USymbol {
-
+
private final SkinParameter skinParameter;
public USymbolCard(SkinParameter skinParameter) {
this.skinParameter = skinParameter;
}
-
+
@Override
public SkinParameter getSkinParameter() {
return skinParameter;
}
-
- private void drawRect(UGraphic ug, double width, double height, boolean shadowing, double top) {
- final URectangle shape = new URectangle(width, height);
+ private void drawCard(UGraphic ug, double width, double height, boolean shadowing, double top, double roundCorner) {
+ final URectangle shape = new URectangle(width, height, roundCorner, roundCorner);
if (shadowing) {
shape.setDeltaShadow(3.0);
}
@@ -72,13 +71,16 @@ class USymbolCard extends USymbol {
return new Margin(10, 10, 3, 3);
}
- public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
+ @Override
+ public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype,
+ final SymbolContext symbolContext) {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
ug = symbolContext.apply(ug);
- drawRect(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing(), 0);
+ drawCard(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing(), 0,
+ symbolContext.getRoundCorner());
final Margin margin = getMargin();
final TextBlock tb = TextBlockUtils.mergeTB(stereotype, label, HorizontalAlignment.CENTER);
tb.drawU(ug.apply(new UTranslate(margin.getX1(), margin.getY1())));
@@ -92,8 +94,9 @@ class USymbolCard extends USymbol {
};
}
- public TextBlock asBig(final TextBlock title, final TextBlock stereotype, final double width, final double height,
- final SymbolContext symbolContext) {
+ @Override
+ public TextBlock asBig(final TextBlock title, HorizontalAlignment labelAlignment, final TextBlock stereotype,
+ final double width, final double height, final SymbolContext symbolContext) {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
@@ -101,8 +104,8 @@ class USymbolCard extends USymbol {
ug = symbolContext.apply(ug);
final Dimension2D dimStereo = stereotype.calculateDimension(ug.getStringBounder());
final Dimension2D dimTitle = title.calculateDimension(ug.getStringBounder());
- drawRect(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing(), dimTitle.getHeight()
- + dimStereo.getHeight() + 4);
+ drawCard(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing(), dimTitle.getHeight()
+ + dimStereo.getHeight() + 4, symbolContext.getRoundCorner());
final double posStereo = (width - dimStereo.getWidth()) / 2;
stereotype.drawU(ug.apply(new UTranslate(posStereo, 2)));
final double posTitle = (width - dimTitle.getWidth()) / 2;
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolCloud.java b/src/net/sourceforge/plantuml/graphic/USymbolCloud.java
index bf865cf..55d2c06 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolCloud.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolCloud.java
@@ -51,7 +51,6 @@ class USymbolCloud extends USymbol {
return SkinParameter.CLOUD;
}
-
private void drawCloud(UGraphic ug, double width, double height, boolean shadowing) {
final UPath shape = getSpecificFrontierForCloud(width, height);
if (shadowing) {
@@ -90,7 +89,9 @@ class USymbolCloud extends USymbol {
return new Margin(10, 10, 10, 10);
}
- public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
+ @Override
+ public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype,
+ final SymbolContext symbolContext) {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
@@ -111,8 +112,9 @@ class USymbolCloud extends USymbol {
};
}
- public TextBlock asBig(final TextBlock title, final TextBlock stereotype, final double width, final double height,
- final SymbolContext symbolContext) {
+ @Override
+ public TextBlock asBig(final TextBlock title, HorizontalAlignment labelAlignment, final TextBlock stereotype,
+ final double width, final double height, final SymbolContext symbolContext) {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
@@ -132,11 +134,10 @@ class USymbolCloud extends USymbol {
}
};
}
-
+
@Override
public boolean manageHorizontalLine() {
return true;
}
-
} \ No newline at end of file
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolCollections.java b/src/net/sourceforge/plantuml/graphic/USymbolCollections.java
new file mode 100644
index 0000000..0e76ca4
--- /dev/null
+++ b/src/net/sourceforge/plantuml/graphic/USymbolCollections.java
@@ -0,0 +1,147 @@
+/* ========================================================================
+ * 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.graphic;
+
+import java.awt.geom.Dimension2D;
+
+import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UGraphicStencil;
+import net.sourceforge.plantuml.ugraphic.URectangle;
+import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+class USymbolCollections extends USymbol {
+
+ private final SkinParameter skinParameter;
+ private final HorizontalAlignment stereotypeAlignement;
+
+ public USymbolCollections(SkinParameter skinParameter, HorizontalAlignment stereotypeAlignement) {
+ this.skinParameter = skinParameter;
+ this.stereotypeAlignement = stereotypeAlignement;
+ }
+
+ @Override
+ public USymbol withStereoAlignment(HorizontalAlignment alignment) {
+ return new USymbolCollections(skinParameter, alignment);
+ }
+
+ @Override
+ public SkinParameter getSkinParameter() {
+ return skinParameter;
+ }
+
+ private void drawCollections(UGraphic ug, double width, double height, boolean shadowing, double roundCorner) {
+ final URectangle small = new URectangle(width - getDeltaCollection(), height - getDeltaCollection(),
+ roundCorner, roundCorner);
+ if (shadowing) {
+ small.setDeltaShadow(3.0);
+ }
+ ug.apply(new UTranslate(getDeltaCollection(), getDeltaCollection())).draw(small);
+ small.setDeltaShadow(0);
+ ug.apply(new UTranslate(0, 0)).draw(small);
+ }
+
+ private Margin getMargin() {
+ return new Margin(10, 10, 10, 10);
+ }
+
+ private double getDeltaCollection() {
+ return 4;
+ }
+
+ @Override
+ public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype,
+ final SymbolContext symbolContext) {
+ return new AbstractTextBlock() {
+
+ public void drawU(UGraphic ug) {
+ final Dimension2D dim = calculateDimension(ug.getStringBounder());
+ ug = UGraphicStencil.create(ug, getRectangleStencil(dim), new UStroke());
+ ug = symbolContext.apply(ug);
+ drawCollections(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing(),
+ symbolContext.getRoundCorner());
+ final Margin margin = getMargin();
+ final TextBlock tb = TextBlockUtils.mergeTB(stereotype, label, stereotypeAlignement);
+ tb.drawU(ug.apply(new UTranslate(margin.getX1() - getDeltaCollection() / 2, margin.getY1()
+ - getDeltaCollection() / 2)));
+ }
+
+ public Dimension2D calculateDimension(StringBounder stringBounder) {
+ final Dimension2D dimLabel = label.calculateDimension(stringBounder);
+ final Dimension2D dimStereo = stereotype.calculateDimension(stringBounder);
+ return getMargin().addDimension(Dimension2DDouble.mergeTB(dimStereo, dimLabel));
+ }
+ };
+ }
+
+ @Override
+ public TextBlock asBig(final TextBlock title, HorizontalAlignment labelAlignment, final TextBlock stereotype,
+ final double width, final double height, final SymbolContext symbolContext) {
+ return new AbstractTextBlock() {
+ public void drawU(UGraphic ug) {
+ final Dimension2D dim = calculateDimension(ug.getStringBounder());
+ ug = symbolContext.apply(ug);
+ drawCollections(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing(),
+ symbolContext.getRoundCorner());
+ final Dimension2D dimStereo = stereotype.calculateDimension(ug.getStringBounder());
+ final double posStereoX;
+ final double posStereoY;
+ if (stereotypeAlignement == HorizontalAlignment.RIGHT) {
+ posStereoX = width - dimStereo.getWidth() - getMargin().getX1() / 2;
+ posStereoY = getMargin().getY1() / 2;
+ } else {
+ posStereoX = (width - dimStereo.getWidth()) / 2;
+ posStereoY = 2;
+ }
+ stereotype.drawU(ug.apply(new UTranslate(posStereoX, posStereoY)));
+ final Dimension2D dimTitle = title.calculateDimension(ug.getStringBounder());
+ final double posTitle = (width - dimTitle.getWidth()) / 2;
+ title.drawU(ug.apply(new UTranslate(posTitle, 2 + dimStereo.getHeight())));
+ }
+
+ public Dimension2D calculateDimension(StringBounder stringBounder) {
+ return new Dimension2DDouble(width, height);
+ }
+ };
+ }
+
+ @Override
+ public boolean manageHorizontalLine() {
+ return true;
+ }
+
+} \ No newline at end of file
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolComponent1.java b/src/net/sourceforge/plantuml/graphic/USymbolComponent1.java
index 7e3c420..1e3a9d1 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolComponent1.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolComponent1.java
@@ -52,9 +52,10 @@ class USymbolComponent1 extends USymbol {
return SkinParameter.COMPONENT1;
}
- private void drawNode(UGraphic ug, double widthTotal, double heightTotal, boolean shadowing) {
+ private void drawComponent1(UGraphic ug, double widthTotal, double heightTotal, boolean shadowing,
+ double roundCorner) {
- final URectangle form = new URectangle(widthTotal, heightTotal);
+ final URectangle form = new URectangle(widthTotal, heightTotal, roundCorner, roundCorner);
if (shadowing) {
form.setDeltaShadow(4);
}
@@ -72,6 +73,7 @@ class USymbolComponent1 extends USymbol {
return new Margin(10, 10, 10, 10);
}
+ @Override
public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype,
final SymbolContext symbolContext) {
return new AbstractTextBlock() {
@@ -81,7 +83,8 @@ class USymbolComponent1 extends USymbol {
final Dimension2D dimTotal = calculateDimension(stringBounder);
ug = UGraphicStencil.create(ug, getRectangleStencil(dimTotal), new UStroke());
ug = symbolContext.apply(ug);
- drawNode(ug, dimTotal.getWidth(), dimTotal.getHeight(), symbolContext.isShadowing());
+ drawComponent1(ug, dimTotal.getWidth(), dimTotal.getHeight(), symbolContext.isShadowing(),
+ symbolContext.getRoundCorner());
final Margin margin = getMargin();
final TextBlock tb = TextBlockUtils.mergeTB(stereotype, label, HorizontalAlignment.CENTER);
tb.drawU(ug.apply(new UTranslate(margin.getX1(), margin.getY1())));
@@ -95,8 +98,9 @@ class USymbolComponent1 extends USymbol {
};
}
- public TextBlock asBig(final TextBlock title, TextBlock stereotype, final double width, final double height,
- final SymbolContext symbolContext) {
+ @Override
+ public TextBlock asBig(final TextBlock title, HorizontalAlignment labelAlignment, final TextBlock stereotype,
+ final double width, final double height, final SymbolContext symbolContext) {
throw new UnsupportedOperationException();
}
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolComponent2.java b/src/net/sourceforge/plantuml/graphic/USymbolComponent2.java
index 9ca34d6..2de97fc 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolComponent2.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolComponent2.java
@@ -52,9 +52,10 @@ class USymbolComponent2 extends USymbol {
return SkinParameter.COMPONENT2;
}
- private void drawNode(UGraphic ug, double widthTotal, double heightTotal, boolean shadowing) {
+ private void drawComponent2(UGraphic ug, double widthTotal, double heightTotal, boolean shadowing,
+ double roundCorner) {
- final URectangle form = new URectangle(widthTotal, heightTotal);
+ final URectangle form = new URectangle(widthTotal, heightTotal, roundCorner, roundCorner);
if (shadowing) {
form.setDeltaShadow(4);
}
@@ -75,6 +76,7 @@ class USymbolComponent2 extends USymbol {
return new Margin(10 + 5, 20 + 5, 15 + 5, 5 + 5);
}
+ @Override
public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype,
final SymbolContext symbolContext) {
return new AbstractTextBlock() {
@@ -83,7 +85,8 @@ class USymbolComponent2 extends USymbol {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
ug = UGraphicStencil.create(ug, getRectangleStencil(dim), new UStroke());
ug = symbolContext.apply(ug);
- drawNode(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing());
+ drawComponent2(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing(),
+ symbolContext.getRoundCorner());
final Margin margin = getMargin();
final TextBlock tb = TextBlockUtils.mergeTB(stereotype, label, HorizontalAlignment.CENTER);
@@ -99,14 +102,16 @@ class USymbolComponent2 extends USymbol {
};
}
- public TextBlock asBig(final TextBlock title, final TextBlock stereotype, final double width, final double height,
- final SymbolContext symbolContext) {
+ @Override
+ public TextBlock asBig(final TextBlock title, HorizontalAlignment labelAlignment, final TextBlock stereotype,
+ final double width, final double height, final SymbolContext symbolContext) {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
ug = symbolContext.apply(ug);
- drawNode(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing());
+ drawComponent2(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing(),
+ symbolContext.getRoundCorner());
final Dimension2D dimStereo = stereotype.calculateDimension(ug.getStringBounder());
final double posStereo = (width - dimStereo.getWidth()) / 2;
stereotype.drawU(ug.apply(new UTranslate(posStereo, 13)));
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolDatabase.java b/src/net/sourceforge/plantuml/graphic/USymbolDatabase.java
index 404e7f5..62425fc 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolDatabase.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolDatabase.java
@@ -52,8 +52,6 @@ class USymbolDatabase extends USymbol {
return SkinParameter.DATABASE;
}
-
-
private void drawDatabase(UGraphic ug, double width, double height, boolean shadowing) {
final UPath shape = new UPath();
if (shadowing) {
@@ -114,7 +112,9 @@ class USymbolDatabase extends USymbol {
return new Margin(10, 10, 24, 5);
}
- public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
+ @Override
+ public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype,
+ final SymbolContext symbolContext) {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
@@ -135,8 +135,9 @@ class USymbolDatabase extends USymbol {
};
}
- public TextBlock asBig(final TextBlock title, final TextBlock stereotype, final double width, final double height,
- final SymbolContext symbolContext) {
+ @Override
+ public TextBlock asBig(final TextBlock title, HorizontalAlignment labelAlignment, final TextBlock stereotype,
+ final double width, final double height, final SymbolContext symbolContext) {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
@@ -145,11 +146,11 @@ class USymbolDatabase extends USymbol {
drawDatabase(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing());
final Dimension2D dimStereo = stereotype.calculateDimension(ug.getStringBounder());
final double posStereo = (width - dimStereo.getWidth()) / 2;
- stereotype.drawU(ug.apply(new UTranslate(posStereo, 0)));
+ stereotype.drawU(ug.apply(new UTranslate(posStereo, 2 + 20)));
final Dimension2D dimTitle = title.calculateDimension(ug.getStringBounder());
final double posTitle = (width - dimTitle.getWidth()) / 2;
- title.drawU(ug.apply(new UTranslate(posTitle, 21)));
+ title.drawU(ug.apply(new UTranslate(posTitle, 2 + 20 + dimStereo.getHeight())));
}
public Dimension2D calculateDimension(StringBounder stringBounder) {
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolFile.java b/src/net/sourceforge/plantuml/graphic/USymbolFile.java
index 0af7c94..e00b32a 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolFile.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolFile.java
@@ -36,8 +36,10 @@
package net.sourceforge.plantuml.graphic;
import java.awt.geom.Dimension2D;
+import java.awt.geom.Point2D;
import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.ugraphic.Shadowable;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UGraphicStencil;
import net.sourceforge.plantuml.ugraphic.UPath;
@@ -54,24 +56,45 @@ class USymbolFile extends USymbol {
return SkinParameter.FILE;
}
- private void drawFile(UGraphic ug, double width, double height, boolean shadowing) {
- final UPolygon polygon = new UPolygon();
+ private void drawFile(UGraphic ug, double width, double height, boolean shadowing, double roundCorner) {
final int cornersize = 10;
- polygon.addPoint(0, 0);
- polygon.addPoint(0, height);
- polygon.addPoint(width, height);
- polygon.addPoint(width, cornersize);
- polygon.addPoint(width - cornersize, 0);
- polygon.addPoint(0, 0);
+ final Shadowable out;
+ if (roundCorner == 0) {
+ final UPolygon polygon = new UPolygon();
+ polygon.addPoint(0, 0);
+ polygon.addPoint(0, height);
+ polygon.addPoint(width, height);
+ polygon.addPoint(width, cornersize);
+ polygon.addPoint(width - cornersize, 0);
+ polygon.addPoint(0, 0);
+ out = polygon;
+ } else {
+ final UPath path = new UPath();
+ path.moveTo(0, roundCorner / 2);
+ path.lineTo(0, height - roundCorner / 2);
+ path.arcTo(new Point2D.Double(roundCorner / 2, height), roundCorner / 2, 0, 0);
+ path.lineTo(width - roundCorner / 2, height);
+ path.arcTo(new Point2D.Double(width, height - roundCorner / 2), roundCorner / 2, 0, 0);
+ path.lineTo(width, cornersize);
+ path.lineTo(width - cornersize, 0);
+ path.lineTo(roundCorner / 2, 0);
+ path.arcTo(new Point2D.Double(0, roundCorner / 2), roundCorner / 2, 0, 0);
+ out = path;
+ }
if (shadowing) {
- polygon.setDeltaShadow(3.0);
+ out.setDeltaShadow(3.0);
}
- ug.draw(polygon);
+ ug.draw(out);
final UPath path = new UPath();
path.moveTo(width - cornersize, 0);
- path.lineTo(width - cornersize, cornersize);
+ if (roundCorner == 0) {
+ path.lineTo(width - cornersize, cornersize);
+ } else {
+ path.lineTo(width - cornersize, cornersize - roundCorner / 2);
+ path.arcTo(new Point2D.Double(width - cornersize + roundCorner / 2, cornersize), roundCorner / 2, 0, 0);
+ }
path.lineTo(width, cornersize);
ug.draw(path);
}
@@ -80,6 +103,7 @@ class USymbolFile extends USymbol {
return new Margin(10, 10, 10, 10);
}
+ @Override
public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype,
final SymbolContext symbolContext) {
return new AbstractTextBlock() {
@@ -88,7 +112,8 @@ class USymbolFile extends USymbol {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
ug = UGraphicStencil.create(ug, getRectangleStencil(dim), new UStroke());
ug = symbolContext.apply(ug);
- drawFile(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing());
+ drawFile(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing(),
+ symbolContext.getRoundCorner());
final Margin margin = getMargin();
final TextBlock tb = TextBlockUtils.mergeTB(stereotype, label, HorizontalAlignment.CENTER);
tb.drawU(ug.apply(new UTranslate(margin.getX1(), margin.getY1())));
@@ -102,14 +127,16 @@ class USymbolFile extends USymbol {
};
}
- public TextBlock asBig(final TextBlock title, final TextBlock stereotype, final double width, final double height,
- final SymbolContext symbolContext) {
+ @Override
+ public TextBlock asBig(final TextBlock title, HorizontalAlignment labelAlignment, final TextBlock stereotype,
+ final double width, final double height, final SymbolContext symbolContext) {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
ug = symbolContext.apply(ug);
- drawFile(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing());
+ drawFile(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing(),
+ symbolContext.getRoundCorner());
final Dimension2D dimStereo = stereotype.calculateDimension(ug.getStringBounder());
final double posStereoX;
final double posStereoY;
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolFolder.java b/src/net/sourceforge/plantuml/graphic/USymbolFolder.java
index 4501170..5495d3d 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolFolder.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolFolder.java
@@ -36,11 +36,14 @@
package net.sourceforge.plantuml.graphic;
import java.awt.geom.Dimension2D;
+import java.awt.geom.Point2D;
import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.ugraphic.Shadowable;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UGraphicStencil;
import net.sourceforge.plantuml.ugraphic.ULine;
+import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
@@ -65,7 +68,8 @@ public class USymbolFolder extends USymbol {
return skinParameter;
}
- private void drawFolder(UGraphic ug, double width, double height, Dimension2D dimTitle, boolean shadowing) {
+ private void drawFolder(UGraphic ug, double width, double height, Dimension2D dimTitle, boolean shadowing,
+ double roundCorner) {
final double wtitle;
if (dimTitle.getWidth() == 0) {
@@ -75,15 +79,36 @@ public class USymbolFolder extends USymbol {
}
final double htitle = getHTitle(dimTitle);
- final UPolygon shape = new UPolygon();
- shape.addPoint(0, 0);
- shape.addPoint(wtitle, 0);
-
- shape.addPoint(wtitle + marginTitleX3, htitle);
- shape.addPoint(width, htitle);
- shape.addPoint(width, height);
- shape.addPoint(0, height);
- shape.addPoint(0, 0);
+ final Shadowable shape;
+ if (roundCorner == 0) {
+ final UPolygon poly = new UPolygon();
+ poly.addPoint(0, 0);
+ poly.addPoint(wtitle, 0);
+
+ poly.addPoint(wtitle + marginTitleX3, htitle);
+ poly.addPoint(width, htitle);
+ poly.addPoint(width, height);
+ poly.addPoint(0, height);
+ poly.addPoint(0, 0);
+ shape = poly;
+ } else {
+ final UPath path = new UPath();
+ path.moveTo(roundCorner / 2, 0);
+ path.lineTo(wtitle - roundCorner / 2, 0);
+ // path.lineTo(wtitle, roundCorner / 2);
+ path.arcTo(new Point2D.Double(wtitle, roundCorner / 2), roundCorner / 2 * 1.5, 0, 1);
+ path.lineTo(wtitle + marginTitleX3, htitle);
+ path.lineTo(width - roundCorner / 2, htitle);
+ path.arcTo(new Point2D.Double(width, htitle + roundCorner / 2), roundCorner / 2, 0, 1);
+ path.lineTo(width, height - roundCorner / 2);
+ path.arcTo(new Point2D.Double(width - roundCorner / 2, height), roundCorner / 2, 0, 1);
+ path.lineTo(roundCorner / 2, height);
+ path.arcTo(new Point2D.Double(0, height - roundCorner / 2), roundCorner / 2, 0, 1);
+ path.lineTo(0, roundCorner / 2);
+ path.arcTo(new Point2D.Double(roundCorner / 2, 0), roundCorner / 2, 0, 1);
+ path.closePath();
+ shape = path;
+ }
if (shadowing) {
shape.setDeltaShadow(3.0);
}
@@ -105,6 +130,7 @@ public class USymbolFolder extends USymbol {
return new Margin(10, 10 + 10, 10 + 3, 10);
}
+ @Override
public TextBlock asSmall(final TextBlock name, final TextBlock label, final TextBlock stereotype,
final SymbolContext symbolContext) {
if (name == null) {
@@ -117,7 +143,8 @@ public class USymbolFolder extends USymbol {
ug = UGraphicStencil.create(ug, getRectangleStencil(dim), new UStroke());
ug = symbolContext.apply(ug);
final Dimension2D dimName = name.calculateDimension(ug.getStringBounder());
- drawFolder(ug, dim.getWidth(), dim.getHeight(), dimName, symbolContext.isShadowing());
+ drawFolder(ug, dim.getWidth(), dim.getHeight(), dimName, symbolContext.isShadowing(),
+ symbolContext.getRoundCorner());
final Margin margin = getMargin();
final TextBlock tb = TextBlockUtils.mergeTB(stereotype, label, HorizontalAlignment.CENTER);
name.drawU(ug.apply(new UTranslate(4, 3)));
@@ -133,8 +160,9 @@ public class USymbolFolder extends USymbol {
};
}
- public TextBlock asBig(final TextBlock title, final TextBlock stereotype, final double width, final double height,
- final SymbolContext symbolContext) {
+ @Override
+ public TextBlock asBig(final TextBlock title, HorizontalAlignment labelAlignment, final TextBlock stereotype,
+ final double width, final double height, final SymbolContext symbolContext) {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
@@ -142,7 +170,8 @@ public class USymbolFolder extends USymbol {
final Dimension2D dim = calculateDimension(stringBounder);
ug = symbolContext.apply(ug);
final Dimension2D dimTitle = title.calculateDimension(stringBounder);
- drawFolder(ug, dim.getWidth(), dim.getHeight(), dimTitle, symbolContext.isShadowing());
+ drawFolder(ug, dim.getWidth(), dim.getHeight(), dimTitle, symbolContext.isShadowing(),
+ symbolContext.getRoundCorner());
title.drawU(ug.apply(new UTranslate(4, 2)));
final Dimension2D dimStereo = stereotype.calculateDimension(stringBounder);
final double posStereo = (width - dimStereo.getWidth()) / 2;
@@ -156,12 +185,10 @@ public class USymbolFolder extends USymbol {
};
}
-
@Override
public boolean manageHorizontalLine() {
return true;
}
-
} \ No newline at end of file
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolFrame.java b/src/net/sourceforge/plantuml/graphic/USymbolFrame.java
index c6b0e95..b94c536 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolFrame.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolFrame.java
@@ -53,8 +53,10 @@ class USymbolFrame extends USymbol {
return SkinParameter.FRAME;
}
- private void drawFrame(UGraphic ug, double width, double height, Dimension2D dimTitle, boolean shadowing) {
- final URectangle shape = new URectangle(width, height);
+ private void drawFrame(UGraphic ug, double width, double height, Dimension2D dimTitle, boolean shadowing,
+ double roundCorner) {
+ final URectangle shape = new URectangle(width, height, roundCorner, roundCorner);
+ shape.setIgnoreForCompression(true);
if (shadowing) {
shape.setDeltaShadow(3.0);
}
@@ -94,6 +96,7 @@ class USymbolFrame extends USymbol {
return new Margin(10 + 5, 20 + 5, 15 + 5, 5 + 5);
}
+ @Override
public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype,
final SymbolContext symbolContext) {
return new AbstractTextBlock() {
@@ -102,7 +105,8 @@ class USymbolFrame extends USymbol {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
ug = UGraphicStencil.create(ug, getRectangleStencil(dim), new UStroke());
ug = symbolContext.apply(ug);
- drawFrame(ug, dim.getWidth(), dim.getHeight(), new Dimension2DDouble(0, 0), symbolContext.isShadowing());
+ drawFrame(ug, dim.getWidth(), dim.getHeight(), new Dimension2DDouble(0, 0),
+ symbolContext.isShadowing(), symbolContext.getRoundCorner());
final Margin margin = getMargin();
final TextBlock tb = TextBlockUtils.mergeTB(stereotype, label, HorizontalAlignment.CENTER);
tb.drawU(ug.apply(new UTranslate(margin.getX1(), margin.getY1())));
@@ -116,8 +120,9 @@ class USymbolFrame extends USymbol {
};
}
- public TextBlock asBig(final TextBlock title, final TextBlock stereotype, final double width, final double height,
- final SymbolContext symbolContext) {
+ @Override
+ public TextBlock asBig(final TextBlock title, HorizontalAlignment labelAlignment, final TextBlock stereotype,
+ final double width, final double height, final SymbolContext symbolContext) {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
@@ -125,7 +130,8 @@ class USymbolFrame extends USymbol {
final Dimension2D dim = calculateDimension(stringBounder);
ug = symbolContext.apply(ug);
final Dimension2D dimTitle = title.calculateDimension(stringBounder);
- drawFrame(ug, dim.getWidth(), dim.getHeight(), dimTitle, symbolContext.isShadowing());
+ drawFrame(ug, dim.getWidth(), dim.getHeight(), dimTitle, symbolContext.isShadowing(),
+ symbolContext.getRoundCorner());
title.drawU(ug.apply(new UTranslate(3, 1)));
final Dimension2D dimStereo = stereotype.calculateDimension(stringBounder);
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolNode.java b/src/net/sourceforge/plantuml/graphic/USymbolNode.java
index 10071ea..ee4c3b9 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolNode.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolNode.java
@@ -109,6 +109,7 @@ class USymbolNode extends USymbol {
return new Margin(10 + 5, 20 + 5, 15 + 5, 5 + 5);
}
+ @Override
public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype,
final SymbolContext symbolContext) {
return new AbstractTextBlock() {
@@ -131,8 +132,9 @@ class USymbolNode extends USymbol {
};
}
- public TextBlock asBig(final TextBlock title, final TextBlock stereotype, final double width, final double height,
- final SymbolContext symbolContext) {
+ @Override
+ public TextBlock asBig(final TextBlock title, HorizontalAlignment labelAlignment, final TextBlock stereotype,
+ final double width, final double height, final SymbolContext symbolContext) {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolQueue.java b/src/net/sourceforge/plantuml/graphic/USymbolQueue.java
index 7b0b427..616539c 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolQueue.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolQueue.java
@@ -127,6 +127,7 @@ class USymbolQueue extends USymbol {
return new Margin(5, 15, 5, 5);
}
+ @Override
public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype,
final SymbolContext symbolContext) {
return new AbstractTextBlock() {
@@ -150,8 +151,9 @@ class USymbolQueue extends USymbol {
};
}
- public TextBlock asBig(final TextBlock title, final TextBlock stereotype, final double width, final double height,
- final SymbolContext symbolContext) {
+ @Override
+ public TextBlock asBig(final TextBlock title, HorizontalAlignment labelAlignment, final TextBlock stereotype,
+ final double width, final double height, final SymbolContext symbolContext) {
throw new UnsupportedOperationException();
// return new TextBlock() {
//
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolRect.java b/src/net/sourceforge/plantuml/graphic/USymbolRect.java
index 9147dc1..55d03c4 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolRect.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolRect.java
@@ -38,8 +38,10 @@ package net.sourceforge.plantuml.graphic;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.ugraphic.Shadowable;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UGraphicStencil;
+import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
@@ -64,18 +66,35 @@ class USymbolRect extends USymbol {
return skinParameter;
}
- private void drawRect(UGraphic ug, double width, double height, boolean shadowing, double roundCorner) {
- final URectangle shape = new URectangle(width, height, roundCorner, roundCorner);
+ private void drawRect(UGraphic ug, double width, double height, boolean shadowing, double roundCorner,
+ double diagonalCorner) {
+ final Shadowable shape = diagonalCorner > 0 ? getDiagonalShape(width, height, diagonalCorner) : new URectangle(
+ width, height, roundCorner, roundCorner);
if (shadowing) {
shape.setDeltaShadow(3.0);
}
ug.draw(shape);
}
+ private Shadowable getDiagonalShape(double width, double height, double diagonalCorner) {
+ final UPath result = new UPath();
+ result.moveTo(diagonalCorner, 0);
+ result.lineTo(width - diagonalCorner, 0);
+ result.lineTo(width, diagonalCorner);
+ result.lineTo(width, height - diagonalCorner);
+ result.lineTo(width - diagonalCorner, height);
+ result.lineTo(diagonalCorner, height);
+ result.lineTo(0, height - diagonalCorner);
+ result.lineTo(0, diagonalCorner);
+ result.lineTo(diagonalCorner, 0);
+ return result;
+ }
+
private Margin getMargin() {
return new Margin(10, 10, 10, 10);
}
+ @Override
public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype,
final SymbolContext symbolContext) {
return new AbstractTextBlock() {
@@ -85,7 +104,7 @@ class USymbolRect extends USymbol {
ug = UGraphicStencil.create(ug, getRectangleStencil(dim), new UStroke());
ug = symbolContext.apply(ug);
drawRect(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing(),
- symbolContext.getRoundCorner());
+ symbolContext.getRoundCorner(), symbolContext.getDiagonalCorner());
final Margin margin = getMargin();
final TextBlock tb = TextBlockUtils.mergeTB(stereotype, label, stereotypeAlignement);
tb.drawU(ug.apply(new UTranslate(margin.getX1(), margin.getY1())));
@@ -99,14 +118,15 @@ class USymbolRect extends USymbol {
};
}
- public TextBlock asBig(final TextBlock title, final TextBlock stereotype, final double width, final double height,
- final SymbolContext symbolContext) {
+ @Override
+ public TextBlock asBig(final TextBlock title, final HorizontalAlignment labelAlignment, final TextBlock stereotype,
+ final double width, final double height, final SymbolContext symbolContext) {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
ug = symbolContext.apply(ug);
drawRect(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing(),
- symbolContext.getRoundCorner());
+ symbolContext.getRoundCorner(), 0);
final Dimension2D dimStereo = stereotype.calculateDimension(ug.getStringBounder());
final double posStereoX;
final double posStereoY;
@@ -119,7 +139,14 @@ class USymbolRect extends USymbol {
}
stereotype.drawU(ug.apply(new UTranslate(posStereoX, posStereoY)));
final Dimension2D dimTitle = title.calculateDimension(ug.getStringBounder());
- final double posTitle = (width - dimTitle.getWidth()) / 2;
+ final double posTitle;
+ if (labelAlignment == HorizontalAlignment.LEFT) {
+ posTitle = 3;
+ } else if (labelAlignment == HorizontalAlignment.RIGHT) {
+ posTitle = width - dimTitle.getWidth() - 3;
+ } else {
+ posTitle = (width - dimTitle.getWidth()) / 2;
+ }
title.drawU(ug.apply(new UTranslate(posTitle, 2 + dimStereo.getHeight())));
}
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolSimpleAbstract.java b/src/net/sourceforge/plantuml/graphic/USymbolSimpleAbstract.java
index c90d443..492e8d4 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolSimpleAbstract.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolSimpleAbstract.java
@@ -43,7 +43,9 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
abstract class USymbolSimpleAbstract extends USymbol {
- public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
+ @Override
+ public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype,
+ final SymbolContext symbolContext) {
if (stereotype == null) {
throw new IllegalArgumentException();
}
@@ -79,8 +81,9 @@ abstract class USymbolSimpleAbstract extends USymbol {
abstract protected TextBlock getDrawing(final SymbolContext symbolContext);
- public TextBlock asBig(final TextBlock title, TextBlock stereotype, final double width, final double height,
- final SymbolContext symbolContext) {
+ @Override
+ public TextBlock asBig(final TextBlock title, HorizontalAlignment labelAlignment, TextBlock stereotype,
+ final double width, final double height, final SymbolContext symbolContext) {
throw new UnsupportedOperationException();
}
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolStack.java b/src/net/sourceforge/plantuml/graphic/USymbolStack.java
index 2e045b7..3511f2b 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolStack.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolStack.java
@@ -36,6 +36,7 @@
package net.sourceforge.plantuml.graphic;
import java.awt.geom.Dimension2D;
+import java.awt.geom.Point2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
@@ -62,12 +63,25 @@ class USymbolStack extends USymbol {
}
ug.apply(new UChangeColor(null)).apply(new UTranslate(border, 0)).draw(rect);
final UPath path = new UPath();
- path.moveTo(0, 0);
- path.lineTo(border, 0);
- path.lineTo(border, height);
- path.lineTo(width - border, height);
- path.lineTo(width - border, 0);
- path.lineTo(width, 0);
+ if (roundCorner == 0) {
+ path.moveTo(0, 0);
+ path.lineTo(border, 0);
+ path.lineTo(border, height);
+ path.lineTo(width - border, height);
+ path.lineTo(width - border, 0);
+ path.lineTo(width, 0);
+ } else {
+ path.moveTo(0, 0);
+ path.lineTo(border - roundCorner / 2, 0);
+ path.arcTo(new Point2D.Double(border, roundCorner / 2), roundCorner / 2, 0, 1);
+ path.lineTo(border, height - roundCorner / 2);
+ path.arcTo(new Point2D.Double(border + roundCorner / 2, height), roundCorner / 2, 0, 0);
+ path.lineTo(width - border - roundCorner / 2, height);
+ path.arcTo(new Point2D.Double(width - border, height - roundCorner / 2), roundCorner / 2, 0, 0);
+ path.lineTo(width - border, roundCorner / 2);
+ path.arcTo(new Point2D.Double(width - border + roundCorner / 2, 0), roundCorner / 2, 0, 1);
+ path.lineTo(width, 0);
+ }
ug.apply(new UChangeBackColor(null)).draw(path);
}
@@ -75,6 +89,7 @@ class USymbolStack extends USymbol {
return new Margin(25, 25, 10, 10);
}
+ @Override
public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype,
final SymbolContext symbolContext) {
return new AbstractTextBlock() {
@@ -98,8 +113,9 @@ class USymbolStack extends USymbol {
};
}
- public TextBlock asBig(final TextBlock title, final TextBlock stereotype, final double width, final double height,
- final SymbolContext symbolContext) {
+ @Override
+ public TextBlock asBig(final TextBlock title, HorizontalAlignment labelAlignment, final TextBlock stereotype,
+ final double width, final double height, final SymbolContext symbolContext) {
throw new UnsupportedOperationException();
}
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolStorage.java b/src/net/sourceforge/plantuml/graphic/USymbolStorage.java
index be784f6..6950654 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolStorage.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolStorage.java
@@ -63,7 +63,9 @@ class USymbolStorage extends USymbol {
return new Margin(10, 10, 10, 10);
}
- public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
+ @Override
+ public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype,
+ final SymbolContext symbolContext) {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
@@ -84,8 +86,9 @@ class USymbolStorage extends USymbol {
};
}
- public TextBlock asBig(final TextBlock title, final TextBlock stereotype, final double width, final double height,
- final SymbolContext symbolContext) {
+ @Override
+ public TextBlock asBig(final TextBlock title, HorizontalAlignment labelAlignment, final TextBlock stereotype,
+ final double width, final double height, final SymbolContext symbolContext) {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
@@ -106,11 +109,10 @@ class USymbolStorage extends USymbol {
}
};
}
-
+
@Override
public boolean manageHorizontalLine() {
return true;
}
-
} \ No newline at end of file
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolTogether.java b/src/net/sourceforge/plantuml/graphic/USymbolTogether.java
index b435ecc..a9bf5c9 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolTogether.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolTogether.java
@@ -47,13 +47,15 @@ class USymbolTogether extends USymbol {
return SkinParameter.STORAGE;
}
+ @Override
public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype,
final SymbolContext symbolContext) {
return TextBlockUtils.empty(10, 10);
}
- public TextBlock asBig(final TextBlock title, final TextBlock stereotype, final double width, final double height,
- final SymbolContext symbolContext) {
+ @Override
+ public TextBlock asBig(final TextBlock title, HorizontalAlignment labelAlignment, final TextBlock stereotype,
+ final double width, final double height, final SymbolContext symbolContext) {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
diff --git a/src/net/sourceforge/plantuml/graphic/color/Colors.java b/src/net/sourceforge/plantuml/graphic/color/Colors.java
index cc8110f..56a297d 100644
--- a/src/net/sourceforge/plantuml/graphic/color/Colors.java
+++ b/src/net/sourceforge/plantuml/graphic/color/Colors.java
@@ -103,11 +103,11 @@ public class Colors {
}
}
if (data.contains("line.dashed")) {
- lineStyle = LinkStyle.DASHED;
+ lineStyle = LinkStyle.DASHED();
} else if (data.contains("line.dotted")) {
- lineStyle = LinkStyle.DOTTED;
+ lineStyle = LinkStyle.DOTTED();
} else if (data.contains("line.bold")) {
- lineStyle = LinkStyle.BOLD;
+ lineStyle = LinkStyle.BOLD();
}
}
@@ -130,7 +130,7 @@ public class Colors {
if (lineStyle == null) {
return null;
}
- return LinkStyle.getStroke(lineStyle);
+ return lineStyle.getStroke3();
}
// public Colors addSpecificLineStroke(UStroke specificStroke) {
@@ -170,7 +170,7 @@ public class Colors {
throw new IllegalArgumentException();
}
final Colors result = copy();
- result.lineStyle = LinkStyle.valueOf(StringUtils.goUpperCase(s));
+ result.lineStyle = LinkStyle.fromString1(StringUtils.goUpperCase(s));
return result;
}
@@ -182,7 +182,7 @@ public class Colors {
if (colors.lineStyle == null) {
return ug;
}
- return ug.apply(LinkStyle.getStroke(colors.lineStyle));
+ return ug.apply(colors.lineStyle.getStroke3());
}
public Colors applyStereotype(Stereotype stereotype, ISkinParam skinParam, ColorParam param) {
@@ -239,4 +239,11 @@ public class Colors {
return shadowing;
}
+ public UStroke muteStroke(UStroke stroke) {
+ if (lineStyle == null) {
+ return stroke;
+ }
+ return lineStyle.muteStroke(stroke);
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/jasic/Jasic.java b/src/net/sourceforge/plantuml/jasic/Jasic.java
index 9b96c86..d16d4fe 100644
--- a/src/net/sourceforge/plantuml/jasic/Jasic.java
+++ b/src/net/sourceforge/plantuml/jasic/Jasic.java
@@ -1,6 +1,5 @@
package net.sourceforge.plantuml.jasic;
-
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
@@ -12,880 +11,861 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-/**
- * This defines a single class that contains an entire interpreter for a
- * language very similar to the original BASIC. Everything is here (albeit in
- * very simplified form): tokenizing, parsing, and interpretation. The file is
- * organized in phases, with each appearing roughly in the order that they
- * occur when a program is run. You should be able to read this top-down to walk
- * through the entire process of loading and running a program.
+/*
+ Jasic uses the MIT License:
+
+ Copyright (c) 2010 Robert Nystrom
+
+ 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.
+ *
+ */
+/*
+ * This defines a single class that contains an entire interpreter for a language very similar to the original BASIC.
+ * Everything is here (albeit in very simplified form): tokenizing, parsing, and interpretation. The file is organized
+ * in phases, with each appearing roughly in the order that they occur when a program is run. You should be able to read
+ * this top-down to walk through the entire process of loading and running a program.
*
- * Jasic language syntax
- * ---------------------
+ * Jasic language syntax ---------------------
*
* Comments start with ' and proceed to the end of the line:
*
- * print "hi there" ' this is a comment
+ * print "hi there" ' this is a comment
*
- * Numbers and strings are supported. Strings should be in "double quotes", and
- * only positive integers can be parsed (though numbers are double internally).
+ * Numbers and strings are supported. Strings should be in "double quotes", and only positive integers can be parsed
+ * (though numbers are double internally).
*
- * Variables are identified by name which must start with a letter and can
- * contain letters or numbers. Case is significant for names and keywords.
+ * Variables are identified by name which must start with a letter and can contain letters or numbers. Case is
+ * significant for names and keywords.
*
- * Each statement is on its own line. Optionally, a line may have a label before
- * the statement. A label is a name that ends with a colon:
+ * Each statement is on its own line. Optionally, a line may have a label before the statement. A label is a name that
+ * ends with a colon:
*
- * foo:
+ * foo:
*
*
* The following statements are supported:
*
- * <name> = <expression>
- * Evaluates the expression and assigns the result to the given named
- * variable. All variables are globally scoped.
- *
- * pi = (314159 / 10000)
- *
- * print <expression>
- * Evaluates the expression and prints the result.
+ * <name> = <expression> Evaluates the expression and assigns the result to the given named variable. All variables are
+ * globally scoped.
+ *
+ * pi = (314159 / 10000)
*
- * print "hello, " + "world"
+ * print <expression> Evaluates the expression and prints the result.
*
- * input <name>
- * Reads in a line of input from the user and stores it in the variable with
- * the given name.
- *
- * input guess
- *
- * goto <label>
- * Jumps to the statement after the label with the given name.
+ * print "hello, " + "world"
*
- * goto loop
+ * input <name> Reads in a line of input from the user and stores it in the variable with the given name.
*
- * if <expression> then <label>
- * Evaluates the expression. If it evaluates to a non-zero number, then
- * jumps to the statement after the given label.
+ * input guess
*
- * if a < b then dosomething
+ * goto <label> Jumps to the statement after the label with the given name.
+ *
+ * goto loop
+ *
+ * if <expression> then <label> Evaluates the expression. If it evaluates to a non-zero number, then jumps to the
+ * statement after the given label.
+ *
+ * if a < b then dosomething
*
*
* The following expressions are supported:
*
- * <expression> = <expression>
- * Evaluates to 1 if the two expressions are equal, 0 otherwise.
+ * <expression> = <expression> Evaluates to 1 if the two expressions are equal, 0 otherwise.
*
- * <expression> + <expression>
- * If the left-hand expression is a number, then adds the two expressions,
- * otherwise concatenates the two strings.
+ * <expression> + <expression> If the left-hand expression is a number, then adds the two expressions, otherwise
+ * concatenates the two strings.
*
- * <expression> - <expression>
- * <expression> * <expression>
- * <expression> / <expression>
- * <expression> < <expression>
- * <expression> > <expression>
- * You can figure it out.
+ * <expression> - <expression> <expression> * <expression> <expression> / <expression> <expression> < <expression>
+ * <expression> > <expression> You can figure it out.
*
- * <name>
- * A name in an expression simply returns the value of the variable with
- * that name. If the variable was never set, it defaults to 0.
+ * <name> A name in an expression simply returns the value of the variable with that name. If the variable was never
+ * set, it defaults to 0.
*
- * All binary operators have the same precedence. Sorry, I had to cut corners
- * somewhere.
+ * All binary operators have the same precedence. Sorry, I had to cut corners somewhere.
*
- * To keep things simple, I've omitted some stuff or hacked things a bit. When
- * possible, I'll leave a "HACK" note there explaining what and why. If you
- * make your own interpreter, you'll want to address those.
+ * To keep things simple, I've omitted some stuff or hacked things a bit. When possible, I'll leave a "HACK" note there
+ * explaining what and why. If you make your own interpreter, you'll want to address those.
*
* @author Bob Nystrom
*/
public class Jasic {
- /**
- * Runs the interpreter as a command-line app. Takes one argument: a path
- * to a script file to load and run. The script should contain one
- * statement per line.
- *
- * @param args Command-line arguments.
- */
- public static void main(String[] args) {
- // Just show the usage and quit if a script wasn't provided.
- if (args.length != 1) {
- System.out.println("Usage: jasic <script>");
- System.out.println("Where <script> is a relative path to a .jas script to run.");
- return;
- }
-
- // Read the file.
- String contents = readFile(args[0]);
-
- // Run it.
- Jasic jasic = new Jasic();
- jasic.interpret(contents);
- }
-
- // Tokenizing (lexing) -----------------------------------------------------
-
- /**
- * This function takes a script as a string of characters and chunks it into
- * a sequence of tokens. Each token is a meaningful unit of program, like a
- * variable name, a number, a string, or an operator.
- */
- private static List<Token> tokenize(String source) {
- List<Token> tokens = new ArrayList<Token>();
-
- String token = "";
- TokenizeState state = TokenizeState.DEFAULT;
-
- // Many tokens are a single character, like operators and ().
- String charTokens = "\n=+-*/<>()";
- TokenType[] tokenTypes = { TokenType.LINE, TokenType.EQUALS,
- TokenType.OPERATOR, TokenType.OPERATOR, TokenType.OPERATOR,
- TokenType.OPERATOR, TokenType.OPERATOR, TokenType.OPERATOR,
- TokenType.LEFT_PAREN, TokenType.RIGHT_PAREN
- };
-
- // Scan through the code one character at a time, building up the list
- // of tokens.
- for (int i = 0; i < source.length(); i++) {
- char c = source.charAt(i);
- switch (state) {
- case DEFAULT:
- if (charTokens.indexOf(c) != -1) {
- tokens.add(new Token(Character.toString(c),
- tokenTypes[charTokens.indexOf(c)]));
- } else if (Character.isLetter(c)) {
- token += c;
- state = TokenizeState.WORD;
- } else if (Character.isDigit(c)) {
- token += c;
- state = TokenizeState.NUMBER;
- } else if (c == '"') {
- state = TokenizeState.STRING;
- } else if (c == '\'') {
- state = TokenizeState.COMMENT;
- }
- break;
-
- case WORD:
- if (Character.isLetterOrDigit(c)) {
- token += c;
- } else if (c == ':') {
- tokens.add(new Token(token, TokenType.LABEL));
- token = "";
- state = TokenizeState.DEFAULT;
- } else {
- tokens.add(new Token(token, TokenType.WORD));
- token = "";
- state = TokenizeState.DEFAULT;
- i--; // Reprocess this character in the default state.
- }
- break;
-
- case NUMBER:
- // HACK: Negative numbers and floating points aren't supported.
- // To get a negative number, just do 0 - <your number>.
- // To get a floating point, divide.
- if (Character.isDigit(c)) {
- token += c;
- } else {
- tokens.add(new Token(token, TokenType.NUMBER));
- token = "";
- state = TokenizeState.DEFAULT;
- i--; // Reprocess this character in the default state.
- }
- break;
-
- case STRING:
- if (c == '"') {
- tokens.add(new Token(token, TokenType.STRING));
- token = "";
- state = TokenizeState.DEFAULT;
- } else {
- token += c;
- }
- break;
-
- case COMMENT:
- if (c == '\n') {
- state = TokenizeState.DEFAULT;
- }
- break;
- }
- }
-
- // HACK: Silently ignore any in-progress token when we run out of
- // characters. This means that, for example, if a script has a string
- // that's missing the closing ", it will just ditch it.
- return tokens;
- }
-
- // Token data --------------------------------------------------------------
-
- /**
- * This defines the different kinds of tokens or meaningful chunks of code
- * that the parser knows how to consume. These let us distinguish, for
- * example, between a string "foo" and a variable named "foo".
- *
- * HACK: A typical tokenizer would actually have unique token types for
- * each keyword (print, goto, etc.) so that the parser doesn't have to look
- * at the names, but Jasic is a little more crude.
- */
- private enum TokenType {
- WORD, NUMBER, STRING, LABEL, LINE,
- EQUALS, OPERATOR, LEFT_PAREN, RIGHT_PAREN, EOF
- }
-
- /**
- * This is a single meaningful chunk of code. It is created by the tokenizer
- * and consumed by the parser.
- */
- private static class Token {
- public Token(String text, TokenType type) {
- this.text = text;
- this.type = type;
- }
-
- public final String text;
- public final TokenType type;
- }
-
- /**
- * This defines the different states the tokenizer can be in while it's
- * scanning through the source code. Tokenizers are state machines, which
- * means the only data they need to store is where they are in the source
- * code and this one "state" or mode value.
- *
- * One of the main differences between tokenizing and parsing is this
- * regularity. Because the tokenizer stores only this one state value, it
- * can't handle nesting (which would require also storing a number to
- * identify how deeply nested you are). The parser is able to handle that.
- */
- private enum TokenizeState {
- DEFAULT, WORD, NUMBER, STRING, COMMENT
- }
-
- // Parsing -----------------------------------------------------------------
-
- /**
- * This defines the Jasic parser. The parser takes in a sequence of tokens
- * and generates an abstract syntax tree. This is the nested data structure
- * that represents the series of statements, and the expressions (which can
- * nest arbitrarily deeply) that they evaluate. In technical terms, what we
- * have is a recursive descent parser, the simplest kind to hand-write.
- *
- * As a side-effect, this phase also stores off the line numbers for each
- * label in the program. It's a bit gross, but it works.
- */
- private class Parser {
- public Parser(List<Token> tokens) {
- this.tokens = tokens;
- position = 0;
- }
-
- /**
- * The top-level function to start parsing. This will keep consuming
- * tokens and routing to the other parse functions for the different
- * grammar syntax until we run out of code to parse.
- *
- * @param labels A map of label names to statement indexes. The
- * parser will fill this in as it scans the code.
- * @return The list of parsed statements.
- */
- public List<Statement> parse(Map<String, Integer> labels) {
- List<Statement> statements = new ArrayList<Statement>();
-
- while (true) {
- // Ignore empty lines.
- while (match(TokenType.LINE));
-
- if (match(TokenType.LABEL)) {
- // Mark the index of the statement after the label.
- labels.put(last(1).text, statements.size());
- } else if (match(TokenType.WORD, TokenType.EQUALS)) {
- String name = last(2).text;
- Expression value = expression();
- statements.add(new AssignStatement(name, value));
- } else if (match("print")) {
- statements.add(new PrintStatement(expression()));
- } else if (match("input")) {
- statements.add(new InputStatement(
- consume(TokenType.WORD).text));
- } else if (match("goto")) {
- statements.add(new GotoStatement(
- consume(TokenType.WORD).text));
- } else if (match("if")) {
- Expression condition = expression();
- consume("then");
- String label = consume(TokenType.WORD).text;
- statements.add(new IfThenStatement(condition, label));
- } else break; // Unexpected token (likely EOF), so end.
- }
-
- return statements;
- }
-
- // The following functions each represent one grammatical part of the
- // language. If this parsed English, these functions would be named like
- // noun() and verb().
-
- /**
- * Parses a single expression. Recursive descent parsers start with the
- * lowest-precedent term and moves towards higher precedence. For Jasic,
- * binary operators (+, -, etc.) are the lowest.
- *
- * @return The parsed expression.
- */
- private Expression expression() {
- return operator();
- }
-
- /**
- * Parses a series of binary operator expressions into a single
- * expression. In Jasic, all operators have the same predecence and
- * associate left-to-right. That means it will interpret:
- * 1 + 2 * 3 - 4 / 5
- * like:
- * ((((1 + 2) * 3) - 4) / 5)
- *
- * It works by building the expression tree one at a time. So, given
- * this code: 1 + 2 * 3, this will:
- *
- * 1. Parse (1) as an atomic expression.
- * 2. See the (+) and start a new operator expression.
- * 3. Parse (2) as an atomic expression.
- * 4. Build a (1 + 2) expression and replace (1) with it.
- * 5. See the (*) and start a new operator expression.
- * 6. Parse (3) as an atomic expression.
- * 7. Build a ((1 + 2) * 3) expression and replace (1 + 2) with it.
- * 8. Return the last expression built.
- *
- * @return The parsed expression.
- */
- private Expression operator() {
- Expression expression = atomic();
-
- // Keep building operator expressions as long as we have operators.
- while (match(TokenType.OPERATOR) ||
- match(TokenType.EQUALS)) {
- char operator = last(1).text.charAt(0);
- Expression right = atomic();
- expression = new OperatorExpression(expression, operator, right);
- }
-
- return expression;
- }
-
- /**
- * Parses an "atomic" expression. This is the highest level of
- * precedence and contains single literal tokens like 123 and "foo", as
- * well as parenthesized expressions.
- *
- * @return The parsed expression.
- */
- private Expression atomic() {
- if (match(TokenType.WORD)) {
- // A word is a reference to a variable.
- return new VariableExpression(last(1).text);
- } else if (match(TokenType.NUMBER)) {
- return new NumberValue(Double.parseDouble(last(1).text));
- } else if (match(TokenType.STRING)) {
- return new StringValue(last(1).text);
- } else if (match(TokenType.LEFT_PAREN)) {
- // The contents of a parenthesized expression can be any
- // expression. This lets us "restart" the precedence cascade
- // so that you can have a lower precedence expression inside
- // the parentheses.
- Expression expression = expression();
- consume(TokenType.RIGHT_PAREN);
- return expression;
- }
- throw new Error("Couldn't parse :(");
- }
-
- // The following functions are the core low-level operations that the
- // grammar parser is built in terms of. They match and consume tokens in
- // the token stream.
-
- /**
- * Consumes the next two tokens if they are the given type (in order).
- * Consumes no tokens if either check fais.
- *
- * @param type1 Expected type of the next token.
- * @param type2 Expected type of the subsequent token.
- * @return True if tokens were consumed.
- */
- private boolean match(TokenType type1, TokenType type2) {
- if (get(0).type != type1) return false;
- if (get(1).type != type2) return false;
- position += 2;
- return true;
- }
-
- /**
- * Consumes the next token if it's the given type.
- *
- * @param type Expected type of the next token.
- * @return True if the token was consumed.
- */
- private boolean match(TokenType type) {
- if (get(0).type != type) return false;
- position++;
- return true;
- }
-
- /**
- * Consumes the next token if it's a word token with the given name.
- *
- * @param name Expected name of the next word token.
- * @return True if the token was consumed.
- */
- private boolean match(String name) {
- if (get(0).type != TokenType.WORD) return false;
- if (!get(0).text.equals(name)) return false;
- position++;
- return true;
- }
-
- /**
- * Consumes the next token if it's the given type. If not, throws an
- * exception. This is for cases where the parser demands a token of a
- * certain type in a certain position, for example a matching ) after
- * an opening (.
- *
- * @param type Expected type of the next token.
- * @return The consumed token.
- */
- private Token consume(TokenType type) {
- if (get(0).type != type) throw new Error("Expected " + type + ".");
- return tokens.get(position++);
- }
-
- /**
- * Consumes the next token if it's a word with the given name. If not,
- * throws an exception.
- *
- * @param name Expected name of the next word token.
- * @return The consumed token.
- */
- private Token consume(String name) {
- if (!match(name)) throw new Error("Expected " + name + ".");
- return last(1);
- }
-
- /**
- * Gets a previously consumed token, indexing backwards. last(1) will
- * be the token just consumed, last(2) the one before that, etc.
- *
- * @param offset How far back in the token stream to look.
- * @return The consumed token.
- */
- private Token last(int offset) {
- return tokens.get(position - offset);
- }
-
- /**
- * Gets an unconsumed token, indexing forward. get(0) will be the next
- * token to be consumed, get(1) the one after that, etc.
- *
- * @param offset How far forward in the token stream to look.
- * @return The yet-to-be-consumed token.
- */
- private Token get(int offset) {
- if (position + offset >= tokens.size()) {
- return new Token("", TokenType.EOF);
- }
- return tokens.get(position + offset);
- }
-
- private final List<Token> tokens;
- private int position;
- }
-
- // Abstract syntax tree (AST) ----------------------------------------------
-
- // These classes define the syntax tree data structures. This is how code is
- // represented internally in a way that's easy for the interpreter to
- // understand.
- //
- // HACK: Unlike most real compilers or interpreters, the logic to execute
- // the code is baked directly into these classes. Typically, it would be
- // separated out so that the AST us just a static data structure.
-
- /**
- * Base interface for a Jasic statement. The different supported statement
- * types like "print" and "goto" implement this.
- */
- public interface Statement {
- /**
- * Statements implement this to actually perform whatever behavior the
- * statement causes. "print" statements will display text here, "goto"
- * statements will change the current statement, etc.
- */
- void execute();
- }
-
- /**
- * Base interface for an expression. An expression is like a statement
- * except that it also returns a value when executed. Expressions do not
- * appear at the top level in Jasic programs, but are used in many
- * statements. For example, the value printed by a "print" statement is an
- * expression. Unlike statements, expressions can nest.
- */
- public interface Expression {
- /**
- * Expression classes implement this to evaluate the expression and
- * return the value.
- *
- * @return The value of the calculated expression.
- */
- Value evaluate();
- }
-
- /**
- * A "print" statement evaluates an expression, converts the result to a
- * string, and displays it to the user.
- */
- public class PrintStatement implements Statement {
- public PrintStatement(Expression expression) {
- this.expression = expression;
- }
-
- public void execute() {
- System.out.println(expression.evaluate().toString());
- }
-
- private final Expression expression;
- }
-
- /**
- * An "input" statement reads input from the user and stores it in a
- * variable.
- */
- public class InputStatement implements Statement {
- public InputStatement(String name) {
- this.name = name;
- }
-
- public void execute() {
- try {
- String input = lineIn.readLine();
-
- // Store it as a number if possible, otherwise use a string.
- try {
- double value = Double.parseDouble(input);
- variables.put(name, new NumberValue(value));
- } catch (NumberFormatException e) {
- variables.put(name, new StringValue(input));
- }
- } catch (IOException e1) {
- // HACK: Just ignore the problem.
- }
- }
-
- private final String name;
- }
-
- /**
- * An assignment statement evaluates an expression and stores the result in
- * a variable.
- */
- public class AssignStatement implements Statement {
- public AssignStatement(String name, Expression value) {
- this.name = name;
- this.value = value;
- }
-
- public void execute() {
- variables.put(name, value.evaluate());
- }
-
- private final String name;
- private final Expression value;
- }
-
- /**
- * A "goto" statement jumps execution to another place in the program.
- */
- public class GotoStatement implements Statement {
- public GotoStatement(String label) {
- this.label = label;
- }
-
- public void execute() {
- if (labels.containsKey(label)) {
- currentStatement = labels.get(label).intValue();
- }
- }
-
- private final String label;
- }
-
- /**
- * An if then statement jumps execution to another place in the program, but
- * only if an expression evaluates to something other than 0.
- */
- public class IfThenStatement implements Statement {
- public IfThenStatement(Expression condition, String label) {
- this.condition = condition;
- this.label = label;
- }
-
- public void execute() {
- if (labels.containsKey(label)) {
- double value = condition.evaluate().toNumber();
- if (value != 0) {
- currentStatement = labels.get(label).intValue();
- }
- }
- }
-
- private final Expression condition;
- private final String label;
- }
-
- /**
- * A variable expression evaluates to the current value stored in that
- * variable.
- */
- public class VariableExpression implements Expression {
- public VariableExpression(String name) {
- this.name = name;
- }
-
- public Value evaluate() {
- if (variables.containsKey(name)) {
- return variables.get(name);
- }
- return new NumberValue(0);
- }
-
- private final String name;
- }
-
- /**
- * An operator expression evaluates two expressions and then performs some
- * arithmetic operation on the results.
- */
- public class OperatorExpression implements Expression {
- public OperatorExpression(Expression left, char operator,
- Expression right) {
- this.left = left;
- this.operator = operator;
- this.right = right;
- }
-
- public Value evaluate() {
- Value leftVal = left.evaluate();
- Value rightVal = right.evaluate();
-
- switch (operator) {
- case '=':
- // Coerce to the left argument's type, then compare.
- if (leftVal instanceof NumberValue) {
- return new NumberValue((leftVal.toNumber() ==
- rightVal.toNumber()) ? 1 : 0);
- } else {
- return new NumberValue(leftVal.toString().equals(
- rightVal.toString()) ? 1 : 0);
- }
- case '+':
- // Addition if the left argument is a number, otherwise do
- // string concatenation.
- if (leftVal instanceof NumberValue) {
- return new NumberValue(leftVal.toNumber() +
- rightVal.toNumber());
- } else {
- return new StringValue(leftVal.toString() +
- rightVal.toString());
- }
- case '-':
- return new NumberValue(leftVal.toNumber() -
- rightVal.toNumber());
- case '*':
- return new NumberValue(leftVal.toNumber() *
- rightVal.toNumber());
- case '/':
- return new NumberValue(leftVal.toNumber() /
- rightVal.toNumber());
- case '<':
- // Coerce to the left argument's type, then compare.
- if (leftVal instanceof NumberValue) {
- return new NumberValue((leftVal.toNumber() <
- rightVal.toNumber()) ? 1 : 0);
- } else {
- return new NumberValue((leftVal.toString().compareTo(
- rightVal.toString()) < 0) ? 1 : 0);
- }
- case '>':
- // Coerce to the left argument's type, then compare.
- if (leftVal instanceof NumberValue) {
- return new NumberValue((leftVal.toNumber() >
- rightVal.toNumber()) ? 1 : 0);
- } else {
- return new NumberValue((leftVal.toString().compareTo(
- rightVal.toString()) > 0) ? 1 : 0);
- }
- }
- throw new Error("Unknown operator.");
- }
-
- private final Expression left;
- private final char operator;
- private final Expression right;
- }
-
- // Value types -------------------------------------------------------------
-
- /**
- * This is the base interface for a value. Values are the data that the
- * interpreter processes. They are what gets stored in variables, printed,
- * and operated on.
- *
- * There is an implementation of this interface for each of the different
- * primitive types (really just double and string) that Jasic supports.
- * Wrapping them in a single Value interface lets Jasic be dynamically-typed
- * and convert between different representations as needed.
- *
- * Note that Value extends Expression. This is a bit of a hack, but it lets
- * us use values (which are typically only ever seen by the interpreter and
- * not the parser) as both runtime values, and as object representing
- * literals in code.
- */
- public interface Value extends Expression {
- /**
- * Value types override this to convert themselves to a string
- * representation.
- */
- String toString();
-
- /**
- * Value types override this to convert themselves to a numeric
- * representation.
- */
- double toNumber();
- }
-
- /**
- * A numeric value. Jasic uses doubles internally for all numbers.
- */
- public class NumberValue implements Value {
- public NumberValue(double value) {
- this.value = value;
- }
-
- @Override public String toString() { return Double.toString(value); }
- public double toNumber() { return value; }
- public Value evaluate() { return this; }
-
- private final double value;
- }
-
- /**
- * A string value.
- */
- public class StringValue implements Value {
- public StringValue(String value) {
- this.value = value;
- }
-
- @Override public String toString() { return value; }
- public double toNumber() { return Double.parseDouble(value); }
- public Value evaluate() { return this; }
-
- private final String value;
- }
-
- // Interpreter -------------------------------------------------------------
-
- /**
- * Constructs a new Jasic instance. The instance stores the global state of
- * the interpreter such as the values of all of the variables and the
- * current statement.
- */
- public Jasic() {
- variables = new HashMap<String, Value>();
- labels = new HashMap<String, Integer>();
-
- InputStreamReader converter = new InputStreamReader(System.in);
- lineIn = new BufferedReader(converter);
- }
-
- /**
- * This is where the magic happens. This runs the code through the parsing
- * pipeline to generate the AST. Then it executes each statement. It keeps
- * track of the current line in a member variable that the statement objects
- * have access to. This lets "goto" and "if then" do flow control by simply
- * setting the index of the current statement.
- *
- * In an interpreter that didn't mix the interpretation logic in with the
- * AST node classes, this would be doing a lot more work.
- *
- * @param source A string containing the source code of a .jas script to
- * interpret.
- */
- public void interpret(String source) {
- // Tokenize.
- List<Token> tokens = tokenize(source);
-
- // Parse.
- Parser parser = new Parser(tokens);
- List<Statement> statements = parser.parse(labels);
-
- // Interpret until we're done.
- currentStatement = 0;
- while (currentStatement < statements.size()) {
- int thisStatement = currentStatement;
- currentStatement++;
- statements.get(thisStatement).execute();
- }
- }
-
- private final Map<String, Value> variables;
- private final Map<String, Integer> labels;
-
- private final BufferedReader lineIn;
-
- private int currentStatement;
-
- // Utility stuff -----------------------------------------------------------
-
- /**
- * Reads the file from the given path and returns its contents as a single
- * string.
- *
- * @param path Path to the text file to read.
- * @return The contents of the file or null if the load failed.
- * @throws IOException
- */
- private static String readFile(String path) {
- try {
- FileInputStream stream = new FileInputStream(path);
-
- try {
- InputStreamReader input = new InputStreamReader(stream,
- Charset.defaultCharset());
- Reader reader = new BufferedReader(input);
-
- StringBuilder builder = new StringBuilder();
- char[] buffer = new char[8192];
- int read;
-
- while ((read = reader.read(buffer, 0, buffer.length)) > 0) {
- builder.append(buffer, 0, read);
- }
-
- // HACK: The parser expects every statement to end in a newline,
- // even the very last one, so we'll just tack one on here in
- // case the file doesn't have one.
- builder.append("\n");
-
- return builder.toString();
- } finally {
- stream.close();
- }
- } catch (IOException ex) {
- return null;
- }
- }
+ /**
+ * Runs the interpreter as a command-line app. Takes one argument: a path to a script file to load and run. The
+ * script should contain one statement per line.
+ *
+ * @param args
+ * Command-line arguments.
+ */
+ public static void main(String[] args) {
+ // Just show the usage and quit if a script wasn't provided.
+ if (args.length != 1) {
+ System.out.println("Usage: jasic <script>");
+ System.out.println("Where <script> is a relative path to a .jas script to run.");
+ return;
+ }
+
+ // Read the file.
+ String contents = readFile(args[0]);
+
+ // Run it.
+ Jasic jasic = new Jasic();
+ jasic.interpret(contents);
+ }
+
+ // Tokenizing (lexing) -----------------------------------------------------
+
+ /**
+ * This function takes a script as a string of characters and chunks it into a sequence of tokens. Each token is a
+ * meaningful unit of program, like a variable name, a number, a string, or an operator.
+ */
+ private static List<Token> tokenize(String source) {
+ List<Token> tokens = new ArrayList<Token>();
+
+ String token = "";
+ TokenizeState state = TokenizeState.DEFAULT;
+
+ // Many tokens are a single character, like operators and ().
+ String charTokens = "\n=+-*/<>()";
+ TokenType[] tokenTypes = { TokenType.LINE, TokenType.EQUALS, TokenType.OPERATOR, TokenType.OPERATOR,
+ TokenType.OPERATOR, TokenType.OPERATOR, TokenType.OPERATOR, TokenType.OPERATOR, TokenType.LEFT_PAREN,
+ TokenType.RIGHT_PAREN };
+
+ // Scan through the code one character at a time, building up the list
+ // of tokens.
+ for (int i = 0; i < source.length(); i++) {
+ char c = source.charAt(i);
+ switch (state) {
+ case DEFAULT:
+ if (charTokens.indexOf(c) != -1) {
+ tokens.add(new Token(Character.toString(c), tokenTypes[charTokens.indexOf(c)]));
+ } else if (Character.isLetter(c)) {
+ token += c;
+ state = TokenizeState.WORD;
+ } else if (Character.isDigit(c)) {
+ token += c;
+ state = TokenizeState.NUMBER;
+ } else if (c == '"') {
+ state = TokenizeState.STRING;
+ } else if (c == '\'') {
+ state = TokenizeState.COMMENT;
+ }
+ break;
+
+ case WORD:
+ if (Character.isLetterOrDigit(c)) {
+ token += c;
+ } else if (c == ':') {
+ tokens.add(new Token(token, TokenType.LABEL));
+ token = "";
+ state = TokenizeState.DEFAULT;
+ } else {
+ tokens.add(new Token(token, TokenType.WORD));
+ token = "";
+ state = TokenizeState.DEFAULT;
+ i--; // Reprocess this character in the default state.
+ }
+ break;
+
+ case NUMBER:
+ // HACK: Negative numbers and floating points aren't supported.
+ // To get a negative number, just do 0 - <your number>.
+ // To get a floating point, divide.
+ if (Character.isDigit(c)) {
+ token += c;
+ } else {
+ tokens.add(new Token(token, TokenType.NUMBER));
+ token = "";
+ state = TokenizeState.DEFAULT;
+ i--; // Reprocess this character in the default state.
+ }
+ break;
+
+ case STRING:
+ if (c == '"') {
+ tokens.add(new Token(token, TokenType.STRING));
+ token = "";
+ state = TokenizeState.DEFAULT;
+ } else {
+ token += c;
+ }
+ break;
+
+ case COMMENT:
+ if (c == '\n') {
+ state = TokenizeState.DEFAULT;
+ }
+ break;
+ }
+ }
+
+ // HACK: Silently ignore any in-progress token when we run out of
+ // characters. This means that, for example, if a script has a string
+ // that's missing the closing ", it will just ditch it.
+ return tokens;
+ }
+
+ // Token data --------------------------------------------------------------
+
+ /**
+ * This defines the different kinds of tokens or meaningful chunks of code that the parser knows how to consume.
+ * These let us distinguish, for example, between a string "foo" and a variable named "foo".
+ *
+ * HACK: A typical tokenizer would actually have unique token types for each keyword (print, goto, etc.) so that the
+ * parser doesn't have to look at the names, but Jasic is a little more crude.
+ */
+ private enum TokenType {
+ WORD, NUMBER, STRING, LABEL, LINE, EQUALS, OPERATOR, LEFT_PAREN, RIGHT_PAREN, EOF
+ }
+
+ /**
+ * This is a single meaningful chunk of code. It is created by the tokenizer and consumed by the parser.
+ */
+ private static class Token {
+ public Token(String text, TokenType type) {
+ this.text = text;
+ this.type = type;
+ }
+
+ public final String text;
+ public final TokenType type;
+ }
+
+ /**
+ * This defines the different states the tokenizer can be in while it's scanning through the source code. Tokenizers
+ * are state machines, which means the only data they need to store is where they are in the source code and this
+ * one "state" or mode value.
+ *
+ * One of the main differences between tokenizing and parsing is this regularity. Because the tokenizer stores only
+ * this one state value, it can't handle nesting (which would require also storing a number to identify how deeply
+ * nested you are). The parser is able to handle that.
+ */
+ private enum TokenizeState {
+ DEFAULT, WORD, NUMBER, STRING, COMMENT
+ }
+
+ // Parsing -----------------------------------------------------------------
+
+ /**
+ * This defines the Jasic parser. The parser takes in a sequence of tokens and generates an abstract syntax tree.
+ * This is the nested data structure that represents the series of statements, and the expressions (which can nest
+ * arbitrarily deeply) that they evaluate. In technical terms, what we have is a recursive descent parser, the
+ * simplest kind to hand-write.
+ *
+ * As a side-effect, this phase also stores off the line numbers for each label in the program. It's a bit gross,
+ * but it works.
+ */
+ private class Parser {
+ public Parser(List<Token> tokens) {
+ this.tokens = tokens;
+ position = 0;
+ }
+
+ /**
+ * The top-level function to start parsing. This will keep consuming tokens and routing to the other parse
+ * functions for the different grammar syntax until we run out of code to parse.
+ *
+ * @param labels
+ * A map of label names to statement indexes. The parser will fill this in as it scans the code.
+ * @return The list of parsed statements.
+ */
+ public List<Statement> parse(Map<String, Integer> labels) {
+ List<Statement> statements = new ArrayList<Statement>();
+
+ while (true) {
+ // Ignore empty lines.
+ while (match(TokenType.LINE))
+ ;
+
+ if (match(TokenType.LABEL)) {
+ // Mark the index of the statement after the label.
+ labels.put(last(1).text, statements.size());
+ } else if (match(TokenType.WORD, TokenType.EQUALS)) {
+ String name = last(2).text;
+ Expression value = expression();
+ statements.add(new AssignStatement(name, value));
+ } else if (match("print")) {
+ statements.add(new PrintStatement(expression()));
+ } else if (match("input")) {
+ statements.add(new InputStatement(consume(TokenType.WORD).text));
+ } else if (match("goto")) {
+ statements.add(new GotoStatement(consume(TokenType.WORD).text));
+ } else if (match("if")) {
+ Expression condition = expression();
+ consume("then");
+ String label = consume(TokenType.WORD).text;
+ statements.add(new IfThenStatement(condition, label));
+ } else
+ break; // Unexpected token (likely EOF), so end.
+ }
+
+ return statements;
+ }
+
+ // The following functions each represent one grammatical part of the
+ // language. If this parsed English, these functions would be named like
+ // noun() and verb().
+
+ /**
+ * Parses a single expression. Recursive descent parsers start with the lowest-precedent term and moves towards
+ * higher precedence. For Jasic, binary operators (+, -, etc.) are the lowest.
+ *
+ * @return The parsed expression.
+ */
+ private Expression expression() {
+ return operator();
+ }
+
+ /**
+ * Parses a series of binary operator expressions into a single expression. In Jasic, all operators have the
+ * same predecence and associate left-to-right. That means it will interpret: 1 + 2 * 3 - 4 / 5 like: ((((1 + 2)
+ * * 3) - 4) / 5)
+ *
+ * It works by building the expression tree one at a time. So, given this code: 1 + 2 * 3, this will:
+ *
+ * 1. Parse (1) as an atomic expression. 2. See the (+) and start a new operator expression. 3. Parse (2) as an
+ * atomic expression. 4. Build a (1 + 2) expression and replace (1) with it. 5. See the (*) and start a new
+ * operator expression. 6. Parse (3) as an atomic expression. 7. Build a ((1 + 2) * 3) expression and replace (1
+ * + 2) with it. 8. Return the last expression built.
+ *
+ * @return The parsed expression.
+ */
+ private Expression operator() {
+ Expression expression = atomic();
+
+ // Keep building operator expressions as long as we have operators.
+ while (match(TokenType.OPERATOR) || match(TokenType.EQUALS)) {
+ char operator = last(1).text.charAt(0);
+ Expression right = atomic();
+ expression = new OperatorExpression(expression, operator, right);
+ }
+
+ return expression;
+ }
+
+ /**
+ * Parses an "atomic" expression. This is the highest level of precedence and contains single literal tokens
+ * like 123 and "foo", as well as parenthesized expressions.
+ *
+ * @return The parsed expression.
+ */
+ private Expression atomic() {
+ if (match(TokenType.WORD)) {
+ // A word is a reference to a variable.
+ return new VariableExpression(last(1).text);
+ } else if (match(TokenType.NUMBER)) {
+ return new NumberValue(Double.parseDouble(last(1).text));
+ } else if (match(TokenType.STRING)) {
+ return new StringValue(last(1).text);
+ } else if (match(TokenType.LEFT_PAREN)) {
+ // The contents of a parenthesized expression can be any
+ // expression. This lets us "restart" the precedence cascade
+ // so that you can have a lower precedence expression inside
+ // the parentheses.
+ Expression expression = expression();
+ consume(TokenType.RIGHT_PAREN);
+ return expression;
+ }
+ throw new Error("Couldn't parse :(");
+ }
+
+ // The following functions are the core low-level operations that the
+ // grammar parser is built in terms of. They match and consume tokens in
+ // the token stream.
+
+ /**
+ * Consumes the next two tokens if they are the given type (in order). Consumes no tokens if either check fais.
+ *
+ * @param type1
+ * Expected type of the next token.
+ * @param type2
+ * Expected type of the subsequent token.
+ * @return True if tokens were consumed.
+ */
+ private boolean match(TokenType type1, TokenType type2) {
+ if (get(0).type != type1)
+ return false;
+ if (get(1).type != type2)
+ return false;
+ position += 2;
+ return true;
+ }
+
+ /**
+ * Consumes the next token if it's the given type.
+ *
+ * @param type
+ * Expected type of the next token.
+ * @return True if the token was consumed.
+ */
+ private boolean match(TokenType type) {
+ if (get(0).type != type)
+ return false;
+ position++;
+ return true;
+ }
+
+ /**
+ * Consumes the next token if it's a word token with the given name.
+ *
+ * @param name
+ * Expected name of the next word token.
+ * @return True if the token was consumed.
+ */
+ private boolean match(String name) {
+ if (get(0).type != TokenType.WORD)
+ return false;
+ if (!get(0).text.equals(name))
+ return false;
+ position++;
+ return true;
+ }
+
+ /**
+ * Consumes the next token if it's the given type. If not, throws an exception. This is for cases where the
+ * parser demands a token of a certain type in a certain position, for example a matching ) after an opening (.
+ *
+ * @param type
+ * Expected type of the next token.
+ * @return The consumed token.
+ */
+ private Token consume(TokenType type) {
+ if (get(0).type != type)
+ throw new Error("Expected " + type + ".");
+ return tokens.get(position++);
+ }
+
+ /**
+ * Consumes the next token if it's a word with the given name. If not, throws an exception.
+ *
+ * @param name
+ * Expected name of the next word token.
+ * @return The consumed token.
+ */
+ private Token consume(String name) {
+ if (!match(name))
+ throw new Error("Expected " + name + ".");
+ return last(1);
+ }
+
+ /**
+ * Gets a previously consumed token, indexing backwards. last(1) will be the token just consumed, last(2) the
+ * one before that, etc.
+ *
+ * @param offset
+ * How far back in the token stream to look.
+ * @return The consumed token.
+ */
+ private Token last(int offset) {
+ return tokens.get(position - offset);
+ }
+
+ /**
+ * Gets an unconsumed token, indexing forward. get(0) will be the next token to be consumed, get(1) the one
+ * after that, etc.
+ *
+ * @param offset
+ * How far forward in the token stream to look.
+ * @return The yet-to-be-consumed token.
+ */
+ private Token get(int offset) {
+ if (position + offset >= tokens.size()) {
+ return new Token("", TokenType.EOF);
+ }
+ return tokens.get(position + offset);
+ }
+
+ private final List<Token> tokens;
+ private int position;
+ }
+
+ // Abstract syntax tree (AST) ----------------------------------------------
+
+ // These classes define the syntax tree data structures. This is how code is
+ // represented internally in a way that's easy for the interpreter to
+ // understand.
+ //
+ // HACK: Unlike most real compilers or interpreters, the logic to execute
+ // the code is baked directly into these classes. Typically, it would be
+ // separated out so that the AST us just a static data structure.
+
+ /**
+ * Base interface for a Jasic statement. The different supported statement types like "print" and "goto" implement
+ * this.
+ */
+ public interface Statement {
+ /**
+ * Statements implement this to actually perform whatever behavior the statement causes. "print" statements will
+ * display text here, "goto" statements will change the current statement, etc.
+ */
+ void execute();
+ }
+
+ /**
+ * Base interface for an expression. An expression is like a statement except that it also returns a value when
+ * executed. Expressions do not appear at the top level in Jasic programs, but are used in many statements. For
+ * example, the value printed by a "print" statement is an expression. Unlike statements, expressions can nest.
+ */
+ public interface Expression {
+ /**
+ * Expression classes implement this to evaluate the expression and return the value.
+ *
+ * @return The value of the calculated expression.
+ */
+ Value evaluate();
+ }
+
+ /**
+ * A "print" statement evaluates an expression, converts the result to a string, and displays it to the user.
+ */
+ public class PrintStatement implements Statement {
+ public PrintStatement(Expression expression) {
+ this.expression = expression;
+ }
+
+ public void execute() {
+ System.out.println(expression.evaluate().toString());
+ }
+
+ private final Expression expression;
+ }
+
+ /**
+ * An "input" statement reads input from the user and stores it in a variable.
+ */
+ public class InputStatement implements Statement {
+ public InputStatement(String name) {
+ this.name = name;
+ }
+
+ public void execute() {
+ try {
+ String input = lineIn.readLine();
+
+ // Store it as a number if possible, otherwise use a string.
+ try {
+ double value = Double.parseDouble(input);
+ variables.put(name, new NumberValue(value));
+ } catch (NumberFormatException e) {
+ variables.put(name, new StringValue(input));
+ }
+ } catch (IOException e1) {
+ // HACK: Just ignore the problem.
+ }
+ }
+
+ private final String name;
+ }
+
+ /**
+ * An assignment statement evaluates an expression and stores the result in a variable.
+ */
+ public class AssignStatement implements Statement {
+ public AssignStatement(String name, Expression value) {
+ this.name = name;
+ this.value = value;
+ }
+
+ public void execute() {
+ variables.put(name, value.evaluate());
+ }
+
+ private final String name;
+ private final Expression value;
+ }
+
+ /**
+ * A "goto" statement jumps execution to another place in the program.
+ */
+ public class GotoStatement implements Statement {
+ public GotoStatement(String label) {
+ this.label = label;
+ }
+
+ public void execute() {
+ if (labels.containsKey(label)) {
+ currentStatement = labels.get(label).intValue();
+ }
+ }
+
+ private final String label;
+ }
+
+ /**
+ * An if then statement jumps execution to another place in the program, but only if an expression evaluates to
+ * something other than 0.
+ */
+ public class IfThenStatement implements Statement {
+ public IfThenStatement(Expression condition, String label) {
+ this.condition = condition;
+ this.label = label;
+ }
+
+ public void execute() {
+ if (labels.containsKey(label)) {
+ double value = condition.evaluate().toNumber();
+ if (value != 0) {
+ currentStatement = labels.get(label).intValue();
+ }
+ }
+ }
+
+ private final Expression condition;
+ private final String label;
+ }
+
+ /**
+ * A variable expression evaluates to the current value stored in that variable.
+ */
+ public class VariableExpression implements Expression {
+ public VariableExpression(String name) {
+ this.name = name;
+ }
+
+ public Value evaluate() {
+ if (variables.containsKey(name)) {
+ return variables.get(name);
+ }
+ return new NumberValue(0);
+ }
+
+ private final String name;
+ }
+
+ /**
+ * An operator expression evaluates two expressions and then performs some arithmetic operation on the results.
+ */
+ public class OperatorExpression implements Expression {
+ public OperatorExpression(Expression left, char operator, Expression right) {
+ this.left = left;
+ this.operator = operator;
+ this.right = right;
+ }
+
+ public Value evaluate() {
+ Value leftVal = left.evaluate();
+ Value rightVal = right.evaluate();
+
+ switch (operator) {
+ case '=':
+ // Coerce to the left argument's type, then compare.
+ if (leftVal instanceof NumberValue) {
+ return new NumberValue((leftVal.toNumber() == rightVal.toNumber()) ? 1 : 0);
+ } else {
+ return new NumberValue(leftVal.toString().equals(rightVal.toString()) ? 1 : 0);
+ }
+ case '+':
+ // Addition if the left argument is a number, otherwise do
+ // string concatenation.
+ if (leftVal instanceof NumberValue) {
+ return new NumberValue(leftVal.toNumber() + rightVal.toNumber());
+ } else {
+ return new StringValue(leftVal.toString() + rightVal.toString());
+ }
+ case '-':
+ return new NumberValue(leftVal.toNumber() - rightVal.toNumber());
+ case '*':
+ return new NumberValue(leftVal.toNumber() * rightVal.toNumber());
+ case '/':
+ return new NumberValue(leftVal.toNumber() / rightVal.toNumber());
+ case '<':
+ // Coerce to the left argument's type, then compare.
+ if (leftVal instanceof NumberValue) {
+ return new NumberValue((leftVal.toNumber() < rightVal.toNumber()) ? 1 : 0);
+ } else {
+ return new NumberValue((leftVal.toString().compareTo(rightVal.toString()) < 0) ? 1 : 0);
+ }
+ case '>':
+ // Coerce to the left argument's type, then compare.
+ if (leftVal instanceof NumberValue) {
+ return new NumberValue((leftVal.toNumber() > rightVal.toNumber()) ? 1 : 0);
+ } else {
+ return new NumberValue((leftVal.toString().compareTo(rightVal.toString()) > 0) ? 1 : 0);
+ }
+ }
+ throw new Error("Unknown operator.");
+ }
+
+ private final Expression left;
+ private final char operator;
+ private final Expression right;
+ }
+
+ // Value types -------------------------------------------------------------
+
+ /**
+ * This is the base interface for a value. Values are the data that the interpreter processes. They are what gets
+ * stored in variables, printed, and operated on.
+ *
+ * There is an implementation of this interface for each of the different primitive types (really just double and
+ * string) that Jasic supports. Wrapping them in a single Value interface lets Jasic be dynamically-typed and
+ * convert between different representations as needed.
+ *
+ * Note that Value extends Expression. This is a bit of a hack, but it lets us use values (which are typically only
+ * ever seen by the interpreter and not the parser) as both runtime values, and as object representing literals in
+ * code.
+ */
+ public interface Value extends Expression {
+ /**
+ * Value types override this to convert themselves to a string representation.
+ */
+ String toString();
+
+ /**
+ * Value types override this to convert themselves to a numeric representation.
+ */
+ double toNumber();
+ }
+
+ /**
+ * A numeric value. Jasic uses doubles internally for all numbers.
+ */
+ public class NumberValue implements Value {
+ public NumberValue(double value) {
+ this.value = value;
+ }
+
+ @Override
+ public String toString() {
+ return Double.toString(value);
+ }
+
+ public double toNumber() {
+ return value;
+ }
+
+ public Value evaluate() {
+ return this;
+ }
+
+ private final double value;
+ }
+
+ /**
+ * A string value.
+ */
+ public class StringValue implements Value {
+ public StringValue(String value) {
+ this.value = value;
+ }
+
+ @Override
+ public String toString() {
+ return value;
+ }
+
+ public double toNumber() {
+ return Double.parseDouble(value);
+ }
+
+ public Value evaluate() {
+ return this;
+ }
+
+ private final String value;
+ }
+
+ // Interpreter -------------------------------------------------------------
+
+ /**
+ * Constructs a new Jasic instance. The instance stores the global state of the interpreter such as the values of
+ * all of the variables and the current statement.
+ */
+ public Jasic() {
+ variables = new HashMap<String, Value>();
+ labels = new HashMap<String, Integer>();
+
+ InputStreamReader converter = new InputStreamReader(System.in);
+ lineIn = new BufferedReader(converter);
+ }
+
+ /**
+ * This is where the magic happens. This runs the code through the parsing pipeline to generate the AST. Then it
+ * executes each statement. It keeps track of the current line in a member variable that the statement objects have
+ * access to. This lets "goto" and "if then" do flow control by simply setting the index of the current statement.
+ *
+ * In an interpreter that didn't mix the interpretation logic in with the AST node classes, this would be doing a
+ * lot more work.
+ *
+ * @param source
+ * A string containing the source code of a .jas script to interpret.
+ */
+ public void interpret(String source) {
+ // Tokenize.
+ List<Token> tokens = tokenize(source);
+
+ // Parse.
+ Parser parser = new Parser(tokens);
+ List<Statement> statements = parser.parse(labels);
+
+ // Interpret until we're done.
+ currentStatement = 0;
+ while (currentStatement < statements.size()) {
+ int thisStatement = currentStatement;
+ currentStatement++;
+ statements.get(thisStatement).execute();
+ }
+ }
+
+ private final Map<String, Value> variables;
+ private final Map<String, Integer> labels;
+
+ private final BufferedReader lineIn;
+
+ private int currentStatement;
+
+ // Utility stuff -----------------------------------------------------------
+
+ /**
+ * Reads the file from the given path and returns its contents as a single string.
+ *
+ * @param path
+ * Path to the text file to read.
+ * @return The contents of the file or null if the load failed.
+ * @throws IOException
+ */
+ private static String readFile(String path) {
+ try {
+ FileInputStream stream = new FileInputStream(path);
+
+ try {
+ InputStreamReader input = new InputStreamReader(stream, Charset.defaultCharset());
+ Reader reader = new BufferedReader(input);
+
+ StringBuilder builder = new StringBuilder();
+ char[] buffer = new char[8192];
+ int read;
+
+ while ((read = reader.read(buffer, 0, buffer.length)) > 0) {
+ builder.append(buffer, 0, read);
+ }
+
+ // HACK: The parser expects every statement to end in a newline,
+ // even the very last one, so we'll just tack one on here in
+ // case the file doesn't have one.
+ builder.append("\n");
+
+ return builder.toString();
+ } finally {
+ stream.close();
+ }
+ } catch (IOException ex) {
+ return null;
+ }
+ }
}
diff --git a/src/net/sourceforge/plantuml/jdot/CucaDiagramFileMakerJDot.java b/src/net/sourceforge/plantuml/jdot/CucaDiagramFileMakerJDot.java
index 2649655..7e2dbc5 100644
--- a/src/net/sourceforge/plantuml/jdot/CucaDiagramFileMakerJDot.java
+++ b/src/net/sourceforge/plantuml/jdot/CucaDiagramFileMakerJDot.java
@@ -449,7 +449,7 @@ public class CucaDiagramFileMakerJDot implements CucaDiagramFileMaker {
} catch (Throwable e) {
UmlDiagram.exportDiagramError(os, e, fileFormatOption, diagram.seed(), diagram.getMetadata(),
diagram.getFlashData(), getFailureText3(e));
- return new ImageDataSimple();
+ return ImageDataSimple.error();
} finally {
Z.close();
}
diff --git a/src/net/sourceforge/plantuml/math/AsciiMath.java b/src/net/sourceforge/plantuml/math/AsciiMath.java
index c39d3ac..3056790 100644
--- a/src/net/sourceforge/plantuml/math/AsciiMath.java
+++ b/src/net/sourceforge/plantuml/math/AsciiMath.java
@@ -82,10 +82,14 @@ public class AsciiMath implements ScientificEquation {
final ScriptEngine engine = new ScriptEngineManager().getEngineByName("JavaScript");
engine.eval(JAVASCRIPT_CODE);
final Invocable inv = (Invocable) engine;
- this.tex = (String) inv.invokeFunction("plantuml", form);
+ this.tex = patchColor((String) inv.invokeFunction("plantuml", form));
this.builder = new LatexBuilder(tex);
}
+ private String patchColor(String latex) {
+ return latex.replace("\\color{", "\\textcolor{");
+ }
+
public Dimension2D getDimension() {
return builder.getDimension();
}
diff --git a/src/net/sourceforge/plantuml/math/PSystemMath.java b/src/net/sourceforge/plantuml/math/PSystemMath.java
index 673998a..9fe3db8 100644
--- a/src/net/sourceforge/plantuml/math/PSystemMath.java
+++ b/src/net/sourceforge/plantuml/math/PSystemMath.java
@@ -41,12 +41,19 @@ import java.io.OutputStream;
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.HtmlColor;
+import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
+import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
public class PSystemMath extends AbstractPSystem {
private String math = "";
+ private float scale = 1;
+ private Color color = Color.BLACK;
+ private Color backColor = Color.WHITE;
public PSystemMath() {
}
@@ -59,11 +66,53 @@ public class PSystemMath extends AbstractPSystem {
final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed)
throws IOException {
final ScientificEquationSafe asciiMath = ScientificEquationSafe.fromAsciiMath(math);
- return asciiMath.export(os, fileFormat, 1, Color.BLACK, Color.WHITE);
+ return asciiMath.export(os, fileFormat, scale, color, backColor);
}
public void doCommandLine(String line) {
- this.math = line;
+ final String lineLower = StringUtils.trin(StringUtils.goLowerCase(line));
+ final String colorParam = "color ";
+ final String backParam = "backgroundcolor ";
+ if (lineLower.startsWith(colorParam)) {
+ final Color col3 = getColor(line.substring(colorParam.length()));
+ if (col3 != null) {
+ color = col3;
+ }
+ } else if (lineLower.startsWith(backParam)) {
+ final Color col3 = getColor(line.substring(backParam.length()));
+ if (col3 != null) {
+ backColor = col3;
+ }
+ } else if (lineLower.startsWith("scale ")) {
+ final String value = line.substring("scale ".length());
+ try {
+ final float scale1 = Float.parseFloat(value);
+ if (scale1 > 0) {
+ scale = scale1;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ } else if (lineLower.startsWith("dpi ")) {
+ final String value = line.substring("dpi ".length());
+ try {
+ final float dpi1 = Float.parseFloat(value);
+ if (dpi1 > 0) {
+ scale = dpi1 / 96;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ } else {
+ this.math = line;
+
+ }
+ }
+
+ private Color getColor(final String col) {
+ final HtmlColor col2 = new HtmlColorSetSimple().getColorIfValid(col);
+ final Color col3 = new ColorMapperIdentity().getMappedColor(col2);
+ return col3;
}
}
diff --git a/src/net/sourceforge/plantuml/math/ScientificEquationSafe.java b/src/net/sourceforge/plantuml/math/ScientificEquationSafe.java
index a1499a1..e8b8271 100644
--- a/src/net/sourceforge/plantuml/math/ScientificEquationSafe.java
+++ b/src/net/sourceforge/plantuml/math/ScientificEquationSafe.java
@@ -147,7 +147,7 @@ public class ScientificEquationSafe {
return new ImageDataSimple(image.getWidth(), image.getHeight());
}
if (fileFormat.getFileFormat() == FileFormat.SVG) {
- os.write(getSvg(1, foregroundColor, backgroundColor).getSvg().getBytes());
+ os.write(getSvg(1, foregroundColor, backgroundColor).getSvg(true).getBytes());
return dimSvg;
}
return null;
diff --git a/src/net/sourceforge/plantuml/mda/MDADiagramImpl.java b/src/net/sourceforge/plantuml/mda/MDADiagramImpl.java
index 1121531..851b7ad 100644
--- a/src/net/sourceforge/plantuml/mda/MDADiagramImpl.java
+++ b/src/net/sourceforge/plantuml/mda/MDADiagramImpl.java
@@ -73,7 +73,7 @@ public class MDADiagramImpl implements MDADiagram {
private MDADiagramImpl(ClassDiagram classDiagram) {
final EntityFactory entityFactory = classDiagram.getEntityFactory();
packages.add(new MDAPackageImpl(entityFactory.getRootGroup()));
- for (IGroup group : entityFactory.getGroups().values()) {
+ for (IGroup group : entityFactory.getGroupsvalues()) {
packages.add(new MDAPackageImpl(group));
}
}
diff --git a/src/net/sourceforge/plantuml/objectdiagram/AbstractClassOrObjectDiagram.java b/src/net/sourceforge/plantuml/objectdiagram/AbstractClassOrObjectDiagram.java
index b179bf7..20b0418 100644
--- a/src/net/sourceforge/plantuml/objectdiagram/AbstractClassOrObjectDiagram.java
+++ b/src/net/sourceforge/plantuml/objectdiagram/AbstractClassOrObjectDiagram.java
@@ -39,6 +39,7 @@ import java.util.ArrayList;
import java.util.List;
import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram;
+import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.cucadiagram.Code;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.IEntity;
@@ -93,16 +94,71 @@ public abstract class AbstractClassOrObjectDiagram extends AbstractEntityDiagram
private final List<Association> associations = new ArrayList<Association>();
+ public CommandExecutionResult associationClass(Code clName1A, Code clName1B, Code clName2A, Code clName2B,
+ LinkType linkType, Display label) {
+ final IEntity entity1A = getOrCreateLeaf(clName1A, null, null);
+ final IEntity entity1B = getOrCreateLeaf(clName1B, null, null);
+ final IEntity entity2A = getOrCreateLeaf(clName2A, null, null);
+ final IEntity entity2B = getOrCreateLeaf(clName2B, null, null);
+ final List<Association> same1 = getExistingAssociatedPoints(entity1A, entity1B);
+ final List<Association> same2 = getExistingAssociatedPoints(entity2A, entity2B);
+ if (same1.size() == 0 && same2.size() == 0) {
+
+ final IEntity point1 = getOrCreateLeaf(UniqueSequence.getCode("apoint"), LeafType.POINT_FOR_ASSOCIATION,
+ null);
+ final IEntity point2 = getOrCreateLeaf(UniqueSequence.getCode("apoint"), LeafType.POINT_FOR_ASSOCIATION,
+ null);
+
+ insertPointBetween(entity1A, entity1B, point1);
+ insertPointBetween(entity2A, entity2B, point2);
+
+ final int length = 1;
+ final Link point1ToPoint2 = new Link(point1, point2, linkType, label, length);
+ addLink(point1ToPoint2);
+
+ return CommandExecutionResult.ok();
+ }
+ return CommandExecutionResult.error("Cannot link two associations points");
+ }
+
+ private void insertPointBetween(final IEntity entity1A, final IEntity entity1B, final IEntity point1) {
+ Link existingLink1 = foundLink(entity1A, entity1B);
+ if (existingLink1 == null) {
+ existingLink1 = new Link(entity1A, entity1B, new LinkType(LinkDecor.NONE, LinkDecor.NONE), Display.NULL, 2);
+ } else {
+ removeLink(existingLink1);
+ }
+
+ final IEntity entity1real = existingLink1.isInverted() ? existingLink1.getEntity2() : existingLink1
+ .getEntity1();
+ final IEntity entity2real = existingLink1.isInverted() ? existingLink1.getEntity1() : existingLink1
+ .getEntity2();
+
+ final Link entity1ToPoint = new Link(entity1real, point1, existingLink1.getType().getPart2(),
+ existingLink1.getLabel(), existingLink1.getLength(), existingLink1.getQualifier1(), null,
+ existingLink1.getLabeldistance(), existingLink1.getLabelangle());
+ entity1ToPoint.setLinkArrow(existingLink1.getLinkArrow());
+ final Link pointToEntity2 = new Link(point1, entity2real, existingLink1.getType().getPart1(), Display.NULL,
+ existingLink1.getLength(), null, existingLink1.getQualifier2(), existingLink1.getLabeldistance(),
+ existingLink1.getLabelangle());
+
+ // int length = 1;
+ // if (existingLink.getLength() == 1 && entity1A != entity1B) {
+ // length = 2;
+ // }
+ // if (existingLink.getLength() == 2 && entity1A == entity1B) {
+ // length = 2;
+ // }
+
+ addLink(entity1ToPoint);
+ addLink(pointToEntity2);
+ }
+
public boolean associationClass(int mode, Code clName1, Code clName2, IEntity associed, LinkType linkType,
Display label) {
final IEntity entity1 = getOrCreateLeaf(clName1, null, null);
final IEntity entity2 = getOrCreateLeaf(clName2, null, null);
- final List<Association> same = new ArrayList<Association>();
- for (Association existing : associations) {
- if (existing.sameCouple(entity1, entity2)) {
- same.add(existing);
- }
- }
+ final List<Association> same = getExistingAssociatedPoints(entity1, entity2);
if (same.size() > 1) {
return false;
} else if (same.size() == 0) {
@@ -120,6 +176,16 @@ public abstract class AbstractClassOrObjectDiagram extends AbstractEntityDiagram
return true;
}
+ private List<Association> getExistingAssociatedPoints(final IEntity entity1, final IEntity entity2) {
+ final List<Association> same = new ArrayList<Association>();
+ for (Association existing : associations) {
+ if (existing.sameCouple(entity1, entity2)) {
+ same.add(existing);
+ }
+ }
+ return same;
+ }
+
class Association {
private IEntity entity1;
private IEntity entity2;
diff --git a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObjectMultilines.java b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObjectMultilines.java
index 35f39dd..a1816bf 100644
--- a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObjectMultilines.java
+++ b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObjectMultilines.java
@@ -79,7 +79,7 @@ public class CommandCreateEntityObjectMultilines extends CommandMultilines2<Abst
return "(?i)^[%s]*\\}[%s]*$";
}
- public CommandExecutionResult executeNow(AbstractClassOrObjectDiagram diagram, BlocLines lines) {
+ protected CommandExecutionResult executeNow(AbstractClassOrObjectDiagram diagram, BlocLines lines) {
lines = lines.trim(true);
final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
final IEntity entity = executeArg0(diagram, line0);
diff --git a/src/net/sourceforge/plantuml/pdf/PdfConverter.java b/src/net/sourceforge/plantuml/pdf/PdfConverter.java
index 4d2addb..1dcb811 100644
--- a/src/net/sourceforge/plantuml/pdf/PdfConverter.java
+++ b/src/net/sourceforge/plantuml/pdf/PdfConverter.java
@@ -34,6 +34,7 @@
*
*/
package net.sourceforge.plantuml.pdf;
+
import java.io.File;
import java.lang.reflect.Method;
@@ -50,6 +51,9 @@ public class PdfConverter {
}
try {
+ // https://stackoverflow.com/questions/12579468/how-to-set-log4j-property-file
+ System.setProperty("log4j.debug", "false");
+
final Class<?> clSVGConverter = Class.forName("org.apache.batik.apps.rasterizer.SVGConverter");
final Object converter = clSVGConverter.newInstance();
diff --git a/src/net/sourceforge/plantuml/png/PngIO.java b/src/net/sourceforge/plantuml/png/PngIO.java
index 10b6fee..9a4bda2 100644
--- a/src/net/sourceforge/plantuml/png/PngIO.java
+++ b/src/net/sourceforge/plantuml/png/PngIO.java
@@ -82,25 +82,66 @@ public class PngIO {
public static void write(RenderedImage image, OutputStream os, String metadata, int dpi, String debugData)
throws IOException {
- if (metadata != null && checkPNGMetadata()) {
+ if (forceImageIO == false && metadata != null && checkPNGMetadata()) {
PngIOMetadata.writeWithMetadata(image, os, metadata, dpi, debugData);
} else {
ImageIO.write(image, "png", os);
}
-
}
+// /** writes a BufferedImage of type TYPE_INT_ARGB to PNG using PNGJ */
+// public static void writeARGB(BufferedImage bi, OutputStream os, String metadata) {
+// // if (bi.getType() != BufferedImage.TYPE_INT_ARGB)
+// // throw new PngjException("This method expects BufferedImage.TYPE_INT_ARGB");
+// ImageInfo imi = new ImageInfo(bi.getWidth(), bi.getHeight(), 8, false);
+// PngChunkTEXT chunkText = new PngChunkTEXT(imi, "copyleft", copyleft);
+// // PngChunkTEXT chunkTextDebug = new PngChunkTEXT(imi, "debug", "debugData");
+// PngChunkITXT meta = new PngChunkITXT(imi);
+// meta.setKeyVal("plantuml", metadata);
+// meta.setCompressed(true);
+//
+// PngWriter pngw = new PngWriter(os, imi);
+// pngw.setCompLevel(9);// maximum compression, not critical usually
+// // pngw.setFilterType(FilterType.FILTER_ADAPTIVE_FAST); // see what you prefer here
+// // pngw.setFilterType(FilterType.FILTER_ADAPTIVE_MEDIUM); // see what you prefer here
+// pngw.setFilterType(FilterType.FILTER_ADAPTIVE_FULL); // see what you prefer here
+// pngw.queueChunk(chunkText);
+// // // pngw.queueChunk(chunkTextDebug);
+// pngw.queueChunk(meta);
+// DataBufferInt db = ((DataBufferInt) bi.getRaster().getDataBuffer());
+// SinglePixelPackedSampleModel samplemodel = (SinglePixelPackedSampleModel) bi.getSampleModel();
+// if (db.getNumBanks() != 1)
+// throw new PngjException("This method expects one bank");
+// ImageLineInt line = new ImageLineInt(imi);
+// for (int row = 0; row < imi.rows; row++) {
+// int elem = samplemodel.getOffset(0, row);
+// for (int col = 0, j = 0; col < imi.cols; col++) {
+// int sample = db.getElem(elem++);
+// line.scanline[j++] = (sample & 0xFF0000) >> 16; // R
+// line.scanline[j++] = (sample & 0xFF00) >> 8; // G
+// line.scanline[j++] = (sample & 0xFF); // B
+// // line.scanline[j++] = (((sample & 0xFF000000) >> 24) & 0xFF); // A
+// }
+// pngw.writeRow(line, row);
+// }
+// pngw.end();
+// }
+
+ public static boolean forceImageIO = false;
+
static boolean checkPNGMetadata() {
try {
final Class cl = Class.forName("com.sun.imageio.plugins.png.PNGMetadata");
if (cl == null) {
Log.info("Cannot load com.sun.imageio.plugins.png.PNGMetadata");
+ forceImageIO = true;
return false;
}
Log.info("Ok for com.sun.imageio.plugins.png.PNGMetadata");
return true;
} catch (Exception e) {
Log.info("Error loading com.sun.imageio.plugins.png.PNGMetadata " + e);
+ forceImageIO = true;
return false;
}
}
diff --git a/src/net/sourceforge/plantuml/png/PngIOMetadata.java b/src/net/sourceforge/plantuml/png/PngIOMetadata.java
index 180d650..6d2dcb1 100644
--- a/src/net/sourceforge/plantuml/png/PngIOMetadata.java
+++ b/src/net/sourceforge/plantuml/png/PngIOMetadata.java
@@ -57,8 +57,20 @@ public class PngIOMetadata {
String debugData) throws IOException {
// Create & populate metadata
- final PNGMetadata pngMetadata = new PNGMetadata();
+ PNGMetadata pngMetadata = null;
+ try {
+ pngMetadata = new PNGMetadata();
+ } catch (Throwable e) {
+ Log.info("Cannot create com.sun.imageio.plugins.png.PNGMetadata");
+ PngIO.forceImageIO = true;
+ ImageIO.write(image, "png", os);
+ return;
+ }
+ writeInternal(image, os, metadata, dpi, debugData, pngMetadata);
+ }
+ private static void writeInternal(RenderedImage image, OutputStream os, String metadata, int dpi, String debugData,
+ final PNGMetadata pngMetadata) throws IOException {
if (dpi != 96) {
pngMetadata.pHYs_present = true;
pngMetadata.pHYs_unitSpecifier = PNGMetadata.PHYS_UNIT_METER;
@@ -97,7 +109,7 @@ public class PngIOMetadata {
try {
imagewriter.write(null /* default */, iioImage, null /* use default ImageWriteParam */);
} finally {
- //os.flush();
+ // os.flush();
// Log.debug("PngIOMetadata finally 1");
imageOutputStream.flush();
// Log.debug("PngIOMetadata finally 2");
diff --git a/src/net/sourceforge/plantuml/png/PngTitler.java b/src/net/sourceforge/plantuml/png/PngTitler.java
index ee522c4..f00fa1b 100644
--- a/src/net/sourceforge/plantuml/png/PngTitler.java
+++ b/src/net/sourceforge/plantuml/png/PngTitler.java
@@ -39,9 +39,8 @@ import java.awt.Font;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.SpriteContainerEmpty;
-import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.cucadiagram.DisplaySection;
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;
@@ -51,43 +50,38 @@ public class PngTitler {
private final HtmlColor textColor;
private final HtmlColor hyperlinkColor;
- private final Display text;
+ private final DisplaySection text;
private final int fontSize;
private final String fontFamily;
- private final HorizontalAlignment horizontalAlignment;
private final boolean useUnderlineForHyperlink;
- public PngTitler(HtmlColor textColor, Display text, int fontSize, String fontFamily,
- HorizontalAlignment horizontalAlignment, HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink) {
+ public PngTitler(HtmlColor textColor, DisplaySection text, int fontSize, String fontFamily,
+ HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink) {
this.textColor = textColor;
this.text = text;
this.fontSize = fontSize;
this.fontFamily = fontFamily;
- this.horizontalAlignment = horizontalAlignment;
this.hyperlinkColor = hyperlinkColor;
this.useUnderlineForHyperlink = useUnderlineForHyperlink;
}
public Dimension2D getTextDimension(StringBounder stringBounder) {
- final TextBlock textBloc = getTextBlock();
+ final TextBlock textBloc = getRibbonBlock();
if (textBloc == null) {
return null;
}
return textBloc.calculateDimension(stringBounder);
}
- public TextBlock getTextBlock() {
- if (Display.isNull(text) || text.size() == 0) {
- return null;
- }
+ public TextBlock getRibbonBlock() {
final UFont normalFont = new UFont(fontFamily, Font.PLAIN, fontSize);
- return text.create(new FontConfiguration(normalFont, textColor, hyperlinkColor, useUnderlineForHyperlink),
- horizontalAlignment, new SpriteContainerEmpty());
+ return text.createRibbon(new FontConfiguration(normalFont, textColor, hyperlinkColor, useUnderlineForHyperlink),
+ new SpriteContainerEmpty());
}
private double getOffsetX(double imWidth, StringBounder stringBounder) {
- final TextBlock textBloc = getTextBlock();
+ final TextBlock textBloc = getRibbonBlock();
if (textBloc == null) {
return 0;
}
@@ -100,7 +94,7 @@ public class PngTitler {
}
private double getOffsetY(StringBounder stringBounder) {
- final TextBlock textBloc = getTextBlock();
+ final TextBlock textBloc = getRibbonBlock();
if (textBloc == null) {
return 0;
}
diff --git a/src/net/sourceforge/plantuml/posimo/DecorInterfaceProvider.java b/src/net/sourceforge/plantuml/posimo/DecorInterfaceProvider.java
index 404e5bf..fdc7f11 100644
--- a/src/net/sourceforge/plantuml/posimo/DecorInterfaceProvider.java
+++ b/src/net/sourceforge/plantuml/posimo/DecorInterfaceProvider.java
@@ -52,9 +52,9 @@ public class DecorInterfaceProvider implements Decor {
// private final double distanceCircle = 16;
public DecorInterfaceProvider(LinkStyle style) {
- if (style != LinkStyle.__toremove_INTERFACE_PROVIDER && style != LinkStyle.__toremove_INTERFACE_USER) {
- throw new IllegalArgumentException();
- }
+// if (style != LinkStyle.__toremove_INTERFACE_PROVIDER && style != LinkStyle.__toremove_INTERFACE_USER) {
+// throw new IllegalArgumentException();
+// }
this.style = style;
}
@@ -64,9 +64,9 @@ public class DecorInterfaceProvider implements Decor {
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 (style == LinkStyle.__toremove_INTERFACE_USER) {
+// direction += 180;
+// }
if (direction >= 360) {
direction -= 360;
}
diff --git a/src/net/sourceforge/plantuml/posimo/DotPath.java b/src/net/sourceforge/plantuml/posimo/DotPath.java
index 2fe0f18..7a83a15 100644
--- a/src/net/sourceforge/plantuml/posimo/DotPath.java
+++ b/src/net/sourceforge/plantuml/posimo/DotPath.java
@@ -45,9 +45,9 @@ import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.StringTokenizer;
import net.sourceforge.plantuml.EnsureVisible;
import net.sourceforge.plantuml.asciiart.BasicCharArea;
@@ -58,6 +58,7 @@ import net.sourceforge.plantuml.svek.ClusterPosition;
import net.sourceforge.plantuml.svek.MinFinder;
import net.sourceforge.plantuml.svek.PointAndAngle;
import net.sourceforge.plantuml.svek.PointDirected;
+import net.sourceforge.plantuml.svek.SvgResult;
import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.USegmentType;
@@ -66,16 +67,13 @@ import net.sourceforge.plantuml.ugraphic.UShape;
public class DotPath implements UShape, Moveable {
static class TriPoints {
- public TriPoints(String p1, String p2, String p, double deltaY) {
- final StringTokenizer st1 = new StringTokenizer(p1, ",");
- x1 = Double.parseDouble(st1.nextToken());
- y1 = Double.parseDouble(st1.nextToken()) + deltaY;
- final StringTokenizer st2 = new StringTokenizer(p2, ",");
- x2 = Double.parseDouble(st2.nextToken());
- y2 = Double.parseDouble(st2.nextToken()) + deltaY;
- final StringTokenizer st = new StringTokenizer(p, ",");
- x = Double.parseDouble(st.nextToken());
- y = Double.parseDouble(st.nextToken()) + deltaY;
+ public TriPoints(Point2D.Double p1, Point2D.Double p2, Point2D.Double p) {
+ x1 = p1.getX();
+ y1 = p1.getY();
+ x2 = p2.getX();
+ y2 = p2.getY();
+ x = p.getX();
+ y = p.getY();
}
private final double x1;
@@ -129,28 +127,25 @@ public class DotPath implements UShape, Moveable {
return new Point2D.Double(x, y);
}
- public DotPath(String init, double deltaY) {
- if (isPathConsistent(init) == false) {
+ public DotPath(SvgResult fullSvg) {
+ if (isPathConsistent(fullSvg.getSvg()) == false) {
throw new IllegalArgumentException();
}
- final int posC = init.indexOf("C");
+ final int posC = fullSvg.indexOf("C", 0);
if (posC == -1) {
throw new IllegalArgumentException();
}
- final StringTokenizer st = new StringTokenizer(init.substring(1, posC), ",");
- final double startX = Double.parseDouble(st.nextToken());
- final double startY = Double.parseDouble(st.nextToken()) + deltaY;
+ final Point2D start = fullSvg.substring(1, posC).getNextPoint();
- final StringTokenizer st2 = new StringTokenizer(init.substring(posC + 1), " ");
final List<TriPoints> triPoints = new ArrayList<TriPoints>();
- while (st2.hasMoreTokens()) {
- final String p1 = st2.nextToken();
- final String p2 = st2.nextToken();
- final String p = st2.nextToken();
- triPoints.add(new TriPoints(p1, p2, p, deltaY));
- }
- double x = startX;
- double y = startY;
+ for (Iterator<Point2D.Double> it = fullSvg.substring(posC + 1).getPoints(" ").iterator(); it.hasNext();) {
+ final Point2D.Double p1 = it.next();
+ final Point2D.Double p2 = it.next();
+ final Point2D.Double p = it.next();
+ triPoints.add(new TriPoints(p1, p2, p));
+ }
+ double x = start.getX();
+ double y = start.getY();
for (TriPoints p : triPoints) {
final CubicCurve2D.Double bezier = new CubicCurve2D.Double(x, y, p.x1, p.y1, p.x2, p.y2, p.x, p.y);
beziers.add(bezier);
diff --git a/src/net/sourceforge/plantuml/posimo/GraphvizSolverB.java b/src/net/sourceforge/plantuml/posimo/GraphvizSolverB.java
index 21b5827..d18f20c 100644
--- a/src/net/sourceforge/plantuml/posimo/GraphvizSolverB.java
+++ b/src/net/sourceforge/plantuml/posimo/GraphvizSolverB.java
@@ -43,10 +43,8 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import java.util.StringTokenizer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -55,6 +53,8 @@ import net.sourceforge.plantuml.cucadiagram.dot.Graphviz;
import net.sourceforge.plantuml.cucadiagram.dot.GraphvizUtils;
import net.sourceforge.plantuml.cucadiagram.dot.ProcessState;
import net.sourceforge.plantuml.svek.MinFinder;
+import net.sourceforge.plantuml.svek.SvgResult;
+import net.sourceforge.plantuml.svek.YDelta;
public class GraphvizSolverB {
@@ -122,15 +122,16 @@ public class GraphvizSolverB {
final int width = Integer.parseInt(mGraph.group(1));
final int height = Integer.parseInt(mGraph.group(2));
+ final YDelta yDelta = new YDelta(height);
for (Block b : root.getRecursiveContents()) {
final String start = "b" + b.getUid();
final int p1 = s.indexOf("<title>" + start + "</title>");
if (p1 == -1) {
throw new IllegalStateException();
}
- final List<Point2D.Double> pointsList = extractPointsList(s, p1);
+ final List<Point2D.Double> pointsList = extractPointsList(s, p1, yDelta);
b.setX(getMinX(pointsList));
- b.setY(getMinY(pointsList) + height);
+ b.setY(getMinY(pointsList));
minMax.manage(b.getPosition());
}
@@ -140,9 +141,9 @@ public class GraphvizSolverB {
if (p1 == -1) {
throw new IllegalStateException();
}
- final List<Point2D.Double> pointsList = extractPointsList(s, p1);
+ final List<Point2D.Double> pointsList = extractPointsList(s, p1, yDelta);
cl.setX(getMinX(pointsList));
- cl.setY(getMinY(pointsList) + height);
+ cl.setY(getMinY(pointsList));
final double w = getMaxX(pointsList) - getMinX(pointsList);
final double h = getMaxY(pointsList) - getMinY(pointsList);
cl.setHeight(h);
@@ -161,15 +162,15 @@ public class GraphvizSolverB {
final int p2 = s.indexOf(" d=\"", p1);
final int p3 = s.indexOf("\"", p2 + " d=\"".length());
final String points = s.substring(p2 + " d=\"".length(), p3);
- final DotPath dotPath = new DotPath(points, height);
+ final DotPath dotPath = new DotPath(new SvgResult(points, yDelta));
p.setDotPath(dotPath);
minMax.manage(dotPath.getMinFinder());
// Log.println("pointsList=" + pointsList);
if (p.getLabel() != null) {
- final List<Point2D.Double> pointsList = extractPointsList(s, p1);
+ final List<Point2D.Double> pointsList = extractPointsList(s, p1, yDelta);
final double x = getMinX(pointsList);
- final double y = getMinY(pointsList) + height;
+ final double y = getMinY(pointsList);
p.setLabelPosition(x, y);
minMax.manage(x, y);
}
@@ -177,13 +178,8 @@ public class GraphvizSolverB {
return new Dimension2DDouble(width, height);
}
- static private List<Point2D.Double> extractPointsList(final String svg, final int starting) {
- final String pointsString = "points=\"";
- final int p2 = svg.indexOf(pointsString, starting);
- final int p3 = svg.indexOf("\"", p2 + pointsString.length());
- final String points = svg.substring(p2 + pointsString.length(), p3);
- final List<Point2D.Double> pointsList = getPoints(points);
- return pointsList;
+ static private List<Point2D.Double> extractPointsList(final String svg, final int starting, final YDelta yDelta) {
+ return new SvgResult(svg, yDelta).substring(starting).extractList(SvgResult.POINTS_EQUALS);
}
static private double getMaxX(List<Point2D.Double> points) {
@@ -226,19 +222,6 @@ public class GraphvizSolverB {
return result;
}
- static private List<Point2D.Double> getPoints(String points) {
- final List<Point2D.Double> result = new ArrayList<Point2D.Double>();
- final StringTokenizer st = new StringTokenizer(points, " ");
- while (st.hasMoreTokens()) {
- final String t = st.nextToken();
- final StringTokenizer st2 = new StringTokenizer(t, ",");
- final double x = Double.parseDouble(st2.nextToken());
- final double y = Double.parseDouble(st2.nextToken());
- result.add(new Point2D.Double(x, y));
- }
- return result;
- }
-
private void exportPng(final String dotString, File f) throws IOException {
final Graphviz graphviz = GraphvizUtils.create(null, dotString, "png");
final OutputStream os = new BufferedOutputStream(new FileOutputStream(f));
diff --git a/src/net/sourceforge/plantuml/posimo/PathDrawerInterface.java b/src/net/sourceforge/plantuml/posimo/PathDrawerInterface.java
index a607648..2707b21 100644
--- a/src/net/sourceforge/plantuml/posimo/PathDrawerInterface.java
+++ b/src/net/sourceforge/plantuml/posimo/PathDrawerInterface.java
@@ -129,25 +129,26 @@ public class PathDrawerInterface implements PathDrawer {
}
final LinkStyle style = linkType.getStyle();
- if (style == LinkStyle.__toremove_INTERFACE_PROVIDER || style == LinkStyle.__toremove_INTERFACE_USER) {
- final Decor decor = new DecorInterfaceProvider(style);
- final Map<Point2D, Double> all = dotPath.somePoints();
- final Point2D p = getFarest(outPoint, inPoint, all.keySet());
+// if (style == LinkStyle.__toremove_INTERFACE_PROVIDER || style == LinkStyle.__toremove_INTERFACE_USER) {
+// final Decor decor = new DecorInterfaceProvider(style);
+// final Map<Point2D, Double> 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));
+// }
- 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));
- }
-
- ug = ug.apply(new UChangeColor(rose.getHtmlColor(param, ColorParam.classBorder)));
- if (linkType.isDashed()) {
- goDash(ug);
- }
- ug.draw(dotPath);
- if (linkType.isDashed()) {
- noDash(ug);
- }
+ 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) {
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<Path> paths)
-}
-GraphvizSolver --> Cluster
-GraphvizSolver *--> Path
-
-
-'Clusterable --> Cluster : Parent
-
-
-
-@enduml
diff --git a/src/net/sourceforge/plantuml/postit/PostIt.java b/src/net/sourceforge/plantuml/postit/PostIt.java
index 19e7001..0153873 100644
--- a/src/net/sourceforge/plantuml/postit/PostIt.java
+++ b/src/net/sourceforge/plantuml/postit/PostIt.java
@@ -43,6 +43,7 @@ import net.sourceforge.plantuml.SkinParam;
import net.sourceforge.plantuml.SpriteContainerEmpty;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
@@ -117,7 +118,7 @@ public class PostIt {
final FontConfiguration font2 = fontNote.toFont2(HtmlColorUtils.BLACK, true, HtmlColorUtils.BLUE, 8);
final ComponentRoseNote note = new ComponentRoseNote(
new SymbolContext(noteBackgroundColor, borderColor).withStroke(new UStroke()), font2, text, 0, 0,
- new SpriteContainerEmpty());
+ new SpriteContainerEmpty(), 0, HorizontalAlignment.LEFT);
return note;
}
}
diff --git a/src/net/sourceforge/plantuml/postit/PostItDiagram.java b/src/net/sourceforge/plantuml/postit/PostItDiagram.java
index bf90b98..9e8ef9b 100644
--- a/src/net/sourceforge/plantuml/postit/PostItDiagram.java
+++ b/src/net/sourceforge/plantuml/postit/PostItDiagram.java
@@ -85,7 +85,7 @@ public class PostItDiagram extends UmlDiagram {
final UGraphicEps eps = (UGraphicEps) ug;
os.write(eps.getEPSCode().getBytes());
}
- return new ImageDataSimple();
+ return ImageDataSimple.ok();
}
public DiagramDescription getDescription() {
@@ -119,7 +119,7 @@ public class PostItDiagram extends UmlDiagram {
.getMappedColor(this.getSkinParam().getBackgroundColor());
final FileFormat fileFormat = fileFormatOption.getFileFormat();
if (fileFormat == FileFormat.PNG) {
- final double height = getDefaultArea().heightWhenWidthIs(width, fileFormat.getDefaultStringBounder());
+ final double height = getDefaultArea().heightWhenWidthIs(width, fileFormatOption.getDefaultStringBounder());
final EmptyImageBuilder builder = new EmptyImageBuilder(width, height, backColor);
final Graphics2D graphics2D = builder.getGraphics2D();
diff --git a/src/net/sourceforge/plantuml/preproc/Define.java b/src/net/sourceforge/plantuml/preproc/Define.java
index 4cbc490..02fe96a 100644
--- a/src/net/sourceforge/plantuml/preproc/Define.java
+++ b/src/net/sourceforge/plantuml/preproc/Define.java
@@ -49,7 +49,6 @@ public class Define {
private final boolean emptyParentheses;
public Define(String key, List<String> lines, boolean emptyParentheses) {
- this.signature = new DefineSignature(key);
this.emptyParentheses = emptyParentheses;
if (lines == null) {
this.definition = null;
@@ -65,6 +64,7 @@ public class Define {
this.definition = sb.toString();
this.definitionQuoted = Matcher.quoteReplacement(definition);
}
+ this.signature = new DefineSignature(key, this.definitionQuoted);
}
@Override
@@ -78,7 +78,7 @@ public class Define {
}
if (signature.isMethod()) {
for (Variables vars : signature.getVariationVariables()) {
- line = vars.applyOn(line, signature.getFonctionName(), definitionQuoted);
+ line = vars.applyOn(line);
}
} else {
final String regex = "\\b" + signature.getKey() + "\\b" + (emptyParentheses ? "(\\(\\))?" : "");
diff --git a/src/net/sourceforge/plantuml/preproc/DefineSignature.java b/src/net/sourceforge/plantuml/preproc/DefineSignature.java
index 46235d1..6952810 100644
--- a/src/net/sourceforge/plantuml/preproc/DefineSignature.java
+++ b/src/net/sourceforge/plantuml/preproc/DefineSignature.java
@@ -43,24 +43,30 @@ import java.util.StringTokenizer;
public class DefineSignature {
private final String key;
- private final String fctName;
- private final Variables vars = new Variables();
+ private final String fonctionName;
+ private final List<Variables> variables = new ArrayList<Variables>();
- public DefineSignature(String key) {
+ public DefineSignature(String key, String definitionQuoted) {
this.key = key;
final StringTokenizer st = new StringTokenizer(key, "(),");
- this.fctName = st.nextToken().trim();
+ this.fonctionName = st.nextToken().trim();
+ final Variables master = new Variables(fonctionName, definitionQuoted);
while (st.hasMoreTokens()) {
final String var1 = st.nextToken().trim();
- this.vars.add(new DefineVariable(var1));
+ master.add(new DefineVariable(var1));
+ }
+
+ final int count = master.countDefaultValue();
+ for (int i = 0; i <= count; i++) {
+ variables.add(master.removeSomeDefaultValues(i));
}
}
@Override
public String toString() {
- return key + "/" + fctName + "/" + vars;
+ return key + "/" + fonctionName;
}
public boolean isMethod() {
@@ -72,16 +78,7 @@ public class DefineSignature {
}
public List<Variables> getVariationVariables() {
- final List<Variables> result = new ArrayList<Variables>();
- final int count = vars.countDefaultValue();
- for (int i = 0; i <= count; i++) {
- result.add(vars.removeSomeDefaultValues(i));
- }
- return Collections.unmodifiableList(result);
- }
-
- public String getFonctionName() {
- return fctName;
+ return Collections.unmodifiableList(variables);
}
}
diff --git a/src/net/sourceforge/plantuml/preproc/Defines.java b/src/net/sourceforge/plantuml/preproc/Defines.java
index fd3b69e..6fbe902 100644
--- a/src/net/sourceforge/plantuml/preproc/Defines.java
+++ b/src/net/sourceforge/plantuml/preproc/Defines.java
@@ -70,6 +70,13 @@ public class Defines implements Truth {
return new Defines();
}
+ public void overrideFilename(String filename) {
+ if (filename != null) {
+ environment.put("filename", filename);
+ environment.put("filenameNoExtension", nameNoExtension(filename));
+ }
+ }
+
public void importFrom(Defines other) {
this.environment.putAll(other.environment);
this.values.putAll(other.values);
@@ -86,15 +93,15 @@ public class Defines implements Truth {
throw new IllegalArgumentException();
}
final Defines result = createEmpty();
+ result.overrideFilename(file.getName());
result.environment.put("filedate", new Date(file.lastModified()).toString());
- result.environment.put("filename", file.getName());
- result.environment.put("filenameNoExtension", nameNoExtension(file));
+ // result.environment.put("filename", file.getName());
+ // result.environment.put("filenameNoExtension", nameNoExtension(file));
result.environment.put("dirpath", file.getAbsoluteFile().getParentFile().getAbsolutePath().replace('\\', '/'));
return result;
}
- private static String nameNoExtension(File file) {
- final String name = file.getName();
+ private static String nameNoExtension(String name) {
final int x = name.lastIndexOf('.');
if (x == -1) {
return name;
diff --git a/src/net/sourceforge/plantuml/preproc/IfManager.java b/src/net/sourceforge/plantuml/preproc/IfManager.java
index 85f9b1f..dd38d19 100644
--- a/src/net/sourceforge/plantuml/preproc/IfManager.java
+++ b/src/net/sourceforge/plantuml/preproc/IfManager.java
@@ -43,7 +43,7 @@ import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
import net.sourceforge.plantuml.version.Version;
-class IfManager implements ReadLine {
+class IfManager extends ReadLineInstrumented implements ReadLine {
protected static final Pattern2 ifdefPattern = MyPattern.cmpile("^[%s]*!if(n)?def[%s]+(.+)$");
protected static final Pattern2 ifcomparePattern = MyPattern
@@ -61,7 +61,8 @@ class IfManager implements ReadLine {
this.source = source;
}
- final public CharSequence2 readLine() throws IOException {
+ @Override
+ final CharSequence2 readLineInst() throws IOException {
if (child != null) {
final CharSequence2 s = child.readLine();
if (s != null) {
@@ -117,7 +118,8 @@ class IfManager implements ReadLine {
return 0;
}
- public void close() throws IOException {
+ @Override
+ void closeInst() throws IOException {
source.close();
}
diff --git a/src/net/sourceforge/plantuml/preproc/Preprocessor.java b/src/net/sourceforge/plantuml/preproc/Preprocessor.java
index 05252fd..1a2e242 100644
--- a/src/net/sourceforge/plantuml/preproc/Preprocessor.java
+++ b/src/net/sourceforge/plantuml/preproc/Preprocessor.java
@@ -37,162 +37,62 @@ package net.sourceforge.plantuml.preproc;
import java.io.File;
import java.io.IOException;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import net.sourceforge.plantuml.CharSequence2;
-import net.sourceforge.plantuml.CharSequence2Impl;
import net.sourceforge.plantuml.DefinitionsContainer;
-import net.sourceforge.plantuml.StringUtils;
-import net.sourceforge.plantuml.command.regex.Matcher2;
-import net.sourceforge.plantuml.command.regex.MyPattern;
-import net.sourceforge.plantuml.command.regex.Pattern2;
-import net.sourceforge.plantuml.utils.StartUtils;
+import net.sourceforge.plantuml.Log;
-public class Preprocessor implements ReadLine {
+public class Preprocessor extends ReadLineInstrumented implements ReadLine {
- private static final String END_DEFINE_LONG = "!enddefinelong";
- private static final String ID = "[A-Za-z_][A-Za-z_0-9]*";
- private static final String ID_ARG = "\\s*[A-Za-z_][A-Za-z_0-9]*\\s*(?:=\\s*(?:\"[^\"]*\"|'[^']*')\\s*)?";
- private static final String ARG = "(?:\\(" + ID_ARG + "(?:," + ID_ARG + ")*?\\))?";
- private static final Pattern2 definePattern = MyPattern.cmpile("^[%s]*!define[%s]+(" + ID + ARG + ")"
- + "(?:[%s]+(.*))?$");
- private static final Pattern2 undefPattern = MyPattern.cmpile("^[%s]*!undef[%s]+(" + ID + ")$");
- private static final Pattern2 definelongPattern = MyPattern.cmpile("^[%s]*!definelong[%s]+(" + ID + ARG + ")");
- private static final Pattern2 enddefinelongPattern = MyPattern.cmpile("^[%s]*" + END_DEFINE_LONG + "[%s]*$");
+ private final PreprocessorInclude include;
+ private final SubPreprocessor subPreprocessor;
+ private final String description;
- private final Defines defines;
- private final PreprocessorInclude rawSource;
- private final ReadLineInsertable source;
-
- public Preprocessor(ReadLine reader, String charset, Defines defines, File newCurrentDir,
- DefinitionsContainer definitionsContainer) {
- this.defines = defines;
- this.defines.saveState();
- this.rawSource = new PreprocessorInclude(reader, defines, charset, newCurrentDir, definitionsContainer);
- this.source = new ReadLineInsertable(new IfManager(rawSource, defines));
- }
-
- public CharSequence2 readLine() throws IOException {
- final CharSequence2 s = source.readLine();
- if (s == null) {
- return null;
- }
- if (StartUtils.isArobaseStartDiagram(s)) {
- this.defines.restoreState();
- }
-
- Matcher2 m = definePattern.matcher(s);
- if (m.find()) {
- return manageDefine(m, s.toString().trim().endsWith("()"));
- }
-
- m = definelongPattern.matcher(s);
- if (m.find()) {
- return manageDefineLong(m, s.toString().trim().endsWith("()"));
- }
-
- m = undefPattern.matcher(s);
- if (m.find()) {
- return manageUndef(m);
- }
-
- if (ignoreDefineDuringSeveralLines > 0) {
- ignoreDefineDuringSeveralLines--;
- return s;
- }
-
- List<String> result = defines.applyDefines(s.toString2());
- if (result.size() > 1) {
- result = cleanEndDefineLong(result);
- final List<String> inserted = cleanEndDefineLong(result.subList(1, result.size()));
- ignoreDefineDuringSeveralLines = inserted.size();
- source.insert(inserted, s.getLocation());
- }
- return new CharSequence2Impl(result.get(0), s.getLocation(), s.getPreprocessorError());
+ public Sub getSub(String blocname) {
+ return subPreprocessor.getSub(blocname);
}
- private List<String> cleanEndDefineLong(List<String> data) {
- final List<String> result = new ArrayList<String>();
- for (String s : data) {
- final String clean = cleanEndDefineLong(s);
- if (clean != null) {
- result.add(clean);
- }
- }
- return result;
-
- }
-
- private String cleanEndDefineLong(String s) {
- if (s.trim().startsWith(END_DEFINE_LONG)) {
- s = s.trim().substring(END_DEFINE_LONG.length());
- if (s.length() == 0) {
- return null;
- }
- }
- return s;
- }
-
- private int ignoreDefineDuringSeveralLines = 0;
-
- private CharSequence2 manageUndef(Matcher2 m) throws IOException {
- defines.undefine(m.group(1));
- return this.readLine();
- }
-
- private CharSequence2 manageDefineLong(Matcher2 m, boolean emptyParentheses) throws IOException {
- final String group1 = m.group(1);
- final List<String> def = new ArrayList<String>();
- while (true) {
- final CharSequence2 read = this.readLine();
- if (read == null) {
- return null;
- }
- def.add(read.toString2());
- if (enddefinelongPattern.matcher(read).find()) {
- defines.define(group1, def, emptyParentheses);
- return this.readLine();
- }
- }
+ // public Preprocessor(List<String> config, ReadLine reader, String charset, Defines defines, File newCurrentDir,
+ // DefinitionsContainer definitionsContainer) {
+ //
+ // final ReadLine source2 = new IfManager(reader, defines);
+ // final ReadLineInsertable source3 = new ReadLineInsertable(source2);
+ // final ReadLine source4 = new PreprocessorDefine(defines, source3);
+ // this.include = new PreprocessorInclude(config, source4, defines, charset, newCurrentDir, definitionsContainer);
+ // this.subPreprocessor = new SubPreprocessor(config, charset, defines, definitionsContainer, include);
+ // }
+
+ public Preprocessor(List<String> config, ReadLine reader, String charset, Defines defines, File newCurrentDir,
+ DefinitionsContainer definitionsContainer) {
+ this.description = reader.toString();
+ this.include = new PreprocessorInclude(config, reader, defines, charset, newCurrentDir, definitionsContainer);
+ final ReadLine source2 = new IfManager(include, defines);
+ final ReadLineInsertable source3 = new ReadLineInsertable(source2);
+ final ReadLine source4 = new PreprocessorDefine(defines, source3);
+ this.subPreprocessor = new SubPreprocessor(config, charset, defines, definitionsContainer, source4);
}
- private CharSequence2 manageDefine(Matcher2 m, boolean emptyParentheses) throws IOException {
- final String group1 = m.group(1);
- final String group2 = m.group(2);
- if (group2 == null) {
- defines.define(group1, null, emptyParentheses);
- } else {
- final List<String> strings = defines.applyDefines(group2);
- if (strings.size() > 1) {
- defines.define(group1, strings, emptyParentheses);
- } else {
- final StringBuilder value = new StringBuilder(strings.get(0));
- while (StringUtils.endsWithBackslash(value.toString())) {
- value.setLength(value.length() - 1);
- final CharSequence2 read = this.readLine();
- value.append(read.toString2());
- }
- final List<String> li = new ArrayList<String>();
- li.add(value.toString());
- defines.define(group1, li, emptyParentheses);
- }
- }
- return this.readLine();
+ @Override
+ CharSequence2 readLineInst() throws IOException {
+ return subPreprocessor.readLine();
}
public int getLineNumber() {
- return rawSource.getLineNumber();
+ return include.getLineNumber();
}
- public void close() throws IOException {
- rawSource.close();
+ @Override
+ void closeInst() throws IOException {
+ // Log.info("Closing preprocessor of " + description);
+ include.close();
+ subPreprocessor.close();
}
public Set<FileWithSuffix> getFilesUsed() {
- return Collections.unmodifiableSet(rawSource.getFilesUsedGlobal());
+ return Collections.unmodifiableSet(include.getFilesUsedGlobal());
}
-
+
} \ No newline at end of file
diff --git a/src/net/sourceforge/plantuml/preproc/PreprocessorDefine.java b/src/net/sourceforge/plantuml/preproc/PreprocessorDefine.java
new file mode 100644
index 0000000..13de984
--- /dev/null
+++ b/src/net/sourceforge/plantuml/preproc/PreprocessorDefine.java
@@ -0,0 +1,201 @@
+/* ========================================================================
+ * 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.preproc;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sourceforge.plantuml.CharSequence2;
+import net.sourceforge.plantuml.CharSequence2Impl;
+import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.command.regex.Matcher2;
+import net.sourceforge.plantuml.command.regex.MyPattern;
+import net.sourceforge.plantuml.command.regex.Pattern2;
+import net.sourceforge.plantuml.utils.StartUtils;
+
+public class PreprocessorDefine extends ReadLineInstrumented implements ReadLine {
+
+ private static final String END_DEFINE_LONG = "!enddefinelong";
+ private static final String ID = "[A-Za-z_][A-Za-z_0-9]*";
+ private static final String ID_ARG = "\\s*[A-Za-z_][A-Za-z_0-9]*\\s*(?:=\\s*(?:\"[^\"]*\"|'[^']*')\\s*)?";
+ private static final String ARG = "(?:\\(" + ID_ARG + "(?:," + ID_ARG + ")*?\\))?";
+ private static final Pattern2 definePattern = MyPattern.cmpile("^[%s]*!define[%s]+(" + ID + ARG + ")"
+ + "(?:[%s]+(.*))?$");
+ private static final Pattern2 filenamePattern = MyPattern.cmpile("^[%s]*!filename[%s]+(.+)$");
+ private static final Pattern2 undefPattern = MyPattern.cmpile("^[%s]*!undef[%s]+(" + ID + ")$");
+ private static final Pattern2 definelongPattern = MyPattern.cmpile("^[%s]*!definelong[%s]+(" + ID + ARG + ")");
+ private static final Pattern2 enddefinelongPattern = MyPattern.cmpile("^[%s]*" + END_DEFINE_LONG + "[%s]*$");
+
+ private final Defines defines;
+
+ private final ReadLineInsertable source;
+
+ public PreprocessorDefine(Defines defines, ReadLineInsertable source) {
+ this.defines = defines;
+ this.defines.saveState();
+ this.source = source;
+ }
+
+ @Override
+ CharSequence2 readLineInst() throws IOException {
+ final CharSequence2 s = source.readLine();
+ if (s == null) {
+ return null;
+ }
+ if (StartUtils.isArobaseStartDiagram(s)) {
+ this.defines.restoreState();
+ }
+
+ Matcher2 m = filenamePattern.matcher(s);
+ if (m.find()) {
+ return manageFilename(m);
+ }
+ m = definePattern.matcher(s);
+ if (m.find()) {
+ return manageDefine(m, s.toString().trim().endsWith("()"));
+ }
+
+ m = definelongPattern.matcher(s);
+ if (m.find()) {
+ return manageDefineLong(m, s.toString().trim().endsWith("()"));
+ }
+
+ m = undefPattern.matcher(s);
+ if (m.find()) {
+ return manageUndef(m);
+ }
+
+ if (ignoreDefineDuringSeveralLines > 0) {
+ ignoreDefineDuringSeveralLines--;
+ return s;
+ }
+
+ List<String> result = defines.applyDefines(s.toString2());
+ if (result.size() > 1) {
+ result = cleanEndDefineLong(result);
+ final List<String> inserted = cleanEndDefineLong(result.subList(1, result.size()));
+ ignoreDefineDuringSeveralLines = inserted.size();
+ source.insert(inserted, s.getLocation());
+ }
+ return new CharSequence2Impl(result.get(0), s.getLocation(), s.getPreprocessorError());
+ }
+
+ private List<String> cleanEndDefineLong(List<String> data) {
+ final List<String> result = new ArrayList<String>();
+ for (String s : data) {
+ final String clean = cleanEndDefineLong(s);
+ if (clean != null) {
+ result.add(clean);
+ }
+ }
+ return result;
+
+ }
+
+ private String cleanEndDefineLong(String s) {
+ if (s.trim().startsWith(END_DEFINE_LONG)) {
+ s = s.trim().substring(END_DEFINE_LONG.length());
+ if (s.length() == 0) {
+ return null;
+ }
+ }
+ return s;
+ }
+
+ private int ignoreDefineDuringSeveralLines = 0;
+
+ private CharSequence2 manageUndef(Matcher2 m) throws IOException {
+ defines.undefine(m.group(1));
+ return this.readLine();
+ }
+
+ private CharSequence2 manageDefineLong(Matcher2 m, boolean emptyParentheses) throws IOException {
+ final String group1 = m.group(1);
+ final List<String> def = new ArrayList<String>();
+ while (true) {
+ final CharSequence2 read = this.readLine();
+ if (read == null) {
+ return null;
+ }
+ if (enddefinelongPattern.matcher(read).find()) {
+ defines.define(group1, def, emptyParentheses);
+ return this.readLine();
+ }
+ def.add(read.toString2());
+ }
+ }
+
+ private CharSequence2 manageFilename(Matcher2 m) throws IOException {
+ final String group1 = m.group(1);
+ this.defines.overrideFilename(group1);
+ return this.readLine();
+ }
+
+ private CharSequence2 manageDefine(Matcher2 m, boolean emptyParentheses) throws IOException {
+ final String group1 = m.group(1);
+ final String group2 = m.group(2);
+ if (group2 == null) {
+ defines.define(group1, null, emptyParentheses);
+ } else {
+ final List<String> strings = defines.applyDefines(group2);
+ if (strings.size() > 1) {
+ defines.define(group1, strings, emptyParentheses);
+ } else {
+ final StringBuilder value = new StringBuilder(strings.get(0));
+ while (StringUtils.endsWithBackslash(value.toString())) {
+ value.setLength(value.length() - 1);
+ final CharSequence2 read = this.readLine();
+ value.append(read.toString2());
+ }
+ final List<String> li = new ArrayList<String>();
+ li.add(value.toString());
+ defines.define(group1, li, emptyParentheses);
+ }
+ }
+ return this.readLine();
+ }
+
+// public int getLineNumber() {
+// return source.getLineNumber();
+// }
+
+ @Override
+ void closeInst() throws IOException {
+ source.close();
+ }
+
+} \ No newline at end of file
diff --git a/src/net/sourceforge/plantuml/preproc/PreprocessorInclude.java b/src/net/sourceforge/plantuml/preproc/PreprocessorInclude.java
index 986c1b7..bf542c7 100644
--- a/src/net/sourceforge/plantuml/preproc/PreprocessorInclude.java
+++ b/src/net/sourceforge/plantuml/preproc/PreprocessorInclude.java
@@ -44,6 +44,7 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
@@ -62,16 +63,18 @@ import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
import net.sourceforge.plantuml.utils.StartUtils;
-public class PreprocessorInclude implements ReadLine {
+public class PreprocessorInclude extends ReadLineInstrumented implements ReadLine {
private static final Pattern2 includeDefPattern = MyPattern.cmpile("^[%s]*!includedef[%s]+[%g]?([^%g]+)[%g]?$");
private static final Pattern2 includePattern = MyPattern.cmpile("^[%s]*!include[%s]+[%g]?([^%g]+)[%g]?$");
+ private static final Pattern2 includePatternStdlib = MyPattern.cmpile("^[%s]*!include[%s]+(\\<[^%g]+\\>)$");
private static final Pattern2 includeManyPattern = MyPattern.cmpile("^[%s]*!include_many[%s]+[%g]?([^%g]+)[%g]?$");
private static final Pattern2 includeURLPattern = MyPattern.cmpile("^[%s]*!includeurl[%s]+[%g]?([^%g]+)[%g]?$");
private final ReadLine reader2;
private final String charset;
private final Defines defines;
+ private final List<String> config;
private final DefinitionsContainer definitionsContainer;
private int numLine = 0;
@@ -82,22 +85,23 @@ public class PreprocessorInclude implements ReadLine {
private final Set<FileWithSuffix> filesUsedCurrent;
private final Set<FileWithSuffix> filesUsedGlobal;
- public PreprocessorInclude(ReadLine reader, Defines defines, String charset, File newCurrentDir,
- DefinitionsContainer definitionsContainer) {
- this(reader, defines, charset, newCurrentDir, new HashSet<FileWithSuffix>(), new HashSet<FileWithSuffix>(),
- definitionsContainer);
+ public PreprocessorInclude(List<String> config, ReadLine reader, Defines defines, String charset,
+ File newCurrentDir, DefinitionsContainer definitionsContainer) {
+ this(config, reader, defines, charset, newCurrentDir, new HashSet<FileWithSuffix>(),
+ new HashSet<FileWithSuffix>(), definitionsContainer);
}
public Set<FileWithSuffix> getFilesUsedGlobal() {
return Collections.unmodifiableSet(filesUsedGlobal);
}
- private PreprocessorInclude(ReadLine reader, Defines defines, String charset, File newCurrentDir,
- Set<FileWithSuffix> filesUsedCurrent, Set<FileWithSuffix> filesUsedGlobal,
+ private PreprocessorInclude(List<String> config, ReadLine reader, Defines defines, String charset,
+ File newCurrentDir, Set<FileWithSuffix> filesUsedCurrent, Set<FileWithSuffix> filesUsedGlobal,
DefinitionsContainer definitionsContainer) {
+ this.config = config;
this.defines = defines;
this.charset = charset;
- this.reader2 = reader;
+ this.reader2 = new ReadLineQuoteComment(reader);
this.definitionsContainer = definitionsContainer;
this.filesUsedCurrent = filesUsedCurrent;
this.filesUsedGlobal = filesUsedGlobal;
@@ -115,8 +119,14 @@ public class PreprocessorInclude implements ReadLine {
}
}
- public CharSequence2 readLine() throws IOException {
+ @Override
+ CharSequence2 readLineInst() throws IOException {
final CharSequence2 result = readLineInternal();
+ if (result != null && StartUtils.isArobaseStartDiagram(result) && config.size() > 0) {
+ final List<String> empty = new ArrayList<String>();
+ included = new PreprocessorInclude(empty, new ReadLineList(config, result.getLocation()), defines, charset,
+ null, filesUsedCurrent, filesUsedGlobal, definitionsContainer);
+ }
if (result != null && (StartUtils.isArobaseEndDiagram(result) || StartUtils.isArobaseStartDiagram(result))) {
// http://plantuml.sourceforge.net/qa/?qa=3389/error-generating-when-same-file-included-different-diagram
filesUsedCurrent.clear();
@@ -153,6 +163,11 @@ public class PreprocessorInclude implements ReadLine {
if (m3.find()) {
return manageDefinitionInclude(s, m3);
}
+ } else {
+ final Matcher2 m1 = includePatternStdlib.matcher(s);
+ if (m1.find()) {
+ return manageFileInclude(s, m1, false);
+ }
}
final Matcher2 mUrl = includeURLPattern.matcher(s);
if (s.getPreprocessorError() == null && mUrl.find()) {
@@ -173,8 +188,8 @@ public class PreprocessorInclude implements ReadLine {
}
try {
final URL url = new URL(urlString);
- included = new PreprocessorInclude(getReaderInclude(s, url, suf), defines, charset, null, filesUsedCurrent,
- filesUsedGlobal, definitionsContainer);
+ included = new PreprocessorInclude(config, getReaderInclude(s, url, suf), defines, charset, null,
+ filesUsedCurrent, filesUsedGlobal, definitionsContainer);
} catch (MalformedURLException e) {
return s.withErrorPreprocessor("Cannot include url " + urlString);
}
@@ -184,14 +199,23 @@ public class PreprocessorInclude implements ReadLine {
private CharSequence2 manageDefinitionInclude(CharSequence2 s, Matcher2 matcher) throws IOException {
final String definitionName = matcher.group(1);
final List<? extends CharSequence> definition = definitionsContainer.getDefinition(definitionName);
- included = new PreprocessorInclude(new ReadLineList(definition, s.getLocation()), defines, charset, null,
- filesUsedCurrent, filesUsedGlobal, definitionsContainer);
+ included = new PreprocessorInclude(config, new ReadLineList(definition, s.getLocation()), defines, charset,
+ null, filesUsedCurrent, filesUsedGlobal, definitionsContainer);
return this.readLine();
}
private CharSequence2 manageFileInclude(CharSequence2 s, Matcher2 matcher, boolean allowMany) throws IOException {
String fileName = matcher.group(1);
fileName = defines.applyDefines(fileName).get(0);
+ if (fileName.startsWith("<") && fileName.endsWith(">")) {
+ final ReadLine strlibReader = getReaderStdlibInclude(s, fileName.substring(1, fileName.length() - 1));
+ if (strlibReader == null) {
+ return s.withErrorPreprocessor("Cannot include " + fileName);
+ }
+ included = new PreprocessorInclude(config, strlibReader, defines, charset, null, filesUsedCurrent,
+ filesUsedGlobal, definitionsContainer);
+ return this.readLine();
+ }
final int idx = fileName.lastIndexOf('!');
String suf = null;
if (idx != -1) {
@@ -205,12 +229,11 @@ public class PreprocessorInclude implements ReadLine {
} else if (allowMany == false && filesUsedCurrent.contains(f2)) {
// return CharSequence2Impl.errorPreprocessor("File already included " + f.getAbsolutePath(), lineLocation);
return this.readLine();
- } else {
- filesUsedCurrent.add(f2);
- filesUsedGlobal.add(f2);
- included = new PreprocessorInclude(getReaderInclude(s, f, suf), defines, charset, f.getParentFile(),
- filesUsedCurrent, filesUsedGlobal, definitionsContainer);
}
+ filesUsedCurrent.add(f2);
+ filesUsedGlobal.add(f2);
+ included = new PreprocessorInclude(config, getReaderInclude(s, f, suf), defines, charset, f.getParentFile(),
+ filesUsedCurrent, filesUsedGlobal, definitionsContainer);
return this.readLine();
}
@@ -243,6 +266,34 @@ public class PreprocessorInclude implements ReadLine {
return null;
}
+ private InputStream getStdlibInputStream(String filename) {
+ final InputStream result = Stdlib.getResourceAsStream(filename);
+ // Log.info("Loading sdlib " + filename + " ok");
+ return result;
+ }
+
+ private ReadLine getReaderStdlibInclude(CharSequence2 s, String filename) {
+ Log.info("Loading sdlib " + filename);
+ InputStream is = getStdlibInputStream(filename);
+ if (is == null) {
+ return null;
+ }
+ final String description = "<" + filename + ">";
+ try {
+ if (StartDiagramExtractReader.containsStartDiagram(s, is, description)) {
+ is = getStdlibInputStream(filename);
+ return new StartDiagramExtractReader(s, is, description);
+ }
+ is = getStdlibInputStream(filename);
+ if (is == null) {
+ return null;
+ }
+ return ReadLineReader.create(new InputStreamReader(is), description);
+ } catch (IOException e) {
+ return new ReadLineSimple(s, e.toString());
+ }
+ }
+
private ReadLine getReaderInclude(CharSequence2 s, final File f, String suf) {
try {
if (StartDiagramExtractReader.containsStartDiagram(s, f, charset)) {
@@ -250,10 +301,10 @@ public class PreprocessorInclude implements ReadLine {
}
if (charset == null) {
Log.info("Using default charset");
- return new ReadLineReader(new FileReader(f), f.getAbsolutePath(), s.getLocation());
+ return ReadLineReader.create(new FileReader(f), f.getAbsolutePath(), s.getLocation());
}
Log.info("Using charset " + charset);
- return new ReadLineReader(new InputStreamReader(new FileInputStream(f), charset), f.getAbsolutePath(),
+ return ReadLineReader.create(new InputStreamReader(new FileInputStream(f), charset), f.getAbsolutePath(),
s.getLocation());
} catch (IOException e) {
return new ReadLineSimple(s, e.toString());
@@ -269,10 +320,10 @@ public class PreprocessorInclude implements ReadLine {
final InputStream is = url.openStream();
if (charset == null) {
Log.info("Using default charset");
- return new ReadLineReader(new InputStreamReader(is), url.toString(), s.getLocation());
+ return ReadLineReader.create(new InputStreamReader(is), url.toString(), s.getLocation());
}
Log.info("Using charset " + charset);
- return new ReadLineReader(new InputStreamReader(is, charset), url.toString(), s.getLocation());
+ return ReadLineReader.create(new InputStreamReader(is, charset), url.toString(), s.getLocation());
} catch (IOException e) {
return new ReadLineSimple(s, e.toString());
}
@@ -283,7 +334,8 @@ public class PreprocessorInclude implements ReadLine {
return numLine;
}
- public void close() throws IOException {
+ @Override
+ void closeInst() throws IOException {
restoreCurrentDir();
reader2.close();
}
diff --git a/src/net/sourceforge/plantuml/preproc/ReadLineConcat.java b/src/net/sourceforge/plantuml/preproc/ReadLineConcat.java
new file mode 100644
index 0000000..4ebfa0a
--- /dev/null
+++ b/src/net/sourceforge/plantuml/preproc/ReadLineConcat.java
@@ -0,0 +1,72 @@
+/* ========================================================================
+ * 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.preproc;
+
+import java.io.IOException;
+
+import net.sourceforge.plantuml.CharSequence2;
+
+public class ReadLineConcat implements ReadLine {
+
+ private ReadLine file1;
+ final private ReadLine file2;
+
+ public ReadLineConcat(ReadLine file1, ReadLine file2) {
+ this.file1 = file1;
+ this.file2 = file2;
+ }
+
+ public void close() throws IOException {
+ if (file1 != null) {
+ throw new IllegalStateException();
+ }
+ file2.close();
+ }
+
+ public CharSequence2 readLine() throws IOException {
+ CharSequence2 result = null;
+ if (file1 != null) {
+ result = file1.readLine();
+ if (result == null) {
+ file1.close();
+ file1 = null;
+ }
+ return readLine();
+ }
+ return file2.readLine();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/preproc/ReadLineInstrumented.java b/src/net/sourceforge/plantuml/preproc/ReadLineInstrumented.java
new file mode 100644
index 0000000..b3c8d47
--- /dev/null
+++ b/src/net/sourceforge/plantuml/preproc/ReadLineInstrumented.java
@@ -0,0 +1,98 @@
+/* ========================================================================
+ * 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.preproc;
+
+import java.io.IOException;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.atomic.AtomicLong;
+
+import net.sourceforge.plantuml.CharSequence2;
+import net.sourceforge.plantuml.Log;
+
+public abstract class ReadLineInstrumented implements ReadLine {
+
+ private static final boolean TRACE = false;
+
+ private static ConcurrentMap<Class, AtomicLong> durations = new ConcurrentHashMap<Class, AtomicLong>();
+ private static ConcurrentMap<Class, AtomicLong> maxes = new ConcurrentHashMap<Class, AtomicLong>();
+
+ private long current = 0;
+
+ private AtomicLong get(ConcurrentMap<Class, AtomicLong> source) {
+ AtomicLong result = source.get(getClass());
+ if (result == null) {
+ result = new AtomicLong();
+ source.put(getClass(), result);
+ }
+ return result;
+ }
+
+ public final CharSequence2 readLine() throws IOException {
+ if (TRACE == false) {
+ return readLineInst();
+ }
+ final long now = System.currentTimeMillis();
+ try {
+ return readLineInst();
+ } finally {
+ final long time = System.currentTimeMillis() - now;
+ current += time;
+ get(durations).addAndGet(time);
+ }
+ }
+
+ @Override
+ public String toString() {
+ return super.toString() + " current=" + current;
+ }
+
+ abstract CharSequence2 readLineInst() throws IOException;
+
+ public final void close() throws IOException {
+ if (TRACE) {
+ if (current > get(maxes).get()) {
+ get(maxes).set(current);
+ }
+ Log.info("DURATION::" + getClass() + " duration= " + get(durations).get() + " current=" + current + " max="
+ + get(maxes).get());
+ }
+ closeInst();
+ }
+
+ abstract void closeInst() throws IOException;
+
+} \ No newline at end of file
diff --git a/src/net/sourceforge/plantuml/preproc/ReadLineQuoteComment.java b/src/net/sourceforge/plantuml/preproc/ReadLineQuoteComment.java
new file mode 100644
index 0000000..60e2979
--- /dev/null
+++ b/src/net/sourceforge/plantuml/preproc/ReadLineQuoteComment.java
@@ -0,0 +1,86 @@
+/* ========================================================================
+ * 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.preproc;
+
+import java.io.IOException;
+
+import net.sourceforge.plantuml.CharSequence2;
+import net.sourceforge.plantuml.CharSequence2Impl;
+
+public class ReadLineQuoteComment extends ReadLineInstrumented implements ReadLine {
+
+ private final ReadLine raw;
+ private boolean longComment = false;
+
+ public ReadLineQuoteComment(ReadLine source) {
+ this.raw = source;
+ }
+
+ @Override
+ void closeInst() throws IOException {
+ raw.close();
+ }
+
+ @Override
+ CharSequence2 readLineInst() throws IOException {
+ while (true) {
+ final CharSequence2 result = raw.readLine();
+ if (result == null) {
+ return null;
+ }
+ final String trim = result.toString().replace('\t', ' ').trim();
+ if (this.longComment && trim.endsWith("'/")) {
+ this.longComment = false;
+ continue;
+ }
+ if (this.longComment) {
+ continue;
+ }
+ if (trim.startsWith("'")) {
+ continue;
+ }
+ if (trim.startsWith("/'") && trim.endsWith("'/")) {
+ continue;
+ }
+ if (trim.startsWith("/'") && trim.contains("'/") == false) {
+ this.longComment = true;
+ continue;
+ }
+ return ((CharSequence2Impl) result).removeInnerComment();
+ }
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/preproc/ReadLineReader.java b/src/net/sourceforge/plantuml/preproc/ReadLineReader.java
index 75b96d8..bb73124 100644
--- a/src/net/sourceforge/plantuml/preproc/ReadLineReader.java
+++ b/src/net/sourceforge/plantuml/preproc/ReadLineReader.java
@@ -43,23 +43,44 @@ import net.sourceforge.plantuml.CharSequence2;
import net.sourceforge.plantuml.CharSequence2Impl;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.LineLocationImpl;
+import net.sourceforge.plantuml.Log;
-public class ReadLineReader implements ReadLine {
+public class ReadLineReader extends ReadLineInstrumented implements ReadLine {
// private static final int LIMIT = 850;
private final BufferedReader br;
private LineLocationImpl location;
+ private final String description;
- public ReadLineReader(Reader reader, String desc, LineLocation parent) {
- br = new BufferedReader(reader);
- location = new LineLocationImpl(desc, parent);
+ private ReadLineReader(Reader reader, String description, LineLocation parent) {
+ if (description == null) {
+ description = "?";
+ }
+ this.br = new BufferedReader(reader);
+ this.location = new LineLocationImpl(description, parent);
+ this.description = description;
+ Log.info("Reading from " + description);
+ }
+
+ @Override
+ public String toString() {
+ return super.toString() + " " + description;
}
- public ReadLineReader(Reader reader, String desc) {
+ private ReadLineReader(Reader reader, String desc) {
this(reader, desc, null);
}
- public CharSequence2 readLine() throws IOException {
+ public static ReadLine create(Reader reader, String description) {
+ return new ReadLineReader(reader, description, null);
+ }
+
+ public static ReadLine create(Reader reader, String description, LineLocation parent) {
+ return new ReadLineReader(reader, description, parent);
+ }
+
+ @Override
+ CharSequence2 readLineInst() throws IOException {
String s = br.readLine();
location = location.oneLineRead();
if (s == null) {
@@ -88,7 +109,8 @@ public class ReadLineReader implements ReadLine {
return new CharSequence2Impl(s, location);
}
- public void close() throws IOException {
+ @Override
+ void closeInst() throws IOException {
br.close();
}
diff --git a/src/net/sourceforge/plantuml/preproc/StartDiagramExtractReader.java b/src/net/sourceforge/plantuml/preproc/StartDiagramExtractReader.java
index b8c8f26..ceba7f4 100644
--- a/src/net/sourceforge/plantuml/preproc/StartDiagramExtractReader.java
+++ b/src/net/sourceforge/plantuml/preproc/StartDiagramExtractReader.java
@@ -39,6 +39,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
+import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
@@ -52,14 +53,18 @@ public class StartDiagramExtractReader implements ReadLine {
private boolean finished = false;
public StartDiagramExtractReader(CharSequence2 s, File f, String uid, String charset) {
- this(getReadLine(s, f, charset), uid, charset);
+ this(getReadLine(s, f, charset), uid);
}
public StartDiagramExtractReader(CharSequence2 s, URL url, String uid, String charset) {
- this(getReadLine(s, url, charset), uid, charset);
+ this(getReadLine(s, url, charset), uid);
}
- private StartDiagramExtractReader(ReadLine raw, String suf, String charset) {
+ public StartDiagramExtractReader(CharSequence2 s, InputStream is, String desc) {
+ this(getReadLine(s, is, desc), null);
+ }
+
+ private StartDiagramExtractReader(ReadLine raw, String suf) {
int bloc = 0;
String uid = null;
if (suf != null && suf.matches("\\d+")) {
@@ -102,25 +107,29 @@ public class StartDiagramExtractReader implements ReadLine {
try {
if (charset == null) {
Log.info("Using default charset");
- return new UncommentReadLine(new ReadLineReader(new FileReader(f), f.getAbsolutePath()));
+ return new UncommentReadLine(ReadLineReader.create(new FileReader(f), f.getAbsolutePath()));
}
Log.info("Using charset " + charset);
- return new UncommentReadLine(new ReadLineReader(new InputStreamReader(new FileInputStream(f), charset),
+ return new UncommentReadLine(ReadLineReader.create(new InputStreamReader(new FileInputStream(f), charset),
f.getAbsolutePath()));
} catch (IOException e) {
return new ReadLineSimple(s, e.toString());
}
}
+ private static ReadLine getReadLine(CharSequence2 s, InputStream is, String description) {
+ return new UncommentReadLine(ReadLineReader.create(new InputStreamReader(is), description));
+ }
+
private static ReadLine getReadLine(CharSequence2 s, URL url, String charset) {
try {
if (charset == null) {
Log.info("Using default charset");
- return new UncommentReadLine(
- new ReadLineReader(new InputStreamReader(url.openStream()), url.toString()));
+ return new UncommentReadLine(ReadLineReader.create(new InputStreamReader(url.openStream()),
+ url.toString()));
}
Log.info("Using charset " + charset);
- return new UncommentReadLine(new ReadLineReader(new InputStreamReader(url.openStream(), charset),
+ return new UncommentReadLine(ReadLineReader.create(new InputStreamReader(url.openStream(), charset),
url.toString()));
} catch (IOException e) {
return new ReadLineSimple(s, e.toString());
@@ -137,6 +146,11 @@ public class StartDiagramExtractReader implements ReadLine {
return containsStartDiagram(r);
}
+ static public boolean containsStartDiagram(CharSequence2 s, InputStream is, String description) throws IOException {
+ final ReadLine r = getReadLine(s, is, description);
+ return containsStartDiagram(r);
+ }
+
private static boolean containsStartDiagram(final ReadLine r) throws IOException {
try {
CharSequence2 s = null;
diff --git a/src/net/sourceforge/plantuml/preproc/Stdlib.java b/src/net/sourceforge/plantuml/preproc/Stdlib.java
new file mode 100644
index 0000000..b29047a
--- /dev/null
+++ b/src/net/sourceforge/plantuml/preproc/Stdlib.java
@@ -0,0 +1,317 @@
+package net.sourceforge.plantuml.preproc;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.DataInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.lang.ref.SoftReference;
+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 java.util.Set;
+import java.util.TreeSet;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import net.sourceforge.plantuml.Log;
+import net.sourceforge.plantuml.brotli.BrotliInputStream;
+
+public class Stdlib {
+
+ private static final Map<String, Stdlib> all = new ConcurrentHashMap<String, Stdlib>();
+ private static final String SEPARATOR = "\uF8FF";
+ private static final Pattern sizePattern = Pattern.compile("\\[(\\d+)x(\\d+)/16\\]");
+
+ private final Map<String, SoftReference<String>> cache = new ConcurrentHashMap<String, SoftReference<String>>();
+ private final String name;
+ private final Map<String, String> info = new HashMap<String, String>();
+
+ public static InputStream getResourceAsStream(String fullname) {
+ fullname = fullname.toLowerCase().replace(".puml", "");
+ final int last = fullname.indexOf('/');
+ if (last == -1) {
+ return null;
+ }
+ try {
+ final Stdlib folder = retrieve(fullname.substring(0, last));
+ if (folder == null || folder.info.size() == 0) {
+ return null;
+ }
+ final String data = folder.loadRessource(fullname.substring(last + 1));
+ if (data == null) {
+ return null;
+ }
+ return new ByteArrayInputStream(data.getBytes("UTF-8"));
+ } catch (IOException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ private static Stdlib retrieve(final String name) throws IOException {
+ Stdlib result = all.get(name);
+ if (result == null) {
+ final DataInputStream dataStream = getDataStream(name);
+ if (dataStream == null) {
+ return null;
+ }
+ final String info = dataStream.readUTF();
+ dataStream.close();
+ result = new Stdlib(name, info);
+ all.put(name, result);
+ }
+ return result;
+ }
+
+ private String loadRessource(String file) throws IOException {
+ final SoftReference<String> cached = cache.get(file.toLowerCase());
+ if (cached != null) {
+ final String cachedResult = cached.get();
+ if (cachedResult != null) {
+ // Log.info("Using cache for " + file);
+ return cachedResult;
+ }
+ }
+ Log.info("No cache for " + file);
+ final DataInputStream dataStream = getDataStream();
+ if (dataStream == null) {
+ return null;
+ }
+ dataStream.readUTF();
+ final InputStream spriteStream = getSpriteStream();
+ if (spriteStream == null) {
+ dataStream.close();
+ return null;
+ }
+ try {
+ StringBuilder found = null;
+ while (true) {
+ final String filename = dataStream.readUTF();
+ if (filename.equals(SEPARATOR)) {
+ Log.info("Not found " + filename);
+ return null;
+ }
+ if (filename.equalsIgnoreCase(file)) {
+ found = new StringBuilder();
+ }
+ while (true) {
+ final String s = dataStream.readUTF();
+ if (s.equals(SEPARATOR)) {
+ if (found != null) {
+ final String result = found.toString();
+ cache.put(file.toLowerCase(), new SoftReference<String>(result));
+ return result;
+ }
+ break;
+ }
+ if (found != null) {
+ found.append(s);
+ found.append("\n");
+ }
+ if (isSpriteLine(s)) {
+ final Matcher m = sizePattern.matcher(s);
+ final boolean ok = m.find();
+ if (ok == false) {
+ throw new IOException(s);
+ }
+ final int width = Integer.parseInt(m.group(1));
+ final int height = Integer.parseInt(m.group(2));
+ if (found == null) {
+ skipSprite(width, height, spriteStream);
+ } else {
+ final String sprite = readSprite(width, height, spriteStream);
+ found.append(sprite);
+ found.append("}\n");
+ }
+ }
+ }
+ }
+ } finally {
+ dataStream.close();
+ spriteStream.close();
+ }
+
+ }
+
+ private Stdlib(String name, String info) throws IOException {
+ this.name = name;
+ fillMap(info);
+ }
+
+ private void skipSprite(int width, int height, InputStream inputStream) throws IOException {
+ final int nbLines = (height + 1) / 2;
+ inputStream.skip(nbLines * width);
+ }
+
+ private String readSprite(int width, int height, InputStream inputStream) throws IOException {
+ final int nbLines = (height + 1) / 2;
+ final StringBuilder result = new StringBuilder();
+ int line = 0;
+ for (int j = 0; j < nbLines; j++) {
+ final StringBuilder sb1 = new StringBuilder();
+ final StringBuilder sb2 = new StringBuilder();
+ for (int i = 0; i < width; i++) {
+ final int b = inputStream.read();
+ final int b1 = (b & 0xF0) >> 4;
+ final int b2 = (b & 0x0F);
+ sb1.append(toHexString(b1));
+ sb2.append(toHexString(b2));
+ }
+ result.append(sb1.toString());
+ result.append("\n");
+ line++;
+ if (line < height) {
+ result.append(sb2.toString());
+ result.append("\n");
+ line++;
+ }
+ }
+ return result.toString();
+ }
+
+ private String toHexString(final int b) {
+ return Integer.toHexString(b).toUpperCase();
+ }
+
+ private boolean isSpriteLine(String s) {
+ return s.trim().startsWith("sprite") && s.trim().endsWith("{");
+ }
+
+ private void fillMap(String infoString) {
+ for (String s : infoString.split("\n")) {
+ if (s.contains("=")) {
+ final String data[] = s.split("=");
+ this.info.put(data[0], data[1]);
+ }
+ }
+ }
+
+ private static DataInputStream getDataStream(String name) throws IOException {
+ final InputStream raw = getInternalInputStream(name, "-abx.repx");
+ if (raw == null) {
+ return null;
+ }
+ return new DataInputStream(new BrotliInputStream(raw));
+ }
+
+ private DataInputStream getDataStream() throws IOException {
+ return getDataStream(name);
+ }
+
+ private InputStream getSpriteStream() throws IOException {
+ final InputStream raw = getInternalInputStream(name, "-dex.repx");
+ if (raw == null) {
+ return null;
+ }
+ return new BrotliInputStream(raw);
+ }
+
+ private static InputStream getInternalInputStream(String fullname, String extension) {
+ final String res = "/stdlib/" + fullname + extension;
+ return Stdlib.class.getResourceAsStream(res);
+ }
+
+ public static void extractStdLib() throws IOException {
+ for (String name : getAll()) {
+ final Stdlib folder = Stdlib.retrieve(name);
+ folder.extractMeFull(new File("stdlib", name));
+ }
+ }
+
+ private static Collection<String> getAll() throws IOException {
+ final Set<String> result = new TreeSet<String>();
+ final InputStream home = getInternalInputStream("home", ".repx");
+ final BufferedReader br = new BufferedReader(new InputStreamReader(home));
+ String name;
+ while ((name = br.readLine()) != null) {
+ result.add(name);
+ }
+ return Collections.unmodifiableCollection(result);
+ }
+
+ private void extractMeFull(File dir) throws IOException {
+ final DataInputStream dataStream = getDataStream();
+ if (dataStream == null) {
+ return;
+ }
+ dataStream.readUTF();
+ final InputStream spriteStream = getSpriteStream();
+ try {
+ while (true) {
+ final String filename = dataStream.readUTF();
+ if (filename.equals(SEPARATOR)) {
+ return;
+ }
+ final File f = new File("stdlib/" + name + "/" + filename + ".puml");
+ f.getParentFile().mkdirs();
+ final PrintWriter fos = new PrintWriter(f);
+ while (true) {
+ final String s = dataStream.readUTF();
+ if (s.equals(SEPARATOR)) {
+ break;
+ }
+ fos.println(s);
+ if (isSpriteLine(s)) {
+ final Matcher m = sizePattern.matcher(s);
+ final boolean ok = m.find();
+ if (ok == false) {
+ throw new IOException(s);
+ }
+ final int width = Integer.parseInt(m.group(1));
+ final int height = Integer.parseInt(m.group(2));
+ final String sprite = readSprite(width, height, spriteStream);
+ fos.println(sprite);
+ fos.println("}");
+ }
+ }
+ fos.close();
+ }
+ } finally {
+ dataStream.close();
+ spriteStream.close();
+ }
+ }
+
+ public static void addInfoVersion(List<String> strings, boolean details) {
+ try {
+ for (String name : getAll()) {
+ final Stdlib folder = Stdlib.retrieve(name);
+ if (details) {
+ strings.add("<b>" + name);
+ strings.add("Version " + folder.getVersion());
+ strings.add("Delivered by " + folder.getSource());
+ strings.add(" ");
+ } else {
+ strings.add("* " + name + " (Version " + folder.getVersion() + ")");
+ }
+ }
+ } catch (IOException e) {
+ Log.error("Error " + e);
+ return;
+ }
+ }
+
+ private String getVersion() {
+ return info.get("VERSION");
+ }
+
+ private String getSource() {
+ return info.get("SOURCE");
+ }
+
+ public static void printStdLib() {
+ final List<String> print = new ArrayList<String>();
+ addInfoVersion(print, true);
+ for (String s : print) {
+ System.out.println(s.replace("<b>", ""));
+ }
+ }
+}
diff --git a/src/net/sourceforge/plantuml/preproc/Sub.java b/src/net/sourceforge/plantuml/preproc/Sub.java
new file mode 100644
index 0000000..99a2474
--- /dev/null
+++ b/src/net/sourceforge/plantuml/preproc/Sub.java
@@ -0,0 +1,61 @@
+/* ========================================================================
+ * 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.preproc;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sourceforge.plantuml.CharSequence2;
+import net.sourceforge.plantuml.LineLocation;
+
+public class Sub {
+
+ private final String name;
+ private final List<CharSequence2> lines = new ArrayList<CharSequence2>();
+
+ public Sub(String name) {
+ this.name = name;
+ }
+
+ public void add(CharSequence2 s) {
+ this.lines.add(s);
+ }
+
+ public ReadLine getReadLine(LineLocation lineLocation) {
+ return new ReadLineList(lines, lineLocation);
+ }
+
+} \ No newline at end of file
diff --git a/src/net/sourceforge/plantuml/preproc/SubPreprocessor.java b/src/net/sourceforge/plantuml/preproc/SubPreprocessor.java
new file mode 100644
index 0000000..f9030f3
--- /dev/null
+++ b/src/net/sourceforge/plantuml/preproc/SubPreprocessor.java
@@ -0,0 +1,185 @@
+/* ========================================================================
+ * 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.preproc;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import net.sourceforge.plantuml.CharSequence2;
+import net.sourceforge.plantuml.DefinitionsContainer;
+import net.sourceforge.plantuml.FileSystem;
+import net.sourceforge.plantuml.Log;
+import net.sourceforge.plantuml.command.regex.Matcher2;
+import net.sourceforge.plantuml.command.regex.MyPattern;
+import net.sourceforge.plantuml.command.regex.Pattern2;
+
+public class SubPreprocessor extends ReadLineInstrumented implements ReadLine {
+
+ private static final String ID = "[A-Za-z_][A-Za-z_0-9]*";
+
+ private static final Pattern2 includeSubPattern = MyPattern.cmpile("^[%s]*!includesub[%s]+[%g]?([^%g]+)[%g]?$");
+
+ private static final Pattern2 startsub = MyPattern.cmpile("^[%s]*!startsub[%s]+(" + ID + ")");
+ private static final Pattern2 endsub = MyPattern.cmpile("^[%s]*!endsub[%s]*");
+
+ private final ReadLine source;
+ private final Defines defines;
+ private final DefinitionsContainer definitionsContainer;
+ private final String charset;
+ private final Map<String, Sub> subs = new HashMap<String, Sub>();
+ private final List<String> config;
+ private Sub learningSub;
+ private ReadLine includedSub;
+
+ public SubPreprocessor(List<String> config, String charset, Defines defines,
+ DefinitionsContainer definitionsContainer, ReadLine source) {
+ this.config = config;
+ this.source = source;
+ this.charset = charset;
+ this.defines = defines;
+ this.definitionsContainer = definitionsContainer;
+ }
+
+ @Override
+ CharSequence2 readLineInst() throws IOException {
+ if (includedSub != null) {
+ final CharSequence2 s = includedSub.readLine();
+ if (s != null) {
+ eventuallyLearn(s);
+ return s;
+ }
+ includedSub = null;
+ }
+
+ final CharSequence2 s = source.readLine();
+ if (s == null) {
+ return null;
+ }
+
+ final Matcher2 m1 = includeSubPattern.matcher(s);
+ if (m1.find()) {
+ return manageIncludeSub(s, m1);
+ }
+
+ Matcher2 m = startsub.matcher(s);
+ if (m.find()) {
+ return manageStartsub(m);
+ }
+
+ m = endsub.matcher(s);
+ if (m.find()) {
+ return manageEndsub(m);
+ }
+ eventuallyLearn(s);
+ return s;
+ }
+
+ private void eventuallyLearn(final CharSequence2 s) {
+ if (learningSub != null) {
+ learningSub.add(s);
+ }
+ }
+
+ private CharSequence2 manageIncludeSub(CharSequence2 s, Matcher2 m) throws IOException {
+ final String name = m.group(1);
+ final int idx = name.indexOf('!');
+ if (idx != -1) {
+ final String filename = name.substring(0, idx);
+ final String blocname = name.substring(idx + 1);
+ final File f = FileSystem.getInstance().getFile(PreprocessorInclude.withEnvironmentVariable(filename));
+ if (f.exists() == false || f.isDirectory()) {
+ return s.withErrorPreprocessor("Cannot include " + f.getAbsolutePath());
+ }
+ final Preprocessor data = new Preprocessor(config, getReaderInclude(s, f), charset, defines, null,
+ definitionsContainer);
+ while (data.readLine() != null) {
+ // Read file
+ }
+ data.close();
+ this.includedSub = data.getSub(blocname).getReadLine(s.getLocation());
+ } else {
+ this.includedSub = getSub(name).getReadLine(s.getLocation());
+ }
+ return this.readLine();
+ }
+
+ private ReadLine getReaderInclude(CharSequence2 s, final File f) {
+ try {
+ if (charset == null) {
+ Log.info("Using default charset");
+ return ReadLineReader.create(new FileReader(f), f.getAbsolutePath(), s.getLocation());
+ }
+ Log.info("Using charset " + charset);
+ return ReadLineReader.create(new InputStreamReader(new FileInputStream(f), charset), f.getAbsolutePath(),
+ s.getLocation());
+ } catch (IOException e) {
+ return new ReadLineSimple(s, e.toString());
+ }
+
+ }
+
+ private CharSequence2 manageStartsub(Matcher2 m) throws IOException {
+ final String name = m.group(1);
+ this.learningSub = getSub(name);
+ return this.readLine();
+ }
+
+ private CharSequence2 manageEndsub(Matcher2 m) throws IOException {
+ this.learningSub = null;
+ return this.readLine();
+ }
+
+ Sub getSub(String name) {
+ Sub result = subs.get(name);
+ if (result == null) {
+ result = new Sub(name);
+ subs.put(name, result);
+ }
+ return result;
+ }
+
+ @Override
+ void closeInst() throws IOException {
+ source.close();
+ }
+
+} \ No newline at end of file
diff --git a/src/net/sourceforge/plantuml/preproc/UncommentReadLine.java b/src/net/sourceforge/plantuml/preproc/UncommentReadLine.java
index 1b03651..a8f1b73 100644
--- a/src/net/sourceforge/plantuml/preproc/UncommentReadLine.java
+++ b/src/net/sourceforge/plantuml/preproc/UncommentReadLine.java
@@ -44,21 +44,27 @@ import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
import net.sourceforge.plantuml.utils.StartUtils;
-public class UncommentReadLine implements ReadLine {
+public class UncommentReadLine extends ReadLineInstrumented implements ReadLine {
+
+ private static final Pattern2 unpause = MyPattern.cmpile(StartUtils.PAUSE_PATTERN);
private final ReadLine raw;
- private final Pattern2 start;
- private final Pattern2 unpause;
+ // private final Pattern2 start;
private String headerToRemove;
private boolean paused;
public UncommentReadLine(ReadLine source) {
this.raw = source;
- this.start = MyPattern.cmpile(StartUtils.START_PATTERN);
- this.unpause = MyPattern.cmpile(StartUtils.PAUSE_PATTERN);
+ // this.start = MyPattern.cmpile(StartUtils.START_PATTERN);
+ }
+
+ @Override
+ public String toString() {
+ return "UncommentReadLine of " + raw;
}
- public CharSequence2 readLine() throws IOException {
+ @Override
+ CharSequence2 readLineInst() throws IOException {
final CharSequence2 result = raw.readLine();
if (result == null) {
@@ -88,7 +94,8 @@ public class UncommentReadLine implements ReadLine {
return result;
}
- public void close() throws IOException {
+ @Override
+ void closeInst() throws IOException {
this.raw.close();
}
diff --git a/src/net/sourceforge/plantuml/preproc/Variables.java b/src/net/sourceforge/plantuml/preproc/Variables.java
index d916c57..19442ac 100644
--- a/src/net/sourceforge/plantuml/preproc/Variables.java
+++ b/src/net/sourceforge/plantuml/preproc/Variables.java
@@ -38,10 +38,18 @@ package net.sourceforge.plantuml.preproc;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
+import java.util.regex.Pattern;
public class Variables {
private final List<DefineVariable> all = new ArrayList<DefineVariable>();
+ private final String fonctionName;
+ private final String definitionQuoted;
+
+ public Variables(String fonctionName, String definitionQuoted) {
+ this.fonctionName = fonctionName;
+ this.definitionQuoted = definitionQuoted;
+ }
public void add(DefineVariable var) {
this.all.add(var);
@@ -61,7 +69,7 @@ public class Variables {
if (nb == 0) {
return this;
}
- final Variables result = new Variables();
+ final Variables result = new Variables(fonctionName, definitionQuoted);
for (DefineVariable v : all) {
if (v.getDefaultValue() != null && nb > 0) {
result.add(v.removeDefault());
@@ -76,36 +84,39 @@ public class Variables {
return result;
}
- public String applyOn(String line, String fonctionName, String newValue) {
- // System.err.println("KEY="+key);
- // final StringTokenizer st = new StringTokenizer(key, "(),");
- // final String fctName = st.nextToken();
- final StringBuilder regex = new StringBuilder("\\b" + fonctionName + "\\(");
+ private String newValue;
+ private Pattern regex2;
- final List<DefineVariable> variables = all;
- boolean appended = false;
- for (int j = 0; j < variables.size(); j++) {
- final DefineVariable variable = variables.get(j);
- final String varName = variable.getName();
- final String var2 = "(##" + varName + "\\b)|(\\b" + varName + "##)|(\\b" + varName + "\\b)";
- if (variable.getDefaultValue() == null) {
- regex.append("(?:(?:\\s*\"([^\"]*)\"\\s*)|(?:\\s*'([^']*)'\\s*)|\\s*" + "((?:\\([^()]*\\)|[^,'\"])*?)"
- + ")");
- final int i = 1 + 3 * j;
- newValue = newValue.replaceAll(var2, "\\$" + i + "\\$" + (i + 1) + "\\$" + (i + 2));
- regex.append(",");
- appended = true;
- } else {
- newValue = newValue.replaceAll(var2, Matcher.quoteReplacement(variable.getDefaultValue()));
+ public String applyOn(String line) {
+ if (newValue == null) {
+ newValue = definitionQuoted;
+ final StringBuilder regex = new StringBuilder("\\b" + fonctionName + "\\(");
+
+ final List<DefineVariable> variables = all;
+ boolean appended = false;
+ for (int j = 0; j < variables.size(); j++) {
+ final DefineVariable variable = variables.get(j);
+ final String varName = variable.getName();
+ final String var2 = "(##" + varName + "\\b)|(\\b" + varName + "##)|(\\b" + varName + "\\b)";
+ if (variable.getDefaultValue() == null) {
+ regex.append("(?:(?:\\s*\"([^\"]*)\"\\s*)|(?:\\s*'([^']*)'\\s*)|\\s*"
+ + "((?:\\([^()]*\\)|[^,'\"])*?)" + ")");
+ final int i = 1 + 3 * j;
+ newValue = newValue.replaceAll(var2, "\\$" + i + "\\$" + (i + 1) + "\\$" + (i + 2));
+ regex.append(",");
+ appended = true;
+ } else {
+ newValue = newValue.replaceAll(var2, Matcher.quoteReplacement(variable.getDefaultValue()));
+ }
}
+ if (appended == true) {
+ regex.setLength(regex.length() - 1);
+ }
+ regex.append("\\)");
+ regex2 = Pattern.compile(regex.toString());
}
- if (appended == true) {
- regex.setLength(regex.length() - 1);
- }
- regex.append("\\)");
- // System.err.println("regex=" + regex);
- // System.err.println("newValue=" + newValue);
- line = line.replaceAll(regex.toString(), newValue);
+ // line = line.replaceAll(regex.toString(), newValue);
+ line = regex2.matcher(line).replaceAll(newValue);
return line;
}
diff --git a/src/net/sourceforge/plantuml/project/PSystemProject.java b/src/net/sourceforge/plantuml/project/PSystemProject.java
index def21d6..bb20a6c 100644
--- a/src/net/sourceforge/plantuml/project/PSystemProject.java
+++ b/src/net/sourceforge/plantuml/project/PSystemProject.java
@@ -82,8 +82,9 @@ public class PSystemProject extends AbstractPSystem {
final BufferedImage im = createImage(diagram);
PngIO.write(im, os, fileFormatOption.isWithMetadata() ? getMetadata() : null, 96);
} else if (fileFormat == FileFormat.SVG) {
- final UGraphicSvg svg = new UGraphicSvg(new Dimension2DDouble(0, 0), colorMapper, StringUtils.getAsHtml(background), false, 1.0,
- fileFormatOption.getSvgLinkTarget(), fileFormatOption.getHoverColor(), seed());
+ 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) {
@@ -97,7 +98,7 @@ public class PSystemProject extends AbstractPSystem {
} else {
throw new UnsupportedOperationException();
}
- return new ImageDataSimple();
+ return ImageDataSimple.ok();
}
private BufferedImage createImage(GanttDiagramUnused diagram) {
diff --git a/src/net/sourceforge/plantuml/project2/PSystemProject2.java b/src/net/sourceforge/plantuml/project2/PSystemProject2.java
index 01fe942..926e1d1 100644
--- a/src/net/sourceforge/plantuml/project2/PSystemProject2.java
+++ b/src/net/sourceforge/plantuml/project2/PSystemProject2.java
@@ -81,8 +81,9 @@ public class PSystemProject2 extends AbstractPSystem {
final BufferedImage im = createImage(diagram);
PngIO.write(im, os, fileFormatOption.isWithMetadata() ? getMetadata() : null, 96);
} else if (fileFormat == FileFormat.SVG) {
- final UGraphicSvg svg = new UGraphicSvg(new Dimension2DDouble(0, 0),colorMapper, StringUtils.getAsHtml(background), false, 1.0,
- fileFormatOption.getSvgLinkTarget(), fileFormatOption.getHoverColor(), seed());
+ 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) {
@@ -96,7 +97,7 @@ public class PSystemProject2 extends AbstractPSystem {
} else {
throw new UnsupportedOperationException();
}
- return new ImageDataSimple();
+ return ImageDataSimple.ok();
}
private BufferedImage createImage(GanttDiagram2 diagram) {
diff --git a/src/net/sourceforge/plantuml/project2/PSystemProjectFactory2.java b/src/net/sourceforge/plantuml/project2/PSystemProjectFactory2.java
index 9e8c5e3..8050332 100644
--- a/src/net/sourceforge/plantuml/project2/PSystemProjectFactory2.java
+++ b/src/net/sourceforge/plantuml/project2/PSystemProjectFactory2.java
@@ -57,8 +57,8 @@ public class PSystemProjectFactory2 extends UmlDiagramFactory {
protected List<Command> createCommands() {
final List<Command> cmds = new ArrayList<Command>();
cmds.add(new CommandNope());
- cmds.add(new CommandComment());
- cmds.add(new CommandMultilinesComment());
+// cmds.add(new CommandComment());
+// cmds.add(new CommandMultilinesComment());
cmds.add(new CommandAffectation());
cmds.add(new CommandCloseWeekDay());
return cmds;
diff --git a/src/net/sourceforge/plantuml/project3/CommandGanttArrow.java b/src/net/sourceforge/plantuml/project3/CommandGanttArrow.java
new file mode 100644
index 0000000..5cd0757
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/CommandGanttArrow.java
@@ -0,0 +1,83 @@
+/* ========================================================================
+ * 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.project3;
+
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.SingleLineCommand2;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+
+public class CommandGanttArrow extends SingleLineCommand2<GanttDiagram> {
+
+ public CommandGanttArrow() {
+ super(getRegexConcat());
+ }
+
+ static RegexConcat getRegexConcat() {
+ return new RegexConcat(new RegexLeaf("^"), //
+ new RegexLeaf("CODE1", "([\\p{L}0-9_.]+)"), //
+ new RegexLeaf("[%s]*"), //
+ new RegexLeaf("ARROW", "(-+)\\>"), //
+ new RegexLeaf("[%s]*"), //
+ new RegexLeaf("CODE2", "([\\p{L}0-9_.]+)"), //
+ new RegexLeaf("[%s]*"), //
+ new RegexLeaf("$"));
+ }
+
+ @Override
+ protected CommandExecutionResult executeArg(GanttDiagram diagram, RegexResult arg) {
+
+ final String code1 = arg.get("CODE1", 0);
+ final String code2 = arg.get("CODE2", 0);
+ final Task task1 = diagram.getExistingTask(code1);
+ if (task1 == null) {
+ return CommandExecutionResult.error("No such task " + code1);
+ }
+ final Task task2 = diagram.getExistingTask(code2);
+ if (task2 == null) {
+ return CommandExecutionResult.error("No such task " + code2);
+ }
+
+ final TaskInstant end1 = new TaskInstant(task1, TaskAttribute.END);
+
+ task2.setStart(end1.getInstantPrecise());
+ diagram.addContraint(new GanttConstraint(end1, new TaskInstant(task2, TaskAttribute.START)));
+
+ return CommandExecutionResult.ok();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/project3/CommandGanttArrow2.java b/src/net/sourceforge/plantuml/project3/CommandGanttArrow2.java
new file mode 100644
index 0000000..af29b66
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/CommandGanttArrow2.java
@@ -0,0 +1,74 @@
+/* ========================================================================
+ * 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.project3;
+
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.SingleLineCommand2;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+
+public class CommandGanttArrow2 extends SingleLineCommand2<GanttDiagram> {
+
+ public CommandGanttArrow2() {
+ super(getRegexConcat());
+ }
+
+ static RegexConcat getRegexConcat() {
+ return new RegexConcat(new RegexLeaf("^"), //
+ new RegexLeaf("TASK1", "\\[([^\\[\\]]+?)\\]"), //
+ new RegexLeaf("[%s]*"), //
+ new RegexLeaf("ARROW", "(-+)\\>"), //
+ new RegexLeaf("[%s]*"), //
+ new RegexLeaf("TASK2", "\\[([^\\[\\]]+?)\\]"), //
+ new RegexLeaf("[%s]*"), //
+ new RegexLeaf("$"));
+ }
+
+ @Override
+ protected CommandExecutionResult executeArg(GanttDiagram diagram, RegexResult arg) {
+
+ final String name1 = arg.get("TASK1", 0);
+ final String name2 = arg.get("TASK2", 0);
+ final Task task1 = diagram.getOrCreateTask(name1, null, false);
+ final Task task2 = diagram.getOrCreateTask(name2, null, false);
+
+ diagram.setTaskOrder(task1, task2);
+
+ return CommandExecutionResult.ok();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/project3/CommandPage.java b/src/net/sourceforge/plantuml/project3/CommandPage.java
new file mode 100644
index 0000000..eaf7e1d
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/CommandPage.java
@@ -0,0 +1,63 @@
+/* ========================================================================
+ * 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.project3;
+
+import java.util.List;
+
+import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram;
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.SingleLineCommand;
+
+public class CommandPage extends SingleLineCommand<GanttDiagram> {
+
+ public CommandPage() {
+ super("(?i)^page[%s]+(\\d+)[%s]*x[%s]*(\\d+)$");
+ }
+
+ @Override
+ protected CommandExecutionResult executeArg(GanttDiagram diagram, List<String> arg) {
+
+ final int horizontal = Integer.parseInt(arg.get(0));
+ final int vertical = Integer.parseInt(arg.get(1));
+ if (horizontal <= 0 || vertical <= 0) {
+ return CommandExecutionResult.error("Argument must be positive");
+ }
+ diagram.setHorizontalPages(horizontal);
+ diagram.setVerticalPages(vertical);
+ return CommandExecutionResult.ok();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/project3/CommandSeparator.java b/src/net/sourceforge/plantuml/project3/CommandSeparator.java
new file mode 100644
index 0000000..d4a5cd0
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/CommandSeparator.java
@@ -0,0 +1,65 @@
+/* ========================================================================
+ * 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.project3;
+
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.SingleLineCommand2;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+
+public class CommandSeparator extends SingleLineCommand2<GanttDiagram> {
+
+ public CommandSeparator() {
+ super(getRegexConcat());
+ }
+
+ static RegexConcat getRegexConcat() {
+ return new RegexConcat(new RegexLeaf("^"), //
+ new RegexLeaf("--"), //
+ new RegexLeaf("[%s]*"), //
+ new RegexLeaf("COMMENT", "((.+?)[%s]*--)?"), //
+ new RegexLeaf("$"));
+ }
+
+ @Override
+ protected CommandExecutionResult executeArg(GanttDiagram diagram, RegexResult arg) {
+ final String comment = arg.get("COMMENT", 1);
+ diagram.addSeparator(comment);
+ return CommandExecutionResult.ok();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/project3/ComplementClose.java b/src/net/sourceforge/plantuml/project3/ComplementClose.java
index 113adff..1467246 100644
--- a/src/net/sourceforge/plantuml/project3/ComplementClose.java
+++ b/src/net/sourceforge/plantuml/project3/ComplementClose.java
@@ -42,7 +42,7 @@ import net.sourceforge.plantuml.command.regex.RegexResult;
public class ComplementClose implements ComplementPattern {
public IRegex toRegex(String suffix) {
- return new RegexLeaf("ADAY" + suffix, "(closed?)");
+ return new RegexLeaf("CLOSED" + suffix, "(closed?)");
}
public Failable<Complement> getComplement(GanttDiagram system, RegexResult arg, String suffix) {
diff --git a/src/net/sourceforge/plantuml/project3/ComplementColors.java b/src/net/sourceforge/plantuml/project3/ComplementColors.java
index 6859c91..13e3ea3 100644
--- a/src/net/sourceforge/plantuml/project3/ComplementColors.java
+++ b/src/net/sourceforge/plantuml/project3/ComplementColors.java
@@ -66,4 +66,8 @@ public class ComplementColors implements Complement {
public boolean isOk() {
return center != null;
}
+
+ public HtmlColor getCenter() {
+ return center;
+ }
}
diff --git a/src/net/sourceforge/plantuml/project3/ComplementDates.java b/src/net/sourceforge/plantuml/project3/ComplementDates.java
new file mode 100644
index 0000000..9785f8f
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/ComplementDates.java
@@ -0,0 +1,91 @@
+/* ========================================================================
+ * 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.project3;
+
+import net.sourceforge.plantuml.command.regex.IRegex;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexOr;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+
+public class ComplementDates implements ComplementPattern {
+
+ public IRegex toRegex(String suffix) {
+ return new RegexConcat( //
+ new RegexLeaf("YEAR1" + suffix, "([\\d]{4})"), //
+ new RegexLeaf("\\D"), //
+ new RegexLeaf("MONTH1" + suffix, "([\\d]{1,2})"), //
+ new RegexLeaf("\\D"), //
+ new RegexLeaf("DAY1" + suffix, "([\\d]{1,2})"), //
+ new RegexLeaf("[%s]+to[%s]+"), //
+ new RegexLeaf("YEAR2" + suffix, "([\\d]{4})"), //
+ new RegexLeaf("\\D"), //
+ new RegexLeaf("MONTH2" + suffix, "([\\d]{1,2})"), //
+ new RegexLeaf("\\D"), //
+ new RegexLeaf("DAY2" + suffix, "([\\d]{1,2})") //
+
+ );
+ }
+
+ public Subject getSubject(GanttDiagram project, RegexResult arg) {
+ final DayAsDate date1 = getDate(arg, "1");
+ final DayAsDate date2 = getDate(arg, "2");
+ return new DaysAsDates(date1, date2);
+ }
+
+ private DayAsDate getDate(RegexResult arg, String suffix) {
+ final int day = Integer.parseInt(arg.get("DAY" + suffix, 0));
+ final int month = Integer.parseInt(arg.get("MONTH" + suffix, 0));
+ final int year = Integer.parseInt(arg.get("YEAR" + suffix, 0));
+ return DayAsDate.create(year, month, day);
+ }
+
+ public Failable<Complement> getComplement(GanttDiagram system, RegexResult arg, String suffix) {
+
+ final int day1 = Integer.parseInt(arg.get("DAY1" + suffix, 0));
+ final int month1 = Integer.parseInt(arg.get("MONTH1" + suffix, 0));
+ final int year1 = Integer.parseInt(arg.get("YEAR1" + suffix, 0));
+ final DayAsDate date1 = DayAsDate.create(year1, month1, day1);
+
+ final int day2 = Integer.parseInt(arg.get("DAY2" + suffix, 0));
+ final int month2 = Integer.parseInt(arg.get("MONTH2" + suffix, 0));
+ final int year2 = Integer.parseInt(arg.get("YEAR2" + suffix, 0));
+ final DayAsDate date2 = DayAsDate.create(year2, month2, day2);
+
+ return Failable.<Complement> ok(new DaysAsDates(date1, date2));
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/project3/ComplementInColors2.java b/src/net/sourceforge/plantuml/project3/ComplementInColors2.java
new file mode 100644
index 0000000..28cfe41
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/ComplementInColors2.java
@@ -0,0 +1,56 @@
+/* ========================================================================
+ * 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.project3;
+
+import net.sourceforge.plantuml.command.regex.IRegex;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+
+public class ComplementInColors2 implements ComplementPattern {
+
+ public IRegex toRegex(String suffix) {
+ return new RegexLeaf("COMPLEMENT" + suffix, "colou?red[%s]+(?:in[%s+])?(#?\\w+)(?:/(#?\\w+))?");
+ }
+
+ public Failable<Complement> getComplement(GanttDiagram system, RegexResult arg, String suffix) {
+ final String color1 = arg.get("COMPLEMENT" + suffix, 0);
+ final String color2 = arg.get("COMPLEMENT" + suffix, 1);
+ final HtmlColor col1 = system.getIHtmlColorSet().getColorIfValid(color1);
+ final HtmlColor col2 = system.getIHtmlColorSet().getColorIfValid(color2);
+ return Failable.<Complement> ok(new ComplementColors(col1, col2));
+ }
+}
diff --git a/src/net/sourceforge/plantuml/project3/DurationDay.java b/src/net/sourceforge/plantuml/project3/ComplementName.java
index efd53c4..a3d09f1 100644
--- a/src/net/sourceforge/plantuml/project3/DurationDay.java
+++ b/src/net/sourceforge/plantuml/project3/ComplementName.java
@@ -35,21 +35,16 @@
*/
package net.sourceforge.plantuml.project3;
-public class DurationDay implements Duration {
+public class ComplementName implements Complement {
- private final int days;
+ private final String name;
- public DurationDay(int days) {
- this.days = days;
+ public ComplementName(String name) {
+ this.name = name;
}
- public int getDays() {
- return days;
- }
-
- @Override
- public String toString() {
- return "{" + days + " days}";
+ public final String getName() {
+ return name;
}
}
diff --git a/src/net/sourceforge/plantuml/project3/ComplementNamed.java b/src/net/sourceforge/plantuml/project3/ComplementNamed.java
new file mode 100644
index 0000000..70b5725
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/ComplementNamed.java
@@ -0,0 +1,52 @@
+/* ========================================================================
+ * 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.project3;
+
+import net.sourceforge.plantuml.command.regex.IRegex;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+
+public class ComplementNamed implements ComplementPattern {
+
+ public IRegex toRegex(String suffix) {
+ return new RegexLeaf("COMPLEMENT" + suffix, "\\[([^\\[\\]]+)\\]");
+ }
+
+ public Failable<Complement> getComplement(GanttDiagram system, RegexResult arg, String suffix) {
+ final String name = arg.get("COMPLEMENT" + suffix, 0);
+ return Failable.<Complement> ok(new ComplementName(name));
+ }
+}
diff --git a/src/net/sourceforge/plantuml/project3/ComplementSeveralDays.java b/src/net/sourceforge/plantuml/project3/ComplementSeveralDays.java
index 09226cd..fd6e20c 100644
--- a/src/net/sourceforge/plantuml/project3/ComplementSeveralDays.java
+++ b/src/net/sourceforge/plantuml/project3/ComplementSeveralDays.java
@@ -36,17 +36,24 @@
package net.sourceforge.plantuml.project3;
import net.sourceforge.plantuml.command.regex.IRegex;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
public class ComplementSeveralDays implements ComplementPattern {
public IRegex toRegex(String suffix) {
- return new RegexLeaf("COMPLEMENT" + suffix, "(\\d+)[%s]+days?");
+ return new RegexConcat( //
+ new RegexLeaf("COMPLEMENT" + suffix, "(\\d+)[%s]+days?"), //
+ new RegexLeaf("LOAD" + suffix, "([%s]+at[%s]+(\\d+)%)?"));
}
public Failable<Complement> getComplement(GanttDiagram system, RegexResult arg, String suffix) {
final String days = arg.get("COMPLEMENT" + suffix, 0);
- return Failable.<Complement> ok(new DurationDay(Integer.parseInt(days)));
+ final String load = arg.get("LOAD" + suffix, 1);
+ if (load == null) {
+ return Failable.<Complement> ok(LoadInDays.inDay(Integer.parseInt(days)));
+ }
+ return Failable.<Complement> ok(LoadInDays.inDayWithLoad(Integer.parseInt(days), Integer.parseInt(load)));
}
}
diff --git a/src/net/sourceforge/plantuml/project3/ConstantPlan.java b/src/net/sourceforge/plantuml/project3/ConstantPlan.java
new file mode 100644
index 0000000..ee5cfe4
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/ConstantPlan.java
@@ -0,0 +1,58 @@
+/* ========================================================================
+ * 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.project3;
+
+public class ConstantPlan implements LoadPlanable {
+
+ private final int loadPerInstant;
+
+ private ConstantPlan(int loadPerInstant) {
+ this.loadPerInstant = loadPerInstant;
+ }
+
+ public static LoadPlanable normal() {
+ return new ConstantPlan(100);
+ }
+
+ public static LoadPlanable partial(int load) {
+ return new ConstantPlan(load);
+ }
+
+ public int getLoadAt(Instant instant) {
+ return loadPerInstant;
+
+ }
+}
diff --git a/src/net/sourceforge/plantuml/project3/DayAsDate.java b/src/net/sourceforge/plantuml/project3/DayAsDate.java
index c8d5e6c..43068f8 100644
--- a/src/net/sourceforge/plantuml/project3/DayAsDate.java
+++ b/src/net/sourceforge/plantuml/project3/DayAsDate.java
@@ -35,7 +35,7 @@
*/
package net.sourceforge.plantuml.project3;
-public class DayAsDate implements Complement {
+public class DayAsDate implements Complement, Comparable<DayAsDate>, Subject {
private final int year;
private final int dayOfMonth;
@@ -55,11 +55,26 @@ public class DayAsDate implements Complement {
this.month = month;
}
+ private int internalNumber() {
+ return year * 100 * 100 + month.ordinal() * 100 + dayOfMonth;
+ }
+
@Override
public String toString() {
return "" + year + "/" + month + "/" + dayOfMonth;
}
+ @Override
+ public int hashCode() {
+ return year * 113 + dayOfMonth * 17 + month.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ final DayAsDate other = (DayAsDate) obj;
+ return other.internalNumber() == this.internalNumber();
+ }
+
public final int getDayOfMonth() {
return dayOfMonth;
}
@@ -94,4 +109,21 @@ public class DayAsDate implements Complement {
final int h = ((q + 13 * (m + 1) / 5) + k + k / 4 + j / 4 + 5 * j) % 7;
return DayOfWeek.fromH(h);
}
+
+ public InstantDay asInstantDay(DayAsDate reference) {
+ // if (this.compareTo(reference) < 0) {
+ // throw new IllegalArgumentException();
+ // }
+ int cmp = 0;
+ DayAsDate current = reference;
+ while (current.compareTo(this) < 0) {
+ current = current.next();
+ cmp++;
+ }
+ return new InstantDay(cmp);
+ }
+
+ public int compareTo(DayAsDate other) {
+ return this.internalNumber() - other.internalNumber();
+ }
}
diff --git a/src/net/sourceforge/plantuml/project3/DaysAsDates.java b/src/net/sourceforge/plantuml/project3/DaysAsDates.java
new file mode 100644
index 0000000..ecf51cb
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/DaysAsDates.java
@@ -0,0 +1,90 @@
+/* ========================================================================
+ * 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.project3;
+
+import java.util.Iterator;
+
+public class DaysAsDates implements Subject, Complement, Iterable<DayAsDate> {
+
+ private final DayAsDate date1;
+ private final DayAsDate date2;
+
+ public DaysAsDates(DayAsDate date1, DayAsDate date2) {
+ this.date1 = date1;
+ this.date2 = date2;
+ }
+
+ public DaysAsDates(GanttDiagram gantt, DayAsDate date1, int count) {
+ this.date1 = date1;
+ DayAsDate tmp = date1;
+ while (count > 0) {
+ if (gantt.isOpen(tmp)) {
+ count--;
+ }
+ tmp = tmp.next();
+ }
+ this.date2 = tmp;
+ }
+
+ class MyIterator implements Iterator<DayAsDate> {
+
+ private DayAsDate current;
+
+ public MyIterator(DayAsDate current) {
+ this.current = current;
+ }
+
+ public boolean hasNext() {
+ return current.compareTo(date2) <= 0;
+ }
+
+ public DayAsDate next() {
+ final DayAsDate result = current;
+ current = current.next();
+ return result;
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+
+ }
+
+ public Iterator<DayAsDate> iterator() {
+ return new MyIterator(date1);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/project3/GCalendar.java b/src/net/sourceforge/plantuml/project3/GCalendar.java
index a7277b3..73c25e5 100644
--- a/src/net/sourceforge/plantuml/project3/GCalendar.java
+++ b/src/net/sourceforge/plantuml/project3/GCalendar.java
@@ -37,8 +37,10 @@ package net.sourceforge.plantuml.project3;
public interface GCalendar {
- // public DayAsDate next(DayAsDate day);
-
public DayAsDate toDayAsDate(InstantDay day);
+ public DayAsDate getStartingDate();
+
+ public InstantDay fromDayAsDate(DayAsDate day);
+
}
diff --git a/src/net/sourceforge/plantuml/project3/GCalendarSimple.java b/src/net/sourceforge/plantuml/project3/GCalendarSimple.java
index 5200b52..a257ddc 100644
--- a/src/net/sourceforge/plantuml/project3/GCalendarSimple.java
+++ b/src/net/sourceforge/plantuml/project3/GCalendarSimple.java
@@ -45,10 +45,28 @@ public class GCalendarSimple implements GCalendar {
public DayAsDate toDayAsDate(InstantDay day) {
DayAsDate result = start;
- for (int i = 0; i < day.getNumDay(); i++) {
+ final int target = day.getNumDay();
+ int work = 0;
+ while (work < target) {
result = result.next();
+ work++;
}
return result;
}
+ public InstantDay fromDayAsDate(DayAsDate day) {
+ if (day.compareTo(start) < 0) {
+ throw new IllegalArgumentException();
+ }
+ InstantDay result = new InstantDay(0);
+ while (toDayAsDate(result).equals(day) == false) {
+ result = result.increment();
+ }
+ return result;
+ }
+
+ public DayAsDate getStartingDate() {
+ return start;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/project3/GanttArrow.java b/src/net/sourceforge/plantuml/project3/GanttArrow.java
index 0758159..d48659c 100644
--- a/src/net/sourceforge/plantuml/project3/GanttArrow.java
+++ b/src/net/sourceforge/plantuml/project3/GanttArrow.java
@@ -125,7 +125,7 @@ public class GanttArrow implements UDrawable {
private double getX(TaskInstant when, Direction direction) {
final double x1 = timeScale.getStartingPosition(when.getInstantTheorical());
- final double x2 = timeScale.getStartingPosition(when.getInstantTheorical().increment());
+ final double x2 = timeScale.getEndingPosition(when.getInstantTheorical());
if (direction == Direction.LEFT) {
return x1;
}
diff --git a/src/net/sourceforge/plantuml/project3/GanttDiagram.java b/src/net/sourceforge/plantuml/project3/GanttDiagram.java
index 6ca4226..3308389 100644
--- a/src/net/sourceforge/plantuml/project3/GanttDiagram.java
+++ b/src/net/sourceforge/plantuml/project3/GanttDiagram.java
@@ -35,25 +35,29 @@
*/
package net.sourceforge.plantuml.project3;
-import java.awt.Font;
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.EnumSet;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import net.sourceforge.plantuml.AbstractPSystem;
import net.sourceforge.plantuml.FileFormatOption;
+import net.sourceforge.plantuml.Scale;
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.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.IHtmlColorSet;
@@ -61,10 +65,12 @@ 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.ULine;
+import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
public class GanttDiagram extends AbstractPSystem implements Subject {
@@ -73,29 +79,58 @@ public class GanttDiagram extends AbstractPSystem implements Subject {
private final Map<String, Task> byShortName = new HashMap<String, Task>();
private final List<GanttConstraint> constraints = new ArrayList<GanttConstraint>();
private final IHtmlColorSet colorSet = new HtmlColorSetSimple();
+ private final Collection<DayOfWeek> closedDayOfWeek = EnumSet.noneOf(DayOfWeek.class);
+ private final Collection<DayAsDate> closedDayAsDate = new HashSet<DayAsDate>();
private GCalendar calendar;
- private Instant min;
+ private final Instant min = new InstantDay(0);
private Instant max;
public DiagramDescription getDescription() {
return new DiagramDescription("(Project)");
}
+ private int horizontalPages = 1;
+ private int verticalPages = 1;
+
+ final public int getHorizontalPages() {
+ return horizontalPages;
+ }
+
+ final public void setHorizontalPages(int horizontalPages) {
+ this.horizontalPages = horizontalPages;
+ }
+
+ final public int getVerticalPages() {
+ return verticalPages;
+ }
+
+ final public void setVerticalPages(int verticalPages) {
+ this.verticalPages = verticalPages;
+ }
+
+ @Override
+ public int getNbImages() {
+ return this.horizontalPages * this.verticalPages;
+ }
+
+ public final int getDpi(FileFormatOption fileFormatOption) {
+ return 96;
+ }
+
@Override
protected ImageData exportDiagramNow(OutputStream os, int index, FileFormatOption fileFormatOption, long seed)
throws IOException {
- final double dpiFactor = 1;
final double margin = 10;
- // public ImageBuilder(ColorMapper colorMapper, double dpiFactor, HtmlColor mybackcolor, String metadata,
- // String warningOrError, double margin1, double margin2, Animation animation, boolean useHandwritten) {
-
sortTasks();
+ final Scale scale = getScale();
- final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1, null, "", "", 0, 0, null,
- false);
- imageBuilder.setUDrawable(getUDrawable());
+ final double dpiFactor = scale == null ? 1 : scale.getScale(100, 100);
+ final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), dpiFactor, null, "", "", 0, 0,
+ null, false);
+ final UDrawable result = getUDrawable();
+ imageBuilder.setUDrawable(result);
return imageBuilder.writeImageTOBEMOVED(fileFormatOption, seed, os);
}
@@ -127,10 +162,33 @@ public class GanttDiagram extends AbstractPSystem implements Subject {
}
private TimeScale getTimeScale() {
- return new TimeScaleBasic();
+ if (calendar == null) {
+ return new TimeScaleBasic();
+ }
+ return new TimeScaleBasic2(getCalendarSimple());
// return new TimeScaleWithoutWeekEnd(calendar);
}
+ private GCalendarSimple getCalendarSimple() {
+ return (GCalendarSimple) calendar;
+ }
+
+ public final LoadPlanable getDefaultPlan() {
+ return new LoadPlanable() {
+ public int getLoadAt(Instant instant) {
+ if (calendar == null) {
+ return 100;
+ }
+ final DayAsDate day = getCalendarSimple().toDayAsDate((InstantDay) instant);
+ final DayOfWeek dayOfWeek = day.getDayOfWeek();
+ if (closedDayOfWeek.contains(dayOfWeek) || closedDayAsDate.contains(day)) {
+ return 0;
+ }
+ return 100;
+ }
+ };
+ }
+
private void drawConstraints(final UGraphic ug, TimeScale timeScale) {
for (GanttConstraint constraint : constraints) {
constraint.getUDrawable(timeScale).drawU(ug);
@@ -140,54 +198,114 @@ public class GanttDiagram extends AbstractPSystem implements Subject {
private void drawTimeHeader(final UGraphic ug, TimeScale timeScale) {
- final double yTotal = initTaskDraws(timeScale);
+ final double yTotal = initTaskAndResourceDraws(timeScale);
final double xmin = timeScale.getStartingPosition(min);
- final double xmax = timeScale.getStartingPosition(max.increment());
- ug.apply(new UChangeColor(HtmlColorUtils.LIGHT_GRAY)).draw(new ULine(xmax - xmin, 0));
- ug.apply(new UChangeColor(HtmlColorUtils.LIGHT_GRAY)).apply(new UTranslate(0, getHeaderHeight() - 3))
- .draw(new ULine(xmax - xmin, 0));
+ final double xmax = timeScale.getEndingPosition(max);
if (calendar == null) {
drawSimpleDayCounter(ug, timeScale, yTotal);
} else {
drawCalendar(ug, timeScale, yTotal);
}
+ ug.apply(new UChangeColor(HtmlColorUtils.LIGHT_GRAY)).draw(new ULine(xmax - xmin, 0));
+ ug.apply(new UChangeColor(HtmlColorUtils.LIGHT_GRAY)).apply(new UTranslate(0, getHeaderHeight() - 3))
+ .draw(new ULine(xmax - xmin, 0));
+
+ }
+
+ private final HtmlColor veryLightGray = new HtmlColorSetSimple().getColorIfValid("#E0E8E8");
+
+ private double getHeaderHeight() {
+ return getTimeHeaderHeight() + getHeaderNameDayHeight();
+ }
+
+ private double getTimeHeaderHeight() {
+ if (calendar != null) {
+ return Y_WEEKDAY + Y_NUMDAY;
+ }
+ return 16;
+ }
+ private double getHeaderNameDayHeight() {
+ if (calendar != null && nameDays.size() > 0) {
+ return 16;
+ }
+ return 0;
}
+ private static final int Y_WEEKDAY = 16;
+ private static final int Y_NUMDAY = 28;
+
private void drawCalendar(final UGraphic ug, TimeScale timeScale, final double yTotal) {
- final int magic = 12;
- final ULine vbar = new ULine(0, yTotal - magic);
+ timeScale = new TimeScaleBasic();
+ final ULine vbar = new ULine(0, yTotal - Y_WEEKDAY);
Month lastMonth = null;
- for (Instant i = min; i.compareTo(max.increment()) <= 0; i = i.increment()) {
- final DayAsDate day = calendar.toDayAsDate((InstantDay) i);
+ final GCalendarSimple calendarAll = getCalendarSimple();
+ final Instant max2 = calendarAll.fromDayAsDate(calendar.toDayAsDate((InstantDay) max));
+ for (Instant i = min; i.compareTo(max2.increment()) <= 0; i = i.increment()) {
+ final DayAsDate day = calendarAll.toDayAsDate((InstantDay) i);
+ final DayOfWeek dayOfWeek = day.getDayOfWeek();
+ final boolean isWorkingDay = getDefaultPlan().getLoadAt(i) > 0;
final String d1 = "" + day.getDayOfMonth();
- final TextBlock num = Display.getWithNewlines(d1).create(getFontConfiguration(), HorizontalAlignment.LEFT,
- new SpriteContainerEmpty());
+ final TextBlock num = getTextBlock(d1, 10, false);
final double x1 = timeScale.getStartingPosition(i);
- final double x2 = timeScale.getStartingPosition(i.increment());
- if (i.compareTo(max.increment()) < 0) {
- final TextBlock weekDay = Display.getWithNewlines(day.getDayOfWeek().shortName()).create(
- getFontConfiguration(), HorizontalAlignment.LEFT, new SpriteContainerEmpty());
-
- drawCenter(ug.apply(new UTranslate(0, magic * 2)), num, x1, x2);
- drawCenter(ug.apply(new UTranslate(0, magic)), weekDay, x1, x2);
+ final double x2 = timeScale.getEndingPosition(i);
+ if (i.compareTo(max2.increment()) < 0) {
+ final TextBlock weekDay = getTextBlock(dayOfWeek.shortName(), 10, false);
+
+ final URectangle rect = new URectangle(x2 - x1 - 1, yTotal - Y_WEEKDAY);
+ if (isWorkingDay) {
+ final HtmlColor back = colorDays.get(day);
+ if (back != null) {
+ ug.apply(new UChangeColor(null)).apply(new UChangeBackColor(back))
+ .apply(new UTranslate(x1 + 1, Y_WEEKDAY)).draw(rect);
+ }
+ drawCenter(ug.apply(new UTranslate(0, Y_NUMDAY)), num, x1, x2);
+ drawCenter(ug.apply(new UTranslate(0, Y_WEEKDAY)), weekDay, x1, x2);
+ } else {
+ ug.apply(new UChangeColor(null)).apply(new UChangeBackColor(veryLightGray))
+ .apply(new UTranslate(x1 + 1, Y_WEEKDAY)).draw(rect);
+ }
if (lastMonth != day.getMonth()) {
- final TextBlock month = Display.getWithNewlines(day.getMonth().name()).create(
- getFontConfiguration(), HorizontalAlignment.LEFT, new SpriteContainerEmpty());
- month.drawU(ug.apply(new UTranslate(x1, 0)));
+ final int delta = 5;
+ if (lastMonth != null) {
+ final TextBlock lastMonthBlock = getTextBlock(lastMonth.name(), 12, true);
+ lastMonthBlock.drawU(ug.apply(new UTranslate(x1
+ - lastMonthBlock.calculateDimension(ug.getStringBounder()).getWidth() - delta, 0)));
+ }
+ final TextBlock month = getTextBlock(day.getMonth().name(), 12, true);
+ month.drawU(ug.apply(new UTranslate(x1 + delta, 0)));
+ ug.apply(new UChangeColor(HtmlColorUtils.LIGHT_GRAY)).apply(new UTranslate(x1, 0))
+ .draw(new ULine(0, Y_WEEKDAY));
}
lastMonth = day.getMonth();
}
- ug.apply(new UChangeColor(HtmlColorUtils.LIGHT_GRAY)).apply(new UTranslate(x1, magic)).draw(vbar);
+ ug.apply(new UChangeColor(HtmlColorUtils.LIGHT_GRAY)).apply(new UTranslate(x1, Y_WEEKDAY)).draw(vbar);
}
- }
- private double getHeaderHeight() {
- if (calendar != null) {
- return 40;
+ if (nameDays.size() > 0) {
+ String last = null;
+ for (Instant i = min; i.compareTo(max2.increment()) <= 0; i = i.increment()) {
+ final DayAsDate day = calendarAll.toDayAsDate((InstantDay) i);
+ final String name = nameDays.get(day);
+ if (name != null && name.equals(last) == false) {
+ final double x1 = timeScale.getStartingPosition(i);
+ final double x2 = timeScale.getEndingPosition(i);
+ final TextBlock label = getTextBlock(name, 12, false);
+ final double h = label.calculateDimension(ug.getStringBounder()).getHeight();
+ double y1 = getTimeHeaderHeight();
+ double y2 = getHeaderHeight();
+ label.drawU(ug.apply(new UTranslate(x1, Y_NUMDAY + 11)));
+ }
+ last = name;
+ }
+
}
- return 16;
+ }
+
+ private TextBlock getTextBlock(final String text, int size, boolean bold) {
+ return Display.getWithNewlines(text).create(getFontConfiguration(size, bold), HorizontalAlignment.LEFT,
+ new SpriteContainerEmpty());
}
private void drawCenter(final UGraphic ug, final TextBlock text, final double x1, final double x2) {
@@ -202,10 +320,10 @@ public class GanttDiagram extends AbstractPSystem implements Subject {
private void drawSimpleDayCounter(final UGraphic ug, TimeScale timeScale, final double yTotal) {
final ULine vbar = new ULine(0, yTotal);
for (Instant i = min; i.compareTo(max.increment()) <= 0; i = i.increment()) {
- final TextBlock num = Display.getWithNewlines(i.toShortString()).create(getFontConfiguration(),
+ final TextBlock num = Display.getWithNewlines(i.toShortString()).create(getFontConfiguration(10, false),
HorizontalAlignment.LEFT, new SpriteContainerEmpty());
final double x1 = timeScale.getStartingPosition(i);
- final double x2 = timeScale.getStartingPosition(i.increment());
+ final double x2 = timeScale.getEndingPosition(i);
final double width = num.calculateDimension(ug.getStringBounder()).getWidth();
final double delta = (x2 - x1) - width;
if (i.compareTo(max.increment()) < 0) {
@@ -215,25 +333,40 @@ public class GanttDiagram extends AbstractPSystem implements Subject {
}
}
- private double initTaskDraws(TimeScale timeScale) {
+ private double initTaskAndResourceDraws(TimeScale timeScale) {
double y = getHeaderHeight();
for (Task task : tasks.values()) {
- final TaskDraw draw = new TaskDraw(task, timeScale, y);
+ final TaskDraw draw;
+ if (task instanceof TaskSeparator) {
+ draw = new TaskDrawSeparator((TaskSeparator) task, timeScale, y, min, max);
+ } else {
+ draw = new TaskDrawRegular((TaskImpl) task, timeScale, y);
+ }
task.setTaskDraw(draw);
y += draw.getHeight();
+
+ }
+ for (Resource res : resources.values()) {
+ final ResourceDraw draw = new ResourceDraw(this, res, timeScale, y, min, max);
+ res.setTaskDraw(draw);
+ y += draw.getHeight();
+
}
return y;
}
private void initMinMax() {
- min = tasks.values().iterator().next().getStart();
+ // min = tasks.values().iterator().next().getStart();
max = tasks.values().iterator().next().getEnd();
for (Task task : tasks.values()) {
+ if (task instanceof TaskSeparator) {
+ continue;
+ }
final Instant start = task.getStart();
final Instant end = task.getEnd();
- if (min.compareTo(start) > 0) {
- min = start;
- }
+ // if (min.compareTo(start) > 0) {
+ // min = start;
+ // }
if (max.compareTo(end) < 0) {
max = end;
}
@@ -244,14 +377,20 @@ public class GanttDiagram extends AbstractPSystem implements Subject {
for (Task task : tasks.values()) {
final TaskDraw draw = task.getTaskDraw();
draw.drawU(ug.apply(new UTranslate(0, draw.getY())));
- draw.getTitle().drawU(
- ug.apply(new UTranslate(timeScale.getStartingPosition(task.getStart().increment()), draw.getY())));
+ draw.drawTitle(ug.apply(new UTranslate(0, draw.getY())));
+ }
+ for (Resource res : resources.values()) {
+ final ResourceDraw draw = res.getResourceDraw();
+ draw.drawU(ug.apply(new UTranslate(0, draw.getY())));
}
}
- private FontConfiguration getFontConfiguration() {
- final UFont font = UFont.serif(10);
- return new FontConfiguration(font, HtmlColorUtils.LIGHT_GRAY, HtmlColorUtils.LIGHT_GRAY, false);
+ private FontConfiguration getFontConfiguration(int size, boolean bold) {
+ UFont font = UFont.serif(size);
+ if (bold) {
+ font = font.bold();
+ }
+ return new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLACK, false);
}
public Task getExistingTask(String id) {
@@ -266,7 +405,13 @@ public class GanttDiagram extends AbstractPSystem implements Subject {
return tasks.get(code);
}
- public Task getOrCreateTask(String codeOrShortName, String shortName) {
+ public void setTaskOrder(final Task task1, final Task task2) {
+ final TaskInstant end1 = new TaskInstant(task1, TaskAttribute.END);
+ task2.setStart(end1.getInstantPrecise());
+ addContraint(new GanttConstraint(end1, new TaskInstant(task2, TaskAttribute.START)));
+ }
+
+ public Task getOrCreateTask(String codeOrShortName, String shortName, boolean linkedToPrevious) {
if (codeOrShortName == null) {
throw new IllegalArgumentException();
}
@@ -281,15 +426,37 @@ public class GanttDiagram extends AbstractPSystem implements Subject {
final TaskCode code = new TaskCode(codeOrShortName);
result = tasks.get(code);
if (result == null) {
- result = new TaskImpl(code);
+ Task previous = null;
+ if (linkedToPrevious) {
+ previous = getLastCreatedTask();
+ }
+ result = new TaskImpl(code, getDefaultPlan());
tasks.put(code, result);
if (byShortName != null) {
byShortName.put(shortName, result);
}
+ if (previous != null) {
+ setTaskOrder(previous, result);
+ }
}
return result;
}
+ private Task getLastCreatedTask() {
+ final List<Task> all = new ArrayList<Task>(tasks.values());
+ for (int i = all.size() - 1; i >= 0; i--) {
+ if (all.get(i) instanceof TaskImpl) {
+ return all.get(i);
+ }
+ }
+ return null;
+ }
+
+ public void addSeparator(String comment) {
+ TaskSeparator separator = new TaskSeparator(comment, tasks.size());
+ tasks.put(separator.getCode(), separator);
+ }
+
private TaskCodeSimpleOrder getCanonicalOrder(int hierarchyHeader) {
final List<TaskCode> codes = new ArrayList<TaskCode>();
for (TaskCode code : tasks.keySet()) {
@@ -320,4 +487,66 @@ public class GanttDiagram extends AbstractPSystem implements Subject {
this.calendar = new GCalendarSimple(start);
}
+ public DayAsDate getStartingDate() {
+ if (this.calendar == null) {
+ return null;
+ }
+ return this.calendar.getStartingDate();
+ }
+
+ public void closeDayOfWeek(DayOfWeek day) {
+ closedDayOfWeek.add(day);
+ }
+
+ public void closeDayAsDate(DayAsDate day) {
+ closedDayAsDate.add(day);
+ }
+
+ public Instant convert(DayAsDate day) {
+ return calendar.fromDayAsDate(day);
+ }
+
+ public boolean isOpen(DayAsDate day) {
+ return getDefaultPlan().getLoadAt(convert(day)) > 0;
+ }
+
+ private final Map<String, Resource> resources = new LinkedHashMap<String, Resource>();
+
+ public void affectResource(Task result, String resourceName) {
+ Resource resource = getResource(resourceName);
+ result.addResource(resource);
+ }
+
+ public Resource getResource(String resourceName) {
+ Resource resource = resources.get(resourceName);
+ if (resource == null) {
+ resource = new Resource(resourceName, getDefaultPlan());
+ }
+ resources.put(resourceName, resource);
+ return resource;
+ }
+
+ public int getLoadForResource(Resource res, Instant i) {
+ int result = 0;
+ for (Task task : tasks.values()) {
+ if (task instanceof TaskSeparator) {
+ continue;
+ }
+ final TaskImpl task2 = (TaskImpl) task;
+ result += task2.loadForResource(res, i);
+ }
+ return result;
+ }
+
+ private final Map<DayAsDate, HtmlColor> colorDays = new HashMap<DayAsDate, HtmlColor>();
+ private final Map<DayAsDate, String> nameDays = new HashMap<DayAsDate, String>();
+
+ public void colorDay(DayAsDate day, HtmlColor color) {
+ colorDays.put(day, color);
+ }
+
+ public void nameDay(DayAsDate day, String name) {
+ nameDays.put(day, name);
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/project3/GanttDiagramFactory.java b/src/net/sourceforge/plantuml/project3/GanttDiagramFactory.java
index 68d8603..1b4a870 100644
--- a/src/net/sourceforge/plantuml/project3/GanttDiagramFactory.java
+++ b/src/net/sourceforge/plantuml/project3/GanttDiagramFactory.java
@@ -42,32 +42,44 @@ import java.util.Collections;
import java.util.List;
import net.sourceforge.plantuml.command.Command;
-import net.sourceforge.plantuml.command.CommandComment;
-import net.sourceforge.plantuml.command.CommandMultilinesComment;
import net.sourceforge.plantuml.command.CommandNope;
+import net.sourceforge.plantuml.command.CommandScale;
import net.sourceforge.plantuml.command.UmlDiagramFactory;
import net.sourceforge.plantuml.core.DiagramType;
public class GanttDiagramFactory extends UmlDiagramFactory {
private List<SubjectPattern> subjects() {
- return Arrays.<SubjectPattern> asList(new SubjectTask(), new SubjectProject(), new SubjectDayOfWeek());
+ return Arrays.<SubjectPattern> asList(new SubjectTask(), new SubjectProject(), new SubjectDayOfWeek(),
+ new SubjectDayAsDate(), new SubjectDaysAsDates(), new SubjectResource());
}
- public GanttDiagramFactory() {
- super(DiagramType.UML);
+ public GanttDiagramFactory(DiagramType type) {
+ super(type);
}
@Override
protected List<Command> createCommands() {
final List<Command> cmds = new ArrayList<Command>();
+ // addCommonCommands(cmds);
cmds.add(new CommandNope());
- cmds.add(new CommandComment());
- cmds.add(new CommandMultilinesComment());
-
+ // cmds.add(new CommandComment());
+ // cmds.add(new CommandMultilinesComment());
for (Command cmd : getLanguageCommands()) {
cmds.add(cmd);
}
+ cmds.add(new CommandGanttArrow());
+ cmds.add(new CommandGanttArrow2());
+ cmds.add(new CommandSeparator());
+
+ cmds.add(new CommandScale());
+ cmds.add(new CommandPage());
+ // cmds.add(new CommandScaleWidthAndHeight());
+ // cmds.add(new CommandScaleWidthOrHeight());
+ // cmds.add(new CommandScaleMaxWidth());
+ // cmds.add(new CommandScaleMaxHeight());
+ // cmds.add(new CommandScaleMaxWidthAndHeight());
+
return cmds;
}
diff --git a/src/net/sourceforge/plantuml/project3/Instant.java b/src/net/sourceforge/plantuml/project3/Instant.java
index f9d0567..458a24d 100644
--- a/src/net/sourceforge/plantuml/project3/Instant.java
+++ b/src/net/sourceforge/plantuml/project3/Instant.java
@@ -37,10 +37,6 @@ package net.sourceforge.plantuml.project3;
public interface Instant extends Value, Comparable<Instant> {
- public Instant add(Duration duration);
-
- public Instant sub(Duration duration);
-
public Instant increment();
public Instant decrement();
diff --git a/src/net/sourceforge/plantuml/project3/InstantDay.java b/src/net/sourceforge/plantuml/project3/InstantDay.java
index 95cf49d..8ea1e2c 100644
--- a/src/net/sourceforge/plantuml/project3/InstantDay.java
+++ b/src/net/sourceforge/plantuml/project3/InstantDay.java
@@ -48,16 +48,6 @@ public class InstantDay implements Instant {
return "(day +" + numDay + ")";
}
- public InstantDay add(Duration duration) {
- final int nbdays = ((DurationDay) duration).getDays();
- return new InstantDay(numDay + nbdays);
- }
-
- public InstantDay sub(Duration duration) {
- final int nbdays = ((DurationDay) duration).getDays();
- return new InstantDay(numDay - nbdays);
- }
-
public InstantDay increment() {
return new InstantDay(numDay + 1);
}
diff --git a/src/net/sourceforge/plantuml/project3/Load.java b/src/net/sourceforge/plantuml/project3/Load.java
new file mode 100644
index 0000000..bc95e10
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/Load.java
@@ -0,0 +1,42 @@
+/* ========================================================================
+ * 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.project3;
+
+public interface Load extends Value, Complement, LoadPlanable {
+
+ int getFullLoad();
+
+}
diff --git a/src/net/sourceforge/plantuml/project3/LoadInDays.java b/src/net/sourceforge/plantuml/project3/LoadInDays.java
new file mode 100644
index 0000000..5d13f75
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/LoadInDays.java
@@ -0,0 +1,65 @@
+/* ========================================================================
+ * 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.project3;
+
+public class LoadInDays implements Load {
+
+ private final int days;
+ private final int loadPerDay;
+
+ private LoadInDays(int days, int loadPerDay) {
+ this.days = days;
+ this.loadPerDay = loadPerDay;
+ }
+
+ public static LoadInDays inDay(int days) {
+ return new LoadInDays(days, 100);
+ }
+
+ public static Complement inDayWithLoad(int days, int loadPerDay) {
+ final int tmp = (int) Math.ceil(days * 100.0 / loadPerDay);
+ return new LoadInDays(tmp, loadPerDay);
+ }
+
+ public int getFullLoad() {
+ return days * loadPerDay;
+ }
+
+ public int getLoadAt(Instant instant) {
+ return loadPerDay;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/project3/Duration.java b/src/net/sourceforge/plantuml/project3/LoadPlanable.java
index 2dfa10c..1d04c06 100644
--- a/src/net/sourceforge/plantuml/project3/Duration.java
+++ b/src/net/sourceforge/plantuml/project3/LoadPlanable.java
@@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.project3;
-public interface Duration extends Value, Complement {
+public interface LoadPlanable {
+ public int getLoadAt(Instant instant);
}
diff --git a/src/net/sourceforge/plantuml/project3/NaturalCommand.java b/src/net/sourceforge/plantuml/project3/NaturalCommand.java
index 213e54a..2d2ace9 100644
--- a/src/net/sourceforge/plantuml/project3/NaturalCommand.java
+++ b/src/net/sourceforge/plantuml/project3/NaturalCommand.java
@@ -72,13 +72,15 @@ public class NaturalCommand extends SingleLineCommand2<GanttDiagram> {
}
public static Command create(SubjectPattern subject, VerbPattern verb, ComplementPattern complement) {
- return new NaturalCommand(new RegexConcat(//
+ final RegexConcat pattern = new RegexConcat(//
new RegexLeaf("^"), //
subject.toRegex(), //
new RegexLeaf("[%s]+"), //
verb.toRegex(), //
new RegexLeaf("[%s]+"), //
complement.toRegex("0"), //
- new RegexLeaf("$")), subject, verb, complement);
+ new RegexLeaf("$"));
+ // System.err.println("NaturalCommand="+pattern.getPattern());
+ return new NaturalCommand(pattern, subject, verb, complement);
}
}
diff --git a/src/net/sourceforge/plantuml/project3/PlanUtils.java b/src/net/sourceforge/plantuml/project3/PlanUtils.java
new file mode 100644
index 0000000..e89aae7
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/PlanUtils.java
@@ -0,0 +1,52 @@
+/* ========================================================================
+ * 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.project3;
+
+public class PlanUtils {
+
+ private PlanUtils() {
+
+ }
+
+ public static LoadPlanable minOf(final LoadPlanable p1, final LoadPlanable p2) {
+ return new LoadPlanable() {
+ public int getLoadAt(Instant instant) {
+ return Math.min(p1.getLoadAt(instant), p2.getLoadAt(instant));
+ }
+ };
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/webp/Portrait.java b/src/net/sourceforge/plantuml/project3/Resource.java
index 90d185e..6bfdbca 100644
--- a/src/net/sourceforge/plantuml/webp/Portrait.java
+++ b/src/net/sourceforge/plantuml/project3/Resource.java
@@ -30,57 +30,62 @@
*
*
* Original Author: Arnaud Roques
- *
+ *
*
*/
-package net.sourceforge.plantuml.webp;
-
-import java.awt.image.BufferedImage;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
+package net.sourceforge.plantuml.project3;
-import javax.imageio.ImageIO;
-import javax.imageio.stream.ImageInputStream;
+import java.util.Set;
+import java.util.TreeSet;
-public class Portrait {
+public class Resource implements Subject, LoadPlanable {
private final String name;
- private final int age;
- private final String quote;
- private final byte webp[];
+ private ResourceDraw draw;
+ private final LoadPlanable loadPlanable;
+ private Set<Instant> closed = new TreeSet<Instant>();
- public Portrait(String name, int age, String quote, byte webp[]) throws IOException {
+ public Resource(String name, LoadPlanable loadPlanable) {
this.name = name;
- this.quote = quote;
- this.age = age;
- this.webp = webp;
+ this.loadPlanable = loadPlanable;
}
- public BufferedImage getBufferedImage() {
- try {
- final InputStream is = new ByteArrayInputStream(webp);
- final ImageInputStream iis = ImageIO.createImageInputStream(is);
- final VP8Decoder vp8Decoder = new VP8Decoder();
- vp8Decoder.decodeFrame(iis, false);
- iis.close();
- return vp8Decoder.getFrame().getBufferedImage();
- } catch (IOException e) {
- return null;
- }
+ @Override
+ public int hashCode() {
+ return name.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ final Resource other = (Resource) obj;
+ return this.name.equals(other.name);
+ }
+ @Override
+ public String toString() {
+ return name;
}
public String getName() {
return name;
}
- public int getAge() {
- return age;
+ public ResourceDraw getResourceDraw() {
+ return draw;
+ }
+
+ public void setTaskDraw(ResourceDraw draw) {
+ this.draw = draw;
}
- public String getQuote() {
- return quote;
+ public int getLoadAt(Instant instant) {
+ if (this.closed.contains(instant)) {
+ return 0;
+ }
+ return loadPlanable.getLoadAt(instant);
}
+ public void addCloseDay(Instant instant) {
+ this.closed.add(instant);
+ }
}
diff --git a/src/net/sourceforge/plantuml/project3/ResourceDraw.java b/src/net/sourceforge/plantuml/project3/ResourceDraw.java
new file mode 100644
index 0000000..8b5f258
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/ResourceDraw.java
@@ -0,0 +1,118 @@
+/* ========================================================================
+ * 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.project3;
+
+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.HtmlColor;
+import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.graphic.UDrawable;
+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.UTranslate;
+
+public class ResourceDraw implements UDrawable {
+
+ private final Resource res;
+ private final TimeScale timeScale;
+ private final double y;
+ private final Instant min;
+ private final Instant max;
+ private final GanttDiagram gantt;
+
+ public ResourceDraw(GanttDiagram gantt, Resource res, TimeScale timeScale, double y, Instant min, Instant max) {
+ this.res = res;
+ this.timeScale = timeScale;
+ this.y = y;
+ this.min = min;
+ this.max = max;
+ this.gantt = gantt;
+ }
+
+ public void drawU(UGraphic ug) {
+ final TextBlock title = Display.getWithNewlines(res.getName()).create(getFontConfiguration(13),
+ HorizontalAlignment.LEFT, new SpriteContainerEmpty());
+ title.drawU(ug);
+ final ULine line = new ULine(timeScale.getEndingPosition(max) - timeScale.getStartingPosition(min), 0);
+ ug.apply(new UChangeColor(HtmlColorUtils.BLACK))
+ .apply(new UTranslate(0, title.calculateDimension(ug.getStringBounder()).getHeight())).draw(line);
+ for (Instant i = min; i.compareTo(max) <= 0; i = i.increment()) {
+ final int load = gantt.getLoadForResource(res, i);
+ if (load > 0) {
+ final FontConfiguration fontConfiguration = getFontConfiguration(9, load > 100 ? HtmlColorUtils.RED
+ : HtmlColorUtils.BLACK);
+ final TextBlock value = Display.getWithNewlines("" + load).create(fontConfiguration,
+ HorizontalAlignment.LEFT, new SpriteContainerEmpty());
+ final double start = (timeScale.getStartingPosition(i) + timeScale.getEndingPosition(i)) / 2
+ - value.calculateDimension(ug.getStringBounder()).getWidth() / 2;
+ value.drawU(ug.apply(new UTranslate(start, 16)));
+ }
+
+ }
+
+ }
+
+ private FontConfiguration getFontConfiguration(int size) {
+ return getFontConfiguration(size, HtmlColorUtils.BLACK);
+ }
+
+ private FontConfiguration getFontConfiguration(int size, HtmlColor color) {
+ final UFont font = UFont.serif(size);
+ return new FontConfiguration(font, color, color, false);
+ }
+
+ // public void setColors(ComplementColors colors);
+ //
+ // public double getY();
+ //
+ // public double getY(Direction direction);
+ //
+ // public void drawTitle(UGraphic ug);
+
+ public double getHeight() {
+ return 16 * 2;
+ }
+
+ public double getY() {
+ return y;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/project3/Resources.java b/src/net/sourceforge/plantuml/project3/Resources.java
new file mode 100644
index 0000000..7880a9f
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/Resources.java
@@ -0,0 +1,53 @@
+/* ========================================================================
+ * 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.project3;
+
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+public class Resources implements LoadPlanable {
+
+ private final Set<Resource> all = new LinkedHashSet<Resource>();
+
+ public int getLoadAt(Instant instant) {
+ int result = 0;
+ for (Resource res : all) {
+ result += res.getLoadAt(instant);
+ }
+ return result;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/project3/Solver.java b/src/net/sourceforge/plantuml/project3/Solver3.java
index d18f6e2..70da380 100644
--- a/src/net/sourceforge/plantuml/project3/Solver.java
+++ b/src/net/sourceforge/plantuml/project3/Solver3.java
@@ -40,12 +40,24 @@ import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
-public class Solver {
+public class Solver3 {
private final Map<TaskAttribute, Value> values = new LinkedHashMap<TaskAttribute, Value>();
+ private final LoadPlanable loadPlanable;
+
+ public Solver3(LoadPlanable loadPlanable) {
+ this.loadPlanable = loadPlanable;
+ }
+
public void setData(TaskAttribute attribute, Value value) {
- values.remove(attribute);
+ final Value previous = values.remove(attribute);
+ if (previous != null && attribute == TaskAttribute.START) {
+ final Instant previousInstant = (Instant) previous;
+ if (previousInstant.compareTo((Instant) value) > 0) {
+ value = previous;
+ }
+ }
values.put(attribute, value);
if (values.size() > 2) {
removeFirstElement();
@@ -69,23 +81,30 @@ public class Solver {
if (attribute == TaskAttribute.START) {
return computeStart();
}
- throw new UnsupportedOperationException(attribute.toString());
+ return LoadInDays.inDay(1);
+ // throw new UnsupportedOperationException(attribute.toString());
}
return result;
}
- private Instant computeStart() {
- final Instant end = (Instant) values.get(TaskAttribute.END);
- final Duration duration = (Duration) values.get(TaskAttribute.DURATION);
- assert end != null && duration != null;
- return end.sub(duration).increment();
+ private Instant computeEnd() {
+ Instant current = (Instant) values.get(TaskAttribute.START);
+ int fullLoad = ((Load) values.get(TaskAttribute.LOAD)).getFullLoad();
+ while (fullLoad > 0) {
+ fullLoad -= loadPlanable.getLoadAt(current);
+ current = current.increment();
+ }
+ return current.decrement();
}
- private Instant computeEnd() {
- final Instant start = (Instant) values.get(TaskAttribute.START);
- final Duration duration = (Duration) values.get(TaskAttribute.DURATION);
- assert start != null && duration != null;
- return start.add(duration).decrement();
+ private Instant computeStart() {
+ Instant current = (Instant) values.get(TaskAttribute.END);
+ int fullLoad = ((Load) values.get(TaskAttribute.LOAD)).getFullLoad();
+ while (fullLoad > 0) {
+ fullLoad -= loadPlanable.getLoadAt(current);
+ current = current.decrement();
+ }
+ return current.increment();
}
}
diff --git a/src/net/sourceforge/plantuml/project3/SubjectDayAsDate.java b/src/net/sourceforge/plantuml/project3/SubjectDayAsDate.java
new file mode 100644
index 0000000..01fc742
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/SubjectDayAsDate.java
@@ -0,0 +1,68 @@
+/* ========================================================================
+ * 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.project3;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+import net.sourceforge.plantuml.command.regex.IRegex;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+
+public class SubjectDayAsDate implements SubjectPattern {
+
+ public Collection<VerbPattern> getVerbs() {
+ return Arrays.<VerbPattern> asList(new VerbIsOrAre());
+ }
+
+ public IRegex toRegex() {
+ return new RegexConcat( //
+ new RegexLeaf("YEAR", "([\\d]{4})"), //
+ new RegexLeaf("\\D"), //
+ new RegexLeaf("MONTH", "([\\d]{1,2})"), //
+ new RegexLeaf("\\D"), //
+ new RegexLeaf("DAY", "([\\d]{1,2})"));
+ }
+
+ public Subject getSubject(GanttDiagram project, RegexResult arg) {
+ final int day = Integer.parseInt(arg.get("DAY", 0));
+ final int month = Integer.parseInt(arg.get("MONTH", 0));
+ final int year = Integer.parseInt(arg.get("YEAR", 0));
+ return DayAsDate.create(year, month, day);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/project3/SubjectDaysAsDates.java b/src/net/sourceforge/plantuml/project3/SubjectDaysAsDates.java
new file mode 100644
index 0000000..5a9d63f
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/SubjectDaysAsDates.java
@@ -0,0 +1,107 @@
+/* ========================================================================
+ * 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.project3;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+import net.sourceforge.plantuml.command.regex.IRegex;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexOr;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+
+public class SubjectDaysAsDates implements SubjectPattern {
+
+ public Collection<VerbPattern> getVerbs() {
+ return Arrays.<VerbPattern> asList(new VerbIsOrAre(), new VerbIsOrAreNamed());
+ }
+
+ public IRegex toRegex() {
+ return new RegexOr(regexTo(), regexAnd());
+
+ }
+
+ private IRegex regexTo() {
+ return new RegexConcat( //
+ new RegexLeaf("YEAR1", "([\\d]{4})"), //
+ new RegexLeaf("\\D"), //
+ new RegexLeaf("MONTH1", "([\\d]{1,2})"), //
+ new RegexLeaf("\\D"), //
+ new RegexLeaf("DAY1", "([\\d]{1,2})"), //
+ new RegexLeaf("[%s]+to[%s]+"), //
+ new RegexLeaf("YEAR2", "([\\d]{4})"), //
+ new RegexLeaf("\\D"), //
+ new RegexLeaf("MONTH2", "([\\d]{1,2})"), //
+ new RegexLeaf("\\D"), //
+ new RegexLeaf("DAY2", "([\\d]{1,2})") //
+ );
+ }
+
+ private IRegex regexAnd() {
+ return new RegexConcat( //
+ new RegexLeaf("YEAR3", "([\\d]{4})"), //
+ new RegexLeaf("\\D"), //
+ new RegexLeaf("MONTH3", "([\\d]{1,2})"), //
+ new RegexLeaf("\\D"), //
+ new RegexLeaf("DAY3", "([\\d]{1,2})"), //
+ new RegexLeaf("[%s]+and[%s]+"), //
+ new RegexLeaf("COUNT", "([\\d]+)"), //
+ new RegexLeaf("[%s]+days?") //
+
+ );
+ }
+
+ public Subject getSubject(GanttDiagram project, RegexResult arg) {
+ final String count = arg.get("COUNT", 0);
+ if (count == null) {
+ final DayAsDate date1 = getDate(arg, "1");
+ final DayAsDate date2 = getDate(arg, "2");
+ return new DaysAsDates(date1, date2);
+ }
+ final DayAsDate date3 = getDate(arg, "3");
+ final int nb = Integer.parseInt(count);
+ return new DaysAsDates(project, date3, nb);
+ }
+
+ private DayAsDate getDate(RegexResult arg, String suffix) {
+ final int day = Integer.parseInt(arg.get("DAY" + suffix, 0));
+ final int month = Integer.parseInt(arg.get("MONTH" + suffix, 0));
+ final int year = Integer.parseInt(arg.get("YEAR" + suffix, 0));
+ return DayAsDate.create(year, month, day);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/project3/SubjectResource.java b/src/net/sourceforge/plantuml/project3/SubjectResource.java
new file mode 100644
index 0000000..cd6d701
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/SubjectResource.java
@@ -0,0 +1,63 @@
+/* ========================================================================
+ * 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.project3;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.StringTokenizer;
+
+import net.sourceforge.plantuml.command.regex.IRegex;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+
+public class SubjectResource implements SubjectPattern {
+
+ public Collection<VerbPattern> getVerbs() {
+ return Arrays.<VerbPattern> asList(new VerbIsOff());
+ }
+
+ public IRegex toRegex() {
+ return new RegexConcat( //
+ new RegexLeaf("RESOURCE", "\\{([^{}]+)\\}") //
+ );
+ }
+
+ public Subject getSubject(GanttDiagram project, RegexResult arg) {
+ final String s = arg.get("RESOURCE", 0);
+ return project.getResource(s);
+ }
+}
diff --git a/src/net/sourceforge/plantuml/project3/SubjectTask.java b/src/net/sourceforge/plantuml/project3/SubjectTask.java
index 17ac263..21632df 100644
--- a/src/net/sourceforge/plantuml/project3/SubjectTask.java
+++ b/src/net/sourceforge/plantuml/project3/SubjectTask.java
@@ -37,30 +37,46 @@ package net.sourceforge.plantuml.project3;
import java.util.Arrays;
import java.util.Collection;
+import java.util.StringTokenizer;
import net.sourceforge.plantuml.command.regex.IRegex;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
public class SubjectTask implements SubjectPattern {
public Collection<VerbPattern> getVerbs() {
- return Arrays.<VerbPattern> asList(new VerbLasts(), new VerbStarts(), new VerbHappens(), new VerbEnds(),
- new VerbIsColored());
+ return Arrays.<VerbPattern> asList(new VerbLasts(), new VerbTaskStarts(), new VerbTaskStartsAbsolute(),
+ new VerbHappens(), new VerbEnds(), new VerbTaskEndsAbsolute(), new VerbIsColored());
}
public IRegex toRegex() {
- return new RegexLeaf("SUBJECT", "\\[([^\\[\\]]+?)\\](?:[%s]+as[%s]+\\[([^\\[\\]]+?)\\])?");
+ return new RegexConcat( //
+ new RegexLeaf("THEN", "(then[%s]+)?"), //
+ new RegexLeaf("SUBJECT", "\\[([^\\[\\]]+?)\\](?:[%s]+as[%s]+\\[([^\\[\\]]+?)\\])?"), //
+ new RegexLeaf("RESOURCE", "(?:[%s]+on[%s]+((?:\\{[^{}]+\\}[%s]*)+))?") //
+ );
}
public Subject getSubject(GanttDiagram project, RegexResult arg) {
final String s = arg.get("SUBJECT", 0);
final String shortName = arg.get("SUBJECT", 1);
- final Task result = project.getOrCreateTask(s, shortName);
+ final String then = arg.get("THEN", 0);
+ final String resource = arg.get("RESOURCE", 0);
+ final Task result = project.getOrCreateTask(s, shortName, then != null);
if (result == null) {
throw new IllegalStateException();
}
+ if (resource != null) {
+ for (final StringTokenizer st = new StringTokenizer(resource, "{}"); st.hasMoreTokens();) {
+ final String part = st.nextToken().trim();
+ if (part.length() > 0) {
+ project.affectResource(result, part);
+ }
+ }
+
+ }
return result;
}
-
}
diff --git a/src/net/sourceforge/plantuml/project3/Task.java b/src/net/sourceforge/plantuml/project3/Task.java
index fb7ee8c..770eb09 100644
--- a/src/net/sourceforge/plantuml/project3/Task.java
+++ b/src/net/sourceforge/plantuml/project3/Task.java
@@ -43,18 +43,20 @@ public interface Task extends Subject {
public Instant getEnd();
- public Duration getDuration();
+ public Load getLoad();
+
+ public void setLoad(Load load);
public void setStart(Instant start);
public void setEnd(Instant end);
- public void setDuration(Duration duration);
-
public void setTaskDraw(TaskDraw taskDraw);
public TaskDraw getTaskDraw();
public void setColors(ComplementColors colors);
+ public void addResource(Resource resource);
+
}
diff --git a/src/net/sourceforge/plantuml/project3/TaskAttribute.java b/src/net/sourceforge/plantuml/project3/TaskAttribute.java
index 54d40eb..5a42a6f 100644
--- a/src/net/sourceforge/plantuml/project3/TaskAttribute.java
+++ b/src/net/sourceforge/plantuml/project3/TaskAttribute.java
@@ -36,7 +36,7 @@
package net.sourceforge.plantuml.project3;
public enum TaskAttribute {
- START, END, DURATION;
+ START, END, LOAD;
public static TaskAttribute fromString(String value) {
return valueOf(value.toUpperCase());
diff --git a/src/net/sourceforge/plantuml/project3/TaskCode.java b/src/net/sourceforge/plantuml/project3/TaskCode.java
index 234c833..ad715c3 100644
--- a/src/net/sourceforge/plantuml/project3/TaskCode.java
+++ b/src/net/sourceforge/plantuml/project3/TaskCode.java
@@ -81,9 +81,8 @@ public class TaskCode {
return hierarchy.toString();
}
- public Display getSimpleDisplay() {
- final String last = hierarchy.get(hierarchy.size() - 1);
- return Display.getWithNewlines(last);
+ public String getSimpleDisplay() {
+ return hierarchy.get(hierarchy.size() - 1);
}
public int getHierarchySize() {
diff --git a/src/net/sourceforge/plantuml/project3/TaskDraw.java b/src/net/sourceforge/plantuml/project3/TaskDraw.java
index 4246352..722b2b7 100644
--- a/src/net/sourceforge/plantuml/project3/TaskDraw.java
+++ b/src/net/sourceforge/plantuml/project3/TaskDraw.java
@@ -36,111 +36,19 @@
package net.sourceforge.plantuml.project3;
import net.sourceforge.plantuml.Direction;
-import net.sourceforge.plantuml.SpriteContainerEmpty;
-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.graphic.UDrawable;
-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.UShape;
-import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class TaskDraw implements UDrawable {
+public interface TaskDraw extends UDrawable {
- private final Task task;
- private final TimeScale timeScale;
- private final double y;
- private ComplementColors colors;
+ public void setColors(ComplementColors colors);
- private final double margin = 2;
+ public double getY();
- public TaskDraw(Task task, TimeScale timeScale, double y) {
- this.y = y;
- this.task = task;
- this.timeScale = timeScale;
- }
+ public double getY(Direction direction);
- public TextBlock getTitle() {
- return task.getCode().getSimpleDisplay()
- .create(getFontConfiguration(), HorizontalAlignment.LEFT, new SpriteContainerEmpty());
- }
+ public void drawTitle(UGraphic ug);
- private FontConfiguration getFontConfiguration() {
- final UFont font = UFont.serif(11);
- return new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLACK, false);
- }
+ public double getHeight();
- public void drawU(UGraphic ug) {
- final double start = timeScale.getStartingPosition(task.getStart());
- final UShape rect = getShape();
-
- ug = applyColors(ug);
- ug.apply(new UTranslate(start + margin, margin)).draw(rect);
- }
-
- private UGraphic applyColors(UGraphic ug) {
- if (colors != null && colors.isOk()) {
- return colors.apply(ug);
- }
- if (isDiamond()) {
- return ug.apply(new UChangeColor(HtmlColorUtils.BLACK)).apply(new UChangeBackColor(HtmlColorUtils.BLACK));
- }
- return ug.apply(new UChangeColor(HtmlColorUtils.BLUE)).apply(new UChangeBackColor(HtmlColorUtils.COL_84BE84));
- }
-
- private UShape getShape() {
- if (isDiamond()) {
- return getDiamond();
- }
- final Instant instantStart = task.getStart();
- final Instant instantEnd = task.getEnd();
- final double start = timeScale.getStartingPosition(instantStart);
- final double end = timeScale.getStartingPosition(instantEnd.increment());
- return new URectangle(end - start - 2 * margin, getHeight() - 2 * margin, 8, 8);
- }
-
- private boolean isDiamond() {
- final Instant instantStart = task.getStart();
- final Instant instantEnd = task.getEnd();
- return instantStart.compareTo(instantEnd) == 0;
- }
-
- private UShape getDiamond() {
- final double h = getHeight() - 2 * margin;
- final UPolygon result = new UPolygon();
- result.addPoint(h / 2, 0);
- result.addPoint(h, h / 2);
- result.addPoint(h / 2, h);
- result.addPoint(0, h / 2);
- return result;
- // return result.translate(2, 2);
- }
-
- public double getHeight() {
- return 16;
- }
-
- public double getY() {
- return y;
- }
-
- public double getY(Direction direction) {
- if (direction == Direction.UP) {
- return y;
- }
- if (direction == Direction.DOWN) {
- return y + getHeight();
- }
- return y + getHeight() / 2;
- }
-
- public void setColors(ComplementColors colors) {
- this.colors = colors;
- }
}
diff --git a/src/net/sourceforge/plantuml/project3/TaskDrawRegular.java b/src/net/sourceforge/plantuml/project3/TaskDrawRegular.java
new file mode 100644
index 0000000..0a47344
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/TaskDrawRegular.java
@@ -0,0 +1,174 @@
+/* ========================================================================
+ * 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.project3;
+
+import net.sourceforge.plantuml.Direction;
+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.TextBlock;
+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.UShape;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class TaskDrawRegular implements TaskDraw {
+
+ private final TaskImpl task;
+ private final TimeScale timeScale;
+ private final double y;
+ private ComplementColors colors;
+
+ private final double margin = 2;
+
+ public TaskDrawRegular(TaskImpl task, TimeScale timeScale, double y) {
+ this.y = y;
+ this.task = task;
+ this.timeScale = timeScale;
+ }
+
+ public void drawTitle(UGraphic ug) {
+ final TextBlock title = Display.getWithNewlines(task.getPrettyDisplay()).create(getFontConfiguration(),
+ HorizontalAlignment.LEFT, new SpriteContainerEmpty());
+ title.drawU(ug.apply(new UTranslate(timeScale.getEndingPosition(task.getStart()), 0)));
+ }
+
+ private FontConfiguration getFontConfiguration() {
+ final UFont font = UFont.serif(11);
+ return new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLACK, false);
+ }
+
+ public void drawU(UGraphic ug1) {
+ final double start = timeScale.getStartingPosition(task.getStart());
+ ug1 = applyColors(ug1);
+ UGraphic ug2 = ug1.apply(new UTranslate(start + margin, margin));
+ // final int load = 42; // task.getLoad();
+ final UShape shapeFull = getShape(100);
+ if (shapeFull instanceof UPolygon) {
+ ug2.draw(shapeFull);
+ } else {
+ final double fullHeight = ((URectangle) shapeFull).getHeight();
+ ug2.apply(new UChangeBackColor(HtmlColorUtils.WHITE)).apply(new UChangeColor(HtmlColorUtils.WHITE))
+ .draw(shapeFull);
+ drawInside(ug1, fullHeight);
+ ug2.apply(new UChangeBackColor(null)).draw(shapeFull);
+ }
+ }
+
+ private void drawInside(UGraphic ug, double fullHeight) {
+ for (Instant i = task.getStart(); i.compareTo(task.getEnd()) <= 0; i = i.increment()) {
+ final int load = task.getLoadAt(i);
+ final URectangle shapeLoad = getShapeInside(load, i);
+ final double diffHeight = fullHeight - shapeLoad.getHeight();
+ final double start = timeScale.getStartingPosition(i);
+ ug.apply(new UChangeColor(null)).apply(new UTranslate(start, diffHeight + margin)).draw(shapeLoad);
+ }
+ }
+
+ private UGraphic applyColors(UGraphic ug) {
+ if (colors != null && colors.isOk()) {
+ return colors.apply(ug);
+ }
+ if (isDiamond()) {
+ return ug.apply(new UChangeColor(HtmlColorUtils.BLACK)).apply(new UChangeBackColor(HtmlColorUtils.BLACK));
+ }
+ return ug.apply(new UChangeColor(HtmlColorUtils.BLUE)).apply(new UChangeBackColor(HtmlColorUtils.COL_84BE84));
+ }
+
+ private URectangle getShapeInside(int load, Instant instant) {
+ final double start = timeScale.getStartingPosition(instant);
+ final double end = timeScale.getEndingPosition(instant);
+ final double height = (getHeight() - 2 * margin) * load / 100.0;
+ return new URectangle(end - start, height);
+ }
+
+ private UShape getShape(int load) {
+ if (isDiamond()) {
+ return getDiamond();
+ }
+ final Instant instantStart = task.getStart();
+ final Instant instantEnd = task.getEnd();
+ final double start = timeScale.getStartingPosition(instantStart);
+ final double end = timeScale.getEndingPosition(instantEnd);
+ final double height = (getHeight() - 2 * margin) * load / 100.0;
+ return new URectangle(end - start - 2 * margin, height, 8, 8);
+ }
+
+ private boolean isDiamond() {
+ final Instant instantStart = task.getStart();
+ final Instant instantEnd = task.getEnd();
+ return instantStart.compareTo(instantEnd) == 0;
+ }
+
+ private UShape getDiamond() {
+ final double h = getHeight() - 2 * margin;
+ final UPolygon result = new UPolygon();
+ result.addPoint(h / 2, 0);
+ result.addPoint(h, h / 2);
+ result.addPoint(h / 2, h);
+ result.addPoint(0, h / 2);
+ return result;
+ // return result.translate(2, 2);
+ }
+
+ public double getHeight() {
+ return 16;
+ }
+
+ public double getY() {
+ return y;
+ }
+
+ public double getY(Direction direction) {
+ if (direction == Direction.UP) {
+ return y;
+ }
+ if (direction == Direction.DOWN) {
+ return y + getHeight();
+ }
+ return y + getHeight() / 2;
+ }
+
+ public void setColors(ComplementColors colors) {
+ this.colors = colors;
+ }
+}
diff --git a/src/net/sourceforge/plantuml/project3/TaskDrawSeparator.java b/src/net/sourceforge/plantuml/project3/TaskDrawSeparator.java
new file mode 100644
index 0000000..e0cb984
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/TaskDrawSeparator.java
@@ -0,0 +1,128 @@
+/* ========================================================================
+ * 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.project3;
+
+import net.sourceforge.plantuml.Direction;
+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.TextBlock;
+import net.sourceforge.plantuml.graphic.TextBlockUtils;
+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.UTranslate;
+
+public class TaskDrawSeparator implements TaskDraw {
+
+ private final TimeScale timeScale;
+ private final double y;
+ private final Instant min;
+ private final Instant max;
+ private final String name;
+
+ public TaskDrawSeparator(TaskSeparator task, TimeScale timeScale, double y, Instant min, Instant max) {
+ this.name = task.getName();
+ this.y = y;
+ this.timeScale = timeScale;
+ this.min = min;
+ this.max = max;
+ }
+
+ public void drawTitle(UGraphic ug) {
+ getTitle().drawU(ug.apply(new UTranslate(MARGIN1, 0)));
+ }
+
+ private TextBlock getTitle() {
+ if (name == null) {
+ return TextBlockUtils.empty(0, 0);
+ }
+ return Display.getWithNewlines(this.name).create(getFontConfiguration(), HorizontalAlignment.LEFT,
+ new SpriteContainerEmpty());
+ }
+
+ private FontConfiguration getFontConfiguration() {
+ final UFont font = UFont.serif(11);
+ return new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLACK, false);
+ }
+
+ private final static double MARGIN1 = 10;
+ private final static double MARGIN2 = 2;
+
+ public void drawU(UGraphic ug) {
+ final double widthTitle = getTitle().calculateDimension(ug.getStringBounder()).getWidth();
+ final double start = timeScale.getStartingPosition(min) + widthTitle;
+ final double end = timeScale.getEndingPosition(max);
+
+ ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK));
+ ug = ug.apply(new UTranslate(0, getHeight() / 2));
+
+ if (widthTitle == 0) {
+ final ULine line = new ULine(end - start, 0);
+ ug.draw(line);
+ } else {
+ final ULine line1 = new ULine(MARGIN1 - MARGIN2, 0);
+ final ULine line2 = new ULine(end - start - MARGIN1 - MARGIN2, 0);
+ ug.draw(line1);
+ ug.apply(new UTranslate(widthTitle + MARGIN1 + MARGIN2, 0)).draw(line2);
+ }
+ }
+
+ public double getHeight() {
+ return 16;
+ }
+
+ public double getY() {
+ return y;
+ }
+
+ public double getY(Direction direction) {
+ if (direction == Direction.UP) {
+ return y;
+ }
+ if (direction == Direction.DOWN) {
+ return y + getHeight();
+ }
+ return y + getHeight() / 2;
+ }
+
+ public void setColors(ComplementColors colors) {
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/project3/TaskImpl.java b/src/net/sourceforge/plantuml/project3/TaskImpl.java
index ef44446..68e77b9 100644
--- a/src/net/sourceforge/plantuml/project3/TaskImpl.java
+++ b/src/net/sourceforge/plantuml/project3/TaskImpl.java
@@ -35,15 +35,80 @@
*/
package net.sourceforge.plantuml.project3;
-public class TaskImpl implements Task {
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+public class TaskImpl implements Task, LoadPlanable {
private final TaskCode code;
- private final Solver solver = new Solver();
+ private final Solver3 solver;
+ private final Set<Resource> resources = new LinkedHashSet<Resource>();
+ private final LoadPlanable defaultPlan;
- public TaskImpl(TaskCode code) {
+ public TaskImpl(TaskCode code, LoadPlanable defaultPlan) {
this.code = code;
+ this.defaultPlan = defaultPlan;
+ this.solver = new Solver3(this);
setStart(new InstantDay(0));
- setDuration(new DurationDay(1));
+ setLoad(LoadInDays.inDay(1));
+ }
+
+ public int getLoadAt(Instant instant) {
+ LoadPlanable plan1 = defaultPlan;
+ if (resources.size() > 0) {
+ plan1 = PlanUtils.minOf(plan1, getRessourcePlan());
+ }
+ return PlanUtils.minOf(getLoad(), plan1).getLoadAt(instant);
+ }
+
+ public int loadForResource(Resource res, Instant i) {
+ if (resources.contains(res) && i.compareTo(getStart()) >= 0 && i.compareTo(getEnd()) <= 0) {
+ if (res.getLoadAt(i) == 0) {
+ return 0;
+ }
+ int size = 0;
+ for (Resource r : resources) {
+ if (r.getLoadAt(i) > 0) {
+ size++;
+ }
+ }
+ return getLoadAt(i) / size;
+ }
+ return 0;
+ }
+
+ private LoadPlanable getRessourcePlan() {
+ if (resources.size() == 0) {
+ throw new IllegalStateException();
+ }
+ return new LoadPlanable() {
+
+ public int getLoadAt(Instant instant) {
+ int result = 0;
+ for (Resource res : resources) {
+ result += res.getLoadAt(instant);
+ }
+ return result;
+ }
+ };
+ }
+
+ public String getPrettyDisplay() {
+ if (resources.size() > 0) {
+ final StringBuilder result = new StringBuilder(code.getSimpleDisplay());
+ result.append(" ");
+ for (Iterator<Resource> it = resources.iterator(); it.hasNext();) {
+ result.append("{");
+ result.append(it.next().getName());
+ result.append("}");
+ if (it.hasNext()) {
+ result.append(" ");
+ }
+ }
+ return result.toString();
+ }
+ return code.getSimpleDisplay();
}
@Override
@@ -52,7 +117,7 @@ public class TaskImpl implements Task {
}
public String debug() {
- return "" + getStart() + " ---> " + getEnd() + " [" + getDuration() + "]";
+ return "" + getStart() + " ---> " + getEnd() + " [" + getLoad() + "]";
}
public TaskCode getCode() {
@@ -60,15 +125,23 @@ public class TaskImpl implements Task {
}
public Instant getStart() {
- return (Instant) solver.getData(TaskAttribute.START);
+ Instant result = (Instant) solver.getData(TaskAttribute.START);
+ while (getLoadAt(result) == 0) {
+ result = result.increment();
+ }
+ return result;
}
public Instant getEnd() {
return (Instant) solver.getData(TaskAttribute.END);
}
- public Duration getDuration() {
- return (Duration) solver.getData(TaskAttribute.DURATION);
+ public Load getLoad() {
+ return (Load) solver.getData(TaskAttribute.LOAD);
+ }
+
+ public void setLoad(Load load) {
+ solver.setData(TaskAttribute.LOAD, load);
}
public void setStart(Instant start) {
@@ -79,10 +152,6 @@ public class TaskImpl implements Task {
solver.setData(TaskAttribute.END, end);
}
- public void setDuration(Duration duration) {
- solver.setData(TaskAttribute.DURATION, duration);
- }
-
private TaskDraw taskDraw;
private ComplementColors colors;
@@ -99,4 +168,8 @@ public class TaskImpl implements Task {
this.colors = colors;
}
+ public void addResource(Resource resource) {
+ this.resources.add(resource);
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/project3/TaskSeparator.java b/src/net/sourceforge/plantuml/project3/TaskSeparator.java
new file mode 100644
index 0000000..71822f4
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/TaskSeparator.java
@@ -0,0 +1,99 @@
+/* ========================================================================
+ * 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.project3;
+
+public class TaskSeparator implements Task {
+ // public static final double SPACE = 15;
+
+ private final TaskCode code;
+ private final String comment;
+ private TaskDraw taskDraw;
+
+ public TaskSeparator(String comment, int id) {
+ this.code = new TaskCode("##" + id);
+ this.comment = comment;
+ }
+
+ public TaskCode getCode() {
+ return code;
+ }
+
+ public Instant getStart() {
+ throw new UnsupportedOperationException();
+ }
+
+ public Instant getEnd() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setStart(Instant start) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setEnd(Instant end) {
+ throw new UnsupportedOperationException();
+
+ }
+
+ public void setTaskDraw(TaskDraw taskDraw) {
+ this.taskDraw = taskDraw;
+ }
+
+ public TaskDraw getTaskDraw() {
+ return taskDraw;
+ }
+
+ public void setColors(ComplementColors colors) {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getName() {
+ return comment;
+ }
+
+ public void addResource(Resource resource) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Load getLoad() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setLoad(Load load) {
+ throw new UnsupportedOperationException();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/project3/TimeScale.java b/src/net/sourceforge/plantuml/project3/TimeScale.java
index 7edfde0..222853e 100644
--- a/src/net/sourceforge/plantuml/project3/TimeScale.java
+++ b/src/net/sourceforge/plantuml/project3/TimeScale.java
@@ -39,6 +39,8 @@ public interface TimeScale {
public double getStartingPosition(Instant instant);
+ public double getEndingPosition(Instant instant);
+
public double getWidth(Instant instant);
}
diff --git a/src/net/sourceforge/plantuml/project3/TimeScaleBasic.java b/src/net/sourceforge/plantuml/project3/TimeScaleBasic.java
index 023051d..3909aee 100644
--- a/src/net/sourceforge/plantuml/project3/TimeScaleBasic.java
+++ b/src/net/sourceforge/plantuml/project3/TimeScaleBasic.java
@@ -44,6 +44,10 @@ public class TimeScaleBasic implements TimeScale {
return day * scale;
}
+ public double getEndingPosition(Instant instant) {
+ return getStartingPosition(instant) + getWidth(instant);
+ }
+
public double getWidth(Instant instant) {
return scale;
}
diff --git a/src/net/sourceforge/plantuml/project3/TimeScaleBasic2.java b/src/net/sourceforge/plantuml/project3/TimeScaleBasic2.java
new file mode 100644
index 0000000..caf0f87
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/TimeScaleBasic2.java
@@ -0,0 +1,79 @@
+/* ========================================================================
+ * 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.project3;
+
+import java.util.Map;
+import java.util.TreeMap;
+
+public class TimeScaleBasic2 implements TimeScale {
+
+ private final GCalendar calendar;
+ private final GCalendar calendarAllOpen;
+ private final TimeScaleBasic basic = new TimeScaleBasic();
+ private final Map<Instant, Instant> cache = new TreeMap<Instant, Instant>();
+
+ public TimeScaleBasic2(GCalendarSimple calendar) {
+ this.calendar = calendar;
+ this.calendarAllOpen = calendar;
+ }
+
+ private Instant changeInstantSlow(Instant instant) {
+ final DayAsDate day = calendar.toDayAsDate((InstantDay) instant);
+ return calendarAllOpen.fromDayAsDate(day);
+ }
+
+ private Instant changeInstant(Instant instant) {
+ Instant result = cache.get(instant);
+ if (result == null) {
+ result = changeInstantSlow(instant);
+ cache.put(instant, result);
+ }
+ return result;
+ }
+
+ public double getStartingPosition(Instant instant) {
+ return basic.getStartingPosition(changeInstant(instant));
+ }
+
+ public double getEndingPosition(Instant instant) {
+ return basic.getEndingPosition(changeInstant(instant));
+ }
+
+ public double getWidth(Instant instant) {
+ return basic.getWidth(changeInstant(instant));
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/project3/TimeScaleWithoutWeekEnd.java b/src/net/sourceforge/plantuml/project3/TimeScaleWithoutWeekEnd.java
index a8e525e..5312cc7 100644
--- a/src/net/sourceforge/plantuml/project3/TimeScaleWithoutWeekEnd.java
+++ b/src/net/sourceforge/plantuml/project3/TimeScaleWithoutWeekEnd.java
@@ -66,4 +66,8 @@ public class TimeScaleWithoutWeekEnd implements TimeScale {
return scale;
}
+ public double getEndingPosition(Instant instant) {
+ throw new UnsupportedOperationException();
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/project3/VerbAre.java b/src/net/sourceforge/plantuml/project3/VerbAre.java
index 2c4cdb2..d3e1560 100644
--- a/src/net/sourceforge/plantuml/project3/VerbAre.java
+++ b/src/net/sourceforge/plantuml/project3/VerbAre.java
@@ -57,9 +57,9 @@ public class VerbAre implements VerbPattern {
return new Verb() {
public CommandExecutionResult execute(Subject subject, Complement complement) {
final DayOfWeek day = (DayOfWeek) subject;
+ project.closeDayOfWeek(day);
return CommandExecutionResult.ok();
}
-
};
}
}
diff --git a/src/net/sourceforge/plantuml/project3/VerbHappens.java b/src/net/sourceforge/plantuml/project3/VerbHappens.java
index 20bea96..58a3deb 100644
--- a/src/net/sourceforge/plantuml/project3/VerbHappens.java
+++ b/src/net/sourceforge/plantuml/project3/VerbHappens.java
@@ -46,20 +46,29 @@ import net.sourceforge.plantuml.command.regex.RegexResult;
public class VerbHappens implements VerbPattern {
public Collection<ComplementPattern> getComplements() {
- return Arrays.<ComplementPattern> asList(new ComplementBeforeOrAfterOrAtTaskStartOrEnd());
+ return Arrays.<ComplementPattern> asList(new ComplementBeforeOrAfterOrAtTaskStartOrEnd(), new ComplementDate());
}
public IRegex toRegex() {
- return new RegexLeaf("happens");
+ return new RegexLeaf("happens[%s]*(at[%s]*|the[%s]*|on[%s]*)*");
}
- public Verb getVerb(GanttDiagram project, RegexResult arg) {
+ public Verb getVerb(final GanttDiagram project, RegexResult arg) {
return new Verb() {
public CommandExecutionResult execute(Subject subject, Complement complement) {
final Task task = (Task) subject;
- final TaskInstant when = (TaskInstant) complement;
- task.setDuration(new DurationDay(1));
- task.setStart(when.getInstantTheorical());
+ task.setLoad(LoadInDays.inDay(1));
+ if (complement instanceof DayAsDate) {
+ final DayAsDate start = (DayAsDate) complement;
+ final DayAsDate startingDate = project.getStartingDate();
+ if (startingDate == null) {
+ return CommandExecutionResult.error("No starting date for the project");
+ }
+ task.setStart(start.asInstantDay(startingDate));
+ } else {
+ final TaskInstant when = (TaskInstant) complement;
+ task.setStart(when.getInstantTheorical());
+ }
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/project3/VerbIsOff.java b/src/net/sourceforge/plantuml/project3/VerbIsOff.java
new file mode 100644
index 0000000..bc2308d
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/VerbIsOff.java
@@ -0,0 +1,74 @@
+/* ========================================================================
+ * 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.project3;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.regex.IRegex;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+
+public class VerbIsOff implements VerbPattern {
+
+ public Collection<ComplementPattern> getComplements() {
+ return Arrays.<ComplementPattern> asList(new ComplementDate(), new ComplementDates());
+ }
+
+ public IRegex toRegex() {
+ return new RegexLeaf("is off on");
+ }
+
+ public Verb getVerb(final GanttDiagram project, RegexResult arg) {
+ return new Verb() {
+ public CommandExecutionResult execute(Subject subject, Complement complement) {
+ final Resource resource = (Resource) subject;
+ if (complement instanceof DaysAsDates) {
+ for (DayAsDate when : (DaysAsDates) complement) {
+ resource.addCloseDay(project.convert(when));
+ }
+ } else {
+ final DayAsDate when = (DayAsDate) complement;
+ resource.addCloseDay(project.convert(when));
+ }
+ return CommandExecutionResult.ok();
+ }
+
+ };
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/project3/VerbIsOrAre.java b/src/net/sourceforge/plantuml/project3/VerbIsOrAre.java
new file mode 100644
index 0000000..4e1248e
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/VerbIsOrAre.java
@@ -0,0 +1,96 @@
+/* ========================================================================
+ * 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.project3;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.regex.IRegex;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+
+public class VerbIsOrAre implements VerbPattern {
+
+ public Collection<ComplementPattern> getComplements() {
+ return Arrays.<ComplementPattern> asList(new ComplementClose(), new ComplementInColors2());
+ }
+
+ public IRegex toRegex() {
+ return new RegexLeaf("(is|are)");
+ }
+
+ public Verb getVerb(final GanttDiagram project, final RegexResult arg) {
+ return new Verb() {
+ public CommandExecutionResult execute(Subject subject, Complement complement) {
+ if (complement instanceof ComplementColors) {
+ final HtmlColor color = ((ComplementColors) complement).getCenter();
+ return manageColor(project, subject, color);
+ }
+ return manageClose(project, subject);
+ }
+ };
+ }
+
+ private CommandExecutionResult manageColor(final GanttDiagram project, Subject subject, HtmlColor color) {
+ if (subject instanceof DayAsDate) {
+ final DayAsDate day = (DayAsDate) subject;
+ project.colorDay(day, color);
+ }
+ if (subject instanceof DaysAsDates) {
+ final DaysAsDates days = (DaysAsDates) subject;
+ for (DayAsDate d : days) {
+ project.colorDay(d, color);
+ }
+ }
+ return CommandExecutionResult.ok();
+ }
+
+ private CommandExecutionResult manageClose(final GanttDiagram project, Subject subject) {
+ if (subject instanceof DayAsDate) {
+ final DayAsDate day = (DayAsDate) subject;
+ project.closeDayAsDate(day);
+ }
+ if (subject instanceof DaysAsDates) {
+ final DaysAsDates days = (DaysAsDates) subject;
+ for (DayAsDate d : days) {
+ project.closeDayAsDate(d);
+ }
+ }
+ return CommandExecutionResult.ok();
+ }
+}
diff --git a/src/net/sourceforge/plantuml/project3/VerbIsOrAreNamed.java b/src/net/sourceforge/plantuml/project3/VerbIsOrAreNamed.java
new file mode 100644
index 0000000..c291ce1
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/VerbIsOrAreNamed.java
@@ -0,0 +1,70 @@
+/* ========================================================================
+ * 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.project3;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.regex.IRegex;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+
+public class VerbIsOrAreNamed implements VerbPattern {
+
+ public Collection<ComplementPattern> getComplements() {
+ return Arrays.<ComplementPattern> asList(new ComplementNamed());
+ }
+
+ public IRegex toRegex() {
+ return new RegexLeaf("(is|are)[%s]+named");
+ }
+
+ public Verb getVerb(final GanttDiagram project, final RegexResult arg) {
+ return new Verb() {
+ public CommandExecutionResult execute(Subject subject, Complement complement) {
+ final ComplementName named = (ComplementName) complement;
+ final String name = named.getName();
+ final DaysAsDates days = (DaysAsDates) subject;
+ for (DayAsDate d : days) {
+ project.nameDay(d, name);
+ }
+ return CommandExecutionResult.ok();
+ }
+ };
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/project3/VerbLasts.java b/src/net/sourceforge/plantuml/project3/VerbLasts.java
index 48b5d97..8dc2213 100644
--- a/src/net/sourceforge/plantuml/project3/VerbLasts.java
+++ b/src/net/sourceforge/plantuml/project3/VerbLasts.java
@@ -57,8 +57,8 @@ public class VerbLasts implements VerbPattern {
return new Verb() {
public CommandExecutionResult execute(Subject subject, Complement complement) {
final Task task = (Task) subject;
- final Duration duration = (Duration) complement;
- task.setDuration(duration);
+ final Load duration = (Load) complement;
+ task.setLoad(duration);
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/project3/VerbTaskEndsAbsolute.java b/src/net/sourceforge/plantuml/project3/VerbTaskEndsAbsolute.java
new file mode 100644
index 0000000..b0f7cf4
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/VerbTaskEndsAbsolute.java
@@ -0,0 +1,71 @@
+/* ========================================================================
+ * 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.project3;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.regex.IRegex;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+
+public class VerbTaskEndsAbsolute implements VerbPattern {
+
+ public Collection<ComplementPattern> getComplements() {
+ return Arrays.<ComplementPattern> asList(new ComplementDate());
+ }
+
+ public IRegex toRegex() {
+ return new RegexLeaf("ends[%s]*(the[%s]*|on[%s]*|at[%s]*)*");
+ }
+
+ public Verb getVerb(final GanttDiagram project, RegexResult arg) {
+ return new Verb() {
+ public CommandExecutionResult execute(Subject subject, Complement complement) {
+ final Task task = (Task) subject;
+ final DayAsDate end = (DayAsDate) complement;
+ final DayAsDate startingDate = project.getStartingDate();
+ if (startingDate == null) {
+ return CommandExecutionResult.error("No starting date for the project");
+ }
+ task.setEnd(end.asInstantDay(startingDate));
+ return CommandExecutionResult.ok();
+ }
+
+ };
+ }
+}
diff --git a/src/net/sourceforge/plantuml/project3/VerbStarts.java b/src/net/sourceforge/plantuml/project3/VerbTaskStarts.java
index 89550d9..3cec23a 100644
--- a/src/net/sourceforge/plantuml/project3/VerbStarts.java
+++ b/src/net/sourceforge/plantuml/project3/VerbTaskStarts.java
@@ -43,7 +43,7 @@ import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
-public class VerbStarts implements VerbPattern {
+public class VerbTaskStarts implements VerbPattern {
public Collection<ComplementPattern> getComplements() {
return Arrays.<ComplementPattern> asList(new ComplementBeforeOrAfterOrAtTaskStartOrEnd());
diff --git a/src/net/sourceforge/plantuml/project3/VerbTaskStartsAbsolute.java b/src/net/sourceforge/plantuml/project3/VerbTaskStartsAbsolute.java
new file mode 100644
index 0000000..d011301
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/VerbTaskStartsAbsolute.java
@@ -0,0 +1,71 @@
+/* ========================================================================
+ * 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.project3;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.regex.IRegex;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+
+public class VerbTaskStartsAbsolute implements VerbPattern {
+
+ public Collection<ComplementPattern> getComplements() {
+ return Arrays.<ComplementPattern> asList(new ComplementDate());
+ }
+
+ public IRegex toRegex() {
+ return new RegexLeaf("starts[%s]*(the[%s]*|on[%s]*|at[%s]*)*");
+ }
+
+ public Verb getVerb(final GanttDiagram project, RegexResult arg) {
+ return new Verb() {
+ public CommandExecutionResult execute(Subject subject, Complement complement) {
+ final Task task = (Task) subject;
+ final DayAsDate start = (DayAsDate) complement;
+ final DayAsDate startingDate = project.getStartingDate();
+ if (startingDate == null) {
+ return CommandExecutionResult.error("No starting date for the project");
+ }
+ task.setStart(start.asInstantDay(startingDate));
+ return CommandExecutionResult.ok();
+ }
+
+ };
+ }
+}
diff --git a/src/net/sourceforge/plantuml/salt/DataSourceImpl.java b/src/net/sourceforge/plantuml/salt/DataSourceImpl.java
index 65d43e8..3cfbb39 100644
--- a/src/net/sourceforge/plantuml/salt/DataSourceImpl.java
+++ b/src/net/sourceforge/plantuml/salt/DataSourceImpl.java
@@ -36,10 +36,16 @@
package net.sourceforge.plantuml.salt;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
import java.util.StringTokenizer;
import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.WithSprite;
+import net.sourceforge.plantuml.command.BlocLines;
+import net.sourceforge.plantuml.command.Command;
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.FactorySpriteCommand;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
@@ -51,6 +57,7 @@ public class DataSourceImpl implements DataSource {
public DataSourceImpl(List<String> data) {
final Pattern2 p = MyPattern.cmpile("\\{[-+^#!*/]?");
+
for (String s : data) {
final StringTokenizer st = new StringTokenizer(s, "|}", true);
while (st.hasMoreTokens()) {
@@ -84,6 +91,7 @@ public class DataSourceImpl implements DataSource {
}
}
+
private void addInternal(String s, Terminator t) {
s = StringUtils.trin(s);
if (s.length() > 0) {
diff --git a/src/net/sourceforge/plantuml/salt/Dictionary.java b/src/net/sourceforge/plantuml/salt/Dictionary.java
index a580d5f..a549558 100644
--- a/src/net/sourceforge/plantuml/salt/Dictionary.java
+++ b/src/net/sourceforge/plantuml/salt/Dictionary.java
@@ -64,7 +64,7 @@ public class Dictionary implements SpriteContainer, ISkinSimple {
}
public Sprite getSprite(String name) {
- return null;
+ return sprites.get(name);
}
public String getValue(String key) {
@@ -95,4 +95,11 @@ public class Dictionary implements SpriteContainer, ISkinSimple {
return 96;
}
+ private final Map<String, Sprite> sprites = new HashMap<String, Sprite>();
+
+ public void addSprite(String name, Sprite sprite) {
+ sprites.put(name, sprite);
+
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/salt/PSystemSalt.java b/src/net/sourceforge/plantuml/salt/PSystemSalt.java
index 78476da..f0ef2a5 100644
--- a/src/net/sourceforge/plantuml/salt/PSystemSalt.java
+++ b/src/net/sourceforge/plantuml/salt/PSystemSalt.java
@@ -39,26 +39,55 @@ import java.awt.geom.Dimension2D;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
import java.util.List;
import net.sourceforge.plantuml.AbstractPSystem;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FileFormatOption;
+import net.sourceforge.plantuml.Log;
+import net.sourceforge.plantuml.ScaleSimple;
import net.sourceforge.plantuml.UmlDiagram;
+import net.sourceforge.plantuml.WithSprite;
import net.sourceforge.plantuml.api.ImageDataSimple;
+import net.sourceforge.plantuml.command.BlocLines;
+import net.sourceforge.plantuml.command.Command;
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.FactorySpriteCommand;
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.salt.element.Element;
+import net.sourceforge.plantuml.salt.factory.AbstractElementFactoryComplex;
+import net.sourceforge.plantuml.salt.factory.ElementFactory;
+import net.sourceforge.plantuml.salt.factory.ElementFactoryBorder;
+import net.sourceforge.plantuml.salt.factory.ElementFactoryButton;
+import net.sourceforge.plantuml.salt.factory.ElementFactoryCheckboxOff;
+import net.sourceforge.plantuml.salt.factory.ElementFactoryCheckboxOn;
+import net.sourceforge.plantuml.salt.factory.ElementFactoryDroplist;
+import net.sourceforge.plantuml.salt.factory.ElementFactoryImage;
+import net.sourceforge.plantuml.salt.factory.ElementFactoryLine;
+import net.sourceforge.plantuml.salt.factory.ElementFactoryMenu;
+import net.sourceforge.plantuml.salt.factory.ElementFactoryPyramid;
+import net.sourceforge.plantuml.salt.factory.ElementFactoryRadioOff;
+import net.sourceforge.plantuml.salt.factory.ElementFactoryRadioOn;
+import net.sourceforge.plantuml.salt.factory.ElementFactoryRetrieveFromDictonnary;
+import net.sourceforge.plantuml.salt.factory.ElementFactoryTab;
+import net.sourceforge.plantuml.salt.factory.ElementFactoryText;
+import net.sourceforge.plantuml.salt.factory.ElementFactoryTextField;
+import net.sourceforge.plantuml.salt.factory.ElementFactoryTree;
import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
-public class PSystemSalt extends AbstractPSystem {
+public class PSystemSalt extends AbstractPSystem implements WithSprite {
private final List<String> data;
+ private final Dictionary dictionary = new Dictionary();
@Deprecated
public PSystemSalt(List<String> data) {
@@ -77,10 +106,15 @@ public class PSystemSalt extends AbstractPSystem {
final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed)
throws IOException {
try {
- final Element salt = SaltUtils.createElement(data);
+ final Element salt = createElement(manageSprite());
final Dimension2D size = salt.getPreferredDimension(fileFormat.getDefaultStringBounder(), 0, 0);
- final ImageBuilder builder = new ImageBuilder(new ColorMapperIdentity(), 1.0, HtmlColorUtils.WHITE, null,
+
+ double scale = 1;
+ if (getScale() != null) {
+ scale = getScale().getScale(size.getWidth(), size.getHeight());
+ }
+ final ImageBuilder builder = new ImageBuilder(new ColorMapperIdentity(), scale, HtmlColorUtils.WHITE, null,
null, 5, 5, null, false);
builder.setUDrawable(new UDrawable() {
@@ -94,7 +128,7 @@ public class PSystemSalt extends AbstractPSystem {
} catch (Exception e) {
e.printStackTrace();
UmlDiagram.exportDiagramError(os, e, fileFormat, seed, getMetadata(), "none", new ArrayList<String>());
- return new ImageDataSimple();
+ return ImageDataSimple.error();
}
}
@@ -102,4 +136,87 @@ public class PSystemSalt extends AbstractPSystem {
return new DiagramDescription("(Salt)");
}
+ public void addSprite(String name, Sprite sprite) {
+ dictionary.addSprite(name, sprite);
+ }
+
+ private List<String> manageSprite() {
+
+ final FactorySpriteCommand factorySpriteCommand = new FactorySpriteCommand();
+ Command<WithSprite> cmd = factorySpriteCommand.createMultiLine(false);
+
+ final List<String> result = new ArrayList<String>();
+ for (Iterator<String> it = data.iterator(); it.hasNext();) {
+ String s = it.next();
+ if (s.equals("hide stereotype")) {
+ // System.err.println("skipping " + s);
+ } else if (s.startsWith("skinparam ")) {
+ // System.err.println("skipping " + s);
+ } else if (s.startsWith("scale ")) {
+ final Double scale = Double.parseDouble(s.substring("scale ".length()));
+ this.setScale(new ScaleSimple(scale));
+ // System.err.println("skipping " + s);
+ } else if (s.startsWith("sprite $")) {
+ BlocLines bloc = BlocLines.single(s);
+ do {
+ s = it.next();
+ bloc = bloc.add2(s);
+ } while (s.equals("}") == false);
+ final CommandExecutionResult cmdResult = cmd.execute(this, bloc);
+ } else {
+ result.add(s);
+ }
+ }
+ return result;
+ }
+
+ private Element createElement(List<String> data) {
+
+ final DataSourceImpl source = new DataSourceImpl(data);
+
+ final Collection<AbstractElementFactoryComplex> cpx = new ArrayList<AbstractElementFactoryComplex>();
+
+ // cpx.add(new ElementFactorySimpleFrame(source, dictionnary));
+ cpx.add(new ElementFactoryPyramid(source, dictionary));
+ cpx.add(new ElementFactoryBorder(source, dictionary));
+
+ for (AbstractElementFactoryComplex f : cpx) {
+ addSimpleFactory(f, source, dictionary);
+ }
+ for (AbstractElementFactoryComplex f1 : cpx) {
+ for (AbstractElementFactoryComplex f2 : cpx) {
+ f1.addFactory(f2);
+ }
+ }
+
+ for (ElementFactory f : cpx) {
+ if (f.ready()) {
+ Log.info("Using " + f);
+ return f.create().getElement();
+ }
+ }
+
+ Log.println("data=" + data);
+ throw new IllegalArgumentException();
+
+ }
+
+ private static void addSimpleFactory(final AbstractElementFactoryComplex cpxFactory, final DataSource source,
+ Dictionary dictionary) {
+ cpxFactory.addFactory(new ElementFactoryMenu(source, dictionary));
+ cpxFactory.addFactory(new ElementFactoryTree(source, dictionary));
+ cpxFactory.addFactory(new ElementFactoryTab(source, dictionary));
+ cpxFactory.addFactory(new ElementFactoryLine(source));
+ cpxFactory.addFactory(new ElementFactoryTextField(source, dictionary));
+ cpxFactory.addFactory(new ElementFactoryButton(source, dictionary));
+ cpxFactory.addFactory(new ElementFactoryDroplist(source, dictionary));
+ cpxFactory.addFactory(new ElementFactoryRadioOn(source, dictionary));
+ cpxFactory.addFactory(new ElementFactoryRadioOff(source, dictionary));
+ cpxFactory.addFactory(new ElementFactoryCheckboxOn(source, dictionary));
+ cpxFactory.addFactory(new ElementFactoryCheckboxOff(source, dictionary));
+ cpxFactory.addFactory(new ElementFactoryImage(source, dictionary));
+ cpxFactory.addFactory(new ElementFactoryRetrieveFromDictonnary(source, dictionary));
+ cpxFactory.addFactory(new ElementFactoryText(source, dictionary));
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/salt/PSystemSaltFactory.java b/src/net/sourceforge/plantuml/salt/PSystemSaltFactory.java
index 31dbe78..8de7b67 100644
--- a/src/net/sourceforge/plantuml/salt/PSystemSaltFactory.java
+++ b/src/net/sourceforge/plantuml/salt/PSystemSaltFactory.java
@@ -58,7 +58,7 @@ public class PSystemSaltFactory extends PSystemBasicFactory<PSystemSalt> {
@Override
public PSystemSalt executeLine(PSystemSalt system, String line) {
- if (system == null && line.equals("salt")) {
+ if (system == null && line.replace('\t', ' ').trim().equals("salt")) {
return new PSystemSalt();
}
if (system == null) {
diff --git a/src/net/sourceforge/plantuml/salt/SaltUtils.java b/src/net/sourceforge/plantuml/salt/SaltUtils.java
deleted file mode 100644
index 1447930..0000000
--- a/src/net/sourceforge/plantuml/salt/SaltUtils.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.salt;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import net.sourceforge.plantuml.Log;
-import net.sourceforge.plantuml.salt.element.Element;
-import net.sourceforge.plantuml.salt.factory.AbstractElementFactoryComplex;
-import net.sourceforge.plantuml.salt.factory.ElementFactory;
-import net.sourceforge.plantuml.salt.factory.ElementFactoryBorder;
-import net.sourceforge.plantuml.salt.factory.ElementFactoryButton;
-import net.sourceforge.plantuml.salt.factory.ElementFactoryCheckboxOff;
-import net.sourceforge.plantuml.salt.factory.ElementFactoryCheckboxOn;
-import net.sourceforge.plantuml.salt.factory.ElementFactoryDroplist;
-import net.sourceforge.plantuml.salt.factory.ElementFactoryImage;
-import net.sourceforge.plantuml.salt.factory.ElementFactoryLine;
-import net.sourceforge.plantuml.salt.factory.ElementFactoryMenu;
-import net.sourceforge.plantuml.salt.factory.ElementFactoryPyramid;
-import net.sourceforge.plantuml.salt.factory.ElementFactoryRadioOff;
-import net.sourceforge.plantuml.salt.factory.ElementFactoryRadioOn;
-import net.sourceforge.plantuml.salt.factory.ElementFactoryRetrieveFromDictonnary;
-import net.sourceforge.plantuml.salt.factory.ElementFactoryTab;
-import net.sourceforge.plantuml.salt.factory.ElementFactoryText;
-import net.sourceforge.plantuml.salt.factory.ElementFactoryTextField;
-import net.sourceforge.plantuml.salt.factory.ElementFactoryTree;
-
-public class SaltUtils {
-
- public static Element createElement(List<String> data) {
- final DataSourceImpl source = new DataSourceImpl(data);
-
- final Collection<AbstractElementFactoryComplex> cpx = new ArrayList<AbstractElementFactoryComplex>();
-
- final Dictionary dictionary = new Dictionary();
-
- // cpx.add(new ElementFactorySimpleFrame(source, dictionnary));
- cpx.add(new ElementFactoryPyramid(source, dictionary));
- cpx.add(new ElementFactoryBorder(source, dictionary));
-
- for (AbstractElementFactoryComplex f : cpx) {
- addSimpleFactory(f, source, dictionary);
- }
- for (AbstractElementFactoryComplex f1 : cpx) {
- for (AbstractElementFactoryComplex f2 : cpx) {
- f1.addFactory(f2);
- }
- }
-
- for (ElementFactory f : cpx) {
- if (f.ready()) {
- Log.info("Using " + f);
- return f.create().getElement();
- }
- }
-
- Log.println("data=" + data);
- throw new IllegalArgumentException();
-
- }
-
- private static void addSimpleFactory(final AbstractElementFactoryComplex cpxFactory, final DataSource source,
- Dictionary dictionary) {
- cpxFactory.addFactory(new ElementFactoryMenu(source, dictionary));
- cpxFactory.addFactory(new ElementFactoryTree(source, dictionary));
- cpxFactory.addFactory(new ElementFactoryTab(source, dictionary));
- cpxFactory.addFactory(new ElementFactoryLine(source));
- cpxFactory.addFactory(new ElementFactoryTextField(source, dictionary));
- cpxFactory.addFactory(new ElementFactoryButton(source, dictionary));
- cpxFactory.addFactory(new ElementFactoryDroplist(source, dictionary));
- cpxFactory.addFactory(new ElementFactoryRadioOn(source, dictionary));
- cpxFactory.addFactory(new ElementFactoryRadioOff(source, dictionary));
- cpxFactory.addFactory(new ElementFactoryCheckboxOn(source, dictionary));
- cpxFactory.addFactory(new ElementFactoryCheckboxOff(source, dictionary));
- cpxFactory.addFactory(new ElementFactoryImage(source, dictionary));
- cpxFactory.addFactory(new ElementFactoryRetrieveFromDictonnary(source, dictionary));
- cpxFactory.addFactory(new ElementFactoryText(source, dictionary));
- }
-
-}
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementButton.java b/src/net/sourceforge/plantuml/salt/element/ElementButton.java
index af2475e..933675f 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementButton.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementButton.java
@@ -70,8 +70,9 @@ public class ElementButton extends AbstractElementText implements Element {
}
final Dimension2D dim = getPreferredDimension(ug.getStringBounder(), 0, 0);
ug = ug.apply(new UStroke(stroke));
- ug.apply(new UChangeBackColor(HtmlColorSet.getInstance().getColorIfValid("#EEEEEE"))).apply(new UTranslate(stroke, stroke))
- .draw(new URectangle(dim.getWidth() - 2 * stroke, dim.getHeight() - 2 * stroke, 10, 10));
+ ug = ug.apply(new UChangeBackColor(HtmlColorSet.getInstance().getColorIfValid("#EEEEEE")));
+ ug.apply(new UTranslate(stroke, stroke)).draw(
+ new URectangle(dim.getWidth() - 2 * stroke, dim.getHeight() - 2 * stroke, 10, 10));
final Dimension2D dimPureText = getPureTextDimension(ug.getStringBounder());
drawText(ug, (dim.getWidth() - dimPureText.getWidth()) / 2, stroke + marginY);
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/AbstractMessage.java b/src/net/sourceforge/plantuml/sequencediagram/AbstractMessage.java
index b1676ab..9809092 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/AbstractMessage.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/AbstractMessage.java
@@ -55,7 +55,7 @@ public abstract class AbstractMessage implements EventWithDeactivate {
private final String messageNumber;
private boolean parallel = false;
- private List<NoteOnMessage> noteOnMessages = new ArrayList<NoteOnMessage>();
+ private List<Note> noteOnMessages = new ArrayList<Note>();
public AbstractMessage(Display label, ArrowConfiguration arrowConfiguration, String messageNumber) {
this.url = null;
@@ -63,7 +63,7 @@ public abstract class AbstractMessage implements EventWithDeactivate {
this.arrowConfiguration = arrowConfiguration;
this.messageNumber = messageNumber;
}
-
+
public final void setUrl(Url url) {
this.url = url;
}
@@ -78,9 +78,9 @@ public abstract class AbstractMessage implements EventWithDeactivate {
final public Url getUrl() {
if (url == null) {
- for (NoteOnMessage n : noteOnMessages) {
- if (n.getUrlNote() != null) {
- return n.getUrlNote();
+ for (Note n : noteOnMessages) {
+ if (n.getUrl() != null) {
+ return n.getUrl();
}
}
}
@@ -88,7 +88,7 @@ public abstract class AbstractMessage implements EventWithDeactivate {
}
public boolean hasUrl() {
- for (NoteOnMessage n : noteOnMessages) {
+ for (Note n : noteOnMessages) {
if (n.hasUrl()) {
return true;
}
@@ -159,16 +159,16 @@ public abstract class AbstractMessage implements EventWithDeactivate {
return arrowConfiguration;
}
- public final List<NoteOnMessage> getNoteOnMessages() {
+ public final List<Note> getNoteOnMessages() {
return noteOnMessages;
}
- public final void setNote(Display strings, NotePosition notePosition, NoteStyle noteStyle, String backcolor, Url url) {
- if (notePosition != NotePosition.LEFT && notePosition != NotePosition.RIGHT) {
+ public final void setNote(Note note) {
+ if (note.getPosition() != NotePosition.LEFT && note.getPosition() != NotePosition.RIGHT) {
throw new IllegalArgumentException();
}
- this.noteOnMessages
- .add(new NoteOnMessage(strings, overideNotePosition(notePosition), noteStyle, backcolor, url));
+ note = note.withPosition(overideNotePosition(note.getPosition()));
+ this.noteOnMessages.add(note);
}
protected NotePosition overideNotePosition(NotePosition notePosition) {
diff --git a/src/net/sourceforge/plantuml/sequencediagram/AutoNumber.java b/src/net/sourceforge/plantuml/sequencediagram/AutoNumber.java
new file mode 100644
index 0000000..93f2976
--- /dev/null
+++ b/src/net/sourceforge/plantuml/sequencediagram/AutoNumber.java
@@ -0,0 +1,97 @@
+/* ========================================================================
+ * 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;
+
+import java.text.DecimalFormat;
+
+public class AutoNumber {
+
+ private boolean running = false;
+ private DottedNumber current;
+ private int increment;
+
+ private DecimalFormat format;
+ private String last = "";
+
+ public final void go(DottedNumber startingNumber, int increment, DecimalFormat format) {
+ this.running = true;
+ this.current = startingNumber;
+ this.increment = increment;
+ this.format = format;
+ }
+
+ public final void stop() {
+ this.running = false;
+ }
+
+ public final void resume(DecimalFormat format) {
+ this.running = true;
+ if (format != null) {
+ this.format = format;
+ }
+ }
+
+ public final void resume(int increment, DecimalFormat format) {
+ this.running = true;
+ this.increment = increment;
+ if (format != null) {
+ this.format = format;
+ }
+ }
+
+ public void incrementIntermediate() {
+ current.incrementIntermediate();
+ }
+
+ public void incrementIntermediate(int position) {
+ current.incrementIntermediate(position);
+ }
+
+ public String getNextMessageNumber() {
+ if (running == false) {
+ return null;
+ }
+ last = current.format(format);
+ current.incrementMinor(increment);
+ return last;
+ }
+
+ public String getCurrentMessageNumber(boolean formatted) {
+ if (formatted) {
+ return last;
+ }
+ return last.replace("<b>", "").replace("</b>", "");
+ }
+}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/DottedNumber.java b/src/net/sourceforge/plantuml/sequencediagram/DottedNumber.java
new file mode 100644
index 0000000..0bd665a
--- /dev/null
+++ b/src/net/sourceforge/plantuml/sequencediagram/DottedNumber.java
@@ -0,0 +1,112 @@
+/* ========================================================================
+ * 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;
+
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class DottedNumber {
+
+ private final List<Integer> nums;
+ private final List<String> separators;
+
+ private DottedNumber(List<Integer> nums, List<String> separators) {
+ this.nums = nums;
+ this.separators = separators;
+ }
+
+ public static DottedNumber create(String value) {
+ final Pattern p = Pattern.compile("(\\d+)|(\\D+)");
+ final Matcher m = p.matcher(value);
+ final List<Integer> nums = new ArrayList<Integer>();
+ final List<String> separators = new ArrayList<String>();
+ while (m.find()) {
+ final String part = m.group();
+ if (isDigit(part.charAt(0))) {
+ nums.add(Integer.parseInt(part));
+ } else {
+ separators.add(part);
+ }
+ }
+ return new DottedNumber(nums, separators);
+ }
+
+ private static boolean isDigit(final char c) {
+ return c >= '0' && c <= '9';
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < nums.size(); i++) {
+ sb.append(nums.get(i));
+ if (i < separators.size()) {
+ sb.append(separators.get(i));
+ }
+ }
+ return sb.toString();
+ }
+
+ public void incrementMinor(int step) {
+ final int last = nums.size() - 1;
+ final int newValue = nums.get(last) + step;
+ nums.set(last, newValue);
+ }
+
+ public void incrementIntermediate() {
+ final int intermediate = nums.size() == 1 ? 0 : nums.size() - 2;
+ incrementIntermediate(intermediate);
+ }
+
+ public void incrementIntermediate(int position) {
+ final int intermediate = position;
+ final int newValue = nums.get(intermediate) + 1;
+ for (int i = intermediate + 1; i < nums.size(); i++) {
+ nums.set(i, 1);
+ }
+ nums.set(intermediate, newValue);
+ }
+
+ public String format(DecimalFormat format) {
+ if (nums.size() == 1 && separators.size() == 0) {
+ return format.format(nums.get(0));
+ }
+ return "<b>" + toString() + "</b>";
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/Englober.java b/src/net/sourceforge/plantuml/sequencediagram/Englober.java
index 6e4c7d2..f531e4e 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/Englober.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/Englober.java
@@ -40,6 +40,7 @@ import java.util.List;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.PaddingParam;
import net.sourceforge.plantuml.SkinParamBackcolored;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.real.Real;
@@ -61,11 +62,17 @@ public class Englober {
final private TileArguments tileArguments;
final private Real core1;
final private Real core2;
+ final private boolean isTeoz;
+ private double marginX = 0;
- @Deprecated
- public Englober(ParticipantEnglober participantEnglober, Participant first, ISkinParam skinParam, Skin skin,
+ public static Englober createPuma(ParticipantEnglober englober, Participant first, ISkinParam skinParam, Skin skin,
StringBounder stringBounder) {
- this(participantEnglober, first, convertFunctionToBeRemoved(skinParam, skin, stringBounder));
+ return new Englober(englober, first, convertFunctionToBeRemoved(skinParam, skin, stringBounder), false);
+ }
+
+ public static Englober createTeoz(ParticipantEnglober participantEnglober, Participant first,
+ TileArguments tileArguments) {
+ return new Englober(participantEnglober, first, tileArguments, true);
}
private static TileArguments convertFunctionToBeRemoved(ISkinParam skinParam, Skin skin, StringBounder stringBounder) {
@@ -73,10 +80,12 @@ public class Englober {
return result;
}
- public Englober(ParticipantEnglober participantEnglober, Participant first, TileArguments tileArguments) {
+ private Englober(ParticipantEnglober participantEnglober, Participant first, TileArguments tileArguments,
+ boolean isTeoz) {
if (tileArguments == null) {
throw new IllegalArgumentException();
}
+ this.isTeoz = isTeoz;
this.participantEnglober = participantEnglober;
this.participants.add(first);
this.tileArguments = tileArguments;
@@ -163,6 +172,13 @@ public class Englober {
}
private double getPreferredWidth() {
+ if (isTeoz) {
+ return 10;
+ }
+ return getTitleWidth();
+ }
+
+ private double getTitleWidth() {
return getComponent().getPreferredWidth(tileArguments.getStringBounder());
}
@@ -181,24 +197,36 @@ public class Englober {
}
private Real getX2() {
- return RealUtils.max(getPosD(), core2);
+ return RealUtils.max(getPosD(), core2).addFixed(marginX);
}
private Real getX1() {
- return RealUtils.min(getPosB(), core1);
+ return RealUtils.min(getPosB(), core1).addFixed(-marginX);
}
public void addInternalConstraints() {
- getX1().ensureBiggerThan(getPosAA().addFixed(10));
+ assert isTeoz;
+ final double titleWidth = getTitleWidth();
+ final double x1 = getX1().getCurrentValue();
+ final double x2 = getX2().getCurrentValue();
+ final double actualWidth = x2 - x1;
+ if (titleWidth > actualWidth + 20) {
+ this.marginX = (titleWidth - actualWidth - 20) / 2;
+ }
+ getX1().ensureBiggerThan(getPosAA().addFixed(10 + padding()));
final Real posZZ = getPosZZ();
- final Real limit = getX2().addFixed(10);
+ final Real limit = getX2().addFixed(10 + padding());
if (posZZ != null) {
posZZ.ensureBiggerThan(limit);
}
}
+ private double padding() {
+ return tileArguments.getSkinParam().getPadding(PaddingParam.BOX);
+ }
+
public void addConstraintAfter(Englober current) {
- current.getX1().ensureBiggerThan(getX2().addFixed(10));
+ current.getX1().ensureBiggerThan(getX2().addFixed(10 + 2 * padding()));
}
public Real getMinX(StringBounder stringBounder) {
diff --git a/src/net/sourceforge/plantuml/sequencediagram/GroupingLeaf.java b/src/net/sourceforge/plantuml/sequencediagram/GroupingLeaf.java
index 1098eac..994afb5 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/GroupingLeaf.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/GroupingLeaf.java
@@ -39,7 +39,6 @@ import java.util.ArrayList;
import java.util.List;
import net.sourceforge.plantuml.Url;
-import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HtmlColor;
final public class GroupingLeaf extends Grouping implements EventWithDeactivate {
@@ -118,18 +117,17 @@ final public class GroupingLeaf extends Grouping implements EventWithDeactivate
return true;
}
- private List<NoteOnMessage> noteOnMessages = new ArrayList<NoteOnMessage>();
+ private List<Note> noteOnMessages = new ArrayList<Note>();
- public final void setNote(Display strings, NotePosition notePosition, NoteStyle noteStyle, String backcolor, Url url) {
- if (notePosition != NotePosition.LEFT && notePosition != NotePosition.RIGHT) {
+ public final void setNote(Note note) {
+ if (note.getPosition() != NotePosition.LEFT && note.getPosition() != NotePosition.RIGHT) {
throw new IllegalArgumentException();
}
- this.noteOnMessages.add(new NoteOnMessage(strings, notePosition, noteStyle, backcolor, url));
+ this.noteOnMessages.add(note);
}
-
- public final List<NoteOnMessage> getNoteOnMessages() {
+
+ public final List<Note> getNoteOnMessages() {
return noteOnMessages;
}
-
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/GroupingStart.java b/src/net/sourceforge/plantuml/sequencediagram/GroupingStart.java
index f44d99d..3cbd63f 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/GroupingStart.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/GroupingStart.java
@@ -48,6 +48,7 @@ public class GroupingStart extends Grouping {
private final HtmlColor backColorGeneral;
final private GroupingStart parent;
+ private boolean parallel = false;
public GroupingStart(String title, String comment, HtmlColor backColorGeneral, HtmlColor backColorElement,
GroupingStart parent) {
@@ -83,15 +84,18 @@ public class GroupingStart extends Grouping {
public Url getUrl() {
return null;
}
-
+
public boolean hasUrl() {
return false;
}
-
@Override
public boolean isParallel() {
- return getTitle().equals("par2");
+ return parallel || getTitle().equals("par2");
+ }
+
+ public void goParallel() {
+ this.parallel = true;
}
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/Note.java b/src/net/sourceforge/plantuml/sequencediagram/Note.java
index 944ee46..b2df10d 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/Note.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/Note.java
@@ -39,7 +39,6 @@ import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.SpecificBackcolorable;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.color.Colors;
public class Note extends AbstractEvent implements Event, SpecificBackcolorable {
@@ -51,8 +50,7 @@ public class Note extends AbstractEvent implements Event, SpecificBackcolorable
private final NotePosition position;
private NoteStyle style = NoteStyle.NORMAL;
-
- // private Stereotype stereotype;
+ private Colors colors = Colors.empty();
private Url url;
@@ -60,6 +58,11 @@ public class Note extends AbstractEvent implements Event, SpecificBackcolorable
this(p, null, position, strings);
}
+ public Note(Display strings, NotePosition position, NoteStyle style) {
+ this(null, null, position, strings);
+ this.style = style;
+ }
+
public Note(Participant p, Participant p2, Display strings) {
this(p, p2, NotePosition.OVER_SEVERAL, strings);
}
@@ -71,6 +74,17 @@ public class Note extends AbstractEvent implements Event, SpecificBackcolorable
this.strings = strings;
}
+ public Note withPosition(NotePosition newPosition) {
+ if (position == newPosition) {
+ return this;
+ }
+ final Note result = new Note(p, p2, newPosition, strings);
+ result.style = this.style;
+ result.url = this.url;
+ result.colors = this.colors;
+ return result;
+ }
+
public Participant getParticipant() {
return p;
}
@@ -91,14 +105,6 @@ public class Note extends AbstractEvent implements Event, SpecificBackcolorable
return colors;
}
- // public void setSpecificColorTOBEREMOVED(ColorType type, HtmlColor color) {
- // if (color != null) {
- // this.colors = colors.add(type, color);
- // }
- // }
-
- private Colors colors = Colors.empty();
-
public void setColors(Colors colors) {
this.colors = colors;
}
@@ -124,14 +130,9 @@ public class Note extends AbstractEvent implements Event, SpecificBackcolorable
}
public ISkinParam getSkinParamBackcolored(ISkinParam skinParam) {
- // return new SkinParamBackcolored(skinParam, getColors(skinParam).getColor(ColorType.BACK));
return colors.mute(skinParam);
}
- public void setStereotype(Stereotype stereotype) {
- // this.stereotype = stereotype;
- }
-
@Override
public String toString() {
return super.toString() + " " + strings;
diff --git a/src/net/sourceforge/plantuml/sequencediagram/NoteOnMessage.java b/src/net/sourceforge/plantuml/sequencediagram/NoteOnMessage.java
deleted file mode 100644
index bb30b8a..0000000
--- a/src/net/sourceforge/plantuml/sequencediagram/NoteOnMessage.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.sequencediagram;
-
-import net.sourceforge.plantuml.ISkinParam;
-import net.sourceforge.plantuml.SkinParamBackcolored;
-import net.sourceforge.plantuml.Url;
-import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorSet;
-
-public class NoteOnMessage {
-
- private final Display notes;
- private final NotePosition notePosition;
- private final NoteStyle noteStyle;
- private final HtmlColor noteBackColor;
- private final Url urlNote;
-
- public NoteOnMessage(Display strings, NotePosition notePosition, NoteStyle noteStyle, String backcolor, Url url) {
- if (notePosition != NotePosition.LEFT && notePosition != NotePosition.RIGHT) {
- throw new IllegalArgumentException();
- }
- this.noteStyle = noteStyle;
- this.notes = strings;
- this.urlNote = url;
- this.notePosition = notePosition;
- this.noteBackColor = HtmlColorSet.getInstance().getColorIfValid(backcolor);
- }
-
- public SkinParamBackcolored getSkinParamNoteBackcolored(ISkinParam skinParam) {
- return new SkinParamBackcolored(skinParam, noteBackColor);
- }
-
- public boolean hasUrl() {
- if (notes != null && notes.hasUrl()) {
- return true;
- }
- // if (label != null && label.hasUrl()) {
- // return true;
- // }
- // return getUrl() != null;
- return urlNote != null;
- }
-
- public Display getDisplay() {
- return notes;
- }
-
- public NotePosition getNotePosition() {
- return notePosition;
- }
-
- public NoteStyle getNoteStyle() {
- return noteStyle;
- }
-
- public Url getUrlNote() {
- return urlNote;
- }
-
-}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/Participant.java b/src/net/sourceforge/plantuml/sequencediagram/Participant.java
index 0f5184b..c9202c5 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/Participant.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/Participant.java
@@ -61,9 +61,11 @@ public class Participant implements SpecificBackcolorable {
private Stereotype stereotype;
private boolean stereotypePositionTop;
private final Set<EntityPortion> hiddenPortions;
+ private final int order;
- public Participant(ParticipantType type, String code, Display display, Set<EntityPortion> hiddenPortions) {
+ public Participant(ParticipantType type, String code, Display display, Set<EntityPortion> hiddenPortions, int order) {
this.hiddenPortions = hiddenPortions;
+ this.order = order;
if (type == null) {
throw new IllegalArgumentException();
}
@@ -179,4 +181,8 @@ public class Participant implements SpecificBackcolorable {
return result;
}
+ public int getOrder() {
+ return order;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagram.java b/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagram.java
index 1d3904e..94d847a 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagram.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagram.java
@@ -39,10 +39,10 @@ import java.io.IOException;
import java.io.OutputStream;
import java.text.DecimalFormat;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
import java.util.HashMap;
-import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -73,7 +73,8 @@ import net.sourceforge.plantuml.skin.rose.Rose;
public class SequenceDiagram extends UmlDiagram {
- private final Map<String, Participant> participants = new LinkedHashMap<String, Participant>();
+ // private final Map<String, Participant> participants = new LinkedHashMap<String, Participant>();
+ private final List<Participant> participantsList = new ArrayList<Participant>();
private final List<Event> events = new ArrayList<Event>();
@@ -88,37 +89,60 @@ public class SequenceDiagram extends UmlDiagram {
}
public Participant getOrCreateParticipant(String code, Display display) {
- Participant result = participants.get(code);
+ Participant result = participantsget(code);
if (result == null) {
- result = new Participant(ParticipantType.PARTICIPANT, code, display, hiddenPortions);
- participants.put(code, result);
+ result = new Participant(ParticipantType.PARTICIPANT, code, display, hiddenPortions, 0);
+ addWithOrder(result);
participantEnglobers2.put(result, participantEnglober);
}
return result;
}
+ private Participant participantsget(String code) {
+ for (Participant p : participantsList) {
+ if (p.getCode().equals(code)) {
+ return p;
+ }
+ }
+ return null;
+ }
+
private EventWithDeactivate lastEventWithDeactivate;
public EventWithDeactivate getLastEventWithDeactivate() {
return lastEventWithDeactivate;
}
- public Participant createNewParticipant(ParticipantType type, String code, Display display) {
- if (participants.containsKey(code)) {
+ public Participant createNewParticipant(ParticipantType type, String code, Display display, int order) {
+ if (participantsget(code) != null) {
throw new IllegalArgumentException();
}
if (Display.isNull(display)) {
// display = Arrays.asList(code);
display = Display.getWithNewlines(code);
}
- final Participant result = new Participant(type, code, display, hiddenPortions);
- participants.put(code, result);
+ final Participant result = new Participant(type, code, display, hiddenPortions, order);
+ addWithOrder(result);
participantEnglobers2.put(result, participantEnglober);
return result;
}
- public Map<String, Participant> participants() {
- return Collections.unmodifiableMap(participants);
+ private void addWithOrder(final Participant result) {
+ for (int i = 0; i < participantsList.size(); i++) {
+ if (result.getOrder() < participantsList.get(i).getOrder()) {
+ participantsList.add(i, result);
+ return;
+ }
+ }
+ participantsList.add(result);
+ }
+
+ public Collection<Participant> participants() {
+ return Collections.unmodifiableCollection(participantsList);
+ }
+
+ public boolean participantsContainsKey(String code) {
+ return participantsget(code) != null;
}
public String addMessage(AbstractMessage m) {
@@ -256,7 +280,10 @@ public class SequenceDiagram extends UmlDiagram {
p.incInitialLife(new SymbolContext(backcolor, linecolor));
return null;
}
- return "Only activate command can occur before message are send";
+ if (p.getInitialLife() == 0) {
+ return "You cannot deactivate here";
+ }
+ return null;
}
if (lifeEventType == LifeEventType.ACTIVATE && lastEventWithDeactivate instanceof Message) {
activationState.push((Message) lastEventWithDeactivate);
@@ -276,7 +303,7 @@ public class SequenceDiagram extends UmlDiagram {
private final List<GroupingStart> openGroupings = new ArrayList<GroupingStart>();
public boolean grouping(String title, String comment, GroupingType type, HtmlColor backColorGeneral,
- HtmlColor backColorElement) {
+ HtmlColor backColorElement, boolean parallel) {
if (type != GroupingType.START && openGroupings.size() == 0) {
return false;
}
@@ -292,6 +319,9 @@ public class SequenceDiagram extends UmlDiagram {
events.add(g);
if (type == GroupingType.START) {
+ if (parallel) {
+ ((GroupingStart) g).goParallel();
+ }
openGroupings.add(0, (GroupingStart) g);
} else if (type == GroupingType.END) {
openGroupings.remove(0);
@@ -302,7 +332,7 @@ public class SequenceDiagram extends UmlDiagram {
}
public DiagramDescription getDescription() {
- return new DiagramDescription("(" + participants.size() + " participants)");
+ return new DiagramDescription("(" + participantsList.size() + " participants)");
}
public boolean changeSkin(String className) {
@@ -322,45 +352,30 @@ public class SequenceDiagram extends UmlDiagram {
return skin2;
}
- private boolean autonumber = false;
- private int messageNumber;
- private int incrementMessageNumber;
-
- private DecimalFormat decimalFormat;
+ private final AutoNumber autoNumber = new AutoNumber();
- public final void autonumberGo(int startingNumber, int increment, DecimalFormat decimalFormat) {
- this.autonumber = true;
- this.messageNumber = startingNumber;
- this.incrementMessageNumber = increment;
- this.decimalFormat = decimalFormat;
+ public final void autonumberGo(DottedNumber startingNumber, int increment, DecimalFormat decimalFormat) {
+ autoNumber.go(startingNumber, increment, decimalFormat);
}
public final void autonumberStop() {
- this.autonumber = false;
+ autoNumber.stop();
}
- public final void autonumberResume(DecimalFormat decimalFormat) {
- this.autonumber = true;
- if (decimalFormat != null) {
- this.decimalFormat = decimalFormat;
- }
+ public final AutoNumber getAutoNumber() {
+ return autoNumber;
}
- public final void autonumberResume(int increment, DecimalFormat decimalFormat) {
- this.autonumber = true;
- this.incrementMessageNumber = increment;
- if (decimalFormat != null) {
- this.decimalFormat = decimalFormat;
- }
- }
+ // public final void autonumberResume(DecimalFormat decimalFormat) {
+ // autoNumber.resume(decimalFormat);
+ // }
+ //
+ // public final void autonumberResume(int increment, DecimalFormat decimalFormat) {
+ // autoNumber.resume(increment, decimalFormat);
+ // }
public String getNextMessageNumber() {
- if (autonumber == false) {
- return null;
- }
- final int result = messageNumber;
- messageNumber += incrementMessageNumber;
- return decimalFormat.format(result);
+ return autoNumber.getNextMessageNumber();
}
public boolean isShowFootbox() {
@@ -420,7 +435,7 @@ public class SequenceDiagram extends UmlDiagram {
}
public void removeHiddenParticipants() {
- for (Participant p : new ArrayList<Participant>(participants.values())) {
+ for (Participant p : new ArrayList<Participant>(participantsList)) {
if (isAlone(p)) {
remove(p);
}
@@ -428,7 +443,7 @@ public class SequenceDiagram extends UmlDiagram {
}
private void remove(Participant p) {
- final boolean ok = participants.values().remove(p);
+ final boolean ok = participantsList.remove(p);
if (ok == false) {
throw new IllegalArgumentException();
}
@@ -445,12 +460,13 @@ public class SequenceDiagram extends UmlDiagram {
}
public void putParticipantInLast(String code) {
- final Participant p = participants.get(code);
+ final Participant p = participantsget(code);
if (p == null) {
throw new IllegalArgumentException(code);
}
- participants.remove(code);
- participants.put(code, p);
+ final boolean ok = participantsList.remove(p);
+ assert ok;
+ addWithOrder(p);
participantEnglobers2.put(p, participantEnglober);
}
@@ -469,7 +485,7 @@ public class SequenceDiagram extends UmlDiagram {
}
public boolean hasUrl() {
- for (Participant p : participants.values()) {
+ for (Participant p : participantsList) {
if (p.getUrl() != null) {
return true;
}
@@ -479,7 +495,7 @@ public class SequenceDiagram extends UmlDiagram {
return true;
}
}
- if (DisplayPositionned.isNull(getLegend()) == false && getLegend().hasUrl()) {
+ if (getLegend().isNull() == false && getLegend().hasUrl()) {
return true;
}
return false;
@@ -491,7 +507,7 @@ public class SequenceDiagram extends UmlDiagram {
@Override
public boolean isOk() {
- if (participants.size() == 0) {
+ if (participantsList.size() == 0) {
return false;
}
return true;
@@ -526,4 +542,7 @@ public class SequenceDiagram extends UmlDiagram {
}
}
+ public Display manageVariable(Display labels) {
+ return labels.replace("%autonumber%", autoNumber.getCurrentMessageNumber(false));
+ }
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagramFactory.java b/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagramFactory.java
index a7183ae..b1bc9d2 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagramFactory.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagramFactory.java
@@ -49,10 +49,12 @@ import net.sourceforge.plantuml.sequencediagram.command.CommandArrow;
import net.sourceforge.plantuml.sequencediagram.command.CommandAutoNewpage;
import net.sourceforge.plantuml.sequencediagram.command.CommandAutoactivate;
import net.sourceforge.plantuml.sequencediagram.command.CommandAutonumber;
+import net.sourceforge.plantuml.sequencediagram.command.CommandAutonumberIncrement;
import net.sourceforge.plantuml.sequencediagram.command.CommandAutonumberResume;
import net.sourceforge.plantuml.sequencediagram.command.CommandAutonumberStop;
import net.sourceforge.plantuml.sequencediagram.command.CommandBoxEnd;
import net.sourceforge.plantuml.sequencediagram.command.CommandBoxStart;
+import net.sourceforge.plantuml.sequencediagram.command.CommandDeactivateShort;
import net.sourceforge.plantuml.sequencediagram.command.CommandDelay;
import net.sourceforge.plantuml.sequencediagram.command.CommandDivider;
import net.sourceforge.plantuml.sequencediagram.command.CommandExoArrowLeft;
@@ -88,6 +90,7 @@ public class SequenceDiagramFactory extends UmlDiagramFactory {
addCommonCommands(cmds);
cmds.add(new CommandActivate());
+ cmds.add(new CommandDeactivateShort());
cmds.add(new CommandParticipantA());
cmds.add(new CommandParticipantA2());
@@ -129,6 +132,7 @@ public class SequenceDiagramFactory extends UmlDiagramFactory {
cmds.add(new CommandAutonumber());
cmds.add(new CommandAutonumberStop());
cmds.add(new CommandAutonumberResume());
+ cmds.add(new CommandAutonumberIncrement());
cmds.add(new CommandAutoactivate());
cmds.add(new CommandFootbox());
cmds.add(new CommandDelay());
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandActivate.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandActivate.java
index 117caab..43d28ca 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandActivate.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandActivate.java
@@ -35,36 +35,46 @@
*/
package net.sourceforge.plantuml.sequencediagram.command;
-import java.util.List;
-
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.command.CommandExecutionResult;
-import net.sourceforge.plantuml.command.SingleLineCommand;
+import net.sourceforge.plantuml.command.SingleLineCommand2;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.sequencediagram.LifeEventType;
import net.sourceforge.plantuml.sequencediagram.Participant;
import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
-public class CommandActivate extends SingleLineCommand<SequenceDiagram> {
+public class CommandActivate extends SingleLineCommand2<SequenceDiagram> {
public CommandActivate() {
- super(
- "(?i)^(activate|deactivate|destroy|create)[%s]+([\\p{L}0-9_.@]+|[%g][^%g]+[%g])[%s]*(#\\w+)?(?:[%s]+(#\\w+))?$");
+ super(getRegexConcat());
+ }
+
+ static RegexConcat getRegexConcat() {
+ return new RegexConcat(new RegexLeaf("^"), //
+ new RegexLeaf("TYPE", "(activate|deactivate|destroy|create)"), //
+ new RegexLeaf("[%s]+"), //
+ new RegexLeaf("WHO", "([\\p{L}0-9_.@]+|[%g][^%g]+[%g])"), //
+ new RegexLeaf("[%s]*"), //
+ new RegexLeaf("BACK", "(#\\w+)?"), //
+ new RegexLeaf("LINE", "(?:[%s]+(#\\w+))?"), //
+ new RegexLeaf("$"));
}
@Override
- protected CommandExecutionResult executeArg(SequenceDiagram diagram, List<String> arg) {
- final LifeEventType type = LifeEventType.valueOf(StringUtils.goUpperCase(arg.get(0)));
+ protected CommandExecutionResult executeArg(SequenceDiagram diagram, RegexResult arg) {
+ final LifeEventType type = LifeEventType.valueOf(StringUtils.goUpperCase(arg.get("TYPE", 0)));
final Participant p = diagram.getOrCreateParticipant(StringUtils
- .eventuallyRemoveStartingAndEndingDoubleQuote(arg.get(1)));
- final HtmlColor backColor = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get(2));
- final HtmlColor lineColor = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get(3));
+ .eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("WHO", 0)));
+ final HtmlColor backColor = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("BACK", 0));
+ final HtmlColor lineColor = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("LINE", 0));
final String error = diagram.activate(p, type, backColor, lineColor);
if (error == null) {
return CommandExecutionResult.ok();
}
return CommandExecutionResult.error(error);
-
}
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandArrow.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandArrow.java
index a4cb232..ba86a48 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandArrow.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandArrow.java
@@ -49,6 +49,7 @@ import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexOr;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.descdiagram.command.CommandLinkElement;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.HtmlColorSet;
import net.sourceforge.plantuml.sequencediagram.LifeEventType;
@@ -68,7 +69,7 @@ public class CommandArrow extends SingleLineCommand2<SequenceDiagram> {
}
public static String getColorOrStylePattern() {
- return "(?:\\[((?:#\\w+|dotted|dashed|plain|bold|hidden)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden)*)\\])?";
+ return "(?:\\[(" + CommandLinkElement.LINE_STYLE + ")\\])?";
}
static RegexConcat getRegexConcat() {
@@ -215,10 +216,12 @@ public class CommandArrow extends SingleLineCommand2<SequenceDiagram> {
diagram.activate(p2, LifeEventType.CREATE, null);
}
- final Message msg = new Message(p1, p2, labels, config, diagram.getNextMessageNumber());
- if (arg.get("URL", 0) != null) {
+ final String messageNumber = diagram.getNextMessageNumber();
+ final Message msg = new Message(p1, p2, diagram.manageVariable(labels), config, messageNumber);
+ final String url = arg.get("URL", 0);
+ if (url != null) {
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
- final Url urlLink = urlBuilder.getUrl(arg.get("URL", 0));
+ final Url urlLink = urlBuilder.getUrl(url);
msg.setUrl(urlLink);
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumber.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumber.java
index c3fdaea..ca66887 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumber.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumber.java
@@ -36,30 +36,49 @@
package net.sourceforge.plantuml.sequencediagram.command;
import java.text.DecimalFormat;
-import java.util.List;
import net.sourceforge.plantuml.command.CommandExecutionResult;
-import net.sourceforge.plantuml.command.SingleLineCommand;
+import net.sourceforge.plantuml.command.SingleLineCommand2;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+import net.sourceforge.plantuml.sequencediagram.DottedNumber;
import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
-public class CommandAutonumber extends SingleLineCommand<SequenceDiagram> {
+public class CommandAutonumber extends SingleLineCommand2<SequenceDiagram> {
public CommandAutonumber() {
- super("(?i)^autonumber[%s]*(\\d+)?(?:[%s]+(\\d+))?(?:[%s]+[%g]([^%g]+)[%g])?[%s]*$");
+ super(getConcat());
+ }
+
+ private static RegexConcat getConcat() {
+ return new RegexConcat(new RegexLeaf("^"), //
+ new RegexLeaf("autonumber"), //
+ new RegexLeaf("[%s]*"), //
+ new RegexLeaf("START", "(\\d(?:(?:[^\\p{L}0-9%s]+|\\d+)*\\d)?)?"), //
+ new RegexLeaf("STEP", "(?:[%s]+(\\d+))?"), //
+ new RegexLeaf("FORMAT", "(?:[%s]+[%g]([^%g]+)[%g])?"), //
+ new RegexLeaf("[%s]*"), //
+ new RegexLeaf("$"));
}
@Override
- protected CommandExecutionResult executeArg(SequenceDiagram sequenceDiagram, List<String> arg) {
- int start = 1;
- if (arg.get(0) != null) {
- start = Integer.parseInt(arg.get(0));
+ protected CommandExecutionResult executeArg(SequenceDiagram diagram, RegexResult arg) {
+ DottedNumber start = DottedNumber.create("1");
+ final String arg0 = arg.get("START", 0);
+ // System.err.println("arg0=" + arg0);
+ if (arg0 != null) {
+ start = DottedNumber.create(arg0);
}
+ // System.err.println("start=" + start);
int inc = 1;
- if (arg.get(1) != null) {
- inc = Integer.parseInt(arg.get(1));
+ final String arg1 = arg.get("STEP", 0);
+ if (arg1 != null) {
+ inc = Integer.parseInt(arg1);
}
- final String df = arg.get(2) == null ? "<b>0</b>" : arg.get(2);
+ final String arg2 = arg.get("FORMAT", 0);
+ final String df = arg2 == null ? "<b>0</b>" : arg2;
final DecimalFormat decimalFormat;
try {
decimalFormat = new DecimalFormat(df);
@@ -67,7 +86,8 @@ public class CommandAutonumber extends SingleLineCommand<SequenceDiagram> {
return CommandExecutionResult.error("Error in pattern : " + df);
}
- sequenceDiagram.autonumberGo(start, inc, decimalFormat);
+ diagram.autonumberGo(start, inc, decimalFormat);
return CommandExecutionResult.ok();
}
+
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumberIncrement.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumberIncrement.java
new file mode 100644
index 0000000..4ee28a5
--- /dev/null
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumberIncrement.java
@@ -0,0 +1,74 @@
+/* ========================================================================
+ * 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.command;
+
+import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.SingleLineCommand2;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
+
+public class CommandAutonumberIncrement extends SingleLineCommand2<SequenceDiagram> {
+
+ public CommandAutonumberIncrement() {
+ super(getConcat());
+ }
+
+ private static RegexConcat getConcat() {
+ return new RegexConcat(new RegexLeaf("^"), //
+ new RegexLeaf("autonumber"), //
+ new RegexLeaf("[%s]+"), //
+ new RegexLeaf("inc"), //
+ new RegexLeaf("POS", "(?:[%s]+([A-Za-z]))?"), //
+ new RegexLeaf("[%s]*"), //
+ new RegexLeaf("$"));
+ }
+
+ @Override
+ protected CommandExecutionResult executeArg(SequenceDiagram diagram, RegexResult arg) {
+ final String position = arg.get("POS", 0);
+ if (position == null) {
+ diagram.getAutoNumber().incrementIntermediate();
+ } else {
+ final int pos = StringUtils.goLowerCase(position.charAt(0)) - 'a';
+ diagram.getAutoNumber().incrementIntermediate(pos);
+ }
+ return CommandExecutionResult.ok();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumberResume.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumberResume.java
index 68bee27..2d9d312 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumberResume.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumberResume.java
@@ -36,21 +36,35 @@
package net.sourceforge.plantuml.sequencediagram.command;
import java.text.DecimalFormat;
-import java.util.List;
import net.sourceforge.plantuml.command.CommandExecutionResult;
-import net.sourceforge.plantuml.command.SingleLineCommand;
+import net.sourceforge.plantuml.command.SingleLineCommand2;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
-public class CommandAutonumberResume extends SingleLineCommand<SequenceDiagram> {
+public class CommandAutonumberResume extends SingleLineCommand2<SequenceDiagram> {
public CommandAutonumberResume() {
- super("(?i)^autonumber[%s]*resume(?:[%s]+(\\d+))?(?:[%s]+[%g]([^%g]+)[%g])?[%s]*$");
+ super(getConcat());
+ }
+
+ private static RegexConcat getConcat() {
+ return new RegexConcat(new RegexLeaf("^"), //
+ new RegexLeaf("autonumber"), //
+ new RegexLeaf("[%s]+"), //
+ new RegexLeaf("resume"), //
+ new RegexLeaf("[%s]*"), //
+ new RegexLeaf("INC", "(?:[%s]+(\\d+))?"), //
+ new RegexLeaf("DF", "(?:[%s]+[%g]([^%g]+)[%g])?"), //
+ new RegexLeaf("$"));
}
@Override
- protected CommandExecutionResult executeArg(SequenceDiagram sequenceDiagram, List<String> arg) {
- final String df = arg.get(1);
+ protected CommandExecutionResult executeArg(SequenceDiagram diagram, RegexResult arg) {
+ final String df = arg.get("DF", 0);
+
DecimalFormat decimalFormat = null;
if (df != null) {
try {
@@ -60,13 +74,13 @@ public class CommandAutonumberResume extends SingleLineCommand<SequenceDiagram>
}
}
- final String inc = arg.get(0);
+ final String inc = arg.get("INC", 0);
if (inc == null) {
- sequenceDiagram.autonumberResume(decimalFormat);
+ diagram.getAutoNumber().resume(decimalFormat);
} else {
- sequenceDiagram.autonumberResume(Integer.parseInt(arg.get(0)), decimalFormat);
+ diagram.getAutoNumber().resume(Integer.parseInt(inc), decimalFormat);
}
-
return CommandExecutionResult.ok();
}
+
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumberStop.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumberStop.java
index b9c1568..fb1e396 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumberStop.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumberStop.java
@@ -44,7 +44,7 @@ import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
public class CommandAutonumberStop extends SingleLineCommand<SequenceDiagram> {
public CommandAutonumberStop() {
- super("(?i)^autonumber[%s]*stop$");
+ super("(?i)^autonumber[%s]+stop[%s]*$");
}
@Override
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandDeactivateShort.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandDeactivateShort.java
new file mode 100644
index 0000000..1bfd31a
--- /dev/null
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandDeactivateShort.java
@@ -0,0 +1,73 @@
+/* ========================================================================
+ * 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.command;
+
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.SingleLineCommand2;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+import net.sourceforge.plantuml.sequencediagram.LifeEventType;
+import net.sourceforge.plantuml.sequencediagram.Message;
+import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
+
+public class CommandDeactivateShort extends SingleLineCommand2<SequenceDiagram> {
+
+ public CommandDeactivateShort() {
+ super(getRegexConcat());
+ }
+
+ static RegexConcat getRegexConcat() {
+ return new RegexConcat(new RegexLeaf("^"), //
+ new RegexLeaf("TYPE", "(deactivate)"), //
+ new RegexLeaf("[%s]*"), //
+ new RegexLeaf("$"));
+ }
+
+ @Override
+ protected CommandExecutionResult executeArg(SequenceDiagram sequenceDiagram, RegexResult arg2) {
+ Message message = sequenceDiagram.getActivatingMessage();
+ if (message == null) {
+ return CommandExecutionResult.error("Nothing to deactivate.");
+ }
+ final String error = sequenceDiagram.activate(message.getParticipant2(), LifeEventType.DEACTIVATE, null);
+ if (error != null) {
+ return CommandExecutionResult.error(error);
+ }
+ return CommandExecutionResult.ok();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowAny.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowAny.java
index d90e3d3..0da387f 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowAny.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowAny.java
@@ -129,7 +129,12 @@ abstract class CommandExoArrowAny extends SingleLineCommand2<SequenceDiagram> {
final Url urlLink = urlBuilder.getUrl(arg.get("URL", 0));
msg.setUrl(urlLink);
}
-
+
+ final boolean parallel = arg.get("PARALLEL", 0) != null;
+ if (parallel) {
+ msg.goParallel();
+ }
+
final String error = diagram.addMessage(msg);
if (error != null) {
return CommandExecutionResult.error(error);
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowLeft.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowLeft.java
index 6a2d44c..d83e534 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowLeft.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowLeft.java
@@ -50,6 +50,7 @@ public class CommandExoArrowLeft extends CommandExoArrowAny {
static RegexConcat getRegexConcat() {
return new RegexConcat(new RegexLeaf("^"), //
+ new RegexLeaf("PARALLEL", "(&%s*)?"), //
new RegexLeaf("SHORT", "([?\\[\\]][ox]?)?"), //
new RegexOr( //
new RegexConcat( //
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowRight.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowRight.java
index 2c6716f..018810d 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowRight.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowRight.java
@@ -50,6 +50,7 @@ public class CommandExoArrowRight extends CommandExoArrowAny {
static RegexConcat getRegexConcat() {
return new RegexConcat(new RegexLeaf("^"), //
+ new RegexLeaf("PARALLEL", "(&%s*)?"), //
new RegexLeaf("PARTICIPANT", "([\\p{L}0-9_.@]+|[%g][^%g]+[%g])"), //
new RegexLeaf("[%s]*"), //
new RegexLeaf("ARROW_SUPPCIRCLE", "([%s]+[ox])?"), //
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandGrouping.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandGrouping.java
index 7c86cf1..a4dea53 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandGrouping.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandGrouping.java
@@ -57,6 +57,7 @@ public class CommandGrouping extends SingleLineCommand2<SequenceDiagram> {
static RegexConcat getRegexConcat() {
return new RegexConcat(//
new RegexLeaf("^"), //
+ new RegexLeaf("PARALLEL", "(&%s*)?"), //
new RegexLeaf("TYPE", "(opt|alt|loop|par|par2|break|critical|else|end|also|group)"), //
new RegexLeaf("COLORS", "((?<!else)(?<!also)(?<!end)#\\w+)?(?:[%s]+(#\\w+))?"), //
new RegexLeaf("COMMENT", "(?:[%s]+(.*?))?"), //
@@ -84,7 +85,9 @@ public class CommandGrouping extends SingleLineCommand2<SequenceDiagram> {
}
}
}
- final boolean result = diagram.grouping(type, comment, groupingType, backColorGeneral, backColorElement);
+
+ final boolean parallel = arg.get("PARALLEL", 0) != null;
+ final boolean result = diagram.grouping(type, comment, groupingType, backColorGeneral, backColorElement, parallel);
if (result == false) {
return CommandExecutionResult.error("Cannot create group");
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipant.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipant.java
index e0be1c9..f6034c4 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipant.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipant.java
@@ -63,15 +63,21 @@ public abstract class CommandParticipant extends SingleLineCommand2<SequenceDiag
super(pattern);
}
+ static RegexLeaf getOrderRegex() {
+ return new RegexLeaf("ORDER", "(?:order[%s]+(-?\\d{1,7}))?");
+ }
+
static IRegex getRegexType() {
- return new RegexOr(new RegexLeaf("TYPE", "(participant|actor|create|boundary|control|entity|queue|database|collections)"), //
- new RegexLeaf("CREATE", "create[%s](participant|actor|boundary|control|entity|queue|database|collections)"));
+ return new RegexOr(//
+ new RegexLeaf("TYPE", "(participant|actor|create|boundary|control|entity|queue|database|collections)"), //
+ new RegexLeaf("CREATE",
+ "create[%s](participant|actor|boundary|control|entity|queue|database|collections)"));
}
@Override
final protected CommandExecutionResult executeArg(SequenceDiagram diagram, RegexResult arg) {
final String code = arg.get("CODE", 0);
- if (diagram.participants().containsKey(code)) {
+ if (diagram.participantsContainsKey(code)) {
diagram.putParticipantInLast(code);
return CommandExecutionResult.ok();
}
@@ -95,7 +101,9 @@ public abstract class CommandParticipant extends SingleLineCommand2<SequenceDiag
type = ParticipantType.valueOf(StringUtils.goUpperCase(typeString1));
create = false;
}
- final Participant participant = diagram.createNewParticipant(type, code, strings);
+ final String orderString = arg.get("ORDER", 0);
+ final int order = orderString == null ? 0 : Integer.parseInt(orderString);
+ final Participant participant = diagram.createNewParticipant(type, code, strings, order);
final String stereotype = arg.get("STEREO", 0);
@@ -106,8 +114,8 @@ public abstract class CommandParticipant extends SingleLineCommand2<SequenceDiag
participant.setStereotype(new Stereotype(stereotype, skinParam.getCircledCharacterRadius(), font, diagram
.getSkinParam().getIHtmlColorSet()), stereotypePositionTop);
}
- participant
- .setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
+ participant.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet()
+ .getColorIfValid(arg.get("COLOR", 0)));
final String urlString = arg.get("URL", 0);
if (urlString != null) {
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA.java
index e303a58..6922443 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA.java
@@ -55,6 +55,8 @@ public class CommandParticipantA extends CommandParticipant {
new RegexLeaf("[%s]*"), //
new RegexLeaf("STEREO", "(\\<\\<.*\\>\\>)?"), //
new RegexLeaf("[%s]*"), //
+ getOrderRegex(), //
+ new RegexLeaf("[%s]*"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("[%s]*"), //
ColorParser.exp1(), //
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA2.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA2.java
index bde99ce..994fa99 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA2.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA2.java
@@ -56,6 +56,8 @@ public class CommandParticipantA2 extends CommandParticipant {
new RegexLeaf("[%s]*"), //
new RegexLeaf("STEREO", "(\\<\\<.*\\>\\>)?"), //
new RegexLeaf("[%s]*"), //
+ getOrderRegex(), //
+ new RegexLeaf("[%s]*"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("[%s]*"), //
ColorParser.exp1(), //
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA3.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA3.java
index ce1e106..289df7c 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA3.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA3.java
@@ -55,6 +55,8 @@ public class CommandParticipantA3 extends CommandParticipant {
new RegexLeaf("[%s]*"), //
new RegexLeaf("STEREO", "(\\<\\<.*\\>\\>)?"), //
new RegexLeaf("[%s]*"), //
+ getOrderRegex(), //
+ new RegexLeaf("[%s]*"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("[%s]*"), //
ColorParser.exp1(), //
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA4.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA4.java
index 3902c2e..677d5f8 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA4.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA4.java
@@ -54,10 +54,13 @@ public class CommandParticipantA4 extends CommandParticipant {
new RegexLeaf("[%s]*"), //
new RegexLeaf("STEREO", "(\\<\\<.*\\>\\>)?"), //
new RegexLeaf("[%s]*"), //
+ getOrderRegex(), //
+ new RegexLeaf("[%s]*"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("[%s]*"), //
ColorParser.exp1(), //
new RegexLeaf("$"));
}
+
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/ArrowAndParticipant.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/ArrowAndParticipant.java
index 3a1253c..99a9a99 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/ArrowAndParticipant.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/ArrowAndParticipant.java
@@ -46,12 +46,14 @@ class ArrowAndParticipant extends Arrow implements InGroupable {
private final Arrow arrow;
private final ParticipantBox participantBox;
+ private final double paddingParticipant;
public ArrowAndParticipant(StringBounder stringBounder, Arrow arrow, ParticipantBox participantBox,
double paddingParticipant) {
super(arrow.getStartingY(), arrow.getSkin(), arrow.getArrowComponent(), arrow.getUrl());
this.arrow = arrow;
this.participantBox = participantBox;
+ this.paddingParticipant = paddingParticipant;
arrow.setPaddingArrowHead(participantBox.getPreferredWidth(stringBounder) / 2 - paddingParticipant);
}
@@ -95,7 +97,7 @@ class ArrowAndParticipant extends Arrow implements InGroupable {
arrow.drawInternalU(ug, maxX, context);
} else {
final double boxWidth = participantBox.getPreferredWidth(ug.getStringBounder());
- arrow.drawInternalU(ug.apply(new UTranslate(boxWidth / 2, 0)), maxX, context);
+ arrow.drawInternalU(ug.apply(new UTranslate(boxWidth / 2 - paddingParticipant, 0)), maxX, context);
}
final double arrowHeight = arrow.getPreferredHeight(ug.getStringBounder());
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSet.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSet.java
index c21444e..13392dc 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSet.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSet.java
@@ -167,7 +167,7 @@ public class DrawableSet {
pending.add(ent.getKey());
continue;
}
- pending = new Englober(englober, ent.getKey(), getSkinParam(), skin, stringBounder);
+ pending = Englober.createPuma(englober, ent.getKey(), getSkinParam(), skin, stringBounder);
result.add(pending);
}
return Collections.unmodifiableList(result);
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSetInitializer.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSetInitializer.java
index 5ff6328..af988a9 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSetInitializer.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSetInitializer.java
@@ -62,7 +62,6 @@ import net.sourceforge.plantuml.sequencediagram.Message;
import net.sourceforge.plantuml.sequencediagram.MessageExo;
import net.sourceforge.plantuml.sequencediagram.Newpage;
import net.sourceforge.plantuml.sequencediagram.Note;
-import net.sourceforge.plantuml.sequencediagram.NoteOnMessage;
import net.sourceforge.plantuml.sequencediagram.Notes;
import net.sourceforge.plantuml.sequencediagram.Participant;
import net.sourceforge.plantuml.sequencediagram.ParticipantEnglober;
@@ -409,10 +408,10 @@ class DrawableSetInitializer {
inGroupableStack.addElement((GroupingGraphicalElementElse) element);
} else if (m.getType() == GroupingType.END) {
final List<Component> notes = new ArrayList<Component>();
- for (NoteOnMessage noteOnMessage : m.getNoteOnMessages()) {
- final ISkinParam sk = noteOnMessage.getSkinParamNoteBackcolored(drawableSet.getSkinParam());
+ for (Note noteOnMessage : m.getNoteOnMessages()) {
+ final ISkinParam sk = noteOnMessage.getSkinParamBackcolored(drawableSet.getSkinParam());
final Component note = drawableSet.getSkin().createComponent(
- noteOnMessage.getNoteStyle().getNoteComponentType(), null, sk, noteOnMessage.getDisplay());
+ noteOnMessage.getStyle().getNoteComponentType(), null, sk, noteOnMessage.getStrings());
notes.add(note);
}
if (m.isParallel()) {
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java
index e38d32d..80dc784 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java
@@ -50,6 +50,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.EntityImageLegend;
import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
+import net.sourceforge.plantuml.cucadiagram.DisplaySection;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
@@ -87,7 +88,7 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker {
final DrawableSetInitializer initializer = new DrawableSetInitializer(skin, sequenceDiagram.getSkinParam(),
sequenceDiagram.isShowFootbox(), sequenceDiagram.getAutonewpage());
- for (Participant p : sequenceDiagram.participants().values()) {
+ for (Participant p : sequenceDiagram.participants()) {
initializer.addParticipant(p, sequenceDiagram.getEnglober(p));
}
@@ -158,12 +159,12 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker {
final Dimension2D dimTitle = compTitle.calculateDimension(stringBounder);
area.setTitleArea(dimTitle.getWidth(), dimTitle.getHeight());
}
- area.initFooter(getPngTitler(FontParam.FOOTER), stringBounder);
- area.initHeader(getPngTitler(FontParam.HEADER), stringBounder);
+ area.initFooter(getPngTitler(FontParam.FOOTER, index), stringBounder);
+ area.initHeader(getPngTitler(FontParam.HEADER, index), stringBounder);
final DisplayPositionned legend = diagram.getLegend();
final TextBlock legendBlock;
- if (DisplayPositionned.isNull(legend)) {
+ if (legend.isNull()) {
legendBlock = TextBlockUtils.empty(0, 0);
} else {
legendBlock = EntityImageLegend.create(legend.getDisplay(), diagram.getSkinParam());
@@ -178,8 +179,8 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker {
final String metadata = fileFormatOption.isWithMetadata() ? diagram.getMetadata() : null;
- final ImageBuilder imageBuilder = new ImageBuilder(diagram.getSkinParam(), oneOf(scale, dpiFactor), metadata, null, 3,
- 10, diagram.getAnimation());
+ final ImageBuilder imageBuilder = new ImageBuilder(diagram.getSkinParam(), oneOf(scale, dpiFactor), metadata,
+ null, 3, 10, diagram.getAnimation());
imageBuilder.setUDrawable(new UDrawable() {
public void drawU(UGraphic ug) {
@@ -203,7 +204,7 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker {
final double delta1 = Math.max(0, dimLegend.getWidth() - area.getWidth());
- final boolean legendTop = DisplayPositionned.isNull(legend) == false
+ final boolean legendTop = legend.isNull() == false
&& legend.getVerticalAlignment() == VerticalAlignment.TOP;
double sequenceAreaY = area.getSequenceAreaY();
@@ -213,10 +214,10 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker {
drawableSet.drawU22(ug.apply(new UTranslate(area.getSequenceAreaX() + delta1 / 2, sequenceAreaY)),
delta, fullDimension.getWidth(), page, diagram.isShowFootbox());
- drawHeader(area, ug);
- drawFooter(area, ug);
+ drawHeader(area, ug, index);
+ drawFooter(area, ug, index);
- if (DisplayPositionned.isNull(legend) == false) {
+ if (legend.isNull() == false) {
final double delta2;
if (legend.getHorizontalAlignment() == HorizontalAlignment.LEFT) {
delta2 = 0;
@@ -234,9 +235,9 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker {
return imageBuilder.writeImageTOBEMOVED(fileFormatOption, diagram.seed(), os);
}
- private void drawFooter(SequenceDiagramArea area, UGraphic ug) {
- final PngTitler pngTitler = getPngTitler(FontParam.FOOTER);
- final TextBlock text = pngTitler.getTextBlock();
+ private void drawFooter(SequenceDiagramArea area, UGraphic ug, int page) {
+ final PngTitler pngTitler = getPngTitler(FontParam.FOOTER, page);
+ final TextBlock text = pngTitler.getRibbonBlock();
if (text == null) {
return;
}
@@ -244,9 +245,9 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker {
.getFooterY())));
}
- private void drawHeader(SequenceDiagramArea area, UGraphic ug) {
- final PngTitler pngTitler = getPngTitler(FontParam.HEADER);
- final TextBlock text = pngTitler.getTextBlock();
+ private void drawHeader(SequenceDiagramArea area, UGraphic ug, int page) {
+ final PngTitler pngTitler = getPngTitler(FontParam.HEADER, page);
+ final TextBlock text = pngTitler.getRibbonBlock();
if (text == null) {
return;
}
@@ -281,14 +282,14 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker {
return diagram.getScale().getScale(width, height);
}
- private PngTitler getPngTitler(final FontParam fontParam) {
+ private PngTitler getPngTitler(final FontParam fontParam, int page) {
final HtmlColor hyperlinkColor = diagram.getSkinParam().getHyperlinkColor();
final HtmlColor titleColor = diagram.getSkinParam().getFontHtmlColor(null, fontParam);
final String fontFamily = diagram.getSkinParam().getFont(null, false, fontParam).getFamily(null);
final int fontSize = diagram.getSkinParam().getFont(null, false, fontParam).getSize();
- return new PngTitler(titleColor, diagram.getFooterOrHeaderTeoz(fontParam).getDisplay(), fontSize, fontFamily,
- diagram.getFooterOrHeaderTeoz(fontParam).getHorizontalAlignment(), hyperlinkColor, diagram
- .getSkinParam().useUnderlineForHyperlink());
+ final DisplaySection display = diagram.getFooterOrHeaderTeoz(fontParam).withPage(page + 1, pages.size());
+ return new PngTitler(titleColor, display, fontSize, fontFamily, hyperlinkColor, diagram.getSkinParam()
+ .useUnderlineForHyperlink());
}
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramTxtMaker.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramTxtMaker.java
index 7085244..cc9b55c 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramTxtMaker.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramTxtMaker.java
@@ -41,15 +41,19 @@ import java.io.OutputStream;
import java.io.PrintStream;
import net.sourceforge.plantuml.FileFormat;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.api.ImageDataSimple;
import net.sourceforge.plantuml.asciiart.TextSkin;
import net.sourceforge.plantuml.asciiart.TextStringBounder;
+import net.sourceforge.plantuml.asciiart.UmlCharArea;
import net.sourceforge.plantuml.core.ImageData;
+import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.sequencediagram.Event;
import net.sourceforge.plantuml.sequencediagram.Participant;
import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
import net.sourceforge.plantuml.skin.Skin;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.txt.UGraphicTxt;
public class SequenceDiagramTxtMaker implements FileMaker {
@@ -70,23 +74,23 @@ public class SequenceDiagramTxtMaker implements FileMaker {
final DrawableSetInitializer initializer = new DrawableSetInitializer(skin, sequenceDiagram.getSkinParam(),
sequenceDiagram.isShowFootbox(), sequenceDiagram.getAutonewpage());
- for (Participant p : sequenceDiagram.participants().values()) {
+ for (Participant p : sequenceDiagram.participants()) {
initializer.addParticipant(p, null);
}
for (Event ev : sequenceDiagram.events()) {
initializer.addEvent(ev);
-// if (ev instanceof Message) {
-// // TODO mieux faire
-// final Message m = (Message) ev;
-// for (LifeEvent lifeEvent : m.getLiveEvents()) {
-// if (lifeEvent.getType() == LifeEventType.DESTROY
-// /*
-// * || lifeEvent.getType() == LifeEventType.CREATE
-// */) {
-// initializer.addEvent(lifeEvent);
-// }
-// }
-// }
+ // if (ev instanceof Message) {
+ // // TODO mieux faire
+ // final Message m = (Message) ev;
+ // for (LifeEvent lifeEvent : m.getLiveEvents()) {
+ // if (lifeEvent.getType() == LifeEventType.DESTROY
+ // /*
+ // * || lifeEvent.getType() == LifeEventType.CREATE
+ // */) {
+ // initializer.addEvent(lifeEvent);
+ // }
+ // }
+ // }
}
drawableSet = initializer.createDrawableSet(dummyStringBounder);
// final List<Newpage> newpages = new ArrayList<Newpage>();
@@ -100,10 +104,24 @@ public class SequenceDiagramTxtMaker implements FileMaker {
final double tailHeight = drawableSet.getTailHeight(dummyStringBounder, diagram.isShowFootbox());
final double newpage2 = fullDimension.getHeight() - (diagram.isShowFootbox() ? tailHeight : 0) - headerHeight;
final Page page = new Page(headerHeight, 0, newpage2, tailHeight, 0, null);
- //drawableSet.drawU_REMOVEDME_4243(ug, 0, fullDimension.getWidth(), page, diagram.isShowFootbox());
- drawableSet.drawU22(ug, 0, fullDimension.getWidth(), page, diagram.isShowFootbox());
- }
+ // drawableSet.drawU_REMOVEDME_4243(ug, 0, fullDimension.getWidth(), page, diagram.isShowFootbox());
+
+ final Display title = diagram.getTitle().getDisplay();
+ final UGraphicTxt ug2;
+ if (title.isWhite()) {
+ ug2 = ug;
+ } else {
+ ug2 = (UGraphicTxt) ug.apply(new UTranslate(0, title.as().size() + 1));
+ }
+ drawableSet.drawU22(ug2, 0, fullDimension.getWidth(), page, diagram.isShowFootbox());
+ if (title.isWhite() == false) {
+ final int widthTitle = StringUtils.getWcWidth(title);
+ final UmlCharArea charArea = ug.getCharArea();
+ charArea.drawStringsLR(title.as(), (int) ((fullDimension.getWidth() - widthTitle) / 2), 0);
+ }
+
+ }
public ImageData createOne(OutputStream os, int index, boolean isWithMetadata) throws IOException {
if (fileFormat == FileFormat.UTXT) {
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1Abstract.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1Abstract.java
index 7609e1d..3abad11 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1Abstract.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1Abstract.java
@@ -40,7 +40,7 @@ import java.util.List;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.sequencediagram.AbstractMessage;
-import net.sourceforge.plantuml.sequencediagram.NoteOnMessage;
+import net.sourceforge.plantuml.sequencediagram.Note;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.skin.ArrowConfiguration;
import net.sourceforge.plantuml.skin.Component;
@@ -116,12 +116,12 @@ abstract class Step1Abstract {
}
protected final NoteBox createNoteBox(StringBounder stringBounder, Arrow arrow, Component noteComp,
- NoteOnMessage noteOnMessage) {
- final LivingParticipantBox p = arrow.getParticipantAt(stringBounder, noteOnMessage.getNotePosition());
- final NoteBox noteBox = new NoteBox(arrow.getStartingY(), noteComp, p, null, noteOnMessage.getNotePosition(),
- noteOnMessage.getUrlNote());
+ Note noteOnMessage) {
+ final LivingParticipantBox p = arrow.getParticipantAt(stringBounder, noteOnMessage.getPosition());
+ final NoteBox noteBox = new NoteBox(arrow.getStartingY(), noteComp, p, null, noteOnMessage.getPosition(),
+ noteOnMessage.getUrl());
- if (arrow instanceof MessageSelfArrow && noteOnMessage.getNotePosition() == NotePosition.RIGHT) {
+ if (arrow instanceof MessageSelfArrow && noteOnMessage.getPosition() == NotePosition.RIGHT) {
noteBox.pushToRight(arrow.getPreferredWidth(stringBounder));
}
// if (arrow instanceof MessageExoArrow) {
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1Message.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1Message.java
index 6508d3b..9e6aee7 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1Message.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1Message.java
@@ -45,7 +45,7 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.sequencediagram.InGroupable;
import net.sourceforge.plantuml.sequencediagram.Message;
-import net.sourceforge.plantuml.sequencediagram.NoteOnMessage;
+import net.sourceforge.plantuml.sequencediagram.Note;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.skin.ArrowBody;
import net.sourceforge.plantuml.skin.ArrowConfiguration;
@@ -78,11 +78,11 @@ class Step1Message extends Step1Abstract {
getLivingParticipantBox1(), getLivingParticipantBox2(), message.getUrl(), compAliveBox);
}
- final List<NoteOnMessage> noteOnMessages = message.getNoteOnMessages();
- for (NoteOnMessage noteOnMessage : noteOnMessages) {
- final ISkinParam skinParam = noteOnMessage.getSkinParamNoteBackcolored(drawingSet.getSkinParam());
- addNote(drawingSet.getSkin().createComponent(noteOnMessage.getNoteStyle().getNoteComponentType(), null,
- skinParam, noteOnMessage.getDisplay()));
+ final List<Note> noteOnMessages = message.getNoteOnMessages();
+ for (Note noteOnMessage : noteOnMessages) {
+ final ISkinParam skinParam = noteOnMessage.getSkinParamBackcolored(drawingSet.getSkinParam());
+ addNote(drawingSet.getSkin().createComponent(noteOnMessage.getStyle().getNoteComponentType(), null,
+ skinParam, noteOnMessage.getStrings()));
}
}
@@ -172,7 +172,7 @@ class Step1Message extends Step1Abstract {
final List<NoteBox> noteBoxes = new ArrayList<NoteBox>();
for (int i = 0; i < getNotes().size(); i++) {
final Component note = getNotes().get(i);
- final NoteOnMessage noteOnMessage = getMessage().getNoteOnMessages().get(i);
+ final Note noteOnMessage = getMessage().getNoteOnMessages().get(i);
noteBoxes.add(createNoteBox(getStringBounder(), messageSelfArrow, note, noteOnMessage));
}
return new ArrowAndNoteBox(getStringBounder(), messageSelfArrow, noteBoxes);
@@ -180,7 +180,7 @@ class Step1Message extends Step1Abstract {
final List<NoteBox> noteBoxes = new ArrayList<NoteBox>();
for (int i = 0; i < getNotes().size(); i++) {
final Component note = getNotes().get(i);
- final NoteOnMessage noteOnMessage = getMessage().getNoteOnMessages().get(i);
+ final Note noteOnMessage = getMessage().getNoteOnMessages().get(i);
noteBoxes.add(createNoteBox(getStringBounder(), messageArrow, note, noteOnMessage));
}
return new ArrowAndNoteBox(getStringBounder(), messageArrow, noteBoxes);
@@ -227,9 +227,9 @@ class Step1Message extends Step1Abstract {
final List<NoteBox> noteBoxes = new ArrayList<NoteBox>();
for (int i = 0; i < getNotes().size(); i++) {
final Component note = getNotes().get(i);
- final NoteOnMessage noteOnMessage = getMessage().getNoteOnMessages().get(i);
+ final Note noteOnMessage = getMessage().getNoteOnMessages().get(i);
final NoteBox noteBox = createNoteBox(getStringBounder(), result, note, noteOnMessage);
- if (noteOnMessage.getNotePosition() == NotePosition.RIGHT) {
+ if (noteOnMessage.getPosition() == NotePosition.RIGHT) {
noteBox.pushToRight(getParticipantBox2().getPreferredWidth(getStringBounder()) / 2);
}
noteBoxes.add(noteBox);
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1MessageExo.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1MessageExo.java
index bb15807..f9ea68a 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1MessageExo.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1MessageExo.java
@@ -43,7 +43,7 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.sequencediagram.InGroupable;
import net.sourceforge.plantuml.sequencediagram.MessageExo;
import net.sourceforge.plantuml.sequencediagram.MessageExoType;
-import net.sourceforge.plantuml.sequencediagram.NoteOnMessage;
+import net.sourceforge.plantuml.sequencediagram.Note;
import net.sourceforge.plantuml.skin.ArrowConfiguration;
import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.ComponentType;
@@ -63,11 +63,11 @@ class Step1MessageExo extends Step1Abstract {
message.getLabelNumbered()), getLivingParticipantBox(), message.getType(), message.getUrl(),
message.isShortArrow(), message.getArrowConfiguration());
- final List<NoteOnMessage> noteOnMessages = message.getNoteOnMessages();
- for (NoteOnMessage noteOnMessage : noteOnMessages) {
- final ISkinParam skinParam = noteOnMessage.getSkinParamNoteBackcolored(drawingSet.getSkinParam());
+ final List<Note> noteOnMessages = message.getNoteOnMessages();
+ for (Note noteOnMessage : noteOnMessages) {
+ final ISkinParam skinParam = noteOnMessage.getSkinParamBackcolored(drawingSet.getSkinParam());
addNote(drawingSet.getSkin().createComponent(ComponentType.NOTE, null, skinParam,
- noteOnMessage.getDisplay()));
+ noteOnMessage.getStrings()));
// throw new UnsupportedOperationException();
}
@@ -121,7 +121,7 @@ class Step1MessageExo extends Step1Abstract {
final List<NoteBox> noteBoxes = new ArrayList<NoteBox>();
for (int i = 0; i < getNotes().size(); i++) {
final Component note = getNotes().get(i);
- final NoteOnMessage noteOnMessage = getMessage().getNoteOnMessages().get(i);
+ final Note noteOnMessage = getMessage().getNoteOnMessages().get(i);
noteBoxes.add(createNoteBox(getStringBounder(), messageArrow, note, noteOnMessage));
}
return new ArrowAndNoteBox(getStringBounder(), messageArrow, noteBoxes);
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteLeft.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteLeft.java
index 2882f85..b1f56d7 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteLeft.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteLeft.java
@@ -42,7 +42,7 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.real.Real;
import net.sourceforge.plantuml.sequencediagram.AbstractMessage;
import net.sourceforge.plantuml.sequencediagram.Event;
-import net.sourceforge.plantuml.sequencediagram.NoteOnMessage;
+import net.sourceforge.plantuml.sequencediagram.Note;
import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.ComponentType;
@@ -58,14 +58,14 @@ public class CommunicationTileNoteLeft implements TileWithUpdateStairs, TileWith
private final Skin skin;
private final ISkinParam skinParam;
private final LivingSpace livingSpace;
- private final NoteOnMessage noteOnMessage;
+ private final Note noteOnMessage;
public Event getEvent() {
return message;
}
public CommunicationTileNoteLeft(TileWithUpdateStairs tile, AbstractMessage message, Skin skin,
- ISkinParam skinParam, LivingSpace livingSpace, NoteOnMessage noteOnMessage) {
+ ISkinParam skinParam, LivingSpace livingSpace, Note noteOnMessage) {
this.tile = tile;
this.message = message;
this.skin = skin;
@@ -80,7 +80,7 @@ public class CommunicationTileNoteLeft implements TileWithUpdateStairs, TileWith
private Component getComponent(StringBounder stringBounder) {
final Component comp = skin.createComponent(ComponentType.NOTE, null,
- noteOnMessage.getSkinParamNoteBackcolored(skinParam), noteOnMessage.getDisplay());
+ noteOnMessage.getSkinParamBackcolored(skinParam), noteOnMessage.getStrings());
return comp;
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteRight.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteRight.java
index b0d1d88..fdb2a4d 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteRight.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteRight.java
@@ -42,7 +42,7 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.real.Real;
import net.sourceforge.plantuml.sequencediagram.AbstractMessage;
import net.sourceforge.plantuml.sequencediagram.Event;
-import net.sourceforge.plantuml.sequencediagram.NoteOnMessage;
+import net.sourceforge.plantuml.sequencediagram.Note;
import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.ComponentType;
@@ -58,7 +58,7 @@ public class CommunicationTileNoteRight implements TileWithUpdateStairs, TileWit
private final Skin skin;
private final ISkinParam skinParam;
private final LivingSpace livingSpace;
- private final NoteOnMessage noteOnMessage;
+ private final Note noteOnMessage;
public Event getEvent() {
return message;
@@ -69,7 +69,7 @@ public class CommunicationTileNoteRight implements TileWithUpdateStairs, TileWit
}
public CommunicationTileNoteRight(TileWithUpdateStairs tile, AbstractMessage message, Skin skin,
- ISkinParam skinParam, LivingSpace livingSpace, NoteOnMessage noteOnMessage) {
+ ISkinParam skinParam, LivingSpace livingSpace, Note noteOnMessage) {
this.tile = tile;
this.message = message;
this.skin = skin;
@@ -84,7 +84,7 @@ public class CommunicationTileNoteRight implements TileWithUpdateStairs, TileWit
private Component getComponent(StringBounder stringBounder) {
final Component comp = skin.createComponent(ComponentType.NOTE, null,
- noteOnMessage.getSkinParamNoteBackcolored(skinParam), noteOnMessage.getDisplay());
+ noteOnMessage.getSkinParamBackcolored(skinParam), noteOnMessage.getStrings());
return comp;
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileSelfNoteRight.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileSelfNoteRight.java
index dd278b2..89c18ae 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileSelfNoteRight.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileSelfNoteRight.java
@@ -42,7 +42,7 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.real.Real;
import net.sourceforge.plantuml.sequencediagram.Event;
import net.sourceforge.plantuml.sequencediagram.Message;
-import net.sourceforge.plantuml.sequencediagram.NoteOnMessage;
+import net.sourceforge.plantuml.sequencediagram.Note;
import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.ComponentType;
@@ -57,14 +57,14 @@ public class CommunicationTileSelfNoteRight implements TileWithUpdateStairs {
private final Message message;
private final Skin skin;
private final ISkinParam skinParam;
- private final NoteOnMessage noteOnMessage;
+ private final Note noteOnMessage;
public Event getEvent() {
return message;
}
public CommunicationTileSelfNoteRight(CommunicationTileSelf tile, Message message, Skin skin, ISkinParam skinParam,
- NoteOnMessage noteOnMessage) {
+ Note noteOnMessage) {
this.tile = tile;
this.message = message;
this.skin = skin;
@@ -78,7 +78,7 @@ public class CommunicationTileSelfNoteRight implements TileWithUpdateStairs {
private Component getComponent(StringBounder stringBounder) {
final Component comp = skin.createComponent(ComponentType.NOTE, null,
- noteOnMessage.getSkinParamNoteBackcolored(skinParam), noteOnMessage.getDisplay());
+ noteOnMessage.getSkinParamBackcolored(skinParam), noteOnMessage.getStrings());
return comp;
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/Englobers.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/Englobers.java
index cfead1b..c2d55e1 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/Englobers.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/Englobers.java
@@ -64,7 +64,7 @@ public class Englobers {
pending.add(p);
continue;
}
- pending = new Englober(englober, p, tileArguments);
+ pending = Englober.createTeoz(englober, p, tileArguments);
englobers.add(pending);
}
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/GroupingTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/GroupingTile.java
index a965109..a91b15e 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/GroupingTile.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/GroupingTile.java
@@ -64,7 +64,7 @@ public class GroupingTile implements TileWithCallbackY {
private static final int EXTERNAL_MARGINX2 = 9;
private static final int MARGINX = 16;
private static final int MARGINY = 10;
- private final List<Tile> tiles = new ArrayList<Tile>();
+ private List<Tile> tiles = new ArrayList<Tile>();
private final Real min;
private final Real max;
private final GroupingStart start;
@@ -102,17 +102,21 @@ public class GroupingTile implements TileWithCallbackY {
}
for (Tile tile : TileBuilder.buildOne(it, tileArgumentsOriginal, ev, this)) {
tiles.add(tile);
- bodyHeight += tile.getPreferredHeight(stringBounder);
- if (ev instanceof GroupingLeaf && ((Grouping) ev).getType() == GroupingType.ELSE) {
- allElses.add(tile);
- continue;
- }
- min2.add(tile.getMinX(stringBounder).addFixed(-MARGINX));
- final Real m = tile.getMaxX(stringBounder);
- // max2.add(m == tileArgumentsOriginal.getOmega() ? m : m.addFixed(MARGINX));
- max2.add(m.addFixed(MARGINX));
}
}
+ tiles = mergeParallel(tiles);
+ for (Tile tile : tiles) {
+ bodyHeight += tile.getPreferredHeight(stringBounder);
+ final Event ev = tile.getEvent();
+ if (ev instanceof GroupingLeaf && ((Grouping) ev).getType() == GroupingType.ELSE) {
+ allElses.add(tile);
+ continue;
+ }
+ min2.add(tile.getMinX(stringBounder).addFixed(-MARGINX));
+ final Real m = tile.getMaxX(stringBounder);
+ // max2.add(m == tileArgumentsOriginal.getOmega() ? m : m.addFixed(MARGINX));
+ max2.add(m.addFixed(MARGINX));
+ }
final Dimension2D dim1 = getPreferredDimensionIfEmpty(stringBounder);
final double width = dim1.getWidth();
if (min2.size() == 0) {
@@ -152,9 +156,9 @@ public class GroupingTile implements TileWithCallbackY {
double h = dim1.getHeight() + MARGINY / 2;
for (Tile tile : tiles) {
ug.apply(new UTranslate(0, h)).draw(tile);
- h += tile.getPreferredHeight(stringBounder);
+ final double preferredHeight = tile.getPreferredHeight(stringBounder);
+ h += preferredHeight;
}
-
}
private double getTotalHeight(StringBounder stringBounder) {
@@ -165,12 +169,12 @@ public class GroupingTile implements TileWithCallbackY {
private void drawAllElses(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder();
final double totalHeight = getTotalHeight(stringBounder);
- final double suppHeight = getPreferredDimensionIfEmpty(stringBounder).getHeight() + MARGINY / 2;
+ // final double suppHeight = getPreferredDimensionIfEmpty(stringBounder).getHeight() + MARGINY / 2;
final List<Double> ys = new ArrayList<Double>();
for (Tile tile : tiles) {
if (tile instanceof ElseTile) {
final ElseTile elseTile = (ElseTile) tile;
- ys.add(elseTile.getCallbackY() - y + suppHeight);
+ ys.add(elseTile.getCallbackY() - y + MARGINY / 2/* suppHeight */);
}
}
ys.add(totalHeight);
@@ -213,23 +217,62 @@ public class GroupingTile implements TileWithCallbackY {
public static double fillPositionelTiles(StringBounder stringBounder, double y, List<Tile> tiles,
final List<YPositionedTile> positionedTiles) {
- double lastY = y;
- for (Tile tile : tiles) {
- if (tile.getEvent().isParallel()) {
- y = lastY;
- }
+ for (Tile tile : mergeParallel(tiles)) {
positionedTiles.add(new YPositionedTile(tile, y));
if (tile instanceof GroupingTile) {
final GroupingTile groupingTile = (GroupingTile) tile;
- fillPositionelTiles(stringBounder, y, groupingTile.tiles, new ArrayList<YPositionedTile>());
+ final double headerHeight = groupingTile.getPreferredDimensionIfEmpty(stringBounder).getHeight();
+ fillPositionelTiles(stringBounder, y + headerHeight, groupingTile.tiles,
+ new ArrayList<YPositionedTile>());
}
- lastY = y;
y += tile.getPreferredHeight(stringBounder);
}
return y;
}
+ private static List<Tile> mergeParallel(List<Tile> tiles) {
+ TileParallel pending = null;
+ tiles = removeEmptyCloseToParallel(tiles);
+ final List<Tile> result = new ArrayList<Tile>();
+ for (Tile tile : tiles) {
+ if (isParallel(tile)) {
+ if (pending == null) {
+ pending = new TileParallel();
+ pending.add(result.get(result.size() - 1));
+ result.set(result.size() - 1, pending);
+ }
+ pending.add(tile);
+ } else {
+ result.add(tile);
+ pending = null;
+ }
+ }
+ return result;
+ }
+
+ private static List<Tile> removeEmptyCloseToParallel(List<Tile> tiles) {
+ final List<Tile> result = new ArrayList<Tile>();
+ for (Tile tile : tiles) {
+ if (isParallel(tile)) {
+ removeHeadEmpty(result);
+ }
+ result.add(tile);
+ }
+ return result;
+
+ }
+
+ private static void removeHeadEmpty(List<Tile> tiles) {
+ while (tiles.size() > 0 && tiles.get(tiles.size() - 1) instanceof EmptyTile) {
+ tiles.remove(tiles.size() - 1);
+ }
+ }
+
+ private static boolean isParallel(Tile tile) {
+ return tile instanceof TileParallel == false && tile.getEvent().isParallel();
+ }
+
// public double getStartY() {
// return y + MARGINY;
// }
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/LifeEventTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/LifeEventTile.java
index 68f18dc..a7428a5 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/LifeEventTile.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/LifeEventTile.java
@@ -60,7 +60,7 @@ public class LifeEventTile implements TileWithUpdateStairs {
private final ISkinParam skinParam;
public void updateStairs(StringBounder stringBounder, double y) {
- System.err.println("LifeEventTile::updateStairs " + lifeEvent + " " + livingSpace.getParticipant() + " y=" + y);
+ // System.err.println("LifeEventTile::updateStairs " + lifeEvent + " " + livingSpace.getParticipant() + " y=" + y);
livingSpace.addStepForLivebox(getEvent(), y);
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxFinder.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxFinder.java
index 960aeea..c1ba862 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxFinder.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxFinder.java
@@ -55,6 +55,11 @@ public class LiveBoxFinder implements UGraphic {
public boolean matchesProperty(String propertyName) {
return false;
}
+
+ public double dpiFactor() {
+ return 1;
+ }
+
public UGraphic apply(UChange change) {
if (change instanceof UTranslate) {
@@ -100,6 +105,10 @@ public class LiveBoxFinder implements UGraphic {
((GroupingTile) shape).drawU(this);
} else if (shape instanceof TileWithUpdateStairs) {
((TileWithUpdateStairs) shape).updateStairs(stringBounder, y);
+ } else if (shape instanceof EmptyTile) {
+ // Nothing ?
+ } else if (shape instanceof TileParallel) {
+ // Nothing ?
} else if (shape instanceof NotesTile) {
// Nothing ?
} else if (shape instanceof Tile) {
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java
index 86b68be..b3edc67 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java
@@ -47,7 +47,7 @@ import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.EntityImageLegend;
import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
+import net.sourceforge.plantuml.cucadiagram.DisplaySection;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
@@ -148,8 +148,9 @@ public class SequenceDiagramFileMakerTeoz implements FileMaker {
public void drawU(UGraphic ug) {
ug = ug.apply(min1translate);
- englobers.drawEnglobers(goDownForEnglobers(ug), main.calculateDimension(stringBounder).getHeight()
- + heightEnglober1 + heightEnglober2 / 2, new SimpleContext2D(true));
+
+ englobers.drawEnglobers(goDownAndCenterForEnglobers(ug), main.calculateDimension(stringBounder)
+ .getHeight() + heightEnglober1 + heightEnglober2 / 2, new SimpleContext2D(true));
printAligned(ug, diagram.getFooterOrHeaderTeoz(FontParam.HEADER).getHorizontalAlignment(), header);
ug = goDown(ug, header);
@@ -168,7 +169,7 @@ public class SequenceDiagramFileMakerTeoz implements FileMaker {
ug = ug.apply(new UTranslate(0, heightEnglober2));
printAligned(ug, HorizontalAlignment.CENTER, caption);
-
+
if (diagram.getLegend().getVerticalAlignment() == VerticalAlignment.BOTTOM) {
printAligned(ug, diagram.getLegend().getHorizontalAlignment(), legend);
ug = goDown(ug, legend);
@@ -182,13 +183,14 @@ public class SequenceDiagramFileMakerTeoz implements FileMaker {
}
- private UGraphic goDownForEnglobers(UGraphic ug) {
+ private UGraphic goDownAndCenterForEnglobers(UGraphic ug) {
ug = goDown(ug, title);
ug = goDown(ug, header);
if (diagram.getLegend().getVerticalAlignment() == VerticalAlignment.TOP) {
ug = goDown(ug, legend);
}
- return ug;
+ final double dx = (dimTotal.getWidth() - main.calculateDimension(stringBounder).getWidth()) / 2;
+ return ug.apply(new UTranslate(dx, 0));
}
private UGraphic goDown(UGraphic ug, TextBlock size) {
@@ -208,7 +210,7 @@ public class SequenceDiagramFileMakerTeoz implements FileMaker {
private MainTile createMainTile() {
final RealOrigin origin = RealUtils.createOrigin();
Real currentPos = origin.addAtLeast(0);
- for (Participant p : diagram.participants().values()) {
+ for (Participant p : diagram.participants()) {
final LivingSpace livingSpace = new LivingSpace(p, diagram.getEnglober(p), skin, getSkinParam(),
currentPos, diagram.events());
livingSpaces.put(p, livingSpace);
@@ -233,7 +235,7 @@ public class SequenceDiagramFileMakerTeoz implements FileMaker {
}
private TextBlock getTitle() {
- if (DisplayPositionned.isNull(diagram.getTitle())) {
+ if (diagram.getTitle().isNull()) {
return new ComponentAdapter(null);
}
final TextBlock compTitle = TextBlockUtils.title(new FontConfiguration(getSkinParam(),
@@ -250,17 +252,16 @@ public class SequenceDiagramFileMakerTeoz implements FileMaker {
}
public TextBlock getFooterOrHeader(final FontParam param) {
- if (DisplayPositionned.isNull(diagram.getFooterOrHeaderTeoz(param))) {
+ if (diagram.getFooterOrHeaderTeoz(param).isNull()) {
return new TeozLayer(null, stringBounder, param);
}
- final Display display = diagram.getFooterOrHeaderTeoz(param).getDisplay();
+ final DisplaySection display = diagram.getFooterOrHeaderTeoz(param);
final HtmlColor hyperlinkColor = getSkinParam().getHyperlinkColor();
final HtmlColor titleColor = getSkinParam().getFontHtmlColor(null, param);
final String fontFamily = getSkinParam().getFont(null, false, param).getFamily(null);
final int fontSize = getSkinParam().getFont(null, false, param).getSize();
- final PngTitler pngTitler = new PngTitler(titleColor, display, fontSize, fontFamily, diagram
- .getFooterOrHeaderTeoz(param).getHorizontalAlignment(), hyperlinkColor, getSkinParam()
- .useUnderlineForHyperlink());
+ final PngTitler pngTitler = new PngTitler(titleColor, display, fontSize, fontFamily, hyperlinkColor,
+ getSkinParam().useUnderlineForHyperlink());
return new TeozLayer(pngTitler, stringBounder, param);
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/TeozLayer.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/TeozLayer.java
index cb28b5e..add6cc1 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/TeozLayer.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/TeozLayer.java
@@ -56,8 +56,8 @@ public class TeozLayer extends AbstractTextBlock implements TextBlock {
this.param = param;
dimension = new Dimension2DDouble(0, 0);
- if (titler != null && titler.getTextBlock() != null) {
- dimension = titler.getTextBlock().calculateDimension(stringBounder);
+ if (titler != null && titler.getRibbonBlock() != null) {
+ dimension = titler.getRibbonBlock().calculateDimension(stringBounder);
}
}
@@ -71,7 +71,7 @@ public class TeozLayer extends AbstractTextBlock implements TextBlock {
public void drawU(UGraphic ug) {
if (titler != null) {
- titler.getTextBlock().drawU(ug);
+ titler.getRibbonBlock().drawU(ug);
}
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/TileBuilder.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/TileBuilder.java
index fb2001f..86d8c94 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/TileBuilder.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/TileBuilder.java
@@ -54,7 +54,6 @@ import net.sourceforge.plantuml.sequencediagram.LifeEvent;
import net.sourceforge.plantuml.sequencediagram.Message;
import net.sourceforge.plantuml.sequencediagram.MessageExo;
import net.sourceforge.plantuml.sequencediagram.Note;
-import net.sourceforge.plantuml.sequencediagram.NoteOnMessage;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.Notes;
import net.sourceforge.plantuml.sequencediagram.Reference;
@@ -96,8 +95,8 @@ public class TileBuilder {
result = new CommunicationTile(livingSpace1, livingSpace2, msg, skin, skinParam);
reverse = ((CommunicationTile) result).isReverse(stringBounder);
}
- for (NoteOnMessage noteOnMessage : msg.getNoteOnMessages()) {
- final NotePosition notePosition = noteOnMessage.getNotePosition();
+ for (Note noteOnMessage : msg.getNoteOnMessages()) {
+ final NotePosition notePosition = noteOnMessage.getPosition();
if (notePosition == NotePosition.LEFT) {
result = new CommunicationTileNoteLeft((TileWithUpdateStairs) result, msg, skin, skinParam,
reverse ? livingSpace2 : livingSpace1, noteOnMessage);
@@ -115,8 +114,8 @@ public class TileBuilder {
final LivingSpace livingSpace1 = livingSpaces.get(exo.getParticipant());
Tile result = null;
result = new CommunicationExoTile(livingSpace1, exo, skin, skinParam, tileArguments);
- for (NoteOnMessage noteOnMessage : exo.getNoteOnMessages()) {
- final NotePosition notePosition = exo.getNoteOnMessages().get(0).getNotePosition();
+ for (Note noteOnMessage : exo.getNoteOnMessages()) {
+ final NotePosition notePosition = exo.getNoteOnMessages().get(0).getPosition();
if (notePosition == NotePosition.LEFT) {
result = new CommunicationTileNoteLeft((TileWithUpdateStairs) result, exo, skin, skinParam,
livingSpace1, noteOnMessage);
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/TileParallel.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/TileParallel.java
new file mode 100644
index 0000000..356368f
--- /dev/null
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/TileParallel.java
@@ -0,0 +1,137 @@
+/* ========================================================================
+ * 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.teoz;
+
+import java.util.AbstractCollection;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.real.Real;
+import net.sourceforge.plantuml.real.RealUtils;
+import net.sourceforge.plantuml.sequencediagram.Event;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class TileParallel implements Tile {
+
+ private final List<Tile> tiles = new ArrayList<Tile>();
+
+ public void add(Tile tile) {
+ this.tiles.add(tile);
+ }
+
+ public void drawU(UGraphic ug) {
+ final StringBounder stringBounder = ug.getStringBounder();
+ final double totalHeight = getPreferredHeight(stringBounder);
+ for (Tile tile : tiles) {
+ tile.drawU(ug.apply(new UTranslate(0, totalHeight - tile.getPreferredHeight(stringBounder))));
+ }
+ }
+
+ public double getPreferredHeight(StringBounder stringBounder) {
+ double height = 0;
+ for (Tile tile : tiles) {
+ height = Math.max(height, tile.getPreferredHeight(stringBounder));
+ }
+ return height;
+ }
+
+ public void addConstraints(StringBounder stringBounder) {
+ for (Tile tile : tiles) {
+ tile.addConstraints(stringBounder);
+ }
+ }
+
+ public Real getMinX(final StringBounder stringBounder) {
+ return RealUtils.min(new AbstractCollection<Real>() {
+ public Iterator<Real> iterator() {
+ return new Iterator<Real>() {
+ private final Iterator<Tile> source = tiles.iterator();
+
+ public boolean hasNext() {
+ return source.hasNext();
+ }
+
+ public Real next() {
+ return source.next().getMinX(stringBounder);
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+ };
+ }
+
+ public int size() {
+ return tiles.size();
+ }
+ });
+ }
+
+ public Real getMaxX(final StringBounder stringBounder) {
+ return RealUtils.max(new AbstractCollection<Real>() {
+ public Iterator<Real> iterator() {
+ return new Iterator<Real>() {
+ private final Iterator<Tile> source = tiles.iterator();
+
+ public boolean hasNext() {
+ return source.hasNext();
+ }
+
+ public Real next() {
+ return source.next().getMaxX(stringBounder);
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+ };
+ }
+
+ public int size() {
+ return tiles.size();
+ }
+ });
+ }
+
+ public Event getEvent() {
+ return null;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/skin/AbstractTextualComponent.java b/src/net/sourceforge/plantuml/skin/AbstractTextualComponent.java
index b1d5ae4..bf7c6f5 100644
--- a/src/net/sourceforge/plantuml/skin/AbstractTextualComponent.java
+++ b/src/net/sourceforge/plantuml/skin/AbstractTextualComponent.java
@@ -64,17 +64,16 @@ public abstract class AbstractTextualComponent extends AbstractComponent {
private final UFont font;
private final HtmlColor fontColor;
- public AbstractTextualComponent(LineBreakStrategy maxMessageSize, CharSequence label,
- FontConfiguration font, HorizontalAlignment horizontalAlignment, int marginX1, int marginX2,
- int marginY, ISkinSimple spriteContainer, UFont fontForStereotype,
- HtmlColor htmlColorForStereotype) {
+ public AbstractTextualComponent(LineBreakStrategy maxMessageSize, CharSequence label, FontConfiguration font,
+ HorizontalAlignment horizontalAlignment, int marginX1, int marginX2, int marginY,
+ ISkinSimple spriteContainer, UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
this(maxMessageSize, Display.getWithNewlines(label == null ? "" : label.toString()), font, horizontalAlignment,
marginX1, marginX2, marginY, spriteContainer, false, fontForStereotype, htmlColorForStereotype);
}
public AbstractTextualComponent(LineBreakStrategy maxMessageSize, Display strings, FontConfiguration font,
- HorizontalAlignment horizontalAlignment, int marginX1, int marginX2, int marginY, ISkinSimple spriteContainer,
- boolean enhanced, UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
+ HorizontalAlignment horizontalAlignment, int marginX1, int marginX2, int marginY,
+ ISkinSimple spriteContainer, boolean enhanced, UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
this.font = font.getFont();
this.fontColor = font.getColor();
this.marginX1 = marginX1;
@@ -85,7 +84,8 @@ public abstract class AbstractTextualComponent extends AbstractComponent {
if (strings.size() == 1 && strings.get(0).length() == 0) {
textBlock = new TextBlockEmpty();
} else if (enhanced) {
- textBlock = new BodyEnhanced2(strings, FontParam.NOTE, spriteContainer, HorizontalAlignment.LEFT, font);
+ textBlock = new BodyEnhanced2(strings, FontParam.NOTE, spriteContainer, horizontalAlignment, font,
+ maxMessageSize);
} else {
textBlock = strings.create(font, horizontalAlignment, spriteContainer, maxMessageSize, CreoleMode.FULL,
fontForStereotype, htmlColorForStereotype);
diff --git a/src/net/sourceforge/plantuml/skin/StickMan.java b/src/net/sourceforge/plantuml/skin/StickMan.java
index 3cb3e0e..08895ed 100644
--- a/src/net/sourceforge/plantuml/skin/StickMan.java
+++ b/src/net/sourceforge/plantuml/skin/StickMan.java
@@ -43,6 +43,7 @@ import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.SymbolContext;
import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPath;
@@ -65,7 +66,8 @@ public class StickMan extends AbstractTextBlock implements TextBlock {
}
private StickMan(HtmlColor backgroundColor, HtmlColor foregroundColor, double deltaShadow) {
- this(new SymbolContext(backgroundColor, foregroundColor).withDeltaShadow(deltaShadow).withStroke(new UStroke(2)));
+ this(new SymbolContext(backgroundColor, foregroundColor).withDeltaShadow(deltaShadow)
+ .withStroke(new UStroke(2)));
}
public StickMan(HtmlColor backgroundColor, HtmlColor foregroundColor) {
@@ -73,12 +75,12 @@ public class StickMan extends AbstractTextBlock implements TextBlock {
}
public void drawU(UGraphic ug) {
-
+
final double startX = Math.max(armsLenght, legsX) - headDiam / 2.0 + thickness();
-
+
final UEllipse head = new UEllipse(headDiam, headDiam);
final double centerX = startX + headDiam / 2;
-
+
final UPath path = new UPath();
path.moveTo(0, 0);
path.lineTo(0, bodyLenght);
@@ -92,10 +94,10 @@ public class StickMan extends AbstractTextBlock implements TextBlock {
head.setDeltaShadow(symbolContext.getDeltaShadow());
path.setDeltaShadow(symbolContext.getDeltaShadow());
}
-
+
ug = symbolContext.apply(ug);
ug.apply(new UTranslate(startX, thickness())).draw(head);
- ug.apply(new UTranslate(centerX, headDiam + thickness())).draw(path);
+ ug.apply(new UTranslate(centerX, headDiam + thickness())).apply(new UChangeBackColor(null)).draw(path);
}
private double thickness() {
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseArrow.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseArrow.java
index f32ed66..d3370a7 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseArrow.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseArrow.java
@@ -65,14 +65,17 @@ public class ComponentRoseArrow extends AbstractComponentRoseArrow {
private final HorizontalAlignment messagePosition;
private final boolean niceArrow;
+ private final boolean belowForResponse;
public ComponentRoseArrow(HtmlColor foregroundColor, FontConfiguration font, Display stringsToDisplay,
ArrowConfiguration arrowConfiguration, HorizontalAlignment messagePosition, ISkinSimple spriteContainer,
- HorizontalAlignment textHorizontalAlignment, LineBreakStrategy maxMessageSize, boolean niceArrow) {
+ HorizontalAlignment textHorizontalAlignment, LineBreakStrategy maxMessageSize, boolean niceArrow,
+ boolean belowForResponse) {
super(foregroundColor, font, stringsToDisplay, arrowConfiguration, spriteContainer, textHorizontalAlignment,
maxMessageSize);
this.messagePosition = messagePosition;
this.niceArrow = niceArrow;
+ this.belowForResponse = belowForResponse;
}
public static final double spaceCrossX = 6;
@@ -86,7 +89,6 @@ public class ComponentRoseArrow extends AbstractComponentRoseArrow {
}
final Dimension2D dimensionToUse = area.getDimensionToUse();
final StringBounder stringBounder = ug.getStringBounder();
- final int textHeight = (int) getTextHeight(stringBounder);
ug = ug.apply(new UChangeColor(getForegroundColor()));
final ArrowDressing dressing1 = getArrowConfiguration().getDressing1();
@@ -115,9 +117,6 @@ public class ComponentRoseArrow extends AbstractComponentRoseArrow {
len -= diamCircle + thinCircle;
}
- drawDressing1(ug, pos1, dressing1, getArrowConfiguration().getDecoration1());
- drawDressing2(ug, pos2, dressing2, getArrowConfiguration().getDecoration2());
-
if (dressing2.getPart() == ArrowPart.FULL && dressing2.getHead() == ArrowHead.NORMAL) {
len -= getArrowDeltaX() / 2;
}
@@ -134,7 +133,19 @@ public class ComponentRoseArrow extends AbstractComponentRoseArrow {
len -= 2 * spaceCrossX;
}
- getArrowConfiguration().applyStroke(ug).apply(new UTranslate(start, textHeight)).draw(new ULine(len, 0));
+ final double posArrow;
+ final double yText;
+ if (belowForResponse && getDirection2() == ArrowDirection.RIGHT_TO_LEFT_REVERSE) {
+ posArrow = 0;
+ yText = getMarginY();
+ } else {
+ posArrow = getTextHeight(stringBounder);
+ yText = 0;
+ }
+
+ drawDressing1(ug.apply(new UTranslate(0, posArrow)), pos1, dressing1, getArrowConfiguration().getDecoration1());
+ drawDressing2(ug.apply(new UTranslate(0, posArrow)), pos2, dressing2, getArrowConfiguration().getDecoration2());
+ getArrowConfiguration().applyStroke(ug).apply(new UTranslate(start, posArrow)).draw(new ULine(len, 0));
final ArrowDirection direction2 = getDirection2();
final double textPos;
@@ -150,120 +161,118 @@ public class ComponentRoseArrow extends AbstractComponentRoseArrow {
+ (direction2 == ArrowDirection.RIGHT_TO_LEFT_REVERSE
|| direction2 == ArrowDirection.BOTH_DIRECTION ? getArrowDeltaX() : 0);
}
- getTextBlock().drawU(ug.apply(new UTranslate(textPos, 0)));
+ getTextBlock().drawU(ug.apply(new UTranslate(textPos, yText)));
}
private void drawDressing1(UGraphic ug, double x, ArrowDressing dressing, ArrowDecoration decoration) {
- final StringBounder stringBounder = ug.getStringBounder();
- final int textHeight = (int) getTextHeight(stringBounder);
if (decoration == ArrowDecoration.CIRCLE) {
final UEllipse circle = new UEllipse(diamCircle, diamCircle);
- ug.apply(new UStroke(thinCircle))
- .apply(new UChangeColor(getForegroundColor()))
- .apply(new UTranslate(x - diamCircle / 2 - thinCircle, textHeight - diamCircle / 2 - thinCircle / 2))
+ ug.apply(new UStroke(thinCircle)).apply(new UChangeColor(getForegroundColor()))
+ .apply(new UTranslate(x - diamCircle / 2 - thinCircle, -diamCircle / 2 - thinCircle / 2))
.draw(circle);
x += diamCircle / 2 + thinCircle;
}
if (dressing.getHead() == ArrowHead.ASYNC) {
if (dressing.getPart() != ArrowPart.BOTTOM_PART) {
- getArrowConfiguration().applyThicknessOnly(ug).apply(new UTranslate(x - 1, textHeight)).draw(new ULine(getArrowDeltaX(), -getArrowDeltaY()));
+ getArrowConfiguration().applyThicknessOnly(ug).apply(new UTranslate(x - 1, 0))
+ .draw(new ULine(getArrowDeltaX(), -getArrowDeltaY()));
}
if (dressing.getPart() != ArrowPart.TOP_PART) {
- getArrowConfiguration().applyThicknessOnly(ug).apply(new UTranslate(x - 1, textHeight)).draw(new ULine(getArrowDeltaX(), getArrowDeltaY()));
+ getArrowConfiguration().applyThicknessOnly(ug).apply(new UTranslate(x - 1, 0))
+ .draw(new ULine(getArrowDeltaX(), getArrowDeltaY()));
}
} else if (dressing.getHead() == ArrowHead.CROSSX) {
ug = ug.apply(new UStroke(2));
- ug.apply(new UTranslate(spaceCrossX, textHeight - getArrowDeltaX() / 2)).draw(
+ ug.apply(new UTranslate(spaceCrossX, -getArrowDeltaX() / 2)).draw(
new ULine(getArrowDeltaX(), getArrowDeltaX()));
- ug.apply(new UTranslate(spaceCrossX, textHeight + getArrowDeltaX() / 2)).draw(
+ ug.apply(new UTranslate(spaceCrossX, getArrowDeltaX() / 2)).draw(
new ULine(getArrowDeltaX(), -getArrowDeltaX()));
} else if (dressing.getHead() == ArrowHead.NORMAL) {
- final UPolygon polygon = getPolygonReverse(dressing.getPart(), textHeight);
+ final UPolygon polygon = getPolygonReverse(dressing.getPart());
ug.apply(new UChangeBackColor(getForegroundColor())).apply(new UTranslate(x, 0)).draw(polygon);
}
}
private void drawDressing2(UGraphic ug, double x, ArrowDressing dressing, ArrowDecoration decoration) {
- final StringBounder stringBounder = ug.getStringBounder();
- final int textHeight = (int) getTextHeight(stringBounder);
if (decoration == ArrowDecoration.CIRCLE) {
ug = ug.apply(new UStroke(thinCircle)).apply(new UChangeColor(getForegroundColor()));
final UEllipse circle = new UEllipse(diamCircle, diamCircle);
- ug.apply(new UTranslate(x - diamCircle / 2 + thinCircle, textHeight - diamCircle / 2 - thinCircle / 2))
- .draw(circle);
+ ug.apply(new UTranslate(x - diamCircle / 2 + thinCircle, -diamCircle / 2 - thinCircle / 2)).draw(circle);
ug = ug.apply(new UStroke());
x -= diamCircle / 2 + thinCircle;
}
if (dressing.getHead() == ArrowHead.ASYNC) {
if (dressing.getPart() != ArrowPart.BOTTOM_PART) {
- getArrowConfiguration().applyThicknessOnly(ug).apply(new UTranslate(x, textHeight)).draw(new ULine(-getArrowDeltaX(), -getArrowDeltaY()));
+ getArrowConfiguration().applyThicknessOnly(ug).apply(new UTranslate(x, 0))
+ .draw(new ULine(-getArrowDeltaX(), -getArrowDeltaY()));
}
if (dressing.getPart() != ArrowPart.TOP_PART) {
- getArrowConfiguration().applyThicknessOnly(ug).apply(new UTranslate(x, textHeight)).draw(new ULine(-getArrowDeltaX(), getArrowDeltaY()));
+ getArrowConfiguration().applyThicknessOnly(ug).apply(new UTranslate(x, 0))
+ .draw(new ULine(-getArrowDeltaX(), getArrowDeltaY()));
}
} else if (dressing.getHead() == ArrowHead.CROSSX) {
ug = ug.apply(new UStroke(2));
- ug.apply(new UTranslate(x - spaceCrossX - getArrowDeltaX(), textHeight - getArrowDeltaX() / 2)).draw(
+ ug.apply(new UTranslate(x - spaceCrossX - getArrowDeltaX(), -getArrowDeltaX() / 2)).draw(
new ULine(getArrowDeltaX(), getArrowDeltaX()));
- ug.apply(new UTranslate(x - spaceCrossX - getArrowDeltaX(), textHeight + getArrowDeltaX() / 2)).draw(
+ ug.apply(new UTranslate(x - spaceCrossX - getArrowDeltaX(), getArrowDeltaX() / 2)).draw(
new ULine(getArrowDeltaX(), -getArrowDeltaX()));
ug = ug.apply(new UStroke());
} else if (dressing.getHead() == ArrowHead.NORMAL) {
- final UPolygon polygon = getPolygonNormal(dressing.getPart(), textHeight, x);
+ final UPolygon polygon = getPolygonNormal(dressing.getPart(), x);
ug.apply(new UChangeBackColor(getForegroundColor())).draw(polygon);
}
}
- private UPolygon getPolygonNormal(ArrowPart part, final int textHeight, final double x2) {
+ private UPolygon getPolygonNormal(ArrowPart part, final double x2) {
final UPolygon polygon = new UPolygon();
if (part == ArrowPart.TOP_PART) {
- polygon.addPoint(x2 - getArrowDeltaX(), textHeight - getArrowDeltaY());
- polygon.addPoint(x2, textHeight);
- polygon.addPoint(x2 - getArrowDeltaX(), textHeight);
+ polygon.addPoint(x2 - getArrowDeltaX(), -getArrowDeltaY());
+ polygon.addPoint(x2, 0);
+ polygon.addPoint(x2 - getArrowDeltaX(), 0);
} else if (part == ArrowPart.BOTTOM_PART) {
- polygon.addPoint(x2 - getArrowDeltaX(), textHeight + 1);
- polygon.addPoint(x2, textHeight + 1);
- polygon.addPoint(x2 - getArrowDeltaX(), textHeight + getArrowDeltaY() + 1);
+ polygon.addPoint(x2 - getArrowDeltaX(), 1);
+ polygon.addPoint(x2, 1);
+ polygon.addPoint(x2 - getArrowDeltaX(), getArrowDeltaY() + 1);
} else {
- polygon.addPoint(x2 - getArrowDeltaX(), textHeight - getArrowDeltaY());
- polygon.addPoint(x2, textHeight);
- polygon.addPoint(x2 - getArrowDeltaX(), textHeight + getArrowDeltaY());
+ polygon.addPoint(x2 - getArrowDeltaX(), -getArrowDeltaY());
+ polygon.addPoint(x2, 0);
+ polygon.addPoint(x2 - getArrowDeltaX(), +getArrowDeltaY());
if (niceArrow) {
- polygon.addPoint(x2 - getArrowDeltaX() + 4, textHeight);
+ polygon.addPoint(x2 - getArrowDeltaX() + 4, 0);
}
}
return polygon;
}
- private UPolygon getPolygonReverse(ArrowPart part, final int textHeight) {
+ private UPolygon getPolygonReverse(ArrowPart part) {
final UPolygon polygon = new UPolygon();
if (part == ArrowPart.TOP_PART) {
- polygon.addPoint(getArrowDeltaX(), textHeight - getArrowDeltaY());
- polygon.addPoint(0, textHeight);
- polygon.addPoint(getArrowDeltaX(), textHeight);
+ polygon.addPoint(getArrowDeltaX(), -getArrowDeltaY());
+ polygon.addPoint(0, 0);
+ polygon.addPoint(getArrowDeltaX(), 0);
} else if (part == ArrowPart.BOTTOM_PART) {
- polygon.addPoint(getArrowDeltaX(), textHeight + 1);
- polygon.addPoint(0, textHeight + 1);
- polygon.addPoint(getArrowDeltaX(), textHeight + getArrowDeltaY() + 1);
+ polygon.addPoint(getArrowDeltaX(), 1);
+ polygon.addPoint(0, 1);
+ polygon.addPoint(getArrowDeltaX(), getArrowDeltaY() + 1);
} else {
- polygon.addPoint(getArrowDeltaX(), textHeight - getArrowDeltaY());
- polygon.addPoint(0, textHeight);
- polygon.addPoint(getArrowDeltaX(), textHeight + getArrowDeltaY());
+ polygon.addPoint(getArrowDeltaX(), -getArrowDeltaY());
+ polygon.addPoint(0, 0);
+ polygon.addPoint(getArrowDeltaX(), getArrowDeltaY());
if (niceArrow) {
- polygon.addPoint(getArrowDeltaX() - 4, textHeight);
+ polygon.addPoint(getArrowDeltaX() - 4, 0);
}
}
return polygon;
}
public Point2D getStartPoint(StringBounder stringBounder, Dimension2D dimensionToUse) {
- final int textHeight = (int) getTextHeight(stringBounder);
+ final double textHeight = getTextHeight(stringBounder);
if (getDirection2() == ArrowDirection.LEFT_TO_RIGHT_NORMAL) {
return new Point2D.Double(getPaddingX(), textHeight + getPaddingY());
}
@@ -271,7 +280,7 @@ public class ComponentRoseArrow extends AbstractComponentRoseArrow {
}
public Point2D getEndPoint(StringBounder stringBounder, Dimension2D dimensionToUse) {
- final int textHeight = (int) getTextHeight(stringBounder);
+ final double textHeight = getTextHeight(stringBounder);
if (getDirection2() == ArrowDirection.LEFT_TO_RIGHT_NORMAL) {
return new Point2D.Double(dimensionToUse.getWidth() + getPaddingX(), textHeight + getPaddingY());
}
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseEnglober.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseEnglober.java
index 5eb76be..280da21 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseEnglober.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseEnglober.java
@@ -53,17 +53,21 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
public class ComponentRoseEnglober extends AbstractTextualComponent {
private final SymbolContext symbolContext;
+ private final double roundCorner;
- public ComponentRoseEnglober(SymbolContext symbolContext, Display strings, FontConfiguration font, ISkinSimple spriteContainer) {
- super(LineBreakStrategy.NONE, strings, font, HorizontalAlignment.CENTER, 3, 3, 1, spriteContainer, false, null, null);
+ public ComponentRoseEnglober(SymbolContext symbolContext, Display strings, FontConfiguration font,
+ ISkinSimple spriteContainer, double roundCorner) {
+ super(LineBreakStrategy.NONE, strings, font, HorizontalAlignment.CENTER, 3, 3, 1, spriteContainer, false, null,
+ null);
+ this.roundCorner = roundCorner;
this.symbolContext = symbolContext;
}
@Override
protected void drawBackgroundInternalU(UGraphic ug, Area area) {
final Dimension2D dimensionToUse = area.getDimensionToUse();
- ug = symbolContext.apply(ug);
- ug.draw(new URectangle(dimensionToUse.getWidth(), dimensionToUse.getHeight()));
+ ug = symbolContext.transparentBackColorToNull().apply(ug);
+ ug.draw(new URectangle(dimensionToUse.getWidth(), dimensionToUse.getHeight(), roundCorner, roundCorner));
final double xpos = (dimensionToUse.getWidth() - getPureTextWidth(ug.getStringBounder())) / 2;
getTextBlock().drawU(ug.apply(new UTranslate(xpos, 0)));
}
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingHeader.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingHeader.java
index a39546f..9fcba7f 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingHeader.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingHeader.java
@@ -52,7 +52,7 @@ 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.UPolygon;
+import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
@@ -66,12 +66,14 @@ public class ComponentRoseGroupingHeader extends AbstractTextualComponent {
private final HtmlColor background;
private final SymbolContext symbolContext;
+ private final double roundCorner;
public ComponentRoseGroupingHeader(HtmlColor background, SymbolContext symbolContext, FontConfiguration bigFont,
- FontConfiguration smallFont2, Display strings, ISkinSimple spriteContainer) {
+ FontConfiguration smallFont2, Display strings, ISkinSimple spriteContainer, double roundCorner) {
super(LineBreakStrategy.NONE, strings.get(0), bigFont, HorizontalAlignment.LEFT, 15, 30, 1, spriteContainer,
null, null);
+ this.roundCorner = roundCorner;
this.symbolContext = symbolContext;
this.background = background;
if (strings.size() == 1 || strings.get(1) == null) {
@@ -126,7 +128,8 @@ public class ComponentRoseGroupingHeader extends AbstractTextualComponent {
}
final Dimension2D dimensionToUse = area.getDimensionToUse();
ug = symbolContext.applyStroke(ug).apply(new UChangeColor(symbolContext.getForeColor()));
- final URectangle rect = new URectangle(dimensionToUse.getWidth(), dimensionToUse.getHeight());
+ final URectangle rect = new URectangle(dimensionToUse.getWidth(), dimensionToUse.getHeight(), roundCorner,
+ roundCorner);
rect.setDeltaShadow(symbolContext.getDeltaShadow());
ug.apply(new UChangeBackColor(background)).draw(rect);
}
@@ -134,25 +137,16 @@ public class ComponentRoseGroupingHeader extends AbstractTextualComponent {
@Override
protected void drawInternalU(UGraphic ug, Area area) {
final Dimension2D dimensionToUse = area.getDimensionToUse();
- ug = symbolContext.applyStroke(ug).apply(new UChangeColor(symbolContext.getForeColor()));
- final URectangle rect = new URectangle(dimensionToUse.getWidth(), dimensionToUse.getHeight());
- ug.draw(rect);
-
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);
+ symbolContext.applyColors(ug).draw(getCorner(textWidth, textHeight));
- polygon.addPoint(0, textHeight);
- polygon.addPoint(0, 0);
-
- symbolContext.applyColors(ug).draw(polygon);
+ ug = symbolContext.applyStroke(ug).apply(new UChangeColor(symbolContext.getForeColor()));
+ final URectangle rect = new URectangle(dimensionToUse.getWidth(), dimensionToUse.getHeight(), roundCorner,
+ roundCorner);
+ ug.draw(rect);
ug = ug.apply(new UStroke());
@@ -166,4 +160,28 @@ public class ComponentRoseGroupingHeader extends AbstractTextualComponent {
}
}
+ private UPath getCorner(final double width, final double height) {
+ final UPath polygon = new UPath();
+ if (roundCorner == 0) {
+ polygon.moveTo(0, 0);
+ polygon.lineTo(width, 0);
+
+ polygon.lineTo(width, height - cornersize);
+ polygon.lineTo(width - cornersize, height);
+
+ polygon.lineTo(0, height);
+ polygon.lineTo(0, 0);
+ } else {
+ polygon.moveTo(roundCorner / 2, 0);
+ polygon.lineTo(width, 0);
+
+ polygon.lineTo(width, height - cornersize);
+ polygon.lineTo(width - cornersize, height);
+
+ polygon.lineTo(0, height);
+ polygon.lineTo(0, roundCorner / 2);
+ }
+ return polygon;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseNote.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseNote.java
index 0d26e81..f9bf9f4 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseNote.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseNote.java
@@ -45,23 +45,25 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.SymbolContext;
import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.Area;
+import net.sourceforge.plantuml.svek.image.Opale;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UGraphicStencil;
-import net.sourceforge.plantuml.ugraphic.ULine;
-import net.sourceforge.plantuml.ugraphic.UPolygon;
+import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
final public class ComponentRoseNote extends AbstractTextualComponent implements Stencil {
- private final int cornersize = 10;
private final double paddingX;
private final double paddingY;
private final SymbolContext symbolContext;
+ private final double roundCorner;
- public ComponentRoseNote(SymbolContext symbolContext, FontConfiguration font, Display strings, double paddingX, double paddingY,
- ISkinSimple spriteContainer) {
- super(LineBreakStrategy.NONE, strings, font, HorizontalAlignment.LEFT, 6, 15, 5, spriteContainer, true, null, null);
+ public ComponentRoseNote(SymbolContext symbolContext, FontConfiguration font, Display strings, double paddingX,
+ double paddingY, ISkinSimple spriteContainer, double roundCorner, HorizontalAlignment horizontalAlignment) {
+ super(LineBreakStrategy.NONE, strings, font, horizontalAlignment,
+ horizontalAlignment == HorizontalAlignment.CENTER ? 15 : 6, 15, 5, spriteContainer, true, null, null);
+ this.roundCorner = roundCorner;
this.paddingX = paddingX;
this.paddingY = paddingY;
this.symbolContext = symbolContext;
@@ -103,20 +105,13 @@ final public class ComponentRoseNote extends AbstractTextualComponent implements
x2 = (int) (area.getDimensionToUse().getWidth() - 2 * getPaddingX());
}
- final UPolygon polygon = new UPolygon();
- polygon.addPoint(0, 0);
- polygon.addPoint(0, textHeight);
- polygon.addPoint(x2, textHeight);
- polygon.addPoint(x2, cornersize);
- polygon.addPoint(x2 - cornersize, 0);
- polygon.addPoint(0, 0);
+ final UPath polygon = Opale.getPolygonNormal(x2, textHeight, roundCorner);
polygon.setDeltaShadow(symbolContext.getDeltaShadow());
ug = symbolContext.apply(ug);
ug.draw(polygon);
- ug.apply(new UTranslate(x2 - cornersize, 0)).draw(new ULine(0, cornersize));
- ug.apply(new UTranslate(x2, cornersize)).draw(new ULine(-cornersize, 0));
+ ug.draw(Opale.getCorner(x2, roundCorner));
UGraphic ug2 = UGraphicStencil.create(ug, this, new UStroke());
ug2 = ug2.apply(new UTranslate(getMarginX1() + diffX / 2, getMarginY()));
diff --git a/src/net/sourceforge/plantuml/skin/rose/Rose.java b/src/net/sourceforge/plantuml/skin/rose/Rose.java
index d5e2ec0..784aa18 100644
--- a/src/net/sourceforge/plantuml/skin/rose/Rose.java
+++ b/src/net/sourceforge/plantuml/skin/rose/Rose.java
@@ -35,12 +35,13 @@
*/
package net.sourceforge.plantuml.skin.rose;
-import net.sourceforge.plantuml.AlignParam;
+import net.sourceforge.plantuml.AlignmentParam;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineParam;
import net.sourceforge.plantuml.PaddingParam;
+import net.sourceforge.plantuml.CornerParam;
import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
@@ -99,37 +100,34 @@ public class Rose implements Skin {
config, param, param.maxMessageSize(), param.strictUmlStyle() == false);
}
final HorizontalAlignment messageHorizontalAlignment = param.getHorizontalAlignment(
- AlignParam.SEQUENCE_MESSAGE_ALIGN, config.getArrowDirection());
+ AlignmentParam.sequenceMessageAlignment, config.getArrowDirection());
final HorizontalAlignment textHorizontalAlignment = param.getHorizontalAlignment(
- AlignParam.SEQUENCE_MESSAGETEXT_ALIGN, config.getArrowDirection());
+ AlignmentParam.sequenceMessageTextAlignment, config.getArrowDirection());
return new ComponentRoseArrow(sequenceArrow, getUFont2(param, FontParam.ARROW), stringsToDisplay, config,
messageHorizontalAlignment, param, textHorizontalAlignment, param.maxMessageSize(),
- param.strictUmlStyle() == false);
+ param.strictUmlStyle() == false, param.responseMessageBelowArrow());
}
final double padding = param.getPadding(PaddingParam.PARTICIPANT);
+ final double roundCorner = param.getRoundCorner(CornerParam.DEFAULT, null);
if (type == ComponentType.PARTICIPANT_HEAD) {
return new ComponentRoseParticipant(getSymbolContext(param, ColorParam.participantBorder), getUFont2(param,
- FontParam.PARTICIPANT), stringsToDisplay, param, param.getRoundCorner("", null),
- newFontForStereotype, getFontColor(param, FontParam.SEQUENCE_STEREOTYPE), param.minClassWidth(),
- false, padding);
+ FontParam.PARTICIPANT), stringsToDisplay, param, roundCorner, newFontForStereotype, getFontColor(
+ param, FontParam.SEQUENCE_STEREOTYPE), param.minClassWidth(), false, padding);
}
if (type == ComponentType.PARTICIPANT_TAIL) {
return new ComponentRoseParticipant(getSymbolContext(param, ColorParam.participantBorder), getUFont2(param,
- FontParam.PARTICIPANT), stringsToDisplay, param, param.getRoundCorner("", null),
- newFontForStereotype, getFontColor(param, FontParam.SEQUENCE_STEREOTYPE), param.minClassWidth(),
- false, padding);
+ FontParam.PARTICIPANT), stringsToDisplay, param, roundCorner, newFontForStereotype, getFontColor(
+ param, FontParam.SEQUENCE_STEREOTYPE), param.minClassWidth(), false, padding);
}
if (type == ComponentType.COLLECTIONS_HEAD) {
- return new ComponentRoseParticipant(getSymbolContext(param, ColorParam.participantBorder), getUFont2(param,
- FontParam.PARTICIPANT), stringsToDisplay, param, param.getRoundCorner("", null),
- newFontForStereotype, getFontColor(param, FontParam.SEQUENCE_STEREOTYPE), param.minClassWidth(),
- true, padding);
+ return new ComponentRoseParticipant(getSymbolContext(param, ColorParam.collectionsBorder), getUFont2(param,
+ FontParam.PARTICIPANT), stringsToDisplay, param, roundCorner, newFontForStereotype, getFontColor(
+ param, FontParam.SEQUENCE_STEREOTYPE), param.minClassWidth(), true, padding);
}
if (type == ComponentType.COLLECTIONS_TAIL) {
- return new ComponentRoseParticipant(getSymbolContext(param, ColorParam.participantBorder), getUFont2(param,
- FontParam.PARTICIPANT), stringsToDisplay, param, param.getRoundCorner("", null),
- newFontForStereotype, getFontColor(param, FontParam.SEQUENCE_STEREOTYPE), param.minClassWidth(),
- true, padding);
+ return new ComponentRoseParticipant(getSymbolContext(param, ColorParam.collectionsBorder), getUFont2(param,
+ FontParam.PARTICIPANT), stringsToDisplay, param, roundCorner, newFontForStereotype, getFontColor(
+ param, FontParam.SEQUENCE_STEREOTYPE), param.minClassWidth(), true, padding);
}
if (type == ComponentType.PARTICIPANT_LINE) {
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
@@ -151,57 +149,58 @@ public class Rose implements Skin {
}
if (type == ComponentType.BOUNDARY_HEAD) {
return new ComponentRoseBoundary(getSymbolContext(param, ColorParam.boundaryBorder), getUFont2(param,
- FontParam.ACTOR), stringsToDisplay, true, param, newFontForStereotype, getFontColor(param,
- FontParam.SEQUENCE_STEREOTYPE));
+ FontParam.BOUNDARY), stringsToDisplay, true, param, newFontForStereotype, getFontColor(param,
+ FontParam.BOUNDARY_STEREOTYPE));
}
if (type == ComponentType.BOUNDARY_TAIL) {
return new ComponentRoseBoundary(getSymbolContext(param, ColorParam.boundaryBorder), getUFont2(param,
- FontParam.ACTOR), stringsToDisplay, false, param, newFontForStereotype, getFontColor(param,
- FontParam.SEQUENCE_STEREOTYPE));
+ FontParam.BOUNDARY), stringsToDisplay, false, param, newFontForStereotype, getFontColor(param,
+ FontParam.BOUNDARY_STEREOTYPE));
}
if (type == ComponentType.CONTROL_HEAD) {
return new ComponentRoseControl(getSymbolContext(param, ColorParam.controlBorder), getUFont2(param,
- FontParam.ACTOR), stringsToDisplay, true, param, newFontForStereotype, getFontColor(param,
- FontParam.SEQUENCE_STEREOTYPE));
+ FontParam.CONTROL), stringsToDisplay, true, param, newFontForStereotype, getFontColor(param,
+ FontParam.CONTROL_STEREOTYPE));
}
if (type == ComponentType.CONTROL_TAIL) {
return new ComponentRoseControl(getSymbolContext(param, ColorParam.controlBorder), getUFont2(param,
- FontParam.ACTOR), stringsToDisplay, false, param, newFontForStereotype, getFontColor(param,
- FontParam.SEQUENCE_STEREOTYPE));
+ FontParam.CONTROL), stringsToDisplay, false, param, newFontForStereotype, getFontColor(param,
+ FontParam.CONTROL_STEREOTYPE));
}
if (type == ComponentType.ENTITY_HEAD) {
return new ComponentRoseEntity(getSymbolContext(param, ColorParam.entityBorder), getUFont2(param,
- FontParam.ACTOR), stringsToDisplay, true, param, newFontForStereotype, getFontColor(param,
- FontParam.SEQUENCE_STEREOTYPE));
+ FontParam.ENTITY), stringsToDisplay, true, param, newFontForStereotype, getFontColor(param,
+ FontParam.ENTITY_STEREOTYPE));
}
if (type == ComponentType.ENTITY_TAIL) {
return new ComponentRoseEntity(getSymbolContext(param, ColorParam.entityBorder), getUFont2(param,
- FontParam.ACTOR), stringsToDisplay, false, param, newFontForStereotype, getFontColor(param,
- FontParam.SEQUENCE_STEREOTYPE));
+ FontParam.ENTITY), stringsToDisplay, false, param, newFontForStereotype, getFontColor(param,
+ FontParam.ENTITY_STEREOTYPE));
}
if (type == ComponentType.QUEUE_HEAD) {
return new ComponentRoseQueue(getSymbolContext(param, ColorParam.entityBorder), getUFont2(param,
- FontParam.ACTOR), stringsToDisplay, true, param, newFontForStereotype, getFontColor(param,
- FontParam.SEQUENCE_STEREOTYPE));
+ FontParam.QUEUE), stringsToDisplay, true, param, newFontForStereotype, getFontColor(param,
+ FontParam.QUEUE_STEREOTYPE));
}
if (type == ComponentType.QUEUE_TAIL) {
return new ComponentRoseQueue(getSymbolContext(param, ColorParam.entityBorder), getUFont2(param,
- FontParam.ACTOR), stringsToDisplay, false, param, newFontForStereotype, getFontColor(param,
- FontParam.SEQUENCE_STEREOTYPE));
+ FontParam.QUEUE), stringsToDisplay, false, param, newFontForStereotype, getFontColor(param,
+ FontParam.QUEUE_STEREOTYPE));
}
if (type == ComponentType.DATABASE_HEAD) {
return new ComponentRoseDatabase(getSymbolContext(param, ColorParam.databaseBorder), getUFont2(param,
- FontParam.ACTOR), stringsToDisplay, true, param, newFontForStereotype, getFontColor(param,
- FontParam.SEQUENCE_STEREOTYPE));
+ FontParam.DATABASE), stringsToDisplay, true, param, newFontForStereotype, getFontColor(param,
+ FontParam.DATABASE_STEREOTYPE));
}
if (type == ComponentType.DATABASE_TAIL) {
return new ComponentRoseDatabase(getSymbolContext(param, ColorParam.databaseBorder), getUFont2(param,
- FontParam.ACTOR), stringsToDisplay, false, param, newFontForStereotype, getFontColor(param,
- FontParam.SEQUENCE_STEREOTYPE));
+ FontParam.DATABASE), stringsToDisplay, false, param, newFontForStereotype, getFontColor(param,
+ FontParam.DATABASE_STEREOTYPE));
}
if (type == ComponentType.NOTE) {
+ final HorizontalAlignment alignment = param.getHorizontalAlignment(AlignmentParam.noteTextAlignment, null);
return new ComponentRoseNote(getSymbolContext(param, ColorParam.noteBorder), getUFont2(param,
- FontParam.NOTE), stringsToDisplay, paddingX, paddingY, param);
+ FontParam.NOTE), stringsToDisplay, paddingX, paddingY, param, roundCorner, alignment);
}
if (type == ComponentType.NOTE_HEXAGONAL) {
return new ComponentRoseNoteHexagonal(getSymbolContext(param, ColorParam.noteBorder), getUFont2(param,
@@ -219,7 +218,7 @@ public class Rose implements Skin {
smallFont = smallFont.changeColor(smallColor);
}
return new ComponentRoseGroupingHeader(param.getBackgroundColor(), getSymbolContext(param,
- ColorParam.sequenceGroupBorder), bigFont, smallFont, stringsToDisplay, param);
+ ColorParam.sequenceGroupBorder), bigFont, smallFont, stringsToDisplay, param, roundCorner);
}
if (type == ComponentType.GROUPING_ELSE) {
return new ComponentRoseGroupingElse(getHtmlColor(param, ColorParam.sequenceGroupBorder), getUFont2(param,
@@ -260,7 +259,7 @@ public class Rose implements Skin {
if (type == ComponentType.REFERENCE) {
return new ComponentRoseReference(getUFont2(param, FontParam.SEQUENCE_REFERENCE), getSymbolContext(param,
ColorParam.sequenceReferenceBorder), bigFont, stringsToDisplay, param.getHorizontalAlignment(
- AlignParam.SEQUENCE_REFERENCE_ALIGN, null), param, getHtmlColor(param,
+ AlignmentParam.sequenceReferenceAlignment, null), param, getHtmlColor(param,
ColorParam.sequenceReferenceBackground));
}
// if (type == ComponentType.TITLE) {
@@ -273,7 +272,7 @@ public class Rose implements Skin {
// }
if (type == ComponentType.ENGLOBER) {
return new ComponentRoseEnglober(getSymbolContext(param, ColorParam.sequenceBoxBorder), stringsToDisplay,
- getUFont2(param, FontParam.SEQUENCE_BOX), param);
+ getUFont2(param, FontParam.SEQUENCE_BOX), param, roundCorner);
}
return null;
@@ -304,6 +303,11 @@ public class Rose implements Skin {
ColorParam.controlBorder)).withStroke(getStroke(param, LineParam.sequenceActorBorder, 2))
.withDeltaShadow(deltaShadow(param));
}
+ if (color == ColorParam.collectionsBorder) {
+ return new SymbolContext(getHtmlColor(param, ColorParam.collectionsBackground), getHtmlColor(param,
+ ColorParam.collectionsBorder)).withStroke(getStroke(param, LineParam.sequenceActorBorder, 1.5))
+ .withDeltaShadow(deltaShadow(param));
+ }
if (color == ColorParam.entityBorder) {
return new SymbolContext(getHtmlColor(param, ColorParam.entityBackground), getHtmlColor(param,
ColorParam.entityBorder)).withStroke(getStroke(param, LineParam.sequenceActorBorder, 2))
diff --git a/src/net/sourceforge/plantuml/statediagram/StateDiagram.java b/src/net/sourceforge/plantuml/statediagram/StateDiagram.java
index dd7d4f0..3c673bd 100644
--- a/src/net/sourceforge/plantuml/statediagram/StateDiagram.java
+++ b/src/net/sourceforge/plantuml/statediagram/StateDiagram.java
@@ -45,6 +45,7 @@ import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.IGroup;
import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Link;
+import net.sourceforge.plantuml.cucadiagram.NamespaceStrategy;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.utils.UniqueSequence;
@@ -110,8 +111,9 @@ public class StateDiagram extends AbstractEntityDiagram {
}
public IEntity getHistorical(Code codeGroup) {
- final IEntity g = getOrCreateGroup(codeGroup, Display.getWithNewlines(codeGroup), GroupType.STATE,
- getRootGroup());
+ gotoGroup2(codeGroup, Display.getWithNewlines(codeGroup), GroupType.STATE, getRootGroup(),
+ NamespaceStrategy.SINGLE);
+ final IEntity g = getCurrentGroup();
final IEntity result = getOrCreateLeaf(Code.of("*historical*" + g.getCode().getFullName()),
LeafType.PSEUDO_STATE, null);
endGroup();
@@ -125,13 +127,14 @@ public class StateDiagram extends AbstractEntityDiagram {
super.endGroup();
}
getCurrentGroup().setConcurrentSeparator(direction);
- final IGroup conc1 = getOrCreateGroup(UniqueSequence.getCode(CONCURRENT_PREFIX), Display.create(""),
- GroupType.CONCURRENT_STATE, getCurrentGroup());
+ gotoGroup2(UniqueSequence.getCode(CONCURRENT_PREFIX), Display.create(""), GroupType.CONCURRENT_STATE,
+ getCurrentGroup(), NamespaceStrategy.SINGLE);
+ final IGroup conc1 = getCurrentGroup();
if (EntityUtils.groupRoot(cur) == false && cur.getGroupType() == GroupType.STATE) {
cur.moveEntitiesTo(conc1);
super.endGroup();
- getOrCreateGroup(UniqueSequence.getCode(CONCURRENT_PREFIX), Display.create(""), GroupType.CONCURRENT_STATE,
- getCurrentGroup());
+ gotoGroup2(UniqueSequence.getCode(CONCURRENT_PREFIX), Display.create(""), GroupType.CONCURRENT_STATE,
+ getCurrentGroup(), NamespaceStrategy.SINGLE);
}
// printlink("AFTER");
return true;
diff --git a/src/net/sourceforge/plantuml/statediagram/StateDiagramFactory.java b/src/net/sourceforge/plantuml/statediagram/StateDiagramFactory.java
index 58195ec..126fc6b 100644
--- a/src/net/sourceforge/plantuml/statediagram/StateDiagramFactory.java
+++ b/src/net/sourceforge/plantuml/statediagram/StateDiagramFactory.java
@@ -38,6 +38,8 @@ package net.sourceforge.plantuml.statediagram;
import java.util.ArrayList;
import java.util.List;
+import net.sourceforge.plantuml.classdiagram.command.CommandHideShow2;
+import net.sourceforge.plantuml.classdiagram.command.CommandRemoveRestore;
import net.sourceforge.plantuml.classdiagram.command.CommandUrl;
import net.sourceforge.plantuml.command.Command;
import net.sourceforge.plantuml.command.CommandFootboxIgnored;
@@ -68,6 +70,9 @@ public class StateDiagramFactory extends UmlDiagramFactory {
final List<Command> cmds = new ArrayList<Command>();
cmds.add(new CommandFootboxIgnored());
cmds.add(new CommandRankDir());
+ cmds.add(new CommandHideEmptyDescription());
+ cmds.add(new CommandHideShow2());
+ cmds.add(new CommandRemoveRestore());
cmds.add(new CommandCreateState());
// addCommand(new CommandLinkState());
cmds.add(new CommandLinkState());
@@ -83,8 +88,6 @@ public class StateDiagramFactory extends UmlDiagramFactory {
cmds.add(factoryNoteOnEntityCommand.createMultiLine(true));
cmds.add(factoryNoteOnEntityCommand.createMultiLine(false));
- cmds.add(new CommandHideEmptyDescription());
-
cmds.add(factoryNoteOnEntityCommand.createSingleLine());
final FactoryNoteOnLinkCommand factoryNoteOnLinkCommand = new FactoryNoteOnLinkCommand();
cmds.add(factoryNoteOnLinkCommand.createSingleLine());
diff --git a/src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackageState.java b/src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackageState.java
index 61aac25..008fd34 100644
--- a/src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackageState.java
+++ b/src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackageState.java
@@ -49,6 +49,7 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.GroupType;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.IGroup;
+import net.sourceforge.plantuml.cucadiagram.NamespaceStrategy;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.color.ColorParser;
@@ -81,12 +82,11 @@ public class CommandCreatePackageState extends SingleLineCommand2<StateDiagram>
new RegexLeaf("LINECOLOR", "(?:##(?:\\[(dotted|dashed|bold)\\])?(\\w+)?)?"), //
new RegexLeaf("(?:[%s]*\\{|[%s]+begin)$"));
}
-
+
private static ColorParser color() {
return ColorParser.simpleColor(ColorType.BACK);
}
-
private String getNotNull(RegexResult arg, String v1, String v2) {
if (arg.get(v1, 0) == null) {
return arg.get(v2, 0);
@@ -102,8 +102,9 @@ public class CommandCreatePackageState extends SingleLineCommand2<StateDiagram>
if (display == null) {
display = code.getFullName();
}
- final IEntity p = diagram.getOrCreateGroup(code, Display.getWithNewlines(display), GroupType.STATE,
- currentPackage);
+ diagram.gotoGroup2(code, Display.getWithNewlines(display), GroupType.STATE, currentPackage,
+ NamespaceStrategy.SINGLE);
+ final IEntity p = diagram.getCurrentGroup();
final String stereotype = arg.get("STEREOTYPE", 0);
if (stereotype != null) {
p.setStereotype(new Stereotype(stereotype));
@@ -114,7 +115,7 @@ public class CommandCreatePackageState extends SingleLineCommand2<StateDiagram>
final Url url = urlBuilder.getUrl(urlString);
p.addUrl(url);
}
-
+
Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
final HtmlColor lineColor = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("LINECOLOR", 1));
@@ -126,9 +127,11 @@ public class CommandCreatePackageState extends SingleLineCommand2<StateDiagram>
}
p.setColors(colors);
-// p.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
-// p.setSpecificColorTOBEREMOVED(ColorType.LINE, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("LINECOLOR", 1)));
-// p.applyStroke(arg.get("LINECOLOR", 0));
+ // p.setSpecificColorTOBEREMOVED(ColorType.BACK,
+ // diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
+ // p.setSpecificColorTOBEREMOVED(ColorType.LINE,
+ // diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("LINECOLOR", 1)));
+ // p.applyStroke(arg.get("LINECOLOR", 0));
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/statediagram/command/CommandLinkState.java b/src/net/sourceforge/plantuml/statediagram/command/CommandLinkState.java
index 85adf7d..4d535d9 100644
--- a/src/net/sourceforge/plantuml/statediagram/command/CommandLinkState.java
+++ b/src/net/sourceforge/plantuml/statediagram/command/CommandLinkState.java
@@ -37,7 +37,6 @@ package net.sourceforge.plantuml.statediagram.command;
import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.StringUtils;
-import net.sourceforge.plantuml.classdiagram.command.CommandLinkClass;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.command.regex.RegexConcat;
@@ -51,6 +50,7 @@ import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.LinkDecor;
import net.sourceforge.plantuml.cucadiagram.LinkType;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
+import net.sourceforge.plantuml.descdiagram.command.CommandLinkElement;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.statediagram.StateDiagram;
@@ -65,14 +65,12 @@ public class CommandLinkState extends SingleLineCommand2<StateDiagram> {
getStatePattern("ENT1"), //
new RegexLeaf("[%s]*"), //
new RegexConcat(
- //
+ //
new RegexLeaf("ARROW_CROSS_START", "(x)?"), //
new RegexLeaf("ARROW_BODY1", "(-+)"), //
- new RegexLeaf("ARROW_STYLE1",
- "(?:\\[((?:#\\w+|dotted|dashed|plain|bold|hidden)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden)*)\\])?"), //
+ new RegexLeaf("ARROW_STYLE1", "(?:\\[(" + CommandLinkElement.LINE_STYLE + ")\\])?"), //
new RegexLeaf("ARROW_DIRECTION", "(left|right|up|down|le?|ri?|up?|do?)?"), //
- new RegexLeaf("ARROW_STYLE2",
- "(?:\\[((?:#\\w+|dotted|dashed|plain|bold|hidden)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden)*)\\])?"), //
+ new RegexLeaf("ARROW_STYLE2", "(?:\\[(" + CommandLinkElement.LINE_STYLE + ")\\])?"), //
new RegexLeaf("ARROW_BODY2", "(-*)"), //
new RegexLeaf("\\>"), //
new RegexLeaf("ARROW_CIRCLE_END", "(o[%s]+)?")), //
@@ -109,13 +107,15 @@ public class CommandLinkState extends SingleLineCommand2<StateDiagram> {
cl1.setStereotype(new Stereotype(arg.get("ENT1", 1)));
}
if (arg.get("ENT1", 2) != null) {
- cl1.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("ENT1", 2)));
+ cl1.setSpecificColorTOBEREMOVED(ColorType.BACK,
+ diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("ENT1", 2)));
}
if (arg.get("ENT2", 1) != null) {
cl2.setStereotype(new Stereotype(arg.get("ENT2", 1)));
}
if (arg.get("ENT2", 2) != null) {
- cl2.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("ENT2", 2)));
+ cl2.setSpecificColorTOBEREMOVED(ColorType.BACK,
+ diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("ENT2", 2)));
}
String queue = arg.get("ARROW_BODY1", 0) + arg.get("ARROW_BODY2", 0);
@@ -136,7 +136,7 @@ public class CommandLinkState extends SingleLineCommand2<StateDiagram> {
if (dir == Direction.LEFT || dir == Direction.UP) {
link = link.getInv();
}
- CommandLinkClass.applyStyle(arg.getLazzy("ARROW_STYLE", 0), link);
+ link.applyStyle(arg.getLazzy("ARROW_STYLE", 0));
diagram.addLink(link);
return CommandExecutionResult.ok();
diff --git a/src/net/sourceforge/plantuml/sudoku/GraphicsSudoku.java b/src/net/sourceforge/plantuml/sudoku/GraphicsSudoku.java
index c514ad4..8f921f4 100644
--- a/src/net/sourceforge/plantuml/sudoku/GraphicsSudoku.java
+++ b/src/net/sourceforge/plantuml/sudoku/GraphicsSudoku.java
@@ -43,11 +43,15 @@ 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;
@@ -60,7 +64,10 @@ 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 {
@@ -72,8 +79,38 @@ public class GraphicsSudoku {
this.sudoku = sudoku;
}
- public ImageData writeImage(OutputStream os) throws IOException {
- final BufferedImage im = createImage();
+ 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());
}
@@ -89,17 +126,11 @@ public class GraphicsSudoku {
final private int textTotalHeight = 50;
- private BufferedImage createImage() {
- final int boldWidth = 3;
- final int sudoHeight = 9 * cellHeight + 2 * yOffset + boldWidth;
- final int sudoWidth = 9 * cellWidth + 2 * xOffset + boldWidth;
-
- final EmptyImageBuilder builder = new EmptyImageBuilder(sudoWidth, sudoHeight + textTotalHeight, Color.WHITE);
- final BufferedImage im = builder.getBufferedImage();
- final Graphics2D g3d = builder.getGraphics2D();
-
- UGraphic ug = new UGraphicG2d(new ColorMapperIdentity(), g3d, 1.0);
+ 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++) {
@@ -134,8 +165,6 @@ public class GraphicsSudoku {
final TextBlock textBlock = Display.create(texts).create(FontConfiguration.blackBlueTrue(font),
HorizontalAlignment.LEFT, new SpriteContainerEmpty());
textBlock.drawU(ug);
- g3d.dispose();
- return im;
}
}
diff --git a/src/net/sourceforge/plantuml/sudoku/PSystemSudoku.java b/src/net/sourceforge/plantuml/sudoku/PSystemSudoku.java
index 6d61975..f207faa 100644
--- a/src/net/sourceforge/plantuml/sudoku/PSystemSudoku.java
+++ b/src/net/sourceforge/plantuml/sudoku/PSystemSudoku.java
@@ -39,6 +39,7 @@ 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;
@@ -50,7 +51,18 @@ public class PSystemSudoku extends AbstractPSystem {
@Override
final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed)
throws IOException {
- return new GraphicsSudoku(sudoku).writeImage(os);
+ 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() {
diff --git a/src/net/sourceforge/plantuml/suggest/SuggestEngine.java b/src/net/sourceforge/plantuml/suggest/SuggestEngine.java
index 44d84a3..b929fb8 100644
--- a/src/net/sourceforge/plantuml/suggest/SuggestEngine.java
+++ b/src/net/sourceforge/plantuml/suggest/SuggestEngine.java
@@ -36,16 +36,12 @@
package net.sourceforge.plantuml.suggest;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import net.sourceforge.plantuml.AbstractPSystem;
import net.sourceforge.plantuml.CharSequence2;
import net.sourceforge.plantuml.CharSequence2Impl;
-import net.sourceforge.plantuml.StringUtils;
-import net.sourceforge.plantuml.command.BlocLines;
-import net.sourceforge.plantuml.command.CommandControl;
import net.sourceforge.plantuml.command.UmlDiagramFactory;
import net.sourceforge.plantuml.core.UmlSource;
import net.sourceforge.plantuml.utils.StartUtils;
@@ -60,6 +56,10 @@ final public class SuggestEngine {
private final IteratorCounter2 it99;
+ public SuggestEngine(UmlSource source, Object foo) {
+ throw new UnsupportedOperationException();
+ }
+
public SuggestEngine(UmlSource source, UmlDiagramFactory systemFactory) {
this.systemFactory = systemFactory;
this.it99 = source.iterator2();
@@ -74,79 +74,81 @@ final public class SuggestEngine {
}
private SuggestEngineResult executeUmlCommand(AbstractPSystem system) {
- while (it99.hasNext()) {
- if (StartUtils.isArobaseEndDiagram(it99.peek())) {
- return SuggestEngineResult.SYNTAX_OK;
- }
- final SuggestEngineResult check = checkAndCorrect();
- if (check.getStatus() != SuggestEngineStatus.SYNTAX_OK) {
- return check;
- }
- final CommandControl commandControl = systemFactory.isValid2(it99);
- if (commandControl == CommandControl.OK_PARTIAL) {
- systemFactory.goForwardMultiline(it99);
- // if (ok == false) {
- // return SuggestEngineResult.CANNOT_CORRECT;
- // }
- } else if (commandControl == CommandControl.OK) {
- it99.next();
- // final Command cmd = new ProtectedCommand(systemFactory.createCommand(Arrays.asList(s)));
- // final CommandExecutionResult result = cmd.execute(system, Arrays.asList(s));
- // if (result.isOk() == false) {
- // return SuggestEngineResult.CANNOT_CORRECT;
- // }
- } else {
- return SuggestEngineResult.CANNOT_CORRECT;
- }
- }
- return SuggestEngineResult.CANNOT_CORRECT;
- // throw new IllegalStateException();
+ throw new UnsupportedOperationException();
+// while (it99.hasNext()) {
+// if (StartUtils.isArobaseEndDiagram(it99.peek())) {
+// return SuggestEngineResult.SYNTAX_OK;
+// }
+// final SuggestEngineResult check = checkAndCorrect();
+// if (check.getStatus() != SuggestEngineStatus.SYNTAX_OK) {
+// return check;
+// }
+// final CommandControl commandControl = systemFactory.isValid2(it99);
+// if (commandControl == CommandControl.OK_PARTIAL) {
+// systemFactory.goForwardMultiline(it99);
+// // if (ok == false) {
+// // return SuggestEngineResult.CANNOT_CORRECT;
+// // }
+// } else if (commandControl == CommandControl.OK) {
+// it99.next();
+// // final Command cmd = new ProtectedCommand(systemFactory.createCommand(Arrays.asList(s)));
+// // final CommandExecutionResult result = cmd.execute(system, Arrays.asList(s));
+// // if (result.isOk() == false) {
+// // return SuggestEngineResult.CANNOT_CORRECT;
+// // }
+// } else {
+// return SuggestEngineResult.CANNOT_CORRECT;
+// }
+// }
+// return SuggestEngineResult.CANNOT_CORRECT;
}
SuggestEngineResult checkAndCorrect() {
- final String incorrectLine = it99.peek().toString();
- if (incorrectLine.length() > LIMIT) {
- return SuggestEngineResult.CANNOT_CORRECT;
- }
- final CommandControl commandControl = systemFactory.isValid2(it99);
- if (commandControl != CommandControl.NOT_OK) {
- return SuggestEngineResult.SYNTAX_OK;
- }
-
- if (StringUtils.trin(incorrectLine).startsWith("{")
- && systemFactory.isValid(BlocLines.single(it99.peekPrevious() + " {")) != CommandControl.NOT_OK) {
- return new SuggestEngineResult(it99.peekPrevious() + " {");
- }
-
- final Collection<Iterator<String>> all = new ArrayList<Iterator<String>>();
- all.add(new VariatorRemoveOneChar(incorrectLine));
- all.add(new VariatorSwapLetter(incorrectLine));
- // all.add(new VariatorAddOneCharBetweenWords(incorrectLine, ':'));
- all.add(new VariatorAddOneCharBetweenWords(incorrectLine, '-'));
- all.add(new VariatorAddOneCharBetweenWords(incorrectLine, ' '));
- // all.add(new VariatorAddTwoChar(incorrectLine, '\"'));
-
- for (Iterator<String> it2 : all) {
- final SuggestEngineResult result = tryThis(it2);
- if (result != null) {
- return result;
- }
- }
- return SuggestEngineResult.CANNOT_CORRECT;
+ throw new UnsupportedOperationException();
+// final String incorrectLine = it99.peek().toString();
+// if (incorrectLine.length() > LIMIT) {
+// return SuggestEngineResult.CANNOT_CORRECT;
+// }
+// final CommandControl commandControl = systemFactory.isValid2(it99);
+// if (commandControl != CommandControl.NOT_OK) {
+// return SuggestEngineResult.SYNTAX_OK;
+// }
+//
+// if (StringUtils.trin(incorrectLine).startsWith("{")
+// && systemFactory.isValid(BlocLines.single(it99.peekPrevious() + " {")) != CommandControl.NOT_OK) {
+// return new SuggestEngineResult(it99.peekPrevious() + " {");
+// }
+//
+// final Collection<Iterator<String>> all = new ArrayList<Iterator<String>>();
+// all.add(new VariatorRemoveOneChar(incorrectLine));
+// all.add(new VariatorSwapLetter(incorrectLine));
+// // all.add(new VariatorAddOneCharBetweenWords(incorrectLine, ':'));
+// all.add(new VariatorAddOneCharBetweenWords(incorrectLine, '-'));
+// all.add(new VariatorAddOneCharBetweenWords(incorrectLine, ' '));
+// // all.add(new VariatorAddTwoChar(incorrectLine, '\"'));
+//
+// for (Iterator<String> it2 : all) {
+// final SuggestEngineResult result = tryThis(it2);
+// if (result != null) {
+// return result;
+// }
+// }
+// return SuggestEngineResult.CANNOT_CORRECT;
}
private SuggestEngineResult tryThis(Iterator<String> it2) {
- while (it2.hasNext()) {
- final String newS = it2.next();
- if (StringUtils.trin(newS).length() == 0) {
- continue;
- }
- final CommandControl commandControl = systemFactory.isValid2(replaceFirstLine(newS));
- if (commandControl == CommandControl.OK) {
- return new SuggestEngineResult(newS);
- }
- }
- return null;
+ throw new UnsupportedOperationException();
+// while (it2.hasNext()) {
+// final String newS = it2.next();
+// if (StringUtils.trin(newS).length() == 0) {
+// continue;
+// }
+// final CommandControl commandControl = systemFactory.isValid2(replaceFirstLine(newS));
+// if (commandControl == CommandControl.OK) {
+// return new SuggestEngineResult(newS);
+// }
+// }
+// return null;
}
private IteratorCounter2 replaceFirstLine(String s) {
diff --git a/src/net/sourceforge/plantuml/svek/Boundary.java b/src/net/sourceforge/plantuml/svek/Boundary.java
index a7bb13f..c1d475c 100644
--- a/src/net/sourceforge/plantuml/svek/Boundary.java
+++ b/src/net/sourceforge/plantuml/svek/Boundary.java
@@ -41,6 +41,7 @@ import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.SymbolContext;
+import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPath;
@@ -79,7 +80,7 @@ public class Boundary extends AbstractTextBlock {
path.moveTo(0, radius);
path.lineTo(left, radius);
path.setDeltaShadow(symbolContext.getDeltaShadow());
- ug.apply(new UTranslate(x, y)).draw(path);
+ ug.apply(new UTranslate(x, y)).apply(new UChangeBackColor(null)).draw(path);
// final ULine line1 = new ULine(0, radius * 2);
// line1.setDeltaShadow(deltaShadow);
diff --git a/src/net/sourceforge/plantuml/svek/Cluster.java b/src/net/sourceforge/plantuml/svek/Cluster.java
index aeea8e4..f1c2d99 100644
--- a/src/net/sourceforge/plantuml/svek/Cluster.java
+++ b/src/net/sourceforge/plantuml/svek/Cluster.java
@@ -48,12 +48,12 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
+import net.sourceforge.plantuml.AlignmentParam;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineParam;
-import net.sourceforge.plantuml.OptionFlags;
import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UmlDiagramType;
@@ -66,6 +66,7 @@ import net.sourceforge.plantuml.cucadiagram.Member;
import net.sourceforge.plantuml.cucadiagram.MethodsOrFieldsArea;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.cucadiagram.dot.GraphvizVersion;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.HtmlColorTransparent;
import net.sourceforge.plantuml.graphic.StringBounder;
@@ -74,6 +75,7 @@ import net.sourceforge.plantuml.graphic.TextBlockEmpty;
import net.sourceforge.plantuml.graphic.TextBlockWidth;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.posimo.Moveable;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.svek.image.EntityImageState;
@@ -301,7 +303,13 @@ public class Cluster implements Moveable {
}
public void drawU(UGraphic ug, UStroke stroke, final UmlDiagramType umlDiagramType, final ISkinParam skinParam2) {
- ug.draw(new UComment("cluster " + group.getCode().getFullName()));
+ if (group.isHidden()) {
+ return;
+ }
+ final String fullName = group.getCode().getFullName();
+ if (fullName.startsWith("##") == false) {
+ ug.draw(new UComment("cluster " + fullName));
+ }
final Stereotype stereotype = group.getStereotype();
HtmlColor borderColor;
if (umlDiagramType == UmlDiagramType.STATE) {
@@ -346,18 +354,22 @@ public class Cluster implements Moveable {
}
}
+ final boolean shadowing = group.getUSymbol() == null ? skinParam2.shadowing() : skinParam2.shadowing2(group
+ .getUSymbol().getSkinParameter());
if (ztitle != null || zstereo != null) {
final HtmlColor back = getBackColor(getBackColor(umlDiagramType), skinParam2, group.getStereotype());
final double roundCorner = group.getUSymbol() == null ? 0 : group.getUSymbol().getSkinParameter()
.getRoundCorner(skinParam, stereotype);
+ final UStroke stroke2 = getStrokeInternal(skinParam2);
final ClusterDecoration decoration = new ClusterDecoration(style, group.getUSymbol(), ztitle, zstereo,
- minX, minY, maxX, maxY, getStroke(skinParam2, group.getStereotype()));
- decoration.drawU(ug, back, borderColor, skinParam2.shadowing(), roundCorner);
+ minX, minY, maxX, maxY, stroke2);
+ decoration.drawU(ug, back, borderColor, shadowing, roundCorner,
+ skinParam2.getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null));
return;
}
final URectangle rect = new URectangle(maxX - minX, maxY - minY);
- if (skinParam2.shadowing()) {
+ if (shadowing) {
rect.setDeltaShadow(3.0);
}
final HtmlColor backColor = getBackColor(getBackColor(umlDiagramType), skinParam2, group.getStereotype());
@@ -372,10 +384,17 @@ public class Cluster implements Moveable {
}
- private UStroke getStroke(ISkinParam skinParam, Stereotype stereo) {
- UStroke stroke = skinParam.getThickness(LineParam.packageBorder, stereo);
+ private UStroke getStrokeInternal(ISkinParam skinParam) {
+ final Colors colors = group.getColors(skinParam);
+ if (colors.getSpecificLineStroke() != null) {
+ return colors.getSpecificLineStroke();
+ }
+ if (group.getUSymbol() != null) {
+ return group.getUSymbol().getSkinParameter().getStroke(skinParam, group.getStereotype());
+ }
+ UStroke stroke = skinParam.getThickness(LineParam.packageBorder, group.getStereotype());
if (stroke == null) {
- stroke = new UStroke(2.0);
+ stroke = new UStroke(1.5);
}
return stroke;
}
@@ -565,7 +584,8 @@ public class Cluster implements Moveable {
added = true;
}
- if (skinParam.useRankSame() && dotMode != DotMode.NO_LEFT_RIGHT_AND_XLABEL) {
+ if (skinParam.useRankSame() && dotMode != DotMode.NO_LEFT_RIGHT_AND_XLABEL
+ && graphvizVersion.ignoreHorizontalLinks() == false) {
appendRankSame(sb, lines);
}
@@ -721,6 +741,9 @@ public class Cluster implements Moveable {
Line.appendTable(sblabel, getTitleAndAttributeWidth(), getTitleAndAttributeHeight() - 5, colorTitle);
sblabel.append(">");
label = sblabel.toString();
+ final HorizontalAlignment align = skinParam
+ .getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null);
+ sb.append("labeljust=\"" + align.getGraphVizValue() + "\";");
} else {
label = "\"\"";
}
diff --git a/src/net/sourceforge/plantuml/svek/ClusterDecoration.java b/src/net/sourceforge/plantuml/svek/ClusterDecoration.java
index 265e055..0aef3c4 100644
--- a/src/net/sourceforge/plantuml/svek/ClusterDecoration.java
+++ b/src/net/sourceforge/plantuml/svek/ClusterDecoration.java
@@ -36,6 +36,7 @@
*/
package net.sourceforge.plantuml.svek;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.SymbolContext;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -85,15 +86,16 @@ public class ClusterDecoration {
public final static int marginTitleY1 = 3;
public final static int marginTitleY2 = 3;
- public void drawU(UGraphic ug, HtmlColor backColor, HtmlColor borderColor, boolean shadowing, double roundCorner) {
+ public void drawU(UGraphic ug, HtmlColor backColor, HtmlColor borderColor, boolean shadowing, double roundCorner,
+ HorizontalAlignment titleAlignment) {
final SymbolContext biColor = new SymbolContext(backColor, borderColor);
if (symbol == null) {
throw new UnsupportedOperationException();
}
final SymbolContext symbolContext = biColor.withShadow(shadowing).withStroke(defaultStroke)
- .withRoundCorner(roundCorner);
- symbol.asBig(title, stereo, maxX - minX, maxY - minY, symbolContext)
- .drawU(ug.apply(new UTranslate(minX, minY)));
+ .withCorner(roundCorner, 0);
+ symbol.asBig(title, titleAlignment, stereo, maxX - minX, maxY - minY, symbolContext).drawU(
+ ug.apply(new UTranslate(minX, minY)));
// return;
// }
// if (style == PackageStyle.NODE) {
diff --git a/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java b/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java
index eb8a6e5..5c25be4 100644
--- a/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java
+++ b/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java
@@ -47,6 +47,7 @@ import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.NamedOutputStream;
import net.sourceforge.plantuml.Scale;
import net.sourceforge.plantuml.UmlDiagramType;
+import net.sourceforge.plantuml.api.ImageDataAbstract;
import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.CucaDiagram;
import net.sourceforge.plantuml.cucadiagram.Link;
@@ -107,6 +108,7 @@ public final class CucaDiagramFileMakerSvek implements CucaDiagramFileMaker {
fileFormatOption.getDefaultStringBounder());
result = svek2.buildImage(basefile, diagram.getDotStringSkek());
}
+ final boolean isGraphvizCrash = result instanceof GraphvizCrash;
result = new AnnotatedWorker(diagram, diagram.getSkinParam()).addAdd(result);
final String widthwarning = diagram.getSkinParam().getValue("widthwarning");
@@ -121,8 +123,11 @@ public final class CucaDiagramFileMakerSvek implements CucaDiagramFileMaker {
fileFormatOption.isWithMetadata() ? diagram.getMetadata() : null, warningOrError, 0, 10,
diagram.getAnimation(), result.getBackcolor());
imageBuilder.setUDrawable(result);
- return imageBuilder.writeImageTOBEMOVED(fileFormatOption, diagram.seed(), os);
-
+ final ImageData imageData = imageBuilder.writeImageTOBEMOVED(fileFormatOption, diagram.seed(), os);
+ if (isGraphvizCrash) {
+ ((ImageDataAbstract) imageData).setStatus(503);
+ }
+ return imageData;
}
private List<Link> getOrderedLinks() {
diff --git a/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek2InternalImage.java b/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek2InternalImage.java
index 7c0d06c..00c4945 100644
--- a/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek2InternalImage.java
+++ b/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek2InternalImage.java
@@ -41,6 +41,7 @@ import java.util.List;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
@@ -56,6 +57,7 @@ public final class CucaDiagramFileMakerSvek2InternalImage extends AbstractTextBl
private final List<IEntityImage> inners;
private final Separator separator;
private final ISkinParam skinParam;
+ private final Stereotype stereotype;
static enum Separator {
VERTICAL, HORIZONTAL;
@@ -99,19 +101,20 @@ public final class CucaDiagramFileMakerSvek2InternalImage extends AbstractTextBl
}
}
- private HtmlColor getColor(ColorParam colorParam) {
- return new Rose().getHtmlColor(skinParam, colorParam);
+ private HtmlColor getColor(ColorParam colorParam, Stereotype stereotype) {
+ return new Rose().getHtmlColor(skinParam, colorParam, stereotype);
}
public CucaDiagramFileMakerSvek2InternalImage(List<IEntityImage> inners, char concurrentSeparator,
- ISkinParam skinParam) {
+ ISkinParam skinParam, Stereotype stereotype) {
this.separator = Separator.fromChar(concurrentSeparator);
this.skinParam = skinParam;
+ this.stereotype = stereotype;
this.inners = inners;
}
public void drawU(UGraphic ug) {
- final HtmlColor dotColor = getColor(ColorParam.stateBorder);
+ final HtmlColor dotColor = getColor(ColorParam.stateBorder, stereotype);
final StringBounder stringBounder = ug.getStringBounder();
final Dimension2D dimTotal = calculateDimension(stringBounder);
diff --git a/src/net/sourceforge/plantuml/svek/DecorateEntityImage.java b/src/net/sourceforge/plantuml/svek/DecorateEntityImage.java
index b8d1197..dfbebc5 100644
--- a/src/net/sourceforge/plantuml/svek/DecorateEntityImage.java
+++ b/src/net/sourceforge/plantuml/svek/DecorateEntityImage.java
@@ -44,6 +44,7 @@ import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
+import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
@@ -58,15 +59,15 @@ public class DecorateEntityImage extends AbstractTextBlock implements TextBlockB
private double deltaX;
private double deltaY;
- public static DecorateEntityImage addTop(TextBlock original, TextBlock text, HorizontalAlignment horizontal) {
+ public static TextBlock addTop(TextBlock original, TextBlock text, HorizontalAlignment horizontal) {
return new DecorateEntityImage(original, text, horizontal, null, null);
}
- public static DecorateEntityImage addBottom(TextBlock original, TextBlock text, HorizontalAlignment horizontal) {
+ public static TextBlock addBottom(TextBlock original, TextBlock text, HorizontalAlignment horizontal) {
return new DecorateEntityImage(original, null, null, text, horizontal);
}
- public static DecorateEntityImage add(TextBlock original, TextBlock text, HorizontalAlignment horizontal,
+ public static TextBlock add(TextBlock original, TextBlock text, HorizontalAlignment horizontal,
VerticalAlignment verticalAlignment) {
if (verticalAlignment == VerticalAlignment.TOP) {
return addTop(original, text, horizontal);
@@ -74,7 +75,12 @@ public class DecorateEntityImage extends AbstractTextBlock implements TextBlockB
return addBottom(original, text, horizontal);
}
- public DecorateEntityImage(TextBlock original, TextBlock text1, HorizontalAlignment horizontal1, TextBlock text2,
+ public static TextBlock addTopAndBottom(TextBlock original, TextBlock text1, HorizontalAlignment horizontal1,
+ TextBlock text2, HorizontalAlignment horizontal2) {
+ return new DecorateEntityImage(original, text1, horizontal1, text2, horizontal2);
+ }
+
+ private DecorateEntityImage(TextBlock original, TextBlock text1, HorizontalAlignment horizontal1, TextBlock text2,
HorizontalAlignment horizontal2) {
this.original = original;
this.horizontal1 = horizontal1;
@@ -141,6 +147,11 @@ public class DecorateEntityImage extends AbstractTextBlock implements TextBlockB
return Dimension2DDouble.mergeTB(dimOriginal, dimText);
}
+ @Override
+ public MinMax getMinMax(StringBounder stringBounder) {
+ return MinMax.fromDim(calculateDimension(stringBounder));
+ }
+
public final double getDeltaX() {
if (original instanceof DecorateEntityImage) {
return deltaX + ((DecorateEntityImage) original).deltaX;
diff --git a/src/net/sourceforge/plantuml/svek/DotDataImageBuilder.java b/src/net/sourceforge/plantuml/svek/DotDataImageBuilder.java
index 2c24c40..2929e2b 100644
--- a/src/net/sourceforge/plantuml/svek/DotDataImageBuilder.java
+++ b/src/net/sourceforge/plantuml/svek/DotDataImageBuilder.java
@@ -54,6 +54,7 @@ import net.sourceforge.plantuml.OptionFlags;
import net.sourceforge.plantuml.Pragma;
import net.sourceforge.plantuml.SkinParamForecolored;
import net.sourceforge.plantuml.SkinParamSameClassWidth;
+import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.core.UmlSource;
@@ -77,11 +78,14 @@ import net.sourceforge.plantuml.cucadiagram.dot.ExeState;
import net.sourceforge.plantuml.cucadiagram.dot.GraphvizVersion;
import net.sourceforge.plantuml.cucadiagram.dot.Neighborhood;
import net.sourceforge.plantuml.cucadiagram.entity.EntityFactory;
+import net.sourceforge.plantuml.descdiagram.EntityImageDesignedDomain;
+import net.sourceforge.plantuml.descdiagram.EntityImageDomain;
+import net.sourceforge.plantuml.descdiagram.EntityImageMachine;
+import net.sourceforge.plantuml.descdiagram.EntityImageRequirement;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.GraphicStrings;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockEmpty;
@@ -281,7 +285,8 @@ public final class DotDataImageBuilder {
final IEntityImage image = printEntityInternal(dotStringFactory, ent);
final Dimension2D dim = image.calculateDimension(stringBounder);
final Shape shape = new Shape(image, image.getShapeType(), dim.getWidth(), dim.getHeight(),
- dotStringFactory.getColorSequence(), ent.isTop(), image.getShield(stringBounder), ent.getEntityPosition());
+ dotStringFactory.getColorSequence(), ent.isTop(), image.getShield(stringBounder),
+ ent.getEntityPosition());
dotStringFactory.addShape(shape);
dotStringFactory.getBibliotekon().putShape(ent, shape);
}
@@ -389,7 +394,7 @@ public final class DotDataImageBuilder {
}
}
if (leaf.getLeafType() == LeafType.USECASE) {
- return new EntityImageUseCase(leaf, skinParam);
+ return new EntityImageUseCase(leaf, skinParam, portionShower);
}
// if (leaf.getEntityType() == LeafType.CIRCLE_INTERFACE) {
// return new EntityImageCircleInterface(leaf, skinParam);
@@ -411,8 +416,11 @@ public final class DotDataImageBuilder {
}
if (leaf.getLeafType() == LeafType.EMPTY_PACKAGE) {
if (leaf.getUSymbol() != null) {
- return new EntityImageDescription(leaf, new SkinParamForecolored(skinParam, HtmlColorUtils.BLACK),
- portionShower, links);
+ // final HtmlColor black = HtmlColorUtils.BLACK;
+ final HtmlColor black = SkinParamUtils.getColor(skinParam, leaf.getUSymbol().getColorParamBorder(),
+ leaf.getStereotype());
+ return new EntityImageDescription(leaf, new SkinParamForecolored(skinParam, black), portionShower,
+ links);
}
return new EntityImageEmptyPackage(leaf, skinParam, portionShower);
}
@@ -425,7 +433,28 @@ public final class DotDataImageBuilder {
if (leaf.getLeafType() == LeafType.TIPS) {
return new EntityImageTips(leaf, skinParam, bibliotekon);
}
- throw new UnsupportedOperationException(leaf.getLeafType().toString());
+ // TODO Clean
+ if (leaf.getLeafType() == LeafType.DOMAIN && leaf.getStereotype() != null
+ && leaf.getStereotype().isMachineOrSpecification()) {
+ return new EntityImageMachine(leaf, skinParam);
+ } else if (leaf.getLeafType() == LeafType.DOMAIN && leaf.getStereotype() != null
+ && leaf.getStereotype().isDesignedOrSolved()) {
+ return new EntityImageDesignedDomain(leaf, skinParam);
+ } else if (leaf.getLeafType() == LeafType.REQUIREMENT) {
+ return new EntityImageRequirement(leaf, skinParam);
+ } else if (leaf.getLeafType() == LeafType.DOMAIN && leaf.getStereotype() != null
+ && leaf.getStereotype().isLexicalOrGiven()) {
+ return new EntityImageDomain(leaf, skinParam, 'X');
+ } else if (leaf.getLeafType() == LeafType.DOMAIN && leaf.getStereotype() != null
+ && leaf.getStereotype().isCausal()) {
+ return new EntityImageDomain(leaf, skinParam, 'C');
+ } else if (leaf.getLeafType() == LeafType.DOMAIN && leaf.getStereotype() != null
+ && leaf.getStereotype().isBiddableOrUncertain()) {
+ return new EntityImageDomain(leaf, skinParam, 'B');
+ } else if (leaf.getLeafType() == LeafType.DOMAIN) {
+ return new EntityImageDomain(leaf, skinParam, 'P');
+ } else
+ throw new UnsupportedOperationException(leaf.getLeafType().toString());
}
private Collection<ILeaf> getUnpackagedEntities() {
diff --git a/src/net/sourceforge/plantuml/svek/DotStringFactory.java b/src/net/sourceforge/plantuml/svek/DotStringFactory.java
index 6211ae3..e08a9c3 100644
--- a/src/net/sourceforge/plantuml/svek/DotStringFactory.java
+++ b/src/net/sourceforge/plantuml/svek/DotStringFactory.java
@@ -343,7 +343,7 @@ public class DotStringFactory implements Moveable {
return graphviz.getDotExe();
}
- public ClusterPosition solve(String svg) throws IOException, InterruptedException {
+ public ClusterPosition solve(final String svg) throws IOException, InterruptedException {
if (svg.length() == 0) {
throw new EmptySvgException();
}
@@ -358,11 +358,14 @@ public class DotStringFactory implements Moveable {
final MinFinder corner1 = new MinFinder();
+ final Point2DFunction move = new YDelta(fullHeight);
+ final SvgResult svgResult = new SvgResult(svg, move);
for (Shape sh : bibliotekon.allShapes()) {
int idx = svg.indexOf("<title>" + sh.getUid() + "</title>");
if (sh.getType() == ShapeType.RECTANGLE || sh.getType() == ShapeType.RECTANGLE_HTML_FOR_PORTS
- || sh.getType() == ShapeType.FOLDER || sh.getType() == ShapeType.DIAMOND) {
- final List<Point2D.Double> points = SvekUtils.extractPointsList(svg, idx, fullHeight);
+ || sh.getType() == ShapeType.RECTANGLE_WITH_CIRCLE_INSIDE || sh.getType() == ShapeType.FOLDER
+ || sh.getType() == ShapeType.DIAMOND) {
+ final List<Point2D.Double> points = svgResult.substring(idx).extractList(SvgResult.POINTS_EQUALS);
final double minX = SvekUtils.getMinX(points);
final double minY = SvekUtils.getMinY(points);
corner1.manage(minX, minY);
@@ -373,12 +376,12 @@ public class DotStringFactory implements Moveable {
final List<Point2D.Double> points;
if (idx2 != -1 && (idx == -1 || idx2 < idx)) {
// GraphViz 2.30
- points = SvekUtils.extractD(svg, idx2, fullHeight);
+ points = svgResult.substring(idx2).extractList(SvgResult.D_EQUALS);
} else {
- points = SvekUtils.extractPointsList(svg, idx, fullHeight);
+ points = svgResult.substring(idx).extractList(SvgResult.POINTS_EQUALS);
for (int i = 0; i < 3; i++) {
idx = svg.indexOf("points=\"", idx + 1);
- points.addAll(SvekUtils.extractPointsList(svg, idx, fullHeight));
+ points.addAll(svgResult.substring(idx).extractList(SvgResult.POINTS_EQUALS));
}
}
final double minX = SvekUtils.getMinX(points);
@@ -387,7 +390,8 @@ public class DotStringFactory implements Moveable {
sh.moveSvek(minX, minY);
} else if (sh.getType() == ShapeType.OCTAGON) {
idx = svg.indexOf("points=\"", idx + 1);
- final List<Point2D.Double> points = SvekUtils.extractPointsList(svg, idx, fullHeight);
+ final int starting = idx;
+ final List<Point2D.Double> points = svgResult.substring(starting).extractList(SvgResult.POINTS_EQUALS);
final double minX = SvekUtils.getMinX(points);
final double minY = SvekUtils.getMinY(points);
corner1.manage(minX, minY);
@@ -407,7 +411,8 @@ public class DotStringFactory implements Moveable {
for (Cluster cluster : bibliotekon.allCluster()) {
int idx = getClusterIndex(svg, cluster.getColor());
- final List<Point2D.Double> points = SvekUtils.extractPointsList(svg, idx, fullHeight);
+ final int starting = idx;
+ final List<Point2D.Double> points = svgResult.substring(starting).extractList(SvgResult.POINTS_EQUALS);
final double minX = SvekUtils.getMinX(points);
final double minY = SvekUtils.getMinY(points);
final double maxX = SvekUtils.getMaxX(points);
@@ -419,14 +424,16 @@ public class DotStringFactory implements Moveable {
continue;
}
idx = getClusterIndex(svg, cluster.getTitleColor());
- final List<Point2D.Double> pointsTitle = SvekUtils.extractPointsList(svg, idx, fullHeight);
+ final int starting1 = idx;
+ final List<Point2D.Double> pointsTitle = svgResult.substring(starting1)
+ .extractList(SvgResult.POINTS_EQUALS);
final double minXtitle = SvekUtils.getMinX(pointsTitle);
final double minYtitle = SvekUtils.getMinY(pointsTitle);
cluster.setTitlePosition(minXtitle, minYtitle);
}
for (Line line : bibliotekon.allLines()) {
- line.solveLine(svg, fullHeight, corner1);
+ line.solveLine(svgResult, corner1);
}
for (Line line : bibliotekon.allLines()) {
diff --git a/src/net/sourceforge/plantuml/svek/GraphvizCrash.java b/src/net/sourceforge/plantuml/svek/GraphvizCrash.java
index 7a82d65..f7ea9c9 100644
--- a/src/net/sourceforge/plantuml/svek/GraphvizCrash.java
+++ b/src/net/sourceforge/plantuml/svek/GraphvizCrash.java
@@ -184,7 +184,7 @@ public class GraphvizCrash extends AbstractTextBlock implements IEntityImage {
if (flashCode != null) {
final double h = graphicStrings.calculateDimension(ug.getStringBounder()).getHeight();
ug = ug.apply(new UTranslate(0, h));
- ug.draw(new UImage(flashCode));
+ ug.draw(new UImage(flashCode).scaleNearestNeighbor(3));
}
}
diff --git a/src/net/sourceforge/plantuml/svek/GroupPngMakerState.java b/src/net/sourceforge/plantuml/svek/GroupPngMakerState.java
index e01b303..f215938 100644
--- a/src/net/sourceforge/plantuml/svek/GroupPngMakerState.java
+++ b/src/net/sourceforge/plantuml/svek/GroupPngMakerState.java
@@ -179,7 +179,7 @@ public final class GroupPngMakerState {
inners.add(inner.getSvekImage());
}
return new CucaDiagramFileMakerSvek2InternalImage(inners, dotData.getTopParent().getConcurrentSeparator(),
- dotData.getSkinParam());
+ dotData.getSkinParam(), group.getStereotype());
}
diff --git a/src/net/sourceforge/plantuml/svek/HeaderLayout.java b/src/net/sourceforge/plantuml/svek/HeaderLayout.java
index f126ea1..218bd7c 100644
--- a/src/net/sourceforge/plantuml/svek/HeaderLayout.java
+++ b/src/net/sourceforge/plantuml/svek/HeaderLayout.java
@@ -88,7 +88,7 @@ public class HeaderLayout {
final Dimension2D circleDim = circledCharacter.calculateDimension(stringBounder);
final double widthStereoAndName = Math.max(stereoDim.getWidth(), nameDim.getWidth());
- final double suppWith = width - circleDim.getWidth() - widthStereoAndName - genericDim.getWidth();
+ final double suppWith = Math.max(0, width - circleDim.getWidth() - widthStereoAndName - genericDim.getWidth());
assert suppWith >= 0;
final double h2 = Math.min(circleDim.getWidth() / 4, suppWith * 0.1);
diff --git a/src/net/sourceforge/plantuml/svek/Line.java b/src/net/sourceforge/plantuml/svek/Line.java
index 85258f5..5b31032 100644
--- a/src/net/sourceforge/plantuml/svek/Line.java
+++ b/src/net/sourceforge/plantuml/svek/Line.java
@@ -40,10 +40,12 @@ import java.awt.geom.Point2D;
import java.util.Collection;
import java.util.List;
+import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.Hideable;
import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.LineParam;
import net.sourceforge.plantuml.Log;
import net.sourceforge.plantuml.Pragma;
import net.sourceforge.plantuml.StringUtils;
@@ -64,6 +66,7 @@ import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockArrow;
@@ -77,7 +80,6 @@ import net.sourceforge.plantuml.posimo.DotPath;
import net.sourceforge.plantuml.posimo.Moveable;
import net.sourceforge.plantuml.posimo.Positionable;
import net.sourceforge.plantuml.posimo.PositionableUtils;
-import net.sourceforge.plantuml.svek.SvekUtils.PointListIterator;
import net.sourceforge.plantuml.svek.extremity.Extremity;
import net.sourceforge.plantuml.svek.extremity.ExtremityFactory;
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryExtends;
@@ -85,7 +87,6 @@ import net.sourceforge.plantuml.svek.image.EntityImageNoteLink;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UComment;
-import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UPolygon;
@@ -133,6 +134,8 @@ public class Line implements Moveable, Hideable {
private final Pragma pragma;
private final HtmlColor backgroundColor;
private final boolean useRankSame;
+ private final UStroke defaultThickness;
+ private HtmlColor arrowLollipopColor;
@Override
public String toString() {
@@ -232,6 +235,11 @@ public class Line implements Moveable, Hideable {
labelFont = labelFont.mute(link.getColors());
}
this.backgroundColor = skinParam.getBackgroundColor();
+ this.defaultThickness = skinParam.getThickness(LineParam.arrow, null);
+ this.arrowLollipopColor = skinParam.getHtmlColor(ColorParam.arrowLollipop, null, false);
+ if (arrowLollipopColor == null) {
+ this.arrowLollipopColor = HtmlColorUtils.WHITE;
+ }
this.pragma = pragma;
this.bibliotekon = bibliotekon;
this.stringBounder = stringBounder;
@@ -348,9 +356,9 @@ public class Line implements Moveable, Hideable {
sb.append(decoration);
int length = link.getLength();
- // if (graphvizVersion == GraphvizVersion.V2_34_0 && length == 1) {
- // length = 2;
- // }
+ if (graphvizVersion.ignoreHorizontalLinks() && length == 1) {
+ length = 2;
+ }
if (useRankSame) {
if (pragma.horizontalLineBetweenDifferentPackageAllowed() || link.isInvis() || length != 1) {
// if (graphvizVersion.isJs() == false) {
@@ -365,7 +373,7 @@ public class Line implements Moveable, Hideable {
sb.append("color=\"" + StringUtils.getAsHtml(lineColor) + "\"");
if (labelText != null) {
sb.append(",");
- if (graphvizVersion.modeSafe() || dotMode == DotMode.NO_LEFT_RIGHT_AND_XLABEL) {
+ if (graphvizVersion.useXLabelInsteadOfLabel() || dotMode == DotMode.NO_LEFT_RIGHT_AND_XLABEL) {
sb.append("xlabel=<");
} else {
sb.append("label=<");
@@ -507,27 +515,27 @@ public class Line implements Moveable, Hideable {
}
- public void solveLine(final String svg, final int fullHeight, MinFinder corner1) {
+ public void solveLine(SvgResult fullSvg, MinFinder corner1) {
if (this.link.isInvis()) {
return;
}
- int idx = SvekUtils.getIndexFromColor(svg, this.lineColor);
+ int idx = fullSvg.getIndexFromColor(this.lineColor);
if (idx == -1) {
return;
// throw new IllegalStateException();
}
- idx = svg.indexOf("d=\"", idx);
+ idx = fullSvg.indexOf("d=\"", idx);
if (idx == -1) {
throw new IllegalStateException();
}
- final int end = svg.indexOf("\"", idx + 3);
- final String path = svg.substring(idx + 3, end);
+ final int end = fullSvg.indexOf("\"", idx + 3);
+ final SvgResult path = fullSvg.substring(idx + 3, end);
- if (DotPath.isPathConsistent(path) == false) {
+ if (DotPath.isPathConsistent(path.getSvg()) == false) {
return;
}
- dotPath = new DotPath(path, fullHeight);
+ dotPath = new DotPath(path);
if (projectionCluster != null) {
// System.err.println("Line::solveLine1 projectionCluster=" + projectionCluster.getClusterPosition());
@@ -540,7 +548,8 @@ public class Line implements Moveable, Hideable {
}
dotPath = dotPath.simulateCompound(lhead, ltail);
- PointListIterator pointListIterator = PointListIterator.create(svg.substring(end), fullHeight, lineColor);
+ final SvgResult lineSvg = fullSvg.substring(end);
+ PointListIterator pointListIterator = lineSvg.getPointsWithThisColor(lineColor);
final LinkType linkType = link.getType();
this.extremity1 = getExtremity(linkType.getDecor2(), pointListIterator, dotPath.getStartPoint(),
@@ -557,7 +566,7 @@ public class Line implements Moveable, Hideable {
final double dist2start = p2.distance(dotPath.getStartPoint());
final double dist2end = p2.distance(dotPath.getEndPoint());
if (dist1start > dist1end && dist2end > dist2start) {
- pointListIterator = PointListIterator.create(svg.substring(end), fullHeight, lineColor);
+ pointListIterator = lineSvg.getPointsWithThisColor(lineColor);
this.extremity2 = getExtremity(linkType.getDecor1(), pointListIterator, dotPath.getEndPoint(),
dotPath.getEndAngle(), lhead, bibliotekon.getShape(link.getEntity2()));
this.extremity1 = getExtremity(linkType.getDecor2(), pointListIterator, dotPath.getStartPoint(),
@@ -568,7 +577,7 @@ public class Line implements Moveable, Hideable {
}
if (this.labelText != null) {
- final Point2D pos = getXY(svg, this.noteLabelColor, fullHeight);
+ final Point2D pos = getXY(fullSvg, this.noteLabelColor);
if (pos != null) {
corner1.manage(pos);
this.labelXY = TextBlockUtils.asPositionable(labelText, stringBounder, pos);
@@ -576,7 +585,7 @@ public class Line implements Moveable, Hideable {
}
if (this.startTailText != null) {
- final Point2D pos = getXY(svg, this.startTailColor, fullHeight);
+ final Point2D pos = getXY(fullSvg, this.startTailColor);
if (pos != null) {
corner1.manage(pos);
this.startTailLabelXY = TextBlockUtils.asPositionable(startTailText, stringBounder, pos);
@@ -584,7 +593,7 @@ public class Line implements Moveable, Hideable {
}
if (this.endHeadText != null) {
- final Point2D pos = getXY(svg, this.endHeadColor, fullHeight);
+ final Point2D pos = getXY(fullSvg, this.endHeadColor);
if (pos != null) {
corner1.manage(pos);
this.endHeadLabelXY = TextBlockUtils.asPositionable(endHeadText, stringBounder, pos);
@@ -601,12 +610,12 @@ public class Line implements Moveable, Hideable {
return dotPath.getBeziers().size() <= 1;
}
- private Point2D.Double getXY(String svg, int color, int height) {
- final int idx = SvekUtils.getIndexFromColor(svg, color);
+ private Point2D.Double getXY(SvgResult svgResult, int color) {
+ final int idx = svgResult.getIndexFromColor(color);
if (idx == -1) {
return null;
}
- return SvekUtils.getMinXY(SvekUtils.extractPointsList(svg, idx, height));
+ return SvekUtils.getMinXY(svgResult.substring(idx).extractList(SvgResult.POINTS_EQUALS));
}
@@ -650,7 +659,7 @@ public class Line implements Moveable, Hideable {
ug = ug.apply(new UChangeBackColor(null)).apply(new UChangeColor(color));
final LinkType linkType = link.getType();
- UStroke stroke = linkType.getStroke();
+ UStroke stroke = linkType.getStroke3(defaultThickness);
if (link.getColors() != null && link.getColors().getSpecificLineStroke() != null) {
stroke = link.getColors().getSpecificLineStroke();
}
@@ -716,7 +725,8 @@ public class Line implements Moveable, Hideable {
final PointAndAngle middle = dotPath.getMiddle();
final double angleRad = middle.getAngle();
final double angleDeg = -angleRad * 180.0 / Math.PI;
- final UDrawable mi = linkType.getMiddleDecor().getMiddleFactory().createUDrawable(angleDeg - 45);
+ final UDrawable mi = linkType.getMiddleDecor().getMiddleFactory(arrowLollipopColor)
+ .createUDrawable(angleDeg - 45);
mi.drawU(ug.apply(new UTranslate(x + middle.getX(), y + middle.getY())));
}
diff --git a/src/net/sourceforge/plantuml/svek/Point2DFunction.java b/src/net/sourceforge/plantuml/svek/Point2DFunction.java
new file mode 100644
index 0000000..792db20
--- /dev/null
+++ b/src/net/sourceforge/plantuml/svek/Point2DFunction.java
@@ -0,0 +1,44 @@
+/* ========================================================================
+ * 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 interface Point2DFunction {
+
+ Point2D.Double apply(Point2D pt);
+
+}
diff --git a/src/net/sourceforge/plantuml/svek/PointListIterator.java b/src/net/sourceforge/plantuml/svek/PointListIterator.java
new file mode 100644
index 0000000..f7cc577
--- /dev/null
+++ b/src/net/sourceforge/plantuml/svek/PointListIterator.java
@@ -0,0 +1,46 @@
+/* ========================================================================
+ * 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;
+import java.util.Iterator;
+import java.util.List;
+
+public interface PointListIterator extends Iterator<List<Point2D.Double>> {
+
+ public PointListIterator cloneMe();
+
+}
diff --git a/src/net/sourceforge/plantuml/svek/PointListIteratorImpl.java b/src/net/sourceforge/plantuml/svek/PointListIteratorImpl.java
new file mode 100644
index 0000000..f834873
--- /dev/null
+++ b/src/net/sourceforge/plantuml/svek/PointListIteratorImpl.java
@@ -0,0 +1,90 @@
+/* ========================================================================
+ * 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;
+import java.util.Collections;
+import java.util.List;
+
+import net.sourceforge.plantuml.Log;
+
+class PointListIteratorImpl implements PointListIterator {
+
+ private final SvgResult svg;
+ private int pos = 0;
+
+ static PointListIterator create(SvgResult svg, int lineColor) {
+ final PointListIteratorImpl result = new PointListIteratorImpl(svg);
+ final int idx = svg.getIndexFromColor(lineColor);
+ if (idx == -1) {
+ result.pos = -1;
+ }
+ return result;
+ }
+
+ public PointListIterator cloneMe() {
+ final PointListIteratorImpl result = new PointListIteratorImpl(svg);
+ result.pos = this.pos;
+ return result;
+ }
+
+ private PointListIteratorImpl(SvgResult svg) {
+ this.svg = svg;
+ }
+
+ public boolean hasNext() {
+ return true;
+ }
+
+ public List<Point2D.Double> next() {
+ if (pos == -1) {
+ return Collections.emptyList();
+ }
+ try {
+ final List<Point2D.Double> result = svg.substring(pos).extractList(SvgResult.POINTS_EQUALS);
+ pos = svg.indexOf(SvgResult.POINTS_EQUALS, pos) + SvgResult.POINTS_EQUALS.length() + 1;
+ return result;
+ } catch (StringIndexOutOfBoundsException e) {
+ Log.error("Error " + e);
+ return Collections.emptyList();
+ }
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/svek/Shape.java b/src/net/sourceforge/plantuml/svek/Shape.java
index 8db70c7..9cf1df4 100644
--- a/src/net/sourceforge/plantuml/svek/Shape.java
+++ b/src/net/sourceforge/plantuml/svek/Shape.java
@@ -99,7 +99,8 @@ public class Shape implements Positionable, IShapePseudo, Hideable {
this.color = colorSequence.getValue();
this.uid = String.format("sh%04d", color);
this.shield = shield;
- if (shield.isZero() == false && type != ShapeType.RECTANGLE && type != ShapeType.RECTANGLE_HTML_FOR_PORTS) {
+ if (shield.isZero() == false && type != ShapeType.RECTANGLE && type != ShapeType.RECTANGLE_HTML_FOR_PORTS
+ && type != ShapeType.RECTANGLE_WITH_CIRCLE_INSIDE) {
throw new IllegalArgumentException();
}
}
@@ -121,6 +122,10 @@ public class Shape implements Positionable, IShapePseudo, Hideable {
appendLabelHtmlSpecialForLink(sb, stringBounder);
return;
}
+ if (type == ShapeType.RECTANGLE_WITH_CIRCLE_INSIDE) {
+ appendHtml(sb);
+ return;
+ }
if (type == ShapeType.RECTANGLE && shield.isZero() == false) {
appendHtml(sb);
return;
@@ -232,7 +237,8 @@ public class Shape implements Positionable, IShapePseudo, Hideable {
private void appendShapeInternal(StringBuilder sb) {
if (type == ShapeType.RECTANGLE && shield.isZero() == false) {
throw new UnsupportedOperationException();
- } else if (type == ShapeType.RECTANGLE || type == ShapeType.FOLDER) {
+ } else if (type == ShapeType.RECTANGLE || type == ShapeType.RECTANGLE_WITH_CIRCLE_INSIDE
+ || type == ShapeType.FOLDER) {
sb.append("shape=rect");
} else if (type == ShapeType.RECTANGLE_HTML_FOR_PORTS) {
throw new UnsupportedOperationException();
diff --git a/src/net/sourceforge/plantuml/svek/ShapeType.java b/src/net/sourceforge/plantuml/svek/ShapeType.java
index 7ea65b2..dec490f 100644
--- a/src/net/sourceforge/plantuml/svek/ShapeType.java
+++ b/src/net/sourceforge/plantuml/svek/ShapeType.java
@@ -37,6 +37,6 @@ package net.sourceforge.plantuml.svek;
public enum ShapeType {
- RECTANGLE, RECTANGLE_HTML_FOR_PORTS, ROUND_RECTANGLE, CIRCLE, CIRCLE_IN_RECT, OVAL, DIAMOND, OCTAGON, FOLDER
+ RECTANGLE, RECTANGLE_WITH_CIRCLE_INSIDE, RECTANGLE_HTML_FOR_PORTS, ROUND_RECTANGLE, CIRCLE, CIRCLE_IN_RECT, OVAL, DIAMOND, OCTAGON, FOLDER
}
diff --git a/src/net/sourceforge/plantuml/svek/SvekUtils.java b/src/net/sourceforge/plantuml/svek/SvekUtils.java
index 3de5645..8c51934 100644
--- a/src/net/sourceforge/plantuml/svek/SvekUtils.java
+++ b/src/net/sourceforge/plantuml/svek/SvekUtils.java
@@ -40,15 +40,10 @@ import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
import java.util.List;
import java.util.Locale;
-import java.util.StringTokenizer;
import net.sourceforge.plantuml.Log;
-import net.sourceforge.plantuml.StringUtils;
public class SvekUtils {
@@ -65,95 +60,6 @@ public class SvekUtils {
}
}
- static class PointListIterator implements Iterator<List<Point2D.Double>> {
-
- private final String text;
- private final double yDelta;
- private int pos = 0;
-
- public static PointListIterator create(String text, double yDelta, int lineColor) {
- final PointListIterator result = new PointListIterator(text, yDelta);
- final int idx = getIndexFromColor(text, lineColor);
- if (idx == -1) {
- result.pos = -1;
- }
- return result;
- }
-
- public PointListIterator cloneMe() {
- final PointListIterator result = new PointListIterator(text, yDelta);
- result.pos = this.pos;
- return result;
- }
-
- private PointListIterator(String text, double yDelta) {
- this.text = text;
- this.yDelta = yDelta;
- }
-
- public boolean hasNext() {
- return true;
- }
-
- public List<Point2D.Double> next() {
- if (pos == -1) {
- return Collections.emptyList();
- }
- try {
- final List<Point2D.Double> result = extractPointsList(text, pos, yDelta);
- pos = text.indexOf(pointsString, pos) + pointsString.length() + 1;
- return result;
- } catch (StringIndexOutOfBoundsException e) {
- Log.error("Error " + e);
- return Collections.emptyList();
- }
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- }
-
- final private static String pointsString = "points=\"";
-
- public static List<Point2D.Double> extractPointsList(final String svg, final int starting, double yDelta) {
- final int p2 = svg.indexOf(pointsString, starting);
- final int p3 = svg.indexOf("\"", p2 + pointsString.length());
- final String points = svg.substring(p2 + pointsString.length(), p3);
- final List<Point2D.Double> pointsList = getPoints(points, yDelta);
- return pointsList;
- }
-
- public static List<Point2D.Double> extractD(final String svg, final int starting, double yDelta) {
- final int p2 = svg.indexOf("d=\"", starting);
- final int p3 = svg.indexOf("\"", p2 + "d=\"".length());
- final String points = svg.substring(p2 + "d=\"".length(), p3);
- final List<Point2D.Double> pointsList = getPoints(points, yDelta);
- return pointsList;
- }
-
- public static int getIndexFromColor(String svg, int color) {
- String s = "stroke=\"" + StringUtils.goLowerCase(StringUtils.getAsHtml(color)) + "\"";
- int idx = svg.indexOf(s);
- if (idx != -1) {
- return idx;
- }
- s = ";stroke:" + StringUtils.goLowerCase(StringUtils.getAsHtml(color)) + ";";
- idx = svg.indexOf(s);
- if (idx != -1) {
- return idx;
- }
- s = "fill=\"" + StringUtils.goLowerCase(StringUtils.getAsHtml(color)) + "\"";
- idx = svg.indexOf(s);
- if (idx != -1) {
- return idx;
- }
- // Log.info("Cannot find color=" + color + " " + StringUtils.goLowerCase(StringUtils.getAsHtml(color)));
- return -1;
-
- }
-
static public double getValue(String svg, int starting, String varName) {
final String varNameString = varName + "=\"";
int p1 = svg.indexOf(varNameString, starting);
@@ -210,23 +116,6 @@ public class SvekUtils {
return result;
}
- static private List<Point2D.Double> getPoints(String points, double yDelta) {
- try {
- final List<Point2D.Double> result = new ArrayList<Point2D.Double>();
- final StringTokenizer st = new StringTokenizer(points, " MC");
- while (st.hasMoreTokens()) {
- final String t = st.nextToken();
- final StringTokenizer st2 = new StringTokenizer(t, ",");
- final double x = Double.parseDouble(st2.nextToken());
- final double y = Double.parseDouble(st2.nextToken()) + yDelta;
- result.add(new Point2D.Double(x, y));
- }
- return result;
- } catch (NumberFormatException e) {
- return Collections.emptyList();
- }
- }
-
public static void println(StringBuilder sb) {
sb.append('\n');
}
diff --git a/src/net/sourceforge/plantuml/svek/SvgResult.java b/src/net/sourceforge/plantuml/svek/SvgResult.java
new file mode 100644
index 0000000..3b0a729
--- /dev/null
+++ b/src/net/sourceforge/plantuml/svek/SvgResult.java
@@ -0,0 +1,135 @@
+/* ========================================================================
+ * 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;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import net.sourceforge.plantuml.StringUtils;
+
+public class SvgResult {
+
+ public static final String D_EQUALS = "d=\"";
+ public static final String POINTS_EQUALS = "points=\"";
+
+ private final String svg;
+ private final Point2DFunction function;
+
+ public SvgResult(String svg, Point2DFunction function) {
+ this.svg = svg;
+ this.function = function;
+ }
+
+ public PointListIterator getPointsWithThisColor(int lineColor) {
+ return PointListIteratorImpl.create(this, lineColor);
+ }
+
+ public List<Point2D.Double> extractList(final String searched) {
+ final int p2 = this.indexOf(searched, 0);
+ if (p2 == -1) {
+ return Collections.emptyList();
+ }
+ final int p3 = this.indexOf("\"", p2 + searched.length());
+ if (p3 == -1) {
+ return Collections.emptyList();
+ }
+ return this.substring(p2 + searched.length(), p3).getPoints(" MC");
+ }
+
+ public int getIndexFromColor(int color) {
+ String s = "stroke=\"" + StringUtils.goLowerCase(StringUtils.getAsHtml(color)) + "\"";
+ int idx = svg.indexOf(s);
+ if (idx != -1) {
+ return idx;
+ }
+ s = ";stroke:" + StringUtils.goLowerCase(StringUtils.getAsHtml(color)) + ";";
+ idx = svg.indexOf(s);
+ if (idx != -1) {
+ return idx;
+ }
+ s = "fill=\"" + StringUtils.goLowerCase(StringUtils.getAsHtml(color)) + "\"";
+ idx = svg.indexOf(s);
+ if (idx != -1) {
+ return idx;
+ }
+ // Log.info("Cannot find color=" + color + " " + StringUtils.goLowerCase(StringUtils.getAsHtml(color)));
+ return -1;
+
+ }
+
+ public List<Point2D.Double> getPoints(String separator) {
+ try {
+ final StringTokenizer st = new StringTokenizer(svg, separator);
+ final List<Point2D.Double> result = new ArrayList<Point2D.Double>();
+ while (st.hasMoreTokens()) {
+ result.add(getFirstPoint(st.nextToken()));
+ }
+ return result;
+ } catch (NumberFormatException e) {
+ return Collections.emptyList();
+ }
+ }
+
+ public Point2D.Double getNextPoint() {
+ return getFirstPoint(svg);
+ }
+
+ private Point2D.Double getFirstPoint(final String tmp) {
+ final StringTokenizer st = new StringTokenizer(tmp, ",");
+ final double startX = Double.parseDouble(st.nextToken());
+ final double startY = Double.parseDouble(st.nextToken());
+ return function.apply(new Point2D.Double(startX, startY));
+ }
+
+ public int indexOf(String s, int pos) {
+ return svg.indexOf(s, pos);
+ }
+
+ public SvgResult substring(int pos) {
+ return new SvgResult(svg.substring(pos), function);
+ }
+
+ public SvgResult substring(int start, int end) {
+ return new SvgResult(svg.substring(start, end), function);
+ }
+
+ public final String getSvg() {
+ return svg;
+ }
+}
diff --git a/src/net/sourceforge/plantuml/svek/UGraphicForSnake.java b/src/net/sourceforge/plantuml/svek/UGraphicForSnake.java
index 830b62c..fe43822 100644
--- a/src/net/sourceforge/plantuml/svek/UGraphicForSnake.java
+++ b/src/net/sourceforge/plantuml/svek/UGraphicForSnake.java
@@ -51,6 +51,11 @@ public class UGraphicForSnake extends UGraphicDelegator {
private final double dy;
private final List<PendingSnake> snakes;
+ @Override
+ public String toString() {
+ return super.toString() + " " + getUg();
+ }
+
public UTranslate getTranslation() {
return new UTranslate(dx, dy);
}
@@ -68,11 +73,11 @@ public class UGraphicForSnake extends UGraphicDelegator {
this.dy = dy;
}
- public void drawInternal() {
+ void drawInternal() {
snake.drawInternal(ug);
}
- public void removeEndDecorationIfTouches(List<PendingSnake> snakes) {
+ void removeEndDecorationIfTouches(List<PendingSnake> snakes) {
for (PendingSnake other : snakes) {
if (moved().touches(other.moved())) {
this.snake.removeEndDecoration();
@@ -80,7 +85,7 @@ public class UGraphicForSnake extends UGraphicDelegator {
}
}
}
-
+
private Snake moved() {
return snake.move(dx, dy);
}
diff --git a/src/net/sourceforge/plantuml/svek/YDelta.java b/src/net/sourceforge/plantuml/svek/YDelta.java
new file mode 100644
index 0000000..8d0dc28
--- /dev/null
+++ b/src/net/sourceforge/plantuml/svek/YDelta.java
@@ -0,0 +1,59 @@
+/* ========================================================================
+ * 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 YDelta implements Point2DFunction {
+
+ private final double delta;
+ private final double factor;
+
+ public YDelta(double delta) {
+ this(1, delta);
+ }
+
+ public YDelta(double factor, double delta) {
+ this.delta = delta;
+ this.factor = factor;
+ }
+
+ public Point2D.Double apply(Point2D pt) {
+ return new Point2D.Double(pt.getX(), pt.getY() * factor + delta);
+
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityCircle.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityCircle.java
index d473739..c3aabf8 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityCircle.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityCircle.java
@@ -38,6 +38,7 @@ package net.sourceforge.plantuml.svek.extremity;
import java.awt.geom.Point2D;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UGraphic;
@@ -47,19 +48,31 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
class ExtremityCircle extends Extremity {
private final Point2D dest;
- private final double radius = 6;
+ private static final double radius = 6;
@Override
public Point2D somePoint() {
return dest;
}
- public ExtremityCircle(Point2D p1) {
- this.dest = new Point2D.Double(p1.getX(), p1.getY());
+ // public static UDrawable createContact(Point2D p1, double angle) {
+ // final double x = p1.getX() - radius + radius * Math.sin(angle);
+ // final double y = p1.getY() - radius - radius * Math.cos(angle);
+ // return new ExtremityCircle(x, y);
+ // }
+
+ public static UDrawable create(Point2D center) {
+ return new ExtremityCircle(center.getX(), center.getY());
+ }
+
+ private ExtremityCircle(double x, double y) {
+ this.dest = new Point2D.Double(x, y);
}
public void drawU(UGraphic ug) {
- ug.apply(new UStroke(1.5)).apply(new UChangeBackColor(HtmlColorUtils.WHITE)).apply(new UTranslate(dest.getX() - radius, dest.getY() - radius)).draw(new UEllipse(radius * 2, radius * 2));
+ ug.apply(new UStroke(1.5)).apply(new UChangeBackColor(HtmlColorUtils.WHITE))
+ .apply(new UTranslate(dest.getX() - radius, dest.getY() - radius))
+ .draw(new UEllipse(radius * 2, radius * 2));
}
}
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCircle.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCircle.java
index 5bea50e..686a8d9 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCircle.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCircle.java
@@ -43,9 +43,14 @@ import net.sourceforge.plantuml.svek.Side;
public class ExtremityFactoryCircle extends AbstractExtremityFactory implements ExtremityFactory {
+ @Override
+ public UDrawable createUDrawable(Point2D center, double angle, Side side) {
+ // return ExtremityCircle.createContact(center, angle);
+ return ExtremityCircle.create(center);
+ }
+
public UDrawable createUDrawable(Point2D p0, Point2D p1, Point2D p2, Side side) {
- // final double ortho = atan2(p0, p2);
- return new ExtremityCircle(p1);
+ return ExtremityCircle.create(p1);
}
}
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCrowfoot.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCrowfoot.java
index ad9694a..f2050e8 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCrowfoot.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCrowfoot.java
@@ -47,4 +47,10 @@ public class ExtremityFactoryCrowfoot extends AbstractExtremityFactory implement
final double ortho = atan2(p0, p2);
return new ExtremityCrowfoot(p1, ortho, side);
}
+
+ @Override
+ public UDrawable createUDrawable(Point2D p0, double angle, Side side) {
+ throw new UnsupportedOperationException(getClass().toString());
+ }
+
} \ No newline at end of file
diff --git a/src/net/sourceforge/plantuml/svek/extremity/MiddleCircle.java b/src/net/sourceforge/plantuml/svek/extremity/MiddleCircle.java
index 9c98820..6875452 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/MiddleCircle.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/MiddleCircle.java
@@ -37,7 +37,7 @@ package net.sourceforge.plantuml.svek.extremity;
import java.awt.geom.Point2D;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UGraphic;
@@ -48,7 +48,13 @@ class MiddleCircle extends Extremity {
private final double radius = 6;
private final UEllipse circle = new UEllipse(2 * radius, 2 * radius);
+ private final HtmlColor backColor;
+ public MiddleCircle(HtmlColor backColor) {
+ this.backColor = backColor;
+ }
+
+
@Override
public Point2D somePoint() {
return null;
@@ -56,7 +62,7 @@ class MiddleCircle extends Extremity {
public void drawU(UGraphic ug) {
- ug.apply(new UChangeBackColor(HtmlColorUtils.WHITE)).apply(new UStroke(1.5)).apply(new UTranslate(-radius, -radius)).draw(circle);
+ ug.apply(new UChangeBackColor(backColor)).apply(new UStroke(1.5)).apply(new UTranslate(-radius, -radius)).draw(circle);
}
}
diff --git a/src/net/sourceforge/plantuml/svek/extremity/MiddleCircleCircled.java b/src/net/sourceforge/plantuml/svek/extremity/MiddleCircleCircled.java
index eadcf5e..e38e561 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/MiddleCircleCircled.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/MiddleCircleCircled.java
@@ -37,6 +37,7 @@ package net.sourceforge.plantuml.svek.extremity;
import java.awt.geom.Point2D;
+import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
@@ -47,6 +48,7 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
class MiddleCircleCircled extends Extremity {
+ private final HtmlColor diagramBackColor = HtmlColorUtils.WHITE;
private final double angle;
private final MiddleCircleCircledMode mode;
private final double radius1 = 6;
@@ -54,24 +56,26 @@ class MiddleCircleCircled extends Extremity {
private final double radius2 = 10;
private final UEllipse bigcircle = new UEllipse(2 * radius2, 2 * radius2);
+ private final HtmlColor backColor;
- public MiddleCircleCircled(double angle, MiddleCircleCircledMode mode) {
+ public MiddleCircleCircled(double angle, MiddleCircleCircledMode mode, HtmlColor backColor) {
this.angle = angle;
this.mode = mode;
+ this.backColor = backColor;
}
-
+
@Override
public Point2D somePoint() {
return null;
}
-
public void drawU(UGraphic ug) {
- ug = ug.apply(new UChangeBackColor(HtmlColorUtils.WHITE));
if (mode == MiddleCircleCircledMode.BOTH) {
- ug.apply(new UChangeColor(HtmlColorUtils.WHITE)).apply(new UTranslate(-radius2, -radius2)).draw(bigcircle);
+ ug.apply(new UChangeColor(diagramBackColor)).apply(new UChangeBackColor(diagramBackColor))
+ .apply(new UTranslate(-radius2, -radius2)).draw(bigcircle);
}
+ ug = ug.apply(new UChangeBackColor(backColor));
ug = ug.apply(new UStroke(1.5));
final double d = 0;
diff --git a/src/net/sourceforge/plantuml/svek/extremity/MiddleFactoryCircle.java b/src/net/sourceforge/plantuml/svek/extremity/MiddleFactoryCircle.java
index e221f50..ec66eb8 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/MiddleFactoryCircle.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/MiddleFactoryCircle.java
@@ -35,12 +35,19 @@
*/
package net.sourceforge.plantuml.svek.extremity;
+import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.UDrawable;
public class MiddleFactoryCircle implements MiddleFactory {
+
+ private final HtmlColor backColor;
+
+ public MiddleFactoryCircle(HtmlColor backColor) {
+ this.backColor = backColor;
+ }
public UDrawable createUDrawable(double angle) {
- return new MiddleCircle();
+ return new MiddleCircle(backColor);
}
}
diff --git a/src/net/sourceforge/plantuml/svek/extremity/MiddleFactoryCircleCircled.java b/src/net/sourceforge/plantuml/svek/extremity/MiddleFactoryCircleCircled.java
index 552c395..b9252d2 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/MiddleFactoryCircleCircled.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/MiddleFactoryCircleCircled.java
@@ -35,18 +35,21 @@
*/
package net.sourceforge.plantuml.svek.extremity;
+import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.UDrawable;
public class MiddleFactoryCircleCircled implements MiddleFactory {
private final MiddleCircleCircledMode mode;
+ private final HtmlColor backColor;
- public MiddleFactoryCircleCircled(MiddleCircleCircledMode mode) {
+ public MiddleFactoryCircleCircled(MiddleCircleCircledMode mode, HtmlColor backColor) {
this.mode = mode;
+ this.backColor = backColor;
}
public UDrawable createUDrawable(double angle) {
- return new MiddleCircleCircled(angle, mode);
+ return new MiddleCircleCircled(angle, mode, backColor);
}
}
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageClass.java b/src/net/sourceforge/plantuml/svek/image/EntityImageClass.java
index 403b09e..99e01c3 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageClass.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageClass.java
@@ -44,6 +44,7 @@ import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineConfigurable;
import net.sourceforge.plantuml.LineParam;
+import net.sourceforge.plantuml.CornerParam;
import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.creole.Stencil;
@@ -84,7 +85,7 @@ public class EntityImageClass extends AbstractEntityImage implements Stencil, Wi
public EntityImageClass(GraphvizVersion version, ILeaf entity, ISkinParam skinParam, PortionShower portionShower) {
super(entity, entity.getColors(skinParam).mute(skinParam));
this.lineConfig = entity;
- this.roundCorner = getSkinParam().getRoundCorner("", null);
+ this.roundCorner = getSkinParam().getRoundCorner(CornerParam.DEFAULT, null);
this.shield = version != null && version.useShield() && entity.hasNearDecoration() ? Margins.uniform(16)
: Margins.NONE;
final boolean showMethods = portionShower.showPortion(EntityPortion.METHOD, entity);
@@ -139,7 +140,8 @@ public class EntityImageClass extends AbstractEntityImage implements Stencil, Wi
final double widthTotal = dimTotal.getWidth();
final double heightTotal = dimTotal.getHeight();
- final Shadowable rect = new URectangle(widthTotal, heightTotal, roundCorner, roundCorner, getEntity().getCode().getFullName());
+ final Shadowable rect = new URectangle(widthTotal, heightTotal, roundCorner, roundCorner, getEntity().getCode()
+ .getFullName());
if (getSkinParam().shadowing()) {
rect.setDeltaShadow(4);
}
@@ -162,11 +164,13 @@ public class EntityImageClass extends AbstractEntityImage implements Stencil, Wi
if (headerBackcolor == null) {
headerBackcolor = getSkinParam().getHtmlColor(ColorParam.classHeaderBackground, getStereo(), false);
}
+ UGraphic ugHeader = ug;
if (headerBackcolor != null) {
final Shadowable rect2 = new URectangle(widthTotal, dimHeader.getHeight());
- ug.apply(new UChangeBackColor(headerBackcolor)).apply(stroke).draw(rect2);
+ ugHeader = ugHeader.apply(new UChangeBackColor(headerBackcolor));
+ ugHeader.apply(stroke).draw(rect2);
}
- header.drawU(ug, dimTotal.getWidth(), dimHeader.getHeight());
+ header.drawU(ugHeader, dimTotal.getWidth(), dimHeader.getHeight());
if (body != null) {
final UGraphic ug2 = UGraphicStencil.create(ug, this, stroke);
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageClassHeader2.java b/src/net/sourceforge/plantuml/svek/image/EntityImageClassHeader2.java
index 034e6a4..ddc8051 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageClassHeader2.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageClassHeader2.java
@@ -35,6 +35,8 @@
*/
package net.sourceforge.plantuml.svek.image;
+import h.tedge_t;
+
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ColorParam;
@@ -74,15 +76,18 @@ public class EntityImageClassHeader2 extends AbstractEntityImage {
final boolean italic = entity.getLeafType() == LeafType.ABSTRACT_CLASS
|| entity.getLeafType() == LeafType.INTERFACE;
- // final HtmlColor color = SkinParamUtils.getFontColor(getSkinParam(), FontParam.CLASS, getStereo());
final Stereotype stereotype = entity.getStereotype();
- final String generic = entity.getGeneric();
+ final boolean displayGenericWithOldFashion = skinParam.displayGenericWithOldFashion();
+ final String generic = displayGenericWithOldFashion ? null : entity.getGeneric();
FontConfiguration fontConfigurationName = new FontConfiguration(getSkinParam(), FontParam.CLASS, stereotype);
if (italic) {
fontConfigurationName = fontConfigurationName.italic();
}
- TextBlock name = entity.getDisplay().createWithNiceCreoleMode(fontConfigurationName,
- HorizontalAlignment.CENTER, skinParam);
+ Display display = entity.getDisplay();
+ if (displayGenericWithOldFashion && entity.getGeneric() != null) {
+ display = display.addGeneric(entity.getGeneric());
+ }
+ TextBlock name = display.createWithNiceCreoleMode(fontConfigurationName, HorizontalAlignment.CENTER, skinParam);
final VisibilityModifier modifier = entity.getVisibilityModifier();
if (modifier == null) {
name = TextBlockUtils.withMargin(name, 3, 3, 0, 0);
@@ -117,7 +122,7 @@ public class EntityImageClassHeader2 extends AbstractEntityImage {
genericBlock = TextBlockUtils.withMargin(genericBlock, 1, 1);
final HtmlColor classBackground = SkinParamUtils
.getColor(getSkinParam(), ColorParam.background, stereotype);
- // final HtmlColor classBorder = getColor(ColorParam.classBorder, stereotype);
+
final HtmlColor classBorder = SkinParamUtils.getFontColor(getSkinParam(), FontParam.CLASS_STEREOTYPE,
stereotype);
genericBlock = new TextBlockGeneric(genericBlock, classBackground, classBorder);
@@ -140,45 +145,85 @@ public class EntityImageClassHeader2 extends AbstractEntityImage {
}
final UFont font = SkinParamUtils.getFont(getSkinParam(), FontParam.CIRCLED_CHARACTER, null);
final HtmlColor classBorder = SkinParamUtils.getColor(getSkinParam(), ColorParam.classBorder, stereotype);
+ final HtmlColor fontColor = SkinParamUtils.getFontColor(getSkinParam(), FontParam.CIRCLED_CHARACTER, null);
if (stereotype != null && stereotype.getCharacter() != 0) {
return new CircledCharacter(stereotype.getCharacter(), getSkinParam().getCircledCharacterRadius(), font,
- stereotype.getHtmlColor(), classBorder, SkinParamUtils.getFontColor(getSkinParam(),
- FontParam.CIRCLED_CHARACTER, null));
- }
- if (entity.getLeafType() == LeafType.ANNOTATION) {
- return new CircledCharacter('@', getSkinParam().getCircledCharacterRadius(), font, SkinParamUtils.getColor(
- getSkinParam(), ColorParam.stereotypeNBackground, stereotype), classBorder,
- SkinParamUtils.getFontColor(getSkinParam(), FontParam.CIRCLED_CHARACTER, null));
+ stereotype.getHtmlColor(), classBorder, fontColor);
}
- if (entity.getLeafType() == LeafType.ABSTRACT_CLASS) {
- return new CircledCharacter('A', getSkinParam().getCircledCharacterRadius(), font, SkinParamUtils.getColor(
- getSkinParam(), ColorParam.stereotypeABackground, stereotype), classBorder,
- SkinParamUtils.getFontColor(getSkinParam(), FontParam.CIRCLED_CHARACTER, null));
+ final LeafType leafType = entity.getLeafType();
+ final HtmlColor spotBackColor = SkinParamUtils.getColor(getSkinParam(), spotBackground(leafType), stereotype);
+ HtmlColor spotBorder = SkinParamUtils.getColor(getSkinParam(), spotBorder(leafType), stereotype);
+ if (spotBorder == null) {
+ spotBorder = classBorder;
}
- if (entity.getLeafType() == LeafType.CLASS) {
- return new CircledCharacter('C', getSkinParam().getCircledCharacterRadius(), font, SkinParamUtils.getColor(
- getSkinParam(), ColorParam.stereotypeCBackground, stereotype), classBorder,
- SkinParamUtils.getFontColor(getSkinParam(), FontParam.CIRCLED_CHARACTER, null));
+ char circledChar = 0;
+ if (stereotype != null) {
+ circledChar = getSkinParam().getCircledCharacter(stereotype);
}
- if (entity.getLeafType() == LeafType.INTERFACE) {
- return new CircledCharacter('I', getSkinParam().getCircledCharacterRadius(), font, SkinParamUtils.getColor(
- getSkinParam(), ColorParam.stereotypeIBackground, stereotype), classBorder,
- SkinParamUtils.getFontColor(getSkinParam(), FontParam.CIRCLED_CHARACTER, null));
+ if (circledChar == 0) {
+ circledChar = getCircledChar(leafType);
}
- if (entity.getLeafType() == LeafType.ENUM) {
- return new CircledCharacter('E', getSkinParam().getCircledCharacterRadius(), font, SkinParamUtils.getColor(
- getSkinParam(), ColorParam.stereotypeEBackground, stereotype), classBorder,
- SkinParamUtils.getFontColor(getSkinParam(), FontParam.CIRCLED_CHARACTER, null));
+ return new CircledCharacter(circledChar, getSkinParam().getCircledCharacterRadius(), font, spotBackColor,
+ spotBorder, fontColor);
+ }
+
+ private ColorParam spotBackground(LeafType leafType) {
+ switch (leafType) {
+ case ANNOTATION:
+ return ColorParam.stereotypeNBackground;
+ case ABSTRACT_CLASS:
+ return ColorParam.stereotypeABackground;
+ case CLASS:
+ return ColorParam.stereotypeCBackground;
+ case INTERFACE:
+ return ColorParam.stereotypeIBackground;
+ case ENUM:
+ return ColorParam.stereotypeEBackground;
+ case ENTITY:
+ return ColorParam.stereotypeCBackground;
}
- if (entity.getLeafType() == LeafType.ENTITY) {
- return new CircledCharacter('E', getSkinParam().getCircledCharacterRadius(), font, SkinParamUtils.getColor(
- getSkinParam(), ColorParam.stereotypeCBackground, stereotype), classBorder,
- SkinParamUtils.getFontColor(getSkinParam(), FontParam.CIRCLED_CHARACTER, null));
+ assert false;
+ return null;
+ }
+
+ private ColorParam spotBorder(LeafType leafType) {
+ switch (leafType) {
+ case ANNOTATION:
+ return ColorParam.stereotypeNBorder;
+ case ABSTRACT_CLASS:
+ return ColorParam.stereotypeABorder;
+ case CLASS:
+ return ColorParam.stereotypeCBorder;
+ case INTERFACE:
+ return ColorParam.stereotypeIBorder;
+ case ENUM:
+ return ColorParam.stereotypeEBorder;
+ case ENTITY:
+ return ColorParam.stereotypeCBorder;
}
assert false;
return null;
}
+ private char getCircledChar(LeafType leafType) {
+ switch (leafType) {
+ case ANNOTATION:
+ return '@';
+ case ABSTRACT_CLASS:
+ return 'A';
+ case CLASS:
+ return 'C';
+ case INTERFACE:
+ return 'I';
+ case ENUM:
+ return 'E';
+ case ENTITY:
+ return 'E';
+ }
+ assert false;
+ return '?';
+ }
+
public Dimension2D calculateDimension(StringBounder stringBounder) {
return headerLayout.getDimension(stringBounder);
}
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java b/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java
index 63bc39f..256a313 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java
@@ -38,6 +38,8 @@ package net.sourceforge.plantuml.svek.image;
import java.awt.geom.Dimension2D;
import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam;
@@ -46,6 +48,7 @@ import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.cucadiagram.BodyEnhanced;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.EntityPortion;
+import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.PortionShower;
@@ -60,6 +63,7 @@ import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.USymbolFolder;
import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.svek.AbstractEntityImage;
import net.sourceforge.plantuml.svek.Margins;
import net.sourceforge.plantuml.svek.ShapeType;
@@ -90,10 +94,18 @@ public class EntityImageDescription extends AbstractEntityImage {
Collection<Link> links) {
super(entity, entity.getColors(skinParam).mute(skinParam));
this.useRankSame = skinParam.useRankSame();
+
this.links = links;
final Stereotype stereotype = entity.getStereotype();
USymbol symbol = getUSymbol(entity);
- this.shapeType = symbol == USymbol.FOLDER ? ShapeType.FOLDER : ShapeType.RECTANGLE;
+ if (symbol == USymbol.FOLDER) {
+ this.shapeType = ShapeType.FOLDER;
+ } else if (symbol == USymbol.INTERFACE) {
+ this.shapeType = ShapeType.RECTANGLE;
+ // this.shapeType = ShapeType.RECTANGLE_WITH_CIRCLE_INSIDE;
+ } else {
+ this.shapeType = ShapeType.RECTANGLE;
+ }
this.hideText = symbol == USymbol.INTERFACE;
final Display codeDisplay = Display.getWithNewlines(entity.getCode());
@@ -104,7 +116,8 @@ public class EntityImageDescription extends AbstractEntityImage {
this.url = entity.getUrl99();
- HtmlColor backcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.BACK);
+ final Colors colors = entity.getColors(skinParam);
+ HtmlColor backcolor = colors.getColor(ColorType.BACK);
if (backcolor == null) {
backcolor = SkinParamUtils.getColor(getSkinParam(), symbol.getColorParamBack(), getStereo());
}
@@ -112,9 +125,12 @@ public class EntityImageDescription extends AbstractEntityImage {
assert getStereo() == stereotype;
final HtmlColor forecolor = SkinParamUtils.getColor(getSkinParam(), symbol.getColorParamBorder(), stereotype);
final double roundCorner = symbol.getSkinParameter().getRoundCorner(getSkinParam(), stereotype);
- final UStroke stroke = symbol.getSkinParameter().getStroke(getSkinParam(), stereotype);
+ final double diagonalCorner = symbol.getSkinParameter().getDiagonalCorner(getSkinParam(), stereotype);
+ final UStroke stroke = colors.muteStroke(symbol.getSkinParameter().getStroke(getSkinParam(), stereotype));
+
final SymbolContext ctx = new SymbolContext(backcolor, forecolor).withStroke(stroke)
- .withShadow(getSkinParam().shadowing2(symbol.getSkinParameter())).withRoundCorner(roundCorner);
+ .withShadow(getSkinParam().shadowing2(symbol.getSkinParameter()))
+ .withCorner(roundCorner, diagonalCorner);
stereo = TextBlockUtils.empty(0, 0);
@@ -162,24 +178,59 @@ public class EntityImageDescription extends AbstractEntityImage {
@Override
public Margins getShield(StringBounder stringBounder) {
- if (hideText && (useRankSame == false || hasSomeHorizontalLink((ILeaf) getEntity(), links) == false)) {
- final Dimension2D dimStereo = stereo.calculateDimension(stringBounder);
- final Dimension2D dimDesc = desc.calculateDimension(stringBounder);
- final Dimension2D dimSmall = asSmall.calculateDimension(stringBounder);
- final double x = Math.max(dimStereo.getWidth(), dimDesc.getWidth());
- double suppX = x - dimSmall.getWidth();
- if (suppX < 1) {
- suppX = 1;
+ if (hideText == false) {
+ return Margins.NONE;
+ }
+ // if (useRankSame && hasSomeHorizontalLink((ILeaf) getEntity(), links)) {
+ // return Margins.NONE;
+ // }
+ if (isThereADoubleLink((ILeaf) getEntity(), links)) {
+ return Margins.NONE;
+ }
+ if (hasSomeHorizontalLinkVisible((ILeaf) getEntity(), links)) {
+ return Margins.NONE;
+ }
+ if (hasSomeHorizontalLinkDoubleDecorated((ILeaf) getEntity(), links)) {
+ return Margins.NONE;
+ }
+ final Dimension2D dimStereo = stereo.calculateDimension(stringBounder);
+ final Dimension2D dimDesc = desc.calculateDimension(stringBounder);
+ final Dimension2D dimSmall = asSmall.calculateDimension(stringBounder);
+ final double x = Math.max(dimStereo.getWidth(), dimDesc.getWidth());
+ double suppX = x - dimSmall.getWidth();
+ if (suppX < 1) {
+ suppX = 1;
+ }
+ final double y = MathUtils.max(1, dimDesc.getHeight(), dimStereo.getHeight());
+ return new Margins(suppX / 2, suppX / 2, y, y);
+ }
+
+ private boolean hasSomeHorizontalLinkVisible(ILeaf leaf, Collection<Link> links) {
+ for (Link link : links) {
+ if (link.getLength() == 1 && link.contains(leaf) && link.isInvis() == false) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean isThereADoubleLink(ILeaf leaf, Collection<Link> links) {
+ final Set<IEntity> others = new HashSet<IEntity>();
+ for (Link link : links) {
+ if (link.contains(leaf)) {
+ final IEntity other = link.getOther(leaf);
+ final boolean changed = others.add(other);
+ if (changed == false) {
+ return true;
+ }
}
- final double y = MathUtils.max(1, dimDesc.getHeight(), dimStereo.getHeight());
- return new Margins(suppX / 2, suppX / 2, y, y);
}
- return Margins.NONE;
+ return false;
}
- private boolean hasSomeHorizontalLink(ILeaf leaf, Collection<Link> links) {
+ private boolean hasSomeHorizontalLinkDoubleDecorated(ILeaf leaf, Collection<Link> links) {
for (Link link : links) {
- if (link.getLength() == 1 && link.contains(leaf)) {
+ if (link.getLength() == 1 && link.contains(leaf) && link.getType().isDoubleDecorated()) {
return true;
}
}
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageEmptyPackage.java b/src/net/sourceforge/plantuml/svek/image/EntityImageEmptyPackage.java
index 88faab7..3d86ef8 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageEmptyPackage.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageEmptyPackage.java
@@ -37,6 +37,7 @@ package net.sourceforge.plantuml.svek.image;
import java.awt.geom.Dimension2D;
+import net.sourceforge.plantuml.AlignmentParam;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam;
@@ -105,7 +106,7 @@ public class EntityImageEmptyPackage extends AbstractEntityImage {
private UStroke getStroke() {
UStroke stroke = getSkinParam().getThickness(LineParam.packageBorder, getStereo());
if (stroke == null) {
- stroke = new UStroke(2.0);
+ stroke = new UStroke(1.5);
}
return stroke;
}
@@ -128,7 +129,8 @@ public class EntityImageEmptyPackage extends AbstractEntityImage {
stereoBlock, 0, 0, widthTotal, heightTotal, getStroke());
decoration.drawU(ug, back, SkinParamUtils.getColor(getSkinParam(), ColorParam.packageBorder, getStereo()),
- getSkinParam().shadowing(), roundCorner);
+ getSkinParam().shadowing(), roundCorner,
+ getSkinParam().getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null));
if (url != null) {
ug.closeAction();
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageNote.java b/src/net/sourceforge/plantuml/svek/image/EntityImageNote.java
index 50eb9cb..ec8f58f 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageNote.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageNote.java
@@ -45,6 +45,7 @@ import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineParam;
+import net.sourceforge.plantuml.CornerParam;
import net.sourceforge.plantuml.SkinParamBackcolored;
import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.Url;
@@ -73,14 +74,12 @@ import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UGraphicStencil;
-import net.sourceforge.plantuml.ugraphic.ULine;
-import net.sourceforge.plantuml.ugraphic.UPolygon;
+import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
public class EntityImageNote extends AbstractEntityImage implements Stencil {
- private final int cornersize = 10;
private final HtmlColor noteBackgroundColor;
private final HtmlColor borderColor;
private final int marginX1 = 6;
@@ -114,7 +113,7 @@ public class EntityImageNote extends AbstractEntityImage implements Stencil {
textBlock = new TextBlockEmpty();
} else {
textBlock = new BodyEnhanced2(strings, FontParam.NOTE, getSkinParam(), HorizontalAlignment.LEFT,
- new FontConfiguration(getSkinParam(), FontParam.NOTE, null));
+ new FontConfiguration(getSkinParam(), FontParam.NOTE, null), getSkinParam().wrapWidth());
}
}
@@ -211,6 +210,7 @@ public class EntityImageNote extends AbstractEntityImage implements Stencil {
final Point2D projection = move(other.projection(newRefpp2, stringBounder), -shape.getMinX(),
-shape.getMinY());
final Opale opale = new Opale(borderColor, noteBackgroundColor, textBlock, skinParam.shadowing(), true);
+ opale.setRoundCorner(getRoundCorner());
opale.setOpale(strategy, pp1, projection);
final UGraphic stroked = applyStroke(ug2);
opale.drawU(Colors.applyStroke(stroked, getEntity().getColors(skinParam)));
@@ -220,22 +220,26 @@ public class EntityImageNote extends AbstractEntityImage implements Stencil {
}
}
+ private double getRoundCorner() {
+ return skinParam.getRoundCorner(CornerParam.DEFAULT, null);
+ }
+
private static Point2D move(Point2D pt, double dx, double dy) {
return new Point2D.Double(pt.getX() + dx, pt.getY() + dy);
}
private void drawNormal(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder();
- final UPolygon polygon = getPolygonNormal(stringBounder);
+ final UPath polygon = Opale.getPolygonNormal(getTextWidth(stringBounder), getTextHeight(stringBounder),
+ getRoundCorner());
if (withShadow) {
polygon.setDeltaShadow(4);
}
ug = ug.apply(new UChangeBackColor(noteBackgroundColor)).apply(new UChangeColor(borderColor));
final UGraphic stroked = applyStroke(ug);
stroked.draw(polygon);
+ ug.draw(Opale.getCorner(getTextWidth(stringBounder), getRoundCorner()));
- stroked.apply(new UTranslate(getTextWidth(stringBounder) - cornersize, 0)).draw(new ULine(0, cornersize));
- stroked.apply(new UTranslate(getTextWidth(stringBounder), cornersize)).draw(new ULine(-cornersize, 0));
getTextBlock().drawU(ug.apply(new UTranslate(marginX1, marginY)));
}
@@ -247,17 +251,6 @@ public class EntityImageNote extends AbstractEntityImage implements Stencil {
return ug.apply(stroke);
}
- private UPolygon getPolygonNormal(final StringBounder stringBounder) {
- final UPolygon polygon = new UPolygon();
- polygon.addPoint(0, 0);
- polygon.addPoint(0, getTextHeight(stringBounder));
- polygon.addPoint(getTextWidth(stringBounder), getTextHeight(stringBounder));
- polygon.addPoint(getTextWidth(stringBounder), cornersize);
- polygon.addPoint(getTextWidth(stringBounder) - cornersize, 0);
- polygon.addPoint(0, 0);
- return polygon;
- }
-
private Direction getOpaleStrategy(double width, double height, Point2D pt) {
final double d1 = GeomUtils.getOrthoDistance(new Line2D.Double(width, 0, width, height), pt);
final double d2 = GeomUtils.getOrthoDistance(new Line2D.Double(0, height, width, height), pt);
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageObject.java b/src/net/sourceforge/plantuml/svek/image/EntityImageObject.java
index 2c64232..c4821ab 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageObject.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageObject.java
@@ -43,6 +43,7 @@ import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineConfigurable;
import net.sourceforge.plantuml.LineParam;
+import net.sourceforge.plantuml.CornerParam;
import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.creole.Stencil;
@@ -87,7 +88,7 @@ public class EntityImageObject extends AbstractEntityImage implements Stencil {
super(entity, skinParam);
this.lineConfig = entity;
final Stereotype stereotype = entity.getStereotype();
- this.roundCorner = skinParam.getRoundCorner("", null);
+ this.roundCorner = skinParam.getRoundCorner(CornerParam.DEFAULT, null);
this.name = TextBlockUtils.withMargin(
entity.getDisplay().create(new FontConfiguration(getSkinParam(), FontParam.OBJECT, stereotype),
HorizontalAlignment.CENTER, skinParam), 2, 2);
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageTips.java b/src/net/sourceforge/plantuml/svek/image/EntityImageTips.java
index db11eca..86b1c90 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageTips.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageTips.java
@@ -45,6 +45,7 @@ import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.command.Position;
import net.sourceforge.plantuml.cucadiagram.BodyEnhanced2;
import net.sourceforge.plantuml.cucadiagram.Display;
@@ -129,7 +130,8 @@ public class EntityImageTips extends AbstractEntityImage {
double height = 0;
for (Map.Entry<String, Display> ent : getEntity().getTips().entrySet()) {
final Display display = ent.getValue();
- final Rectangle2D memberPosition = shapeOther.getImage().getInnerPosition(ent.getKey(), stringBounder, InnerStrategy.STRICT);
+ final Rectangle2D memberPosition = shapeOther.getImage().getInnerPosition(ent.getKey(), stringBounder,
+ InnerStrategy.STRICT);
if (memberPosition == null) {
return;
}
@@ -160,7 +162,7 @@ public class EntityImageTips extends AbstractEntityImage {
// final HtmlColor fontColor = rose.getFontColor(skinParam, FontParam.NOTE);
// final UFont fontNote = skinParam.getFont(FontParam.NOTE, null, false);
final TextBlock textBlock = new BodyEnhanced2(display, FontParam.NOTE, skinParam, HorizontalAlignment.LEFT,
- new FontConfiguration(skinParam, FontParam.NOTE, null));
+ new FontConfiguration(skinParam, FontParam.NOTE, null), LineBreakStrategy.NONE);
final Opale opale = new Opale(borderColor, noteBackgroundColor, textBlock, skinParam.shadowing(), true);
return opale;
}
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageUseCase.java b/src/net/sourceforge/plantuml/svek/image/EntityImageUseCase.java
index a6187f0..ace200d 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageUseCase.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageUseCase.java
@@ -46,11 +46,14 @@ import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.creole.Stencil;
import net.sourceforge.plantuml.cucadiagram.BodyEnhanced;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.cucadiagram.EntityPortion;
import net.sourceforge.plantuml.cucadiagram.ILeaf;
+import net.sourceforge.plantuml.cucadiagram.PortionShower;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.SkinParameter;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
@@ -73,14 +76,15 @@ public class EntityImageUseCase extends AbstractEntityImage {
final private Url url;
- public EntityImageUseCase(ILeaf entity, ISkinParam skinParam) {
+ public EntityImageUseCase(ILeaf entity, ISkinParam skinParam, PortionShower portionShower) {
super(entity, skinParam);
final Stereotype stereotype = entity.getStereotype();
final TextBlock tmp = new BodyEnhanced(entity.getDisplay(), FontParam.USECASE, skinParam,
HorizontalAlignment.CENTER, stereotype, true, false, entity);
- if (stereotype == null || stereotype.getLabel(false) == null) {
+ if (stereotype == null || stereotype.getLabel(false) == null
+ || portionShower.showPortion(EntityPortion.STEREOTYPE, entity) == false) {
this.desc = tmp;
} else {
final TextBlock stereo = Display.getWithNewlines(stereotype.getLabel(getSkinParam().useGuillemet()))
@@ -108,7 +112,7 @@ public class EntityImageUseCase extends AbstractEntityImage {
final public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder();
final TextBlockInEllipse ellipse = new TextBlockInEllipse(desc, stringBounder);
- if (getSkinParam().shadowing()) {
+ if (getSkinParam().shadowing2(SkinParameter.USECASE)) {
ellipse.setDeltaShadow(3);
}
diff --git a/src/net/sourceforge/plantuml/svek/image/Footprint.java b/src/net/sourceforge/plantuml/svek/image/Footprint.java
index 699451e..eb7c95b 100644
--- a/src/net/sourceforge/plantuml/svek/image/Footprint.java
+++ b/src/net/sourceforge/plantuml/svek/image/Footprint.java
@@ -53,6 +53,7 @@ import net.sourceforge.plantuml.ugraphic.UImage;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UParam;
import net.sourceforge.plantuml.ugraphic.UParamNull;
+import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.UShape;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UText;
@@ -72,6 +73,10 @@ public class Footprint {
private final UTranslate translate;
private final List<Point2D.Double> all;
+ public double dpiFactor() {
+ return 1;
+ }
+
private MyUGraphic(List<Point2D.Double> all, UTranslate translate) {
this.all = all;
this.translate = translate;
@@ -109,10 +114,13 @@ public class Footprint {
drawText(x, y, (UText) shape);
} else if (shape instanceof UHorizontalLine) {
// Definitively a Horizontal line
+// line.drawTitleInternalForFootprint(this, x, y);
} else if (shape instanceof ULine) {
// Probably a Horizontal line
} else if (shape instanceof UImage) {
drawImage(x, y, (UImage) shape);
+ } else if (shape instanceof UPath) {
+ drawPath(x, y, (UPath) shape);
} else {
throw new UnsupportedOperationException(shape.getClass().toString());
}
@@ -149,6 +157,11 @@ public class Footprint {
addPoint(x + image.getWidth(), y + image.getHeight());
}
+ private void drawPath(double x, double y, UPath path) {
+ addPoint(x + path.getMinX(), y + path.getMinY());
+ addPoint(x + path.getMaxX(), y + path.getMaxY());
+ }
+
public void flushUg() {
}
diff --git a/src/net/sourceforge/plantuml/svek/image/Opale.java b/src/net/sourceforge/plantuml/svek/image/Opale.java
index 0a71d3f..56bca93 100644
--- a/src/net/sourceforge/plantuml/svek/image/Opale.java
+++ b/src/net/sourceforge/plantuml/svek/image/Opale.java
@@ -47,15 +47,13 @@ import net.sourceforge.plantuml.graphic.TextBlock;
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.UShape;
+import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.utils.MathUtils;
public class Opale extends AbstractTextBlock implements TextBlock {
- private final int cornersize = 10;
+ private static final int cornersize = 10;
private final HtmlColor noteBackgroundColor;
private final HtmlColor borderColor;
private final int marginX1 = 6;
@@ -66,6 +64,7 @@ public class Opale extends AbstractTextBlock implements TextBlock {
private Point2D pp1;
private Point2D pp2;
private final boolean withLink;
+ private double roundCorner;
private final TextBlock textBlock;
@@ -79,6 +78,10 @@ public class Opale extends AbstractTextBlock implements TextBlock {
this.textBlock = textBlock;
}
+ public void setRoundCorner(double roundCorner) {
+ this.roundCorner = roundCorner;
+ }
+
public void setOpale(Direction strategy, Point2D pp1, Point2D pp2) {
this.strategy = strategy;
this.pp1 = pp1;
@@ -102,116 +105,163 @@ public class Opale extends AbstractTextBlock implements TextBlock {
final public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder();
-
- final UPolygon polygon = getPolygonNormal(stringBounder);
+ ug = ug.apply(new UChangeBackColor(noteBackgroundColor)).apply(new UChangeColor(borderColor));
+ final UPath polygon;
+ if (withLink == false) {
+ polygon = getPolygonNormal(stringBounder);
+ } else if (strategy == Direction.LEFT) {
+ polygon = getPolygonLeft(stringBounder, pp1, pp2);
+ } else if (strategy == Direction.RIGHT) {
+ polygon = getPolygonRight(stringBounder, pp1, pp2);
+ } else if (strategy == Direction.UP) {
+ polygon = getPolygonUp(stringBounder, pp1, pp2);
+ } else if (strategy == Direction.DOWN) {
+ polygon = getPolygonDown(stringBounder, pp1, pp2);
+ } else {
+ throw new IllegalArgumentException();
+ }
if (withShadow) {
polygon.setDeltaShadow(4);
}
- ug = ug.apply(new UChangeBackColor(noteBackgroundColor)).apply(new UChangeColor(borderColor));
ug.draw(polygon);
+ ug.draw(getCorner(getWidth(stringBounder), roundCorner));
+ textBlock.drawU(ug.apply(new UTranslate(marginX1, marginY)));
+ }
+
+ private UPath getPolygonNormal(final StringBounder stringBounder) {
+ return getPolygonNormal(getWidth(stringBounder), getHeight(stringBounder), roundCorner);
+ }
- if (withLink) {
- final UShape polygonOpale;
- if (strategy == Direction.LEFT) {
- polygonOpale = getPolygonLeft(stringBounder, pp1, pp2);
- } else if (strategy == Direction.RIGHT) {
- polygonOpale = getPolygonRight(stringBounder, pp1, pp2);
- } else if (strategy == Direction.UP) {
- polygonOpale = getPolygonUp(stringBounder, pp1, pp2);
- } else if (strategy == Direction.DOWN) {
- polygonOpale = getPolygonDown(stringBounder, pp1, pp2);
- } else {
- throw new IllegalArgumentException();
- }
- ug.draw(polygonOpale);
+ public static UPath getCorner(double width, double roundCorner) {
+ final UPath path = new UPath();
+ path.moveTo(width - cornersize, 0);
+ if (roundCorner == 0) {
+ path.lineTo(width - cornersize, cornersize);
+ } else {
+ path.lineTo(width - cornersize, cornersize - roundCorner / 4);
+ path.arcTo(new Point2D.Double(width - cornersize + roundCorner / 4, cornersize), roundCorner / 4, 0, 0);
}
- ug.apply(new UTranslate(getWidth(stringBounder) - cornersize, 0)).draw(new ULine(0, cornersize));
- ug.apply(new UTranslate(getWidth(stringBounder), cornersize)).draw(new ULine(-cornersize, 0));
- textBlock.drawU(ug.apply(new UTranslate(marginX1, marginY)));
+ path.lineTo(width, cornersize);
+ path.lineTo(width - cornersize, 0);
+ path.closePath();
+ return path;
}
- private UPolygon getPolygonNormal(final StringBounder stringBounder) {
- final UPolygon polygon = new UPolygon();
- polygon.addPoint(0, 0);
- polygon.addPoint(0, getHeight(stringBounder));
- polygon.addPoint(getWidth(stringBounder), getHeight(stringBounder));
- polygon.addPoint(getWidth(stringBounder), cornersize);
- polygon.addPoint(getWidth(stringBounder) - cornersize, 0);
- polygon.addPoint(0, 0);
+ public static UPath getPolygonNormal(double width, double height, double roundCorner) {
+ final UPath polygon = new UPath();
+ if (roundCorner == 0) {
+ polygon.moveTo(0, 0);
+ polygon.lineTo(0, height);
+ polygon.lineTo(width, height);
+ polygon.lineTo(width, cornersize);
+ polygon.lineTo(width - cornersize, 0);
+ polygon.lineTo(0, 0);
+ } else {
+ polygon.moveTo(0, roundCorner / 2);
+ polygon.lineTo(0, height - roundCorner / 2);
+ polygon.arcTo(new Point2D.Double(roundCorner / 2, height), roundCorner / 2, 0, 0);
+ polygon.lineTo(width - roundCorner / 2, height);
+ polygon.arcTo(new Point2D.Double(width, height - roundCorner / 2), roundCorner / 2, 0, 0);
+ polygon.lineTo(width, cornersize);
+ polygon.lineTo(width - cornersize, 0);
+ polygon.lineTo(roundCorner / 2, 0);
+ polygon.arcTo(new Point2D.Double(0, roundCorner / 2), roundCorner / 2, 0, 0);
+ }
+ polygon.closePath();
return polygon;
}
private final double delta = 4;
- private UPolygon getPolygonLeft(final StringBounder stringBounder, final Point2D pp1, final Point2D pp2) {
- final UPolygon polygon = new UPolygon();
- polygon.addPoint(0, 0);
+ private UPath getPolygonLeft(final StringBounder stringBounder, final Point2D pp1, final Point2D pp2) {
+ final UPath polygon = new UPath();
+ polygon.moveTo(0, roundCorner / 2);
double y1 = pp1.getY() - delta;
y1 = MathUtils.limitation(y1, 0, getHeight(stringBounder) - 2 * delta);
- polygon.addPoint(0, y1);
- polygon.addPoint(pp2.getX(), pp2.getY());
- polygon.addPoint(0, y1 + 2 * delta);
-
- polygon.addPoint(0, getHeight(stringBounder));
- polygon.addPoint(getWidth(stringBounder), getHeight(stringBounder));
- polygon.addPoint(getWidth(stringBounder), cornersize);
- polygon.addPoint(getWidth(stringBounder) - cornersize, 0);
- polygon.addPoint(0, 0);
+ polygon.lineTo(0, y1);
+ polygon.lineTo(pp2.getX(), pp2.getY());
+ polygon.lineTo(0, y1 + 2 * delta);
+
+ polygon.lineTo(0, getHeight(stringBounder) - roundCorner / 2);
+ polygon.arcTo(new Point2D.Double(roundCorner / 2, getHeight(stringBounder)), roundCorner / 2, 0, 0);
+ polygon.lineTo(getWidth(stringBounder) - roundCorner / 2, getHeight(stringBounder));
+ polygon.arcTo(new Point2D.Double(getWidth(stringBounder), getHeight(stringBounder) - roundCorner / 2),
+ roundCorner / 2, 0, 0);
+ polygon.lineTo(getWidth(stringBounder), cornersize);
+ polygon.lineTo(getWidth(stringBounder) - cornersize, 0);
+ polygon.lineTo(roundCorner / 2, 0);
+ polygon.arcTo(new Point2D.Double(0, roundCorner / 2), roundCorner / 2, 0, 0);
+ polygon.closePath();
return polygon;
}
- private UPolygon getPolygonRight(final StringBounder stringBounder, final Point2D pp1, final Point2D pp2) {
- final UPolygon polygon = new UPolygon();
- polygon.addPoint(0, 0);
- polygon.addPoint(0, getHeight(stringBounder));
- polygon.addPoint(getWidth(stringBounder), getHeight(stringBounder));
+ private UPath getPolygonRight(final StringBounder stringBounder, final Point2D pp1, final Point2D pp2) {
+ final UPath polygon = new UPath();
+ polygon.moveTo(0, roundCorner / 2);
+ polygon.lineTo(0, getHeight(stringBounder) - roundCorner / 2);
+ polygon.arcTo(new Point2D.Double(roundCorner / 2, getHeight(stringBounder)), roundCorner / 2, 0, 0);
+ polygon.lineTo(getWidth(stringBounder) - roundCorner / 2, getHeight(stringBounder));
+ polygon.arcTo(new Point2D.Double(getWidth(stringBounder), getHeight(stringBounder) - roundCorner / 2),
+ roundCorner / 2, 0, 0);
double y1 = pp1.getY() - delta;
y1 = MathUtils.limitation(y1, cornersize, getHeight(stringBounder) - 2 * delta);
- polygon.addPoint(getWidth(stringBounder), y1 + 2 * delta);
- polygon.addPoint(pp2.getX(), pp2.getY());
- polygon.addPoint(getWidth(stringBounder), y1);
+ polygon.lineTo(getWidth(stringBounder), y1 + 2 * delta);
+ polygon.lineTo(pp2.getX(), pp2.getY());
+ polygon.lineTo(getWidth(stringBounder), y1);
- polygon.addPoint(getWidth(stringBounder), cornersize);
- polygon.addPoint(getWidth(stringBounder) - cornersize, 0);
- polygon.addPoint(0, 0);
+ polygon.lineTo(getWidth(stringBounder), cornersize);
+ polygon.lineTo(getWidth(stringBounder) - cornersize, 0);
+ polygon.lineTo(roundCorner / 2, 0);
+ polygon.arcTo(new Point2D.Double(0, roundCorner / 2), roundCorner / 2, 0, 0);
+ polygon.closePath();
return polygon;
}
- private UPolygon getPolygonUp(final StringBounder stringBounder, final Point2D pp1, final Point2D pp2) {
- final UPolygon polygon = new UPolygon();
- polygon.addPoint(0, 0);
- polygon.addPoint(0, getHeight(stringBounder));
- polygon.addPoint(getWidth(stringBounder), getHeight(stringBounder));
- polygon.addPoint(getWidth(stringBounder), cornersize);
- polygon.addPoint(getWidth(stringBounder) - cornersize, 0);
+ private UPath getPolygonUp(final StringBounder stringBounder, final Point2D pp1, final Point2D pp2) {
+ final UPath polygon = new UPath();
+ polygon.moveTo(0, roundCorner / 2);
+ polygon.lineTo(0, getHeight(stringBounder) - roundCorner / 2);
+ polygon.arcTo(new Point2D.Double(roundCorner / 2, getHeight(stringBounder)), roundCorner / 2, 0, 0);
+ polygon.lineTo(getWidth(stringBounder) - roundCorner / 2, getHeight(stringBounder));
+ polygon.arcTo(new Point2D.Double(getWidth(stringBounder), getHeight(stringBounder) - roundCorner / 2),
+ roundCorner / 2, 0, 0);
+ polygon.lineTo(getWidth(stringBounder), cornersize);
+ polygon.lineTo(getWidth(stringBounder) - cornersize, 0);
double x1 = pp1.getX() - delta;
x1 = MathUtils.limitation(x1, 0, getWidth(stringBounder) - cornersize);
- polygon.addPoint(x1 + 2 * delta, 0);
- polygon.addPoint(pp2.getX(), pp2.getY());
+ polygon.lineTo(x1 + 2 * delta, 0);
+ polygon.lineTo(pp2.getX(), pp2.getY());
- polygon.addPoint(x1, 0);
- polygon.addPoint(0, 0);
+ polygon.lineTo(x1, 0);
+ polygon.lineTo(roundCorner / 2, 0);
+ polygon.arcTo(new Point2D.Double(0, roundCorner / 2), roundCorner / 2, 0, 0);
+ polygon.closePath();
return polygon;
}
- private UPolygon getPolygonDown(final StringBounder stringBounder, final Point2D pp1, final Point2D pp2) {
- final UPolygon polygon = new UPolygon();
- polygon.addPoint(0, 0);
- polygon.addPoint(0, getHeight(stringBounder));
+ private UPath getPolygonDown(final StringBounder stringBounder, final Point2D pp1, final Point2D pp2) {
+ final UPath polygon = new UPath();
+ polygon.moveTo(0, roundCorner / 2);
+ polygon.lineTo(0, getHeight(stringBounder) - roundCorner / 2);
+ polygon.arcTo(new Point2D.Double(roundCorner / 2, getHeight(stringBounder)), roundCorner / 2, 0, 0);
double x1 = pp1.getX() - delta;
x1 = MathUtils.limitation(x1, 0, getWidth(stringBounder));
- polygon.addPoint(x1, getHeight(stringBounder));
- polygon.addPoint(pp2.getX(), pp2.getY());
- polygon.addPoint(x1 + 2 * delta, getHeight(stringBounder));
-
- polygon.addPoint(getWidth(stringBounder), getHeight(stringBounder));
- polygon.addPoint(getWidth(stringBounder), cornersize);
- polygon.addPoint(getWidth(stringBounder) - cornersize, 0);
- polygon.addPoint(0, 0);
+ polygon.lineTo(x1, getHeight(stringBounder));
+ polygon.lineTo(pp2.getX(), pp2.getY());
+ polygon.lineTo(x1 + 2 * delta, getHeight(stringBounder));
+
+ polygon.lineTo(getWidth(stringBounder) - roundCorner / 2, getHeight(stringBounder));
+ polygon.arcTo(new Point2D.Double(getWidth(stringBounder), getHeight(stringBounder) - roundCorner / 2),
+ roundCorner / 2, 0, 0);
+ polygon.lineTo(getWidth(stringBounder), cornersize);
+ polygon.lineTo(getWidth(stringBounder) - cornersize, 0);
+ polygon.lineTo(roundCorner / 2, 0);
+ polygon.arcTo(new Point2D.Double(0, roundCorner / 2), roundCorner / 2, 0, 0);
+ polygon.closePath();
return polygon;
}
diff --git a/src/net/sourceforge/plantuml/svg/SvgGraphics.java b/src/net/sourceforge/plantuml/svg/SvgGraphics.java
index b41e76f..6005be7 100644
--- a/src/net/sourceforge/plantuml/svg/SvgGraphics.java
+++ b/src/net/sourceforge/plantuml/svg/SvgGraphics.java
@@ -106,6 +106,7 @@ public class SvgGraphics {
private final String filterUid;
private final String shadowId;
private final String gradientId;
+ private final boolean svgDimensionStyle;
final protected void ensureVisible(double x, double y) {
if (x > maxX) {
@@ -116,12 +117,14 @@ public class SvgGraphics {
}
}
- public SvgGraphics(Dimension2D minDim, double scale, String hover, long seed) {
- this(minDim, null, scale, hover, seed);
+ public SvgGraphics(boolean svgDimensionStyle, Dimension2D minDim, double scale, String hover, long seed) {
+ this(svgDimensionStyle, minDim, null, scale, hover, seed);
}
- public SvgGraphics(Dimension2D minDim, String backcolor, double scale, String hover, long seed) {
+ public SvgGraphics(boolean svgDimensionStyle, Dimension2D minDim, String backcolor, double scale, String hover,
+ long seed) {
try {
+ this.svgDimensionStyle = svgDimensionStyle;
this.scale = scale;
this.document = getDocument();
this.backcolor = backcolor;
@@ -296,49 +299,54 @@ public class SvgGraphics {
}
public void closeLink() {
- if (pendingLink2.size() > 0) {
- final Element element = pendingLink2.get(0);
- pendingLink2.remove(0);
- getG().appendChild(element);
+ if (pendingAction.size() > 0) {
+ final Element element = pendingAction.get(0);
+ pendingAction.remove(0);
+ if (element.getFirstChild() != null) {
+ // Empty link
+ getG().appendChild(element);
+ }
}
}
- private final List<Element> pendingLink2 = new ArrayList<Element>();
+ private final List<Element> pendingAction = new ArrayList<Element>();
public void openLink(String url, String title, String target) {
if (url == null) {
throw new IllegalArgumentException();
}
- if (pendingLink2.size() > 0) {
+ if (pendingAction.size() > 0) {
closeLink();
}
- pendingLink2.add(0, (Element) document.createElement("a"));
- pendingLink2.get(0).setAttribute("target", target);
- pendingLink2.get(0).setAttribute("xlink:href", url);
- pendingLink2.get(0).setAttribute("xlink:type", "simple");
- pendingLink2.get(0).setAttribute("xlink:actuate", "onRequest");
- pendingLink2.get(0).setAttribute("xlink:show", "new");
+ pendingAction.add(0, (Element) document.createElement("a"));
+ pendingAction.get(0).setAttribute("target", target);
+ pendingAction.get(0).setAttribute("xlink:href", url);
+ pendingAction.get(0).setAttribute("xlink:type", "simple");
+ pendingAction.get(0).setAttribute("xlink:actuate", "onRequest");
+ pendingAction.get(0).setAttribute("xlink:show", "new");
if (title == null) {
- pendingLink2.get(0).setAttribute("xlink:title", url);
+ pendingAction.get(0).setAttribute("xlink:title", url);
} else {
title = title.replaceAll("\\\\n", "\n");
- pendingLink2.get(0).setAttribute("xlink:title", title);
+ pendingAction.get(0).setAttribute("xlink:title", title);
}
}
public final Element getG() {
- if (pendingLink2.size() == 0) {
+ if (pendingAction.size() == 0) {
return gRoot;
}
- return pendingLink2.get(0);
+ return pendingAction.get(0);
}
public void svgRectangle(double x, double y, double width, double height, double rx, double ry, double deltaShadow,
String id) {
if (height <= 0 || width <= 0) {
- throw new IllegalArgumentException();
+ return;
+ // To be restored when Teoz will be finished
+ // throw new IllegalArgumentException();
}
manageShadow(deltaShadow);
if (hidden == false) {
@@ -564,9 +572,11 @@ public class SvgGraphics {
if (backcolor != null) {
style += "background:" + backcolor + ";";
}
- root.setAttribute("style", style);
- root.setAttribute("width", format(maxX) + "px");
- root.setAttribute("height", format(maxY) + "px");
+ if (svgDimensionStyle) {
+ root.setAttribute("style", style);
+ root.setAttribute("width", format(maxX) + "px");
+ root.setAttribute("height", format(maxY) + "px");
+ }
root.setAttribute("viewBox", "0 0 " + maxXscaled + " " + maxYscaled);
root.setAttribute("zoomAndPan", "magnify");
root.setAttribute("preserveAspectRatio", "none");
@@ -611,8 +621,9 @@ public class SvgGraphics {
ensureVisible(coord[2] + x + 2 * deltaShadow, coord[3] + y + 2 * deltaShadow);
ensureVisible(coord[4] + x + 2 * deltaShadow, coord[5] + y + 2 * deltaShadow);
} else if (type == USegmentType.SEG_ARCTO) {
- sb.append("A" + format(coord[0]) + "," + format(coord[1]) + " " + format(coord[2]) + ","
- + format(coord[3]) + " " + format(coord[4]) + "," + format(coord[5] + x) + ","
+ // A25,25 0,0 5,395,40
+ sb.append("A" + format(coord[0]) + "," + format(coord[1]) + " " + formatBoolean(coord[2]) + " "
+ + formatBoolean(coord[3]) + " " + formatBoolean(coord[4]) + " " + format(coord[5] + x) + ","
+ format(coord[6] + y) + " ");
ensureVisible(coord[5] + coord[0] + x + 2 * deltaShadow, coord[6] + coord[1] + y + 2 * deltaShadow);
} else if (type == USegmentType.SEG_CLOSE) {
@@ -683,6 +694,10 @@ public class SvgGraphics {
return EpsGraphics.format(x * scale);
}
+ private String formatBoolean(double x) {
+ return x == 0 ? "0" : "1";
+ }
+
public void fill(int windingRule) {
if (hidden == false) {
final Element elt = (Element) document.createElement("path");
@@ -728,11 +743,11 @@ public class SvgGraphics {
private String manageScale(SvgString svg) {
final double svgScale = svg.getScale();
if (svgScale * scale == 1) {
- return svg.getSvg();
+ return svg.getSvg(false);
}
final String s1 = "\\<g\\b";
final String s2 = "<g transform=\"scale(" + format(svgScale) + "," + format(svgScale) + ")\" ";
- return svg.getSvg().replaceFirst(s1, s2);
+ return svg.getSvg(false).replaceFirst(s1, s2);
}
private String toBase64(BufferedImage image) throws IOException {
diff --git a/src/net/sourceforge/plantuml/swing/ImageHelper.java b/src/net/sourceforge/plantuml/swing/ImageHelper.java
index a012b2d..01a8785 100644
--- a/src/net/sourceforge/plantuml/swing/ImageHelper.java
+++ b/src/net/sourceforge/plantuml/swing/ImageHelper.java
@@ -145,7 +145,6 @@ public class ImageHelper {
* dimensions of the area the image is to be drawn in.
*/
public static Dimension getScaledDimension(Dimension imgSize, Dimension boundary) {
-
final int originalWidth = imgSize.width;
final int originaHeight = imgSize.height;
final int boundWidth = boundary.width;
@@ -172,6 +171,25 @@ public class ImageHelper {
return new Dimension(newWidth, newHeight);
}
+ public static Dimension getScaledDimensionWidthFit(Dimension imgSize, Dimension boundary) {
+ final int originalWidth = imgSize.width;
+ final int originaHeight = imgSize.height;
+ final int boundWidth = boundary.width;
+ final int boundHeight = boundary.height;
+ int newWidth = originalWidth;
+ int newHeight = originaHeight;
+
+ // first check if we need to scale width
+ if (originalWidth != boundWidth) {
+ // scale width to fit
+ newWidth = boundWidth;
+ // scale height to maintain aspect ratio
+ newHeight = (newWidth * originaHeight) / originalWidth;
+ }
+
+ return new Dimension(newWidth, newHeight);
+ }
+
public static Dimension getScaledDimension(Dimension dim, double zoom) {
return new Dimension((int) (dim.getWidth() * zoom), (int) (dim.getHeight() * zoom));
}
diff --git a/src/net/sourceforge/plantuml/swing/ImageWindow2.java b/src/net/sourceforge/plantuml/swing/ImageWindow2.java
index a508dc1..8123e72 100644
--- a/src/net/sourceforge/plantuml/swing/ImageWindow2.java
+++ b/src/net/sourceforge/plantuml/swing/ImageWindow2.java
@@ -40,9 +40,6 @@ import java.awt.Dimension;
import java.awt.Image;
import java.awt.RenderingHints;
import java.awt.Toolkit;
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.Transferable;
-import java.awt.datatransfer.UnsupportedFlavorException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
@@ -75,6 +72,7 @@ import javax.swing.WindowConstants;
import net.sourceforge.plantuml.FileFormat;
import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.GeneratedImage;
+import net.sourceforge.plantuml.ImageSelection;
import net.sourceforge.plantuml.graphic.GraphicStrings;
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
@@ -85,6 +83,7 @@ class ImageWindow2 extends JFrame {
private final static Preferences prefs = Preferences.userNodeForPackage(ImageWindow2.class);
private final static String KEY_ZOOM_FIT = "zoomfit";
+ private final static String KEY_WIDTH_FIT = "widthfit";
private SimpleLine2 simpleLine2;
private final JScrollPane scrollPane;
@@ -92,6 +91,7 @@ class ImageWindow2 extends JFrame {
private final JButton copy = new JButton("Copy");
private final JButton previous = new JButton("Previous");
private final JCheckBox zoomFitButt = new JCheckBox("Zoom fit");
+ private final JCheckBox widthFitButt = new JCheckBox("Width fit");
private final JButton zoomMore = new JButton("+");
private final JButton zoomLess = new JButton("-");
private final MainWindow2 main;
@@ -101,7 +101,7 @@ class ImageWindow2 extends JFrame {
private int zoomFactor = 0;
private enum SizeMode {
- FULL_SIZE, ZOOM_FIT
+ FULL_SIZE, ZOOM_FIT, WIDTH_FIT
};
private SizeMode sizeMode = SizeMode.FULL_SIZE;
@@ -121,6 +121,7 @@ class ImageWindow2 extends JFrame {
north.add(copy);
north.add(next);
north.add(zoomFitButt);
+ north.add(widthFitButt);
north.add(zoomMore);
north.add(zoomLess);
copy.setFocusable(false);
@@ -144,6 +145,14 @@ class ImageWindow2 extends JFrame {
zoomFitButt.setFocusable(false);
zoomFitButt.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
+ widthFitButt.setSelected(false);
+ zoomFit();
+ }
+ });
+ widthFitButt.setFocusable(false);
+ widthFitButt.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent ae) {
+ zoomFitButt.setSelected(false);
zoomFit();
}
});
@@ -189,6 +198,11 @@ class ImageWindow2 extends JFrame {
if (zoomChecked) {
sizeMode = SizeMode.ZOOM_FIT;
}
+ final boolean widthZoomChecked = prefs.getBoolean(KEY_WIDTH_FIT, false);
+ widthFitButt.setSelected(widthZoomChecked);
+ if (widthZoomChecked) {
+ sizeMode = SizeMode.WIDTH_FIT;
+ }
this.setFocusable(true);
this.addKeyListener(new KeyAdapter() {
@@ -251,11 +265,15 @@ class ImageWindow2 extends JFrame {
}
private void zoomFit() {
- final boolean selected = zoomFitButt.isSelected();
- prefs.putBoolean(KEY_ZOOM_FIT, selected);
+ final boolean selectedZoom = zoomFitButt.isSelected();
+ final boolean selectedWidth = widthFitButt.isSelected();
+ prefs.putBoolean(KEY_ZOOM_FIT, selectedZoom);
+ prefs.putBoolean(KEY_WIDTH_FIT, selectedWidth);
zoomFactor = 0;
- if (selected) {
+ if (selectedZoom) {
sizeMode = SizeMode.ZOOM_FIT;
+ } else if (selectedWidth) {
+ sizeMode = SizeMode.WIDTH_FIT;
} else {
sizeMode = SizeMode.FULL_SIZE;
}
@@ -297,6 +315,11 @@ class ImageWindow2 extends JFrame {
final Dimension newImgDim = ImageHelper
.getScaledDimension(imageDim, scrollPane.getViewport().getSize());
image = ImageHelper.getScaledInstance(image, newImgDim, getHints(), true);
+ } else if (sizeMode == SizeMode.WIDTH_FIT) {
+ final Dimension imageDim = new Dimension(image.getWidth(), image.getHeight());
+ final Dimension newImgDim = ImageHelper.getScaledDimensionWidthFit(imageDim, scrollPane.getViewport()
+ .getSize());
+ image = ImageHelper.getScaledInstance(image, newImgDim, getHints(), false);
} else if (zoomFactor != 0) {
final Dimension imageDim = new Dimension(image.getWidth(), image.getHeight());
final Dimension newImgDim = ImageHelper.getScaledDimension(imageDim, getZoom());
@@ -417,30 +440,3 @@ class ImageWindow2 extends JFrame {
}
}
-
-// This class is used to hold an image while on the clipboard.
-class ImageSelection implements Transferable {
- private Image image;
-
- public ImageSelection(Image image) {
- this.image = image;
- }
-
- // Returns supported flavors
- public DataFlavor[] getTransferDataFlavors() {
- return new DataFlavor[] { DataFlavor.imageFlavor };
- }
-
- // Returns true if flavor is supported
- public boolean isDataFlavorSupported(DataFlavor flavor) {
- return DataFlavor.imageFlavor.equals(flavor);
- }
-
- // Returns image
- public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
- if (!DataFlavor.imageFlavor.equals(flavor)) {
- throw new UnsupportedFlavorException(flavor);
- }
- return image;
- }
-}
diff --git a/src/net/sourceforge/plantuml/swing/MainWindow2.java b/src/net/sourceforge/plantuml/swing/MainWindow2.java
index 5750aae..ad1628b 100644
--- a/src/net/sourceforge/plantuml/swing/MainWindow2.java
+++ b/src/net/sourceforge/plantuml/swing/MainWindow2.java
@@ -108,7 +108,7 @@ public class MainWindow2 extends JFrame {
}
private String getDefaultFileExtensions() {
- return "txt, tex, java, htm, html, c, h, cpp, apt, pu, puml";
+ return "txt, tex, java, htm, html, c, h, cpp, apt, pu, puml, hpp, hh";
}
private void changeExtensions(String ext) {
diff --git a/src/net/sourceforge/plantuml/swing/SpriteWindow.java b/src/net/sourceforge/plantuml/swing/SpriteWindow.java
index 8a24a4f..7ea5651 100644
--- a/src/net/sourceforge/plantuml/swing/SpriteWindow.java
+++ b/src/net/sourceforge/plantuml/swing/SpriteWindow.java
@@ -111,6 +111,7 @@ public class SpriteWindow extends JFrame {
return;
}
final StringBuilder sb = new StringBuilder();
+ encodeColor(img, sb);
encode(img, SpriteGrayLevel.GRAY_16, sb);
encodeCompressed(img, SpriteGrayLevel.GRAY_16, sb);
encode(img, SpriteGrayLevel.GRAY_8, sb);
@@ -120,6 +121,12 @@ public class SpriteWindow extends JFrame {
printData(sb.toString());
}
+ private void encodeColor(BufferedImage img, StringBuilder sb) {
+ sb.append("\n");
+ sb.append(SpriteUtils.encodeColor(img, "demo"));
+
+ }
+
private void encodeCompressed(BufferedImage img, SpriteGrayLevel level, StringBuilder sb) {
sb.append("\n");
sb.append(SpriteUtils.encodeCompressed(img, "demo", level));
diff --git a/src/net/sourceforge/plantuml/syntax/LanguageDescriptor.java b/src/net/sourceforge/plantuml/syntax/LanguageDescriptor.java
index f4dfb0a..eacb667 100644
--- a/src/net/sourceforge/plantuml/syntax/LanguageDescriptor.java
+++ b/src/net/sourceforge/plantuml/syntax/LanguageDescriptor.java
@@ -42,6 +42,7 @@ import java.util.TreeSet;
import net.sourceforge.plantuml.SkinParam;
import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
+import net.sourceforge.plantuml.utils.Cypher;
public class LanguageDescriptor {
@@ -50,7 +51,7 @@ public class LanguageDescriptor {
private final Set<String> preproc = new TreeSet<String>();
public LanguageDescriptor() {
-
+
type.add("actor");
type.add("participant");
type.add("usecase");
@@ -149,7 +150,9 @@ public class LanguageDescriptor {
keyword.add("fork");
keyword.add("again");
keyword.add("kill");
+ keyword.add("order");
+ preproc.add("!exit");
preproc.add("!include");
preproc.add("!pragma");
preproc.add("!define");
@@ -163,6 +166,26 @@ public class LanguageDescriptor {
preproc.add("!enddefinelong");
}
+ public Cypher getCypher() {
+ final Cypher cypher = new Cypher();
+ for (String s : type) {
+ cypher.addException(s);
+ }
+ for (String s : keyword) {
+ cypher.addException(s.replace("@", ""));
+ }
+ for (String s : preproc) {
+ cypher.addException(s.substring(1));
+ }
+ for (String s : SkinParam.getPossibleValues()) {
+ cypher.addException(s);
+ }
+ for (String s : new HtmlColorSetSimple().names()) {
+ cypher.addException(s);
+ }
+ return cypher;
+ }
+
public void print(PrintStream ps) {
print(ps, "type", type);
print(ps, "keyword", keyword);
@@ -173,7 +196,7 @@ public class LanguageDescriptor {
}
private static void print(PrintStream ps, String name, Collection<String> data) {
- ps.println(";"+name);
+ ps.println(";" + name);
ps.println(";" + data.size());
for (String k : data) {
ps.println(k);
diff --git a/src/net/sourceforge/plantuml/syntax/SyntaxChecker.java b/src/net/sourceforge/plantuml/syntax/SyntaxChecker.java
index abf64b1..f970fd2 100644
--- a/src/net/sourceforge/plantuml/syntax/SyntaxChecker.java
+++ b/src/net/sourceforge/plantuml/syntax/SyntaxChecker.java
@@ -71,7 +71,7 @@ public class SyntaxChecker {
result.setLineLocation(new LineLocationImpl(null, null).oneLineRead());
// result.setErrorLinePosition(0);
result.addErrorText("No @startuml found");
- result.setSuggest(Arrays.asList("Did you mean:", "@startuml"));
+ // result.setSuggest(Arrays.asList("Did you mean:", "@startuml"));
return result;
}
if (source.endsWith("@enduml\n") == false && source.endsWith("@enduml") == false) {
@@ -79,7 +79,7 @@ public class SyntaxChecker {
result.setLineLocation(lastLineNumber2(source));
// result.setErrorLinePosition(lastLineNumber(source));
result.addErrorText("No @enduml found");
- result.setSuggest(Arrays.asList("Did you mean:", "@enduml"));
+ // result.setSuggest(Arrays.asList("Did you mean:", "@enduml"));
return result;
}
final SourceStringReader sourceStringReader = new SourceStringReader(Defines.createEmpty(), source,
@@ -91,7 +91,7 @@ public class SyntaxChecker {
result.setLineLocation(lastLineNumber2(source));
// result.setErrorLinePosition(lastLineNumber(source));
result.addErrorText("No @enduml found");
- result.setSuggest(Arrays.asList("Did you mean:", "@enduml"));
+ // result.setSuggest(Arrays.asList("Did you mean:", "@enduml"));
return result;
}
final Diagram system = blocks.get(0).getDiagram();
@@ -108,7 +108,7 @@ public class SyntaxChecker {
for (ErrorUml er : sys.getErrorsUml()) {
result.addErrorText(er.getError());
}
- result.setSuggest(sys.getSuggest());
+ // result.setSuggest(sys.getSuggest());
} else {
result.setDescription(system.getDescription().getDescription());
}
@@ -125,7 +125,7 @@ public class SyntaxChecker {
result.setError(true);
result.setLineLocation(lastLineNumber2(source));
result.addErrorText("No @enduml found");
- result.setSuggest(Arrays.asList("Did you mean:", "@enduml"));
+ // result.setSuggest(Arrays.asList("Did you mean:", "@enduml"));
return result;
}
@@ -143,7 +143,7 @@ public class SyntaxChecker {
result.addErrorText(er.getError());
}
result.setSystemError(sys);
- result.setSuggest(sys.getSuggest());
+ // result.setSuggest(sys.getSuggest());
} else {
result.setDescription(system.getDescription().getDescription());
}
diff --git a/src/net/sourceforge/plantuml/syntax/SyntaxResult.java b/src/net/sourceforge/plantuml/syntax/SyntaxResult.java
index 629aa90..801a120 100644
--- a/src/net/sourceforge/plantuml/syntax/SyntaxResult.java
+++ b/src/net/sourceforge/plantuml/syntax/SyntaxResult.java
@@ -54,7 +54,7 @@ public class SyntaxResult {
private String description;
// private int errorLinePosition;
private Collection<String> errors = new TreeSet<String>();
- private List<String> suggest;
+ // private List<String> suggest;
private boolean hasCmapData;
private PSystemError systemError;
private LineLocation lineLocation;
@@ -71,13 +71,13 @@ public class SyntaxResult {
return description;
}
-// public int getErrorLinePosition() {
-// return errorLinePosition;
-// }
+ // public int getErrorLinePosition() {
+ // return errorLinePosition;
+ // }
- public List<String> getSuggest() {
- return suggest;
- }
+ // public List<String> getSuggest() {
+ // return suggest;
+ // }
public Collection<String> getErrors() {
return Collections.unmodifiableCollection(errors);
@@ -95,17 +95,17 @@ public class SyntaxResult {
this.description = description;
}
-// public void setErrorLinePosition(int errorLinePosition) {
-// this.errorLinePosition = errorLinePosition;
-// }
+ // public void setErrorLinePosition(int errorLinePosition) {
+ // this.errorLinePosition = errorLinePosition;
+ // }
public void addErrorText(String error) {
this.errors.add(error);
}
- public void setSuggest(List<String> suggest) {
- this.suggest = suggest;
- }
+ // public void setSuggest(List<String> suggest) {
+ // this.suggest = suggest;
+ // }
public final boolean hasCmapData() {
return hasCmapData;
diff --git a/src/net/sourceforge/plantuml/tikz/TikzGraphics.java b/src/net/sourceforge/plantuml/tikz/TikzGraphics.java
index 81a2f0a..750e55b 100644
--- a/src/net/sourceforge/plantuml/tikz/TikzGraphics.java
+++ b/src/net/sourceforge/plantuml/tikz/TikzGraphics.java
@@ -40,11 +40,14 @@ import java.awt.geom.PathIterator;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import net.sourceforge.plantuml.Log;
+import net.sourceforge.plantuml.SignatureUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.eps.EpsGraphics;
import net.sourceforge.plantuml.ugraphic.UPath;
@@ -62,6 +65,8 @@ public class TikzGraphics {
private Color color = Color.BLACK;
private Color fillcolor = Color.BLACK;
+ private Color fillcolorGradient2 = null;
+ private char gradientPolicy;
private double thickness = 1.0;
private final double scale;
private String dash = null;
@@ -73,6 +78,29 @@ public class TikzGraphics {
this.scale = scale;
}
+ private final Map<String, Integer> styles = new LinkedHashMap<String, Integer>();
+ private final Map<String, String> stylesID = new HashMap<String, String>();
+
+ private void addCommand(final StringBuilder sb) {
+ final String s = sb.toString();
+ cmd.add(s);
+ if (s.startsWith("\\draw[") || s.startsWith("\\shade[")) {
+ final int end = s.indexOf(']');
+ if (end != -1) {
+ final int start = s.indexOf('[');
+ final String style = s.substring(start + 1, end);
+ Integer count = styles.get(style);
+ if (count == null) {
+ count = 1;
+ stylesID.put(style, "pstyle" + stylesID.size());
+ } else {
+ count++;
+ }
+ styles.put(style, count);
+ }
+ }
+ }
+
private String getColorName(Color c) {
if (c.equals(Color.WHITE)) {
return "white";
@@ -89,7 +117,7 @@ public class TikzGraphics {
public void createData(OutputStream os) throws IOException {
if (withPreamble) {
- out(os, "\\documentclass{article}");
+ out(os, "\\documentclass{standalone}");
out(os, "\\usepackage{tikz}");
out(os, "\\usepackage{aeguill}");
if (hasUrl) {
@@ -140,9 +168,14 @@ public class TikzGraphics {
if (scale != 1) {
out(os, "\\scalebox{" + format(scale) + "}{");
}
- out(os, "\\begin{tikzpicture}[yscale=-1]");
+ out(os, "\\begin{tikzpicture}[yscale=-1");
+ purgeStyles();
+ for (String style : styles.keySet()) {
+ out(os, "," + stylesID.get(style) + "/.style={" + style + "}");
+ }
+ out(os, "]");
for (String s : cmd) {
- out(os, s);
+ out(os, useStyle(s));
}
out(os, "\\end{tikzpicture}");
if (scale != 1) {
@@ -153,6 +186,31 @@ public class TikzGraphics {
}
}
+ private String useStyle(String s) {
+ for (String style : styles.keySet()) {
+ final String start1 = "\\draw[" + style + "]";
+ if (s.startsWith(start1)) {
+ final String newStart = "\\draw[" + stylesID.get(style) + "]";
+ return newStart + s.substring(start1.length());
+ }
+ final String start2 = "\\shade[" + style + "]";
+ if (s.startsWith(start2)) {
+ final String newStart = "\\shade[" + stylesID.get(style) + "]";
+ return newStart + s.substring(start2.length());
+ }
+ }
+ return s;
+ }
+
+ private void purgeStyles() {
+ for (Iterator<Map.Entry<String, Integer>> it = styles.entrySet().iterator(); it.hasNext();) {
+ final Map.Entry<String, Integer> ent = it.next();
+ if (ent.getValue().intValue() == 1) {
+ it.remove();
+ }
+ }
+ }
+
private String definecolor(String name, Color color) {
return "\\definecolor{" + name + "}{RGB}{" + color.getRed() + "," + color.getGreen() + "," + color.getBlue()
+ "}";
@@ -161,16 +219,7 @@ public class TikzGraphics {
public void rectangle(double x, double y, double width, double height) {
final StringBuilder sb = new StringBuilder();
if (pendingUrl == null) {
- sb.append("\\draw[");
- if (color != null) {
- sb.append("color=" + getColorName(color) + ",");
- }
- if (fillcolor != null) {
- sb.append("fill=" + getColorName(fillcolor) + ",");
- if (color == null) {
- sb.append("color=" + getColorName(fillcolor) + ",");
- }
- }
+ appendShadeOrDraw(sb);
sb.append("line width=" + thickness + "pt] ");
sb.append(couple(x, y) + " rectangle " + couple(x + width, y + height));
sb.append(";");
@@ -199,7 +248,23 @@ public class TikzGraphics {
sb.append(" {};");
urlIgnoreText = true;
}
- cmd.add(sb.toString());
+ addCommand(sb);
+ }
+
+ private String getAngleFromGradientPolicy() {
+ if (this.gradientPolicy == '-') {
+ return "0";
+ }
+ if (this.gradientPolicy == '|') {
+ return "90";
+ }
+ if (this.gradientPolicy == '/') {
+ return "45";
+ }
+ if (this.gradientPolicy == '\\') {
+ return "135";
+ }
+ throw new IllegalArgumentException();
}
private String couple(double x, double y) {
@@ -211,14 +276,38 @@ public class TikzGraphics {
}
private void out(OutputStream os, String s) throws IOException {
- os.write(s.getBytes());
- os.write("\n".getBytes());
+ os.write(s.getBytes("UTF-8"));
+ os.write("\n".getBytes("UTF-8"));
}
- public void text(double x, double y, String text) {
- final StringBuilder sb = new StringBuilder("\\node at " + couple(x, y) + "[below right]{");
+ public void text(double x, double y, String text, boolean underline, boolean italic, boolean bold) {
+ final StringBuilder sb = new StringBuilder("\\node at " + couple(x, y));
+ sb.append("[below right");
+ if (color != null) {
+ sb.append(",color=");
+ sb.append(getColorName(color));
+ }
+ sb.append("]{");
if (pendingUrl == null || urlIgnoreText) {
+ if (underline) {
+ sb.append("\\underline{");
+ }
+ if (italic) {
+ sb.append("\\textit{");
+ }
+ if (bold) {
+ sb.append("\\textbf{");
+ }
sb.append(protectText(text));
+ if (bold) {
+ sb.append("}");
+ }
+ if (italic) {
+ sb.append("}");
+ }
+ if (underline) {
+ sb.append("}");
+ }
} else {
appendPendingUrl(sb);
sb.append("{");
@@ -226,7 +315,7 @@ public class TikzGraphics {
sb.append("}");
}
sb.append("};");
- cmd.add(sb.toString());
+ addCommand(sb);
}
private void appendPendingUrl(final StringBuilder sb) {
@@ -249,11 +338,16 @@ public class TikzGraphics {
}
private String protectText(String text) {
+ text = text.replaceAll("\\\\", "\\\\\\\\");
text = text.replaceAll("_", "\\\\_");
text = text.replaceAll("\u00AB", "\\\\guillemotleft ");
text = text.replaceAll("\u00BB", "\\\\guillemotright ");
text = text.replaceAll("<", "\\\\textless ");
text = text.replaceAll(">", "\\\\textgreater ");
+ text = text.replaceAll("&", "\\\\&");
+ text = text.replaceAll("%", "\\\\%");
+ text = text.replace("$", "\\$");
+ text = text.replaceAll("~", "\\\\~{}");
return text;
}
@@ -272,17 +366,13 @@ public class TikzGraphics {
sb.append(" -- ");
sb.append(couple(x2, y2));
sb.append(";");
- cmd.add(sb.toString());
+ addCommand(sb);
}
public void polygon(double[] points) {
- final StringBuilder sb = new StringBuilder("\\draw[");
- if (color != null) {
- sb.append("color=" + getColorName(color) + ",");
- }
- if (fillcolor != null) {
- sb.append("fill=" + getColorName(fillcolor) + ",");
- }
+
+ final StringBuilder sb = new StringBuilder();
+ appendShadeOrDraw(sb);
sb.append("line width=" + thickness + "pt]");
sb.append(" ");
for (int i = 0; i < points.length; i += 2) {
@@ -290,17 +380,12 @@ public class TikzGraphics {
sb.append(" -- ");
}
sb.append("cycle;");
- cmd.add(sb.toString());
+ addCommand(sb);
}
private void round(double r, double[] points) {
- final StringBuilder sb = new StringBuilder("\\draw[");
- if (color != null) {
- sb.append("color=" + getColorName(color) + ",");
- }
- if (fillcolor != null) {
- sb.append("fill=" + getColorName(fillcolor) + ",");
- }
+ final StringBuilder sb = new StringBuilder();
+ appendShadeOrDraw(sb);
sb.append("line width=" + thickness + "pt]");
sb.append(" ");
int i = 0;
@@ -321,7 +406,26 @@ public class TikzGraphics {
sb.append(couple(points[i++], points[i++]));
sb.append(" -- ");
sb.append("cycle;");
- cmd.add(sb.toString());
+ addCommand(sb);
+ }
+
+ private void appendShadeOrDraw(final StringBuilder sb) {
+ final boolean gradient = this.fillcolorGradient2 != null;
+ sb.append(gradient ? "\\shade[" : "\\draw[");
+ if (color != null) {
+ sb.append(gradient ? "draw=" : "color=");
+ sb.append(getColorName(color) + ",");
+ }
+ if (gradient) {
+ sb.append("top color=" + getColorName(fillcolor) + ",");
+ sb.append("bottom color=" + getColorName(fillcolorGradient2) + ",");
+ sb.append("shading=axis,shading angle=" + getAngleFromGradientPolicy() + ",");
+ } else if (fillcolor != null) {
+ sb.append("fill=" + getColorName(fillcolor) + ",");
+ if (color == null) {
+ sb.append("color=" + getColorName(fillcolor) + ",");
+ }
+ }
}
public void rectangleRound(double x, double y, double width, double height, double r) {
@@ -350,8 +454,13 @@ public class TikzGraphics {
}
public void upath(double x, double y, UPath path) {
- final StringBuilder sb = new StringBuilder("\\draw[color=" + getColorName(color) + ",line width=" + thickness
- + "pt] ");
+ final StringBuilder sb = new StringBuilder();
+ appendShadeOrDraw(sb);
+ sb.append("line width=" + thickness + "pt");
+ if (dash != null) {
+ sb.append(",dash pattern=" + dash);
+ }
+ sb.append("] ");
for (USegment seg : path) {
final USegmentType type = seg.getSegmentType();
final double coord[] = seg.getCoord();
@@ -377,7 +486,7 @@ public class TikzGraphics {
}
}
sb.append(";");
- cmd.add(sb.toString());
+ addCommand(sb);
}
public void ellipse(double x, double y, double width, double height) {
@@ -391,7 +500,15 @@ public class TikzGraphics {
}
sb.append("line width=" + thickness + "pt] " + couple(x, y) + " ellipse (" + format(width) + "pt and "
+ format(height) + "pt);");
- cmd.add(sb.toString());
+ addCommand(sb);
+ }
+
+ public void drawSingleCharacter(double x, double y, char c) {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("\\node at ");
+ sb.append(couple(x, y));
+ sb.append("[]{\\textbf{\\Large " + c + "}};");
+ addCommand(sb);
}
public void drawPathIterator(double x, double y, PathIterator path) {
@@ -407,7 +524,7 @@ public class TikzGraphics {
sb.append(couple(coord[0] + x, coord[1] + y));
} else if (code == PathIterator.SEG_CLOSE) {
sb.append(";");
- cmd.add(sb.toString());
+ addCommand(sb);
sb.setLength(0);
sb.append("\\draw ");
} else if (code == PathIterator.SEG_CUBICTO) {
@@ -438,9 +555,18 @@ public class TikzGraphics {
// c = Color.WHITE;
// }
this.fillcolor = c;
+ this.fillcolorGradient2 = null;
addColor(c);
}
+ public void setGradientColor(Color c1, Color c2, char policy) {
+ this.fillcolor = c1;
+ this.fillcolorGradient2 = c2;
+ this.gradientPolicy = policy;
+ addColor(c1);
+ addColor(c2);
+ }
+
public void setStrokeColor(Color c) {
// if (c == null) {
// throw new IllegalArgumentException();
diff --git a/src/net/sourceforge/plantuml/timingdiagram/CommandDefineStateLong.java b/src/net/sourceforge/plantuml/timingdiagram/CommandDefineStateLong.java
new file mode 100644
index 0000000..aa8ff9f
--- /dev/null
+++ b/src/net/sourceforge/plantuml/timingdiagram/CommandDefineStateLong.java
@@ -0,0 +1,74 @@
+/* ========================================================================
+ * 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.timingdiagram;
+
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.SingleLineCommand2;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+
+public class CommandDefineStateLong extends SingleLineCommand2<TimingDiagram> {
+
+ public CommandDefineStateLong() {
+ super(getRegexConcat());
+ }
+
+ private static RegexConcat getRegexConcat() {
+ return new RegexConcat(new RegexLeaf("^"), //
+ new RegexLeaf("PLAYER", "([\\p{L}0-9_.@]+)"), //
+ new RegexLeaf("[%s]+has[%s]+"), //
+ new RegexLeaf("LABEL", "[%g]([^%g]+)[%g]"), //
+ new RegexLeaf("[%s]+as[%s]+"), //
+ new RegexLeaf("STATE", "([\\p{L}0-9_.@]+)"), //
+ new RegexLeaf("$"));
+ }
+
+ @Override
+ final protected CommandExecutionResult executeArg(TimingDiagram diagram, RegexResult arg) {
+ final String playerCode = arg.get("PLAYER", 0);
+ final Player player = diagram.getPlayer(playerCode);
+ if (player == null) {
+ return CommandExecutionResult.error("Unknown " + playerCode);
+ }
+ final String label = arg.get("LABEL", 0);
+ final String stateCode = arg.get("STATE", 0);
+ player.defineState(stateCode, label);
+
+ return CommandExecutionResult.ok();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/timingdiagram/CommandDefineStateShort.java b/src/net/sourceforge/plantuml/timingdiagram/CommandDefineStateShort.java
new file mode 100644
index 0000000..57a82c8
--- /dev/null
+++ b/src/net/sourceforge/plantuml/timingdiagram/CommandDefineStateShort.java
@@ -0,0 +1,71 @@
+/* ========================================================================
+ * 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.timingdiagram;
+
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.SingleLineCommand2;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+
+public class CommandDefineStateShort extends SingleLineCommand2<TimingDiagram> {
+
+ public CommandDefineStateShort() {
+ super(getRegexConcat());
+ }
+
+ private static RegexConcat getRegexConcat() {
+ return new RegexConcat(new RegexLeaf("^"), //
+ new RegexLeaf("PLAYER", "([\\p{L}0-9_.@]+)"), //
+ new RegexLeaf("[%s]+has[%s]+"), //
+ new RegexLeaf("STATE", "([\\p{L}0-9_.@]+)"), //
+ new RegexLeaf("$"));
+ }
+
+ @Override
+ final protected CommandExecutionResult executeArg(TimingDiagram diagram, RegexResult arg) {
+ final String playerCode = arg.get("PLAYER", 0);
+ final Player player = diagram.getPlayer(playerCode);
+ if (player == null) {
+ return CommandExecutionResult.error("Unknown " + playerCode);
+ }
+ final String stateCode = arg.get("STATE", 0);
+ player.defineState(stateCode, stateCode);
+
+ return CommandExecutionResult.ok();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/timingdiagram/CommandNote.java b/src/net/sourceforge/plantuml/timingdiagram/CommandNote.java
new file mode 100644
index 0000000..a423457
--- /dev/null
+++ b/src/net/sourceforge/plantuml/timingdiagram/CommandNote.java
@@ -0,0 +1,76 @@
+/* ========================================================================
+ * 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.timingdiagram;
+
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.Position;
+import net.sourceforge.plantuml.command.SingleLineCommand2;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+import net.sourceforge.plantuml.cucadiagram.Display;
+
+public class CommandNote extends SingleLineCommand2<TimingDiagram> {
+
+ public CommandNote() {
+ super(getRegexConcat());
+ }
+
+ private static RegexConcat getRegexConcat() {
+ return new RegexConcat(new RegexLeaf("^"), //
+ new RegexLeaf("[%s]*note[%s]+"), //
+ new RegexLeaf("POSITION", "(top|bottom)[%s]+of[%s]+"), //
+ new RegexLeaf("CODE", CommandTimeMessage.PLAYER_CODE), //
+ new RegexLeaf("[%s]*:[%s]*"), //
+ new RegexLeaf("NOTE", "(.+)"), //
+ new RegexLeaf("[%s]*$"));
+ }
+
+ @Override
+ final protected CommandExecutionResult executeArg(TimingDiagram diagram, RegexResult arg) {
+ final String code = arg.get("CODE", 0);
+ final Player player = diagram.getPlayer(code);
+ if (player == null) {
+ return CommandExecutionResult.error("Unkown \"" + code + "\"");
+ }
+ final Display note = Display.getWithNewlines(arg.get("NOTE", 0));
+ final TimeTick now = diagram.getNow();
+ // final Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
+ player.addNote(now, note, Position.fromString(arg.get("POSITION", 0)));
+ return CommandExecutionResult.ok();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/timingdiagram/CommandNoteLong.java b/src/net/sourceforge/plantuml/timingdiagram/CommandNoteLong.java
new file mode 100644
index 0000000..ad254f4
--- /dev/null
+++ b/src/net/sourceforge/plantuml/timingdiagram/CommandNoteLong.java
@@ -0,0 +1,84 @@
+/* ========================================================================
+ * 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.timingdiagram;
+
+import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.command.BlocLines;
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.CommandMultilines2;
+import net.sourceforge.plantuml.command.MultilinesStrategy;
+import net.sourceforge.plantuml.command.Position;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+import net.sourceforge.plantuml.cucadiagram.Display;
+
+public class CommandNoteLong extends CommandMultilines2<TimingDiagram> {
+
+ public CommandNoteLong() {
+ super(getRegexConcat(), MultilinesStrategy.REMOVE_STARTING_QUOTE);
+ }
+
+ public String getPatternEnd() {
+ return "(?i)^end[%s]?note$";
+ }
+
+ protected CommandExecutionResult executeNow(final TimingDiagram diagram, BlocLines lines) {
+
+ final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
+ lines = lines.subExtract(1, 1);
+ lines = lines.removeEmptyColumns();
+ final String code = line0.get("CODE", 0);
+ final Player player = diagram.getPlayer(code);
+ if (player == null) {
+ return CommandExecutionResult.error("Unkown \"" + code + "\"");
+ }
+ final Display note = lines.toDisplay();
+ final TimeTick now = diagram.getNow();
+ // final Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
+ player.addNote(now, note, Position.fromString(line0.get("POSITION", 0)));
+ return CommandExecutionResult.ok();
+ }
+
+ private static RegexConcat getRegexConcat() {
+ return new RegexConcat(new RegexLeaf("^"), //
+ new RegexLeaf("[%s]*note[%s]+"), //
+ new RegexLeaf("POSITION", "(top|bottom)[%s]+of[%s]+"), //
+ new RegexLeaf("CODE", CommandTimeMessage.PLAYER_CODE), //
+ new RegexLeaf("[%s]*$"));
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/timingdiagram/CommandTimeMessage.java b/src/net/sourceforge/plantuml/timingdiagram/CommandTimeMessage.java
index 267fad3..e4b31c3 100644
--- a/src/net/sourceforge/plantuml/timingdiagram/CommandTimeMessage.java
+++ b/src/net/sourceforge/plantuml/timingdiagram/CommandTimeMessage.java
@@ -40,6 +40,7 @@ import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
+import net.sourceforge.plantuml.descdiagram.command.CommandLinkElement;
public class CommandTimeMessage extends SingleLineCommand2<TimingDiagram> {
@@ -54,7 +55,9 @@ public class CommandTimeMessage extends SingleLineCommand2<TimingDiagram> {
new RegexLeaf("PART1", PLAYER_CODE), //
TimeTickBuilder.optionalExpressionAtWithArobase("TIME1"), //
new RegexLeaf("[%s]*"), //
- new RegexLeaf("ARROW", "(-+)\\>"), //
+ new RegexLeaf("ARROW_BODY", "(-+)"), //
+ new RegexLeaf("ARROW_STYLE", "(?:\\[(" + CommandLinkElement.LINE_STYLE + ")\\])?"), //
+ new RegexLeaf("ARROW_HEAD", "\\>"), //
new RegexLeaf("[%s]*"), //
new RegexLeaf("PART2", PLAYER_CODE), //
TimeTickBuilder.optionalExpressionAtWithArobase("TIME2"), //
@@ -66,10 +69,17 @@ public class CommandTimeMessage extends SingleLineCommand2<TimingDiagram> {
@Override
final protected CommandExecutionResult executeArg(TimingDiagram diagram, RegexResult arg) {
final Player player1 = diagram.getPlayer(arg.get("PART1", 0));
+ if (player1 == null) {
+ return CommandExecutionResult.error("No such element: " + arg.get("PART1", 0));
+ }
final Player player2 = diagram.getPlayer(arg.get("PART2", 0));
+ if (player2 == null) {
+ return CommandExecutionResult.error("No such element: " + arg.get("PART2", 0));
+ }
final TimeTick tick1 = TimeTickBuilder.parseTimeTick("TIME1", arg, diagram);
final TimeTick tick2 = TimeTickBuilder.parseTimeTick("TIME2", arg, diagram);
- diagram.createTimeMessage(player1, tick1, player2, tick2, arg.get("MESSAGE", 0));
+ final TimeMessage result = diagram.createTimeMessage(player1, tick1, player2, tick2, arg.get("MESSAGE", 0));
+ result.applyStyle(arg.getLazzy("ARROW_STYLE", 0));
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/timingdiagram/Histogram.java b/src/net/sourceforge/plantuml/timingdiagram/Histogram.java
index af319f4..98c1cc0 100644
--- a/src/net/sourceforge/plantuml/timingdiagram/Histogram.java
+++ b/src/net/sourceforge/plantuml/timingdiagram/Histogram.java
@@ -5,12 +5,12 @@
* (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
@@ -40,6 +40,7 @@ import java.awt.geom.Point2D.Double;
import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
import java.util.List;
@@ -55,6 +56,7 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.SymbolContext;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.color.Colors;
+import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UStroke;
@@ -65,16 +67,18 @@ public class Histogram implements TimeDrawing {
private final List<ChangeState> changes = new ArrayList<ChangeState>();
private final List<TimeConstraint> constraints = new ArrayList<TimeConstraint>();
- private List<String> allStates = new ArrayList<String>();
+ private List<String> allStates;
private final double stepHeight = 20;
private final ISkinParam skinParam;
private final TimingRuler ruler;
private String initialState;
- public Histogram(TimingRuler ruler, ISkinParam skinParam) {
+ public Histogram(TimingRuler ruler, ISkinParam skinParam, Collection<String> someStates) {
this.ruler = ruler;
this.skinParam = skinParam;
+ this.allStates = new ArrayList<String>(someStates);
+ Collections.reverse(allStates);
}
public IntricatedPoint getTimeProjection(StringBounder stringBounder, TimeTick tick) {
@@ -103,7 +107,8 @@ public class Histogram implements TimeDrawing {
return Collections.emptyList();
}
for (int i = 0; i < changes.size(); i++) {
- if (changes.get(i).getWhen().compareTo(tick) == 0) {
+ final int tickWithCurrentChangeTimeComparisonResult = changes.get(i).getWhen().compareTo(tick);
+ if (tickWithCurrentChangeTimeComparisonResult == 0) {
if (i == 0 && initialState == null) {
return Arrays.asList(changes.get(i).getState());
}
@@ -112,8 +117,16 @@ public class Histogram implements TimeDrawing {
}
return Arrays.asList(changes.get(i - 1).getState(), changes.get(i).getState());
}
- if (changes.get(i).getWhen().compareTo(tick) > 0) {
- return Collections.singletonList(changes.get(i - 1).getState());
+ if (tickWithCurrentChangeTimeComparisonResult > 0) {
+ final int changeIndex;
+ if (i == 0) {
+ // if this time tick was not yet defined in any place, and is less then the first one,
+ // assume it's the leftmost
+ changeIndex = 0;
+ } else {
+ changeIndex = i - 1;
+ }
+ return Collections.singletonList(changes.get(changeIndex).getState());
}
}
return Collections.singletonList(changes.get(changes.size() - 1).getState());
@@ -226,7 +239,7 @@ public class Histogram implements TimeDrawing {
return display.create(getFontConfiguration(), HorizontalAlignment.LEFT, skinParam);
}
- public double getHeight() {
+ public double getHeight(StringBounder stringBounder) {
return stepHeight * allStates.size() + 10;
}
@@ -254,6 +267,10 @@ public class Histogram implements TimeDrawing {
return new Dimension2DDouble(width, getFullDeltaY());
}
+ public MinMax getMinMax(StringBounder stringBounder) {
+ throw new UnsupportedOperationException();
+ }
+
public Rectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
return null;
}
diff --git a/src/net/sourceforge/plantuml/timingdiagram/Player.java b/src/net/sourceforge/plantuml/timingdiagram/Player.java
index fb5c775..85f189e 100644
--- a/src/net/sourceforge/plantuml/timingdiagram/Player.java
+++ b/src/net/sourceforge/plantuml/timingdiagram/Player.java
@@ -37,13 +37,16 @@ package net.sourceforge.plantuml.timingdiagram;
import java.awt.geom.Dimension2D;
import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
+import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.command.Position;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
@@ -52,6 +55,7 @@ import net.sourceforge.plantuml.graphic.InnerStrategy;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.color.Colors;
+import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
@@ -69,6 +73,8 @@ public class Player implements TextBlock, TimeProjected {
private final Set<ChangeState> changes = new TreeSet<ChangeState>();
private final List<TimeConstraint> constraints = new ArrayList<TimeConstraint>();
+ private final List<TimingNote> notes = new ArrayList<TimingNote>();
+ private final Map<String, String> statesLabel = new LinkedHashMap<String, String>();
public Player(String code, String full, TimingStyle type, ISkinParam skinParam, TimingRuler ruler) {
this.code = code;
@@ -138,9 +144,9 @@ public class Player implements TextBlock, TimeProjected {
private TimeDrawing computeTimeDrawing() {
final TimeDrawing result;
if (type == TimingStyle.CONCISE) {
- result = new Ribbon(ruler, skinParam);
+ result = new Ribbon(ruler, skinParam, notes);
} else if (type == TimingStyle.ROBUST) {
- result = new Histogram(ruler, skinParam);
+ result = new Histogram(ruler, skinParam, statesLabel.values());
} else {
throw new IllegalStateException();
}
@@ -157,12 +163,16 @@ public class Player implements TextBlock, TimeProjected {
public Dimension2D calculateDimension(StringBounder stringBounder) {
final TextBlock title = getTitle();
final double width = ruler.getWidth();
- final double zoneHeight = getZoneHeight();
+ final double zoneHeight = getZoneHeight(stringBounder);
return new Dimension2DDouble(width, title.calculateDimension(stringBounder).getHeight() * 2 + zoneHeight);
}
- private double getZoneHeight() {
- return getTimeDrawing().getHeight();
+ public MinMax getMinMax(StringBounder stringBounder) {
+ throw new UnsupportedOperationException();
+ }
+
+ private double getZoneHeight(StringBounder stringBounder) {
+ return getTimeDrawing().getHeight(stringBounder);
}
public Rectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
@@ -170,6 +180,7 @@ public class Player implements TextBlock, TimeProjected {
}
public void setState(TimeTick now, String state, String comment, Colors color) {
+ state = decodeState(state);
if (now == null) {
this.initialState = state;
this.initialColors = color;
@@ -182,6 +193,14 @@ public class Player implements TextBlock, TimeProjected {
}
+ private String decodeState(String code) {
+ final String label = statesLabel.get(code);
+ if (label == null) {
+ return code;
+ }
+ return label;
+ }
+
public IntricatedPoint getTimeProjection(StringBounder stringBounder, TimeTick tick) {
final IntricatedPoint point = getTimeDrawing().getTimeProjection(stringBounder, tick);
if (point == null) {
@@ -195,4 +214,12 @@ public class Player implements TextBlock, TimeProjected {
this.constraints.add(new TimeConstraint(tick1, tick2, message));
}
+ public void addNote(TimeTick now, Display note, Position position) {
+ this.notes.add(new TimingNote(now, this, note, position, skinParam));
+ }
+
+ public void defineState(String stateCode, String label) {
+ statesLabel.put(stateCode, label);
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/timingdiagram/Ribbon.java b/src/net/sourceforge/plantuml/timingdiagram/Ribbon.java
index 147a5b8..0eb61eb 100644
--- a/src/net/sourceforge/plantuml/timingdiagram/Ribbon.java
+++ b/src/net/sourceforge/plantuml/timingdiagram/Ribbon.java
@@ -41,6 +41,7 @@ import java.util.List;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.command.Position;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
@@ -64,10 +65,12 @@ public class Ribbon implements TimeDrawing {
private final TimingRuler ruler;
private String initialState;
private Colors initialColors;
+ private final List<TimingNote> notes;
- public Ribbon(TimingRuler ruler, ISkinParam skinParam) {
+ public Ribbon(TimingRuler ruler, ISkinParam skinParam, List<TimingNote> notes) {
this.ruler = ruler;
this.skinParam = skinParam;
+ this.notes = notes;
}
public IntricatedPoint getTimeProjection(StringBounder stringBounder, TimeTick tick) {
@@ -93,24 +96,31 @@ public class Ribbon implements TimeDrawing {
return new FontConfiguration(skinParam, FontParam.ACTIVITY, null);
}
- private TextBlock getTextBlock(String value) {
+ private TextBlock createTextBlock(String value) {
final Display display = Display.getWithNewlines(value);
return display.create(getFontConfiguration(), HorizontalAlignment.LEFT, skinParam);
}
public void drawU(UGraphic ug) {
- UGraphic ugDown = ug.apply(new UTranslate(0, getHeightForConstraints()));
+ final StringBounder stringBounder = ug.getStringBounder();
+ final double halfDelta = delta / 2;
+ drawNotes(ug.apply(new UTranslate(0, -delta)), Position.TOP);
- final TextBlock inital;
- final StringBounder stringBounder = ugDown.getStringBounder();
+ final double ribbonHeight = getRibbonHeight();
+ UGraphic ugDown = ug.apply(new UTranslate(0, getHeightForConstraints()
+ + getHeightForNotes(stringBounder, Position.TOP)));
+
+ final TextBlock initial;
if (initialState == null) {
- inital = null;
+ initial = null;
} else {
- inital = getTextBlock(initialState);
- final double a = getPosInPixel(changes.get(0));
- drawPentaA(ugDown.apply(new UTranslate(-getInitialWidth(stringBounder), -delta / 2)),
- getInitialWidth(stringBounder) + a, changes.get(0));
+ initial = createTextBlock(initialState);
+ if (changes.size() > 0) {
+ final double a = getPosInPixel(changes.get(0));
+ drawPentaA(ugDown.apply(new UTranslate(-getInitialWidth(stringBounder), -halfDelta)),
+ getInitialWidth(stringBounder) + a, changes.get(0));
+ }
}
for (int i = 0; i < changes.size() - 1; i++) {
@@ -118,28 +128,28 @@ public class Ribbon implements TimeDrawing {
final double b = getPosInPixel(changes.get(i + 1));
assert b > a;
if (changes.get(i).isCompletelyHidden() == false) {
- drawHexa(ugDown.apply(new UTranslate(a, -delta / 2)), b - a, changes.get(i));
+ drawHexa(ugDown.apply(new UTranslate(a, -halfDelta)), b - a, changes.get(i));
}
}
if (changes.size() >= 1) {
final ChangeState last = changes.get(changes.size() - 1);
final double a = getPosInPixel(last);
if (last.isCompletelyHidden() == false) {
- drawPentaB(ugDown.apply(new UTranslate(a, -delta / 2)), ruler.getWidth() - a, last);
+ drawPentaB(ugDown.apply(new UTranslate(a, -halfDelta)), ruler.getWidth() - a, last);
}
}
- ugDown = ugDown.apply(new UTranslate(0, delta / 2));
+ ugDown = ugDown.apply(new UTranslate(0, halfDelta));
- if (inital != null) {
- final Dimension2D dimInital = inital.calculateDimension(stringBounder);
- inital.drawU(ugDown.apply(new UTranslate(-getDelta() - dimInital.getWidth(), -dimInital.getHeight() / 2)));
+ if (initial != null) {
+ final Dimension2D dimInital = initial.calculateDimension(stringBounder);
+ initial.drawU(ugDown.apply(new UTranslate(-getDelta() - dimInital.getWidth(), -dimInital.getHeight() / 2)));
}
for (int i = 0; i < changes.size(); i++) {
final ChangeState change = changes.get(i);
final double x = ruler.getPosInPixel(change.getWhen());
if (change.isBlank() == false && change.isCompletelyHidden() == false) {
- final TextBlock state = getTextBlock(change.getState());
+ final TextBlock state = createTextBlock(change.getState());
final Dimension2D dim = state.calculateDimension(stringBounder);
final double xtext;
if (i == changes.size() - 1) {
@@ -152,29 +162,46 @@ public class Ribbon implements TimeDrawing {
}
final String commentString = change.getComment();
if (commentString != null) {
- final TextBlock comment = getTextBlock(commentString);
+ final TextBlock comment = createTextBlock(commentString);
final Dimension2D dimComment = comment.calculateDimension(stringBounder);
comment.drawU(ugDown.apply(new UTranslate(x + getDelta(), -delta - dimComment.getHeight())));
}
}
for (TimeConstraint constraint : constraints) {
- constraint.drawU(ug.apply(new UTranslate(0, 15)), ruler, skinParam);
+ constraint.drawU(ug.apply(new UTranslate(0, getHeightForConstraints() / 2)), ruler, skinParam);
}
+ drawNotes(
+ ug.apply(new UTranslate(0, getHeightForConstraints() + getHeightForNotes(stringBounder, Position.TOP)
+ + ribbonHeight)), Position.BOTTOM);
+
+ }
+
+ private void drawNotes(UGraphic ug, final Position position) {
+ for (TimingNote note : notes) {
+ if (note.getPosition() == position) {
+ final double x = ruler.getPosInPixel(note.getWhen());
+ note.drawU(ug.apply(new UTranslate(x, 0)));
+ }
+ }
}
private double getInitialWidth(final StringBounder stringBounder) {
- return getTextBlock(initialState).calculateDimension(stringBounder).getWidth() + 2 * delta;
+ return createTextBlock(initialState).calculateDimension(stringBounder).getWidth() + getRibbonHeight();
}
private void drawHexa(UGraphic ug, double len, ChangeState change) {
- final HexaShape shape = HexaShape.create(len, 2 * delta, change.getContext());
+ final HexaShape shape = HexaShape.create(len, getRibbonHeight(), change.getContext());
shape.drawU(ug);
}
+ private double getRibbonHeight() {
+ return 2 * delta;
+ }
+
private void drawPentaB(UGraphic ug, double len, ChangeState change) {
- final PentaBShape shape = PentaBShape.create(len, 2 * delta, change.getContext());
+ final PentaBShape shape = PentaBShape.create(len, getRibbonHeight(), change.getContext());
shape.drawU(ug);
}
@@ -184,7 +211,7 @@ public class Ribbon implements TimeDrawing {
if (back != null) {
context = context.withBackColor(back);
}
- final PentaAShape shape = PentaAShape.create(len, 2 * delta, context);
+ final PentaAShape shape = PentaAShape.create(len, getRibbonHeight(), context);
shape.drawU(ug);
}
@@ -195,8 +222,19 @@ public class Ribbon implements TimeDrawing {
return 30;
}
- public double getHeight() {
- return 3 * delta + getHeightForConstraints();
+ public double getHeight(StringBounder stringBounder) {
+ return 3 * delta + getHeightForConstraints() + getHeightForNotes(stringBounder, Position.TOP)
+ + getHeightForNotes(stringBounder, Position.BOTTOM);
+ }
+
+ private double getHeightForNotes(StringBounder stringBounder, Position position) {
+ double height = 0;
+ for (TimingNote note : notes) {
+ if (note.getPosition() == position) {
+ height = Math.max(height, note.getHeight(stringBounder));
+ }
+ }
+ return height;
}
public double getDelta() {
@@ -205,7 +243,7 @@ public class Ribbon implements TimeDrawing {
public TextBlock getWidthHeader(StringBounder stringBounder) {
if (initialState != null) {
- return TextBlockUtils.empty(getInitialWidth(stringBounder), 2 * delta);
+ return TextBlockUtils.empty(getInitialWidth(stringBounder), getRibbonHeight());
}
return TextBlockUtils.empty(0, 0);
}
diff --git a/src/net/sourceforge/plantuml/timingdiagram/RibbonNew.java b/src/net/sourceforge/plantuml/timingdiagram/RibbonNew.java
new file mode 100644
index 0000000..7e0b3c9
--- /dev/null
+++ b/src/net/sourceforge/plantuml/timingdiagram/RibbonNew.java
@@ -0,0 +1,244 @@
+/* ========================================================================
+ * 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.timingdiagram;
+
+import java.awt.geom.Dimension2D;
+import java.awt.geom.Point2D;
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sourceforge.plantuml.FontParam;
+import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.SymbolContext;
+import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.graphic.TextBlockUtils;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class RibbonNew implements TimeDrawing {
+
+ private final List<ChangeState> changes = new ArrayList<ChangeState>();
+ private final List<TimeConstraint> constraints = new ArrayList<TimeConstraint>();
+
+ private final double delta = 12;
+ private final ISkinParam skinParam;
+ private final TimingRuler ruler;
+ private String initialState;
+ private Colors initialColors;
+ private final List<TimingNote> notes;
+
+ public RibbonNew(TimingRuler ruler, ISkinParam skinParam, List<TimingNote> notes) {
+ this.ruler = ruler;
+ this.skinParam = skinParam;
+ this.notes = notes;
+ }
+
+ public IntricatedPoint getTimeProjection(StringBounder stringBounder, TimeTick tick) {
+ final double x = ruler.getPosInPixel(tick);
+ final double y = delta * 0.5 + getHeightForConstraints();
+ for (ChangeState change : changes) {
+ if (change.getWhen().compareTo(tick) == 0) {
+ return new IntricatedPoint(new Point2D.Double(x, y), new Point2D.Double(x, y));
+ }
+ }
+ return new IntricatedPoint(new Point2D.Double(x, y - delta), new Point2D.Double(x, y + delta));
+ }
+
+ public void addChange(ChangeState change) {
+ this.changes.add(change);
+ }
+
+ private double getPosInPixel(ChangeState change) {
+ return ruler.getPosInPixel(change.getWhen());
+ }
+
+ private FontConfiguration getFontConfiguration() {
+ return new FontConfiguration(skinParam, FontParam.ACTIVITY, null);
+ }
+
+ private TextBlock createTextBlock(String value) {
+ final Display display = Display.getWithNewlines(value);
+ return display.create(getFontConfiguration(), HorizontalAlignment.LEFT, skinParam);
+ }
+
+ public void drawU(UGraphic ug) {
+
+ final StringBounder stringBounder = ug.getStringBounder();
+
+ final double ribbonHeight = getRibbonHeight(stringBounder);
+ UGraphic ugDown = ug.apply(new UTranslate(0, getHeightForConstraints()));
+
+ final TextBlock inital;
+ if (initialState == null) {
+ inital = null;
+ } else {
+ inital = createTextBlock(initialState);
+ final double a = getPosInPixel(changes.get(0));
+ drawPentaA(ribbonHeight, ugDown.apply(new UTranslate(-getInitialWidth(stringBounder), -delta / 2)),
+ getInitialWidth(stringBounder) + a, changes.get(0));
+ }
+
+ for (int i = 0; i < changes.size() - 1; i++) {
+ final double a = getPosInPixel(changes.get(i));
+ final double b = getPosInPixel(changes.get(i + 1));
+ assert b > a;
+ if (changes.get(i).isCompletelyHidden() == false) {
+ drawHexa(ribbonHeight, ugDown.apply(new UTranslate(a, -delta / 2)), b - a, changes.get(i));
+ }
+ }
+ if (changes.size() >= 1) {
+ final ChangeState last = changes.get(changes.size() - 1);
+ final double a = getPosInPixel(last);
+ if (last.isCompletelyHidden() == false) {
+ drawPentaB(ribbonHeight, ugDown.apply(new UTranslate(a, -delta / 2)), ruler.getWidth() - a, last);
+ }
+ }
+
+ ugDown = ugDown.apply(new UTranslate(0, delta / 2));
+
+ if (inital != null) {
+ final Dimension2D dimInital = inital.calculateDimension(stringBounder);
+ inital.drawU(ugDown.apply(new UTranslate(-getDelta() - dimInital.getWidth(), -dimInital.getHeight() / 2)));
+ }
+ for (int i = 0; i < changes.size(); i++) {
+ final ChangeState change = changes.get(i);
+ final double x = ruler.getPosInPixel(change.getWhen());
+ if (change.isBlank() == false && change.isCompletelyHidden() == false) {
+ final TextBlock state = createTextBlock(change.getState());
+ final Dimension2D dim = state.calculateDimension(stringBounder);
+ final double xtext;
+ if (i == changes.size() - 1) {
+ xtext = x + getDelta();
+ } else {
+ final double x2 = ruler.getPosInPixel(changes.get(i + 1).getWhen());
+ xtext = (x + x2) / 2 - dim.getWidth() / 2;
+ }
+ state.drawU(ugDown.apply(new UTranslate(xtext, -dim.getHeight() / 2)));
+ }
+ final String commentString = change.getComment();
+ if (commentString != null) {
+ final TextBlock comment = createTextBlock(commentString);
+ final Dimension2D dimComment = comment.calculateDimension(stringBounder);
+ comment.drawU(ugDown.apply(new UTranslate(x + getDelta(), -delta - dimComment.getHeight())));
+ }
+ }
+
+ for (TimeConstraint constraint : constraints) {
+ constraint.drawU(ug.apply(new UTranslate(0, ribbonHeight / 2)), ruler, skinParam);
+ }
+
+ for (TimingNote note : notes) {
+ final double x = ruler.getPosInPixel(note.getWhen());
+ note.drawU(ug.apply(new UTranslate(x, ribbonHeight)));
+ }
+
+ }
+
+ private double getInitialWidth(final StringBounder stringBounder) {
+ return createTextBlock(initialState).calculateDimension(stringBounder).getWidth() + 2 * delta;
+ }
+
+ private void drawHexa(double ribbonHeight, UGraphic ug, double len, ChangeState change) {
+ final HexaShape shape = HexaShape.create(len, ribbonHeight, change.getContext());
+ shape.drawU(ug);
+ }
+
+ private void drawPentaB(double ribbonHeight, UGraphic ug, double len, ChangeState change) {
+ final PentaBShape shape = PentaBShape.create(len, ribbonHeight, change.getContext());
+ shape.drawU(ug);
+ }
+
+ private void drawPentaA(double ribbonHeight, UGraphic ug, double len, ChangeState change) {
+ SymbolContext context = change.getContext();
+ final HtmlColor back = initialColors.getColor(ColorType.BACK);
+ if (back != null) {
+ context = context.withBackColor(back);
+ }
+ final PentaAShape shape = PentaAShape.create(len, ribbonHeight, context);
+ shape.drawU(ug);
+ }
+
+ private double getHeightForConstraints() {
+ if (constraints.size() == 0) {
+ return 0;
+ }
+ return 30;
+ }
+
+ public double getHeight(StringBounder stringBounder) {
+ return getHeightForConstraints() + getRibbonHeight(stringBounder) + getHeightForNotes(stringBounder);
+ }
+
+ private double getRibbonHeight(StringBounder stringBounder) {
+ double height = 24;
+ return height;
+ }
+
+ private double getHeightForNotes(StringBounder stringBounder) {
+ double height = 0;
+ for (TimingNote note : notes) {
+ height = Math.max(height, note.getHeight(stringBounder));
+ }
+ return height;
+ }
+
+ public double getDelta() {
+ return delta;
+ }
+
+ public TextBlock getWidthHeader(StringBounder stringBounder) {
+ if (initialState != null) {
+ return TextBlockUtils.empty(getInitialWidth(stringBounder), getRibbonHeight(stringBounder));
+ }
+ return TextBlockUtils.empty(0, 0);
+ }
+
+ public void setInitialState(String initialState, Colors initialColors) {
+ this.initialState = initialState;
+ this.initialColors = initialColors;
+ }
+
+ public void addConstraint(TimeConstraint constraint) {
+ this.constraints.add(constraint);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/timingdiagram/RibbonOld.java b/src/net/sourceforge/plantuml/timingdiagram/RibbonOld.java
new file mode 100644
index 0000000..a0123ed
--- /dev/null
+++ b/src/net/sourceforge/plantuml/timingdiagram/RibbonOld.java
@@ -0,0 +1,226 @@
+/* ========================================================================
+ * 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.timingdiagram;
+
+import java.awt.geom.Dimension2D;
+import java.awt.geom.Point2D;
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sourceforge.plantuml.FontParam;
+import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.SymbolContext;
+import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.graphic.TextBlockUtils;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class RibbonOld implements TimeDrawing {
+
+ private final List<ChangeState> changes = new ArrayList<ChangeState>();
+ private final List<TimeConstraint> constraints = new ArrayList<TimeConstraint>();
+
+ private final double delta = 12;
+ private final ISkinParam skinParam;
+ private final TimingRuler ruler;
+ private String initialState;
+ private Colors initialColors;
+
+ public RibbonOld(TimingRuler ruler, ISkinParam skinParam) {
+ this.ruler = ruler;
+ this.skinParam = skinParam;
+ }
+
+ public IntricatedPoint getTimeProjection(StringBounder stringBounder, TimeTick tick) {
+ final double x = ruler.getPosInPixel(tick);
+ final double y = delta * 0.5 + getHeightForConstraints();
+ for (ChangeState change : changes) {
+ if (change.getWhen().compareTo(tick) == 0) {
+ return new IntricatedPoint(new Point2D.Double(x, y), new Point2D.Double(x, y));
+ }
+ }
+ return new IntricatedPoint(new Point2D.Double(x, y - delta), new Point2D.Double(x, y + delta));
+ }
+
+ public void addChange(ChangeState change) {
+ this.changes.add(change);
+ }
+
+ private double getPosInPixel(ChangeState change) {
+ return ruler.getPosInPixel(change.getWhen());
+ }
+
+ private FontConfiguration getFontConfiguration() {
+ return new FontConfiguration(skinParam, FontParam.ACTIVITY, null);
+ }
+
+ private TextBlock getTextBlock(String value) {
+ final Display display = Display.getWithNewlines(value);
+ return display.create(getFontConfiguration(), HorizontalAlignment.LEFT, skinParam);
+ }
+
+ public void drawU(UGraphic ug) {
+
+ UGraphic ugDown = ug.apply(new UTranslate(0, getHeightForConstraints()));
+
+ final TextBlock inital;
+ final StringBounder stringBounder = ugDown.getStringBounder();
+ if (initialState == null) {
+ inital = null;
+ } else {
+ inital = getTextBlock(initialState);
+ final double a = getPosInPixel(changes.get(0));
+ drawPentaA(ugDown.apply(new UTranslate(-getInitialWidth(stringBounder), -delta / 2)),
+ getInitialWidth(stringBounder) + a, changes.get(0));
+ }
+
+ for (int i = 0; i < changes.size() - 1; i++) {
+ final double a = getPosInPixel(changes.get(i));
+ final double b = getPosInPixel(changes.get(i + 1));
+ assert b > a;
+ if (changes.get(i).isCompletelyHidden() == false) {
+ drawHexa(ugDown.apply(new UTranslate(a, -delta / 2)), b - a, changes.get(i));
+ }
+ }
+ if (changes.size() >= 1) {
+ final ChangeState last = changes.get(changes.size() - 1);
+ final double a = getPosInPixel(last);
+ if (last.isCompletelyHidden() == false) {
+ drawPentaB(ugDown.apply(new UTranslate(a, -delta / 2)), ruler.getWidth() - a, last);
+ }
+ }
+
+ ugDown = ugDown.apply(new UTranslate(0, delta / 2));
+
+ if (inital != null) {
+ final Dimension2D dimInital = inital.calculateDimension(stringBounder);
+ inital.drawU(ugDown.apply(new UTranslate(-getDelta() - dimInital.getWidth(), -dimInital.getHeight() / 2)));
+ }
+ for (int i = 0; i < changes.size(); i++) {
+ final ChangeState change = changes.get(i);
+ final double x = ruler.getPosInPixel(change.getWhen());
+ if (change.isBlank() == false && change.isCompletelyHidden() == false) {
+ final TextBlock state = getTextBlock(change.getState());
+ final Dimension2D dim = state.calculateDimension(stringBounder);
+ final double xtext;
+ if (i == changes.size() - 1) {
+ xtext = x + getDelta();
+ } else {
+ final double x2 = ruler.getPosInPixel(changes.get(i + 1).getWhen());
+ xtext = (x + x2) / 2 - dim.getWidth() / 2;
+ }
+ state.drawU(ugDown.apply(new UTranslate(xtext, -dim.getHeight() / 2)));
+ }
+ final String commentString = change.getComment();
+ if (commentString != null) {
+ final TextBlock comment = getTextBlock(commentString);
+ final Dimension2D dimComment = comment.calculateDimension(stringBounder);
+ comment.drawU(ugDown.apply(new UTranslate(x + getDelta(), -delta - dimComment.getHeight())));
+ }
+ }
+
+ for (TimeConstraint constraint : constraints) {
+ constraint.drawU(ug.apply(new UTranslate(0, 15)), ruler, skinParam);
+ }
+
+ }
+
+ private double getInitialWidth(final StringBounder stringBounder) {
+ return getTextBlock(initialState).calculateDimension(stringBounder).getWidth() + getRibonHeight();
+ }
+
+ private void drawHexa(UGraphic ug, double len, ChangeState change) {
+ final HexaShape shape = HexaShape.create(len, getRibonHeight(), change.getContext());
+ shape.drawU(ug);
+ }
+
+ private double getRibonHeight() {
+ return 2 * delta;
+ }
+
+ private void drawPentaB(UGraphic ug, double len, ChangeState change) {
+ final PentaBShape shape = PentaBShape.create(len, getRibonHeight(), change.getContext());
+ shape.drawU(ug);
+ }
+
+ private void drawPentaA(UGraphic ug, double len, ChangeState change) {
+ SymbolContext context = change.getContext();
+ final HtmlColor back = initialColors.getColor(ColorType.BACK);
+ if (back != null) {
+ context = context.withBackColor(back);
+ }
+ final PentaAShape shape = PentaAShape.create(len, getRibonHeight(), context);
+ shape.drawU(ug);
+ }
+
+ private double getHeightForConstraints() {
+ if (constraints.size() == 0) {
+ return 0;
+ }
+ return 30;
+ }
+
+ public double getHeight(StringBounder stringBounder) {
+ return 3 * delta + getHeightForConstraints();
+ }
+
+ public double getDelta() {
+ return delta;
+ }
+
+ public TextBlock getWidthHeader(StringBounder stringBounder) {
+ if (initialState != null) {
+ return TextBlockUtils.empty(getInitialWidth(stringBounder), getRibonHeight());
+ }
+ return TextBlockUtils.empty(0, 0);
+ }
+
+ public void setInitialState(String initialState, Colors initialColors) {
+ this.initialState = initialState;
+ this.initialColors = initialColors;
+ }
+
+ public void addConstraint(TimeConstraint constraint) {
+ this.constraints.add(constraint);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/timingdiagram/TickInPlayer.java b/src/net/sourceforge/plantuml/timingdiagram/TickInPlayer.java
index 3a7c090..3fa2003 100644
--- a/src/net/sourceforge/plantuml/timingdiagram/TickInPlayer.java
+++ b/src/net/sourceforge/plantuml/timingdiagram/TickInPlayer.java
@@ -40,6 +40,9 @@ public class TickInPlayer {
private final TimeTick tick;
public TickInPlayer(Player player, TimeTick tick) {
+ if (player == null) {
+ throw new IllegalArgumentException();
+ }
this.player = player;
this.tick = tick;
}
diff --git a/src/net/sourceforge/plantuml/timingdiagram/TimeArrow.java b/src/net/sourceforge/plantuml/timingdiagram/TimeArrow.java
index 5d561b6..06a02ed 100644
--- a/src/net/sourceforge/plantuml/timingdiagram/TimeArrow.java
+++ b/src/net/sourceforge/plantuml/timingdiagram/TimeArrow.java
@@ -34,15 +34,15 @@
*/
package net.sourceforge.plantuml.timingdiagram;
-import java.awt.Font;
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.cucadiagram.WithLinkType;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
@@ -60,17 +60,20 @@ public class TimeArrow implements UDrawable {
private final Point2D end;
private final Display label;
private final ISkinSimple spriteContainer;
-
- public static TimeArrow create(IntricatedPoint pt1, IntricatedPoint pt2, Display label, ISkinSimple spriteContainer) {
- final TimeArrow arrow1 = new TimeArrow(pt1.getPointA(), pt2.getPointA(), label, spriteContainer);
- final TimeArrow arrow2 = new TimeArrow(pt1.getPointA(), pt2.getPointB(), label, spriteContainer);
- final TimeArrow arrow3 = new TimeArrow(pt1.getPointB(), pt2.getPointA(), label, spriteContainer);
- final TimeArrow arrow4 = new TimeArrow(pt1.getPointB(), pt2.getPointB(), label, spriteContainer);
+ private final WithLinkType type;
+
+ public static TimeArrow create(IntricatedPoint pt1, IntricatedPoint pt2, Display label,
+ ISkinSimple spriteContainer, WithLinkType type) {
+ final TimeArrow arrow1 = new TimeArrow(pt1.getPointA(), pt2.getPointA(), label, spriteContainer, type);
+ final TimeArrow arrow2 = new TimeArrow(pt1.getPointA(), pt2.getPointB(), label, spriteContainer, type);
+ final TimeArrow arrow3 = new TimeArrow(pt1.getPointB(), pt2.getPointA(), label, spriteContainer, type);
+ final TimeArrow arrow4 = new TimeArrow(pt1.getPointB(), pt2.getPointB(), label, spriteContainer, type);
return shorter(arrow1, arrow2, arrow3, arrow4);
}
- private TimeArrow(Point2D start, Point2D end, Display label, ISkinSimple spriteContainer) {
+ private TimeArrow(Point2D start, Point2D end, Display label, ISkinSimple spriteContainer, WithLinkType type) {
this.start = start;
+ this.type = type;
this.end = end;
this.label = label;
this.spriteContainer = spriteContainer;
@@ -96,7 +99,7 @@ public class TimeArrow implements UDrawable {
}
public TimeArrow translate(UTranslate translate) {
- return new TimeArrow(translate.getTranslated(start), translate.getTranslated(end), label, spriteContainer);
+ return new TimeArrow(translate.getTranslated(start), translate.getTranslated(end), label, spriteContainer, type);
}
public static Point2D onCircle(Point2D pt, double alpha) {
@@ -108,12 +111,13 @@ public class TimeArrow implements UDrawable {
private FontConfiguration getFontConfiguration() {
final UFont font = UFont.serif(14);
- return new FontConfiguration(font, HtmlColorUtils.BLUE, HtmlColorUtils.BLUE, false);
+
+ return new FontConfiguration(font, type.getSpecificColor(), type.getSpecificColor(), false);
}
public void drawU(UGraphic ug) {
final double angle = getAngle();
- ug = ug.apply(new UChangeColor(HtmlColorUtils.BLUE)).apply(new UStroke());
+ ug = ug.apply(new UChangeColor(type.getSpecificColor())).apply(type.getType().getStroke3(new UStroke()));
final ULine line = new ULine(end.getX() - start.getX(), end.getY() - start.getY());
ug.apply(new UTranslate(start)).draw(line);
@@ -126,7 +130,7 @@ public class TimeArrow implements UDrawable {
polygon.addPoint(pt2.getX(), pt2.getY());
polygon.addPoint(end.getX(), end.getY());
- ug = ug.apply(new UChangeBackColor(HtmlColorUtils.BLUE));
+ ug = ug.apply(new UChangeBackColor(type.getSpecificColor()));
ug.draw(polygon);
final TextBlock textLabel = label.create(getFontConfiguration(), HorizontalAlignment.LEFT, spriteContainer);
diff --git a/src/net/sourceforge/plantuml/timingdiagram/TimeDrawing.java b/src/net/sourceforge/plantuml/timingdiagram/TimeDrawing.java
index 58230f7..0124fe8 100644
--- a/src/net/sourceforge/plantuml/timingdiagram/TimeDrawing.java
+++ b/src/net/sourceforge/plantuml/timingdiagram/TimeDrawing.java
@@ -41,7 +41,7 @@ import net.sourceforge.plantuml.graphic.color.Colors;
public interface TimeDrawing extends TimeProjected, UDrawable {
- public double getHeight();
+ public double getHeight(StringBounder stringBounder);
public void addChange(ChangeState change);
diff --git a/src/net/sourceforge/plantuml/timingdiagram/TimeMessage.java b/src/net/sourceforge/plantuml/timingdiagram/TimeMessage.java
index ec5b059..0a2b40c 100644
--- a/src/net/sourceforge/plantuml/timingdiagram/TimeMessage.java
+++ b/src/net/sourceforge/plantuml/timingdiagram/TimeMessage.java
@@ -35,8 +35,12 @@
package net.sourceforge.plantuml.timingdiagram;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.cucadiagram.LinkDecor;
+import net.sourceforge.plantuml.cucadiagram.LinkType;
+import net.sourceforge.plantuml.cucadiagram.WithLinkType;
+import net.sourceforge.plantuml.graphic.HtmlColorUtils;
-public class TimeMessage {
+public class TimeMessage extends WithLinkType {
private final TickInPlayer tickInPlayer1;
private final TickInPlayer tickInPlayer2;
@@ -46,6 +50,8 @@ public class TimeMessage {
this.tickInPlayer1 = tickInPlayer1;
this.tickInPlayer2 = tickInPlayer2;
this.label = Display.getWithNewlines(label);
+ this.setSpecificColor(HtmlColorUtils.BLUE);
+ this.type = new LinkType(LinkDecor.NONE, LinkDecor.NONE);
}
public final Player getPlayer1() {
@@ -68,4 +74,9 @@ public class TimeMessage {
return label;
}
+ @Override
+ public void goNorank() {
+ // Nothing to do
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/timingdiagram/TimeTickBuilder.java b/src/net/sourceforge/plantuml/timingdiagram/TimeTickBuilder.java
index 86d0652..d31f71e 100644
--- a/src/net/sourceforge/plantuml/timingdiagram/TimeTickBuilder.java
+++ b/src/net/sourceforge/plantuml/timingdiagram/TimeTickBuilder.java
@@ -41,7 +41,7 @@ import net.sourceforge.plantuml.command.regex.RegexResult;
public class TimeTickBuilder {
- private static final String WITHOUT_AROBASE = "(\\+?)(\\d+\\.?\\d*)";
+ private static final String WITHOUT_AROBASE = "(\\+?)(-?\\d+\\.?\\d*)";
private static final String WITH_AROBASE = "@" + WITHOUT_AROBASE;
public static RegexLeaf expressionAtWithoutArobase(String name) {
diff --git a/src/net/sourceforge/plantuml/timingdiagram/TimingDiagram.java b/src/net/sourceforge/plantuml/timingdiagram/TimingDiagram.java
index 6e6037e..1c46d67 100644
--- a/src/net/sourceforge/plantuml/timingdiagram/TimingDiagram.java
+++ b/src/net/sourceforge/plantuml/timingdiagram/TimingDiagram.java
@@ -35,6 +35,7 @@
package net.sourceforge.plantuml.timingdiagram;
import java.awt.geom.Dimension2D;
+import java.awt.geom.Rectangle2D;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
@@ -42,15 +43,25 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import net.sourceforge.plantuml.AnnotatedWorker;
+import net.sourceforge.plantuml.ColorParam;
+import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FileFormatOption;
+import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.HtmlColorSet;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.InnerStrategy;
import net.sourceforge.plantuml.graphic.StringBounder;
-import net.sourceforge.plantuml.graphic.UDrawable;
+import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.skin.rose.Rose;
+import net.sourceforge.plantuml.svek.TextBlockBackcolored;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
+import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
@@ -82,16 +93,40 @@ public class TimingDiagram extends UmlDiagram implements Clock {
final ImageBuilder imageBuilder = new ImageBuilder(getSkinParam(), dpiFactor,
fileFormatOption.isWithMetadata() ? getMetadata() : null, getWarningOrError(), margin, margin,
getAnimation());
- imageBuilder.setUDrawable(getUDrawable());
+
+ TextBlock result = getTextBlock();
+ final ISkinParam skinParam = getSkinParam();
+ result = new AnnotatedWorker(this, skinParam).addAdd(result);
+ imageBuilder.setUDrawable(result);
return imageBuilder.writeImageTOBEMOVED(fileFormatOption, seed(), os);
}
- private UDrawable getUDrawable() {
- return new UDrawable() {
+ private TextBlockBackcolored getTextBlock() {
+ return new TextBlockBackcolored() {
+
public void drawU(UGraphic ug) {
drawInternal(ug);
}
+
+ public Rectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
+ return null;
+ }
+
+ public Dimension2D calculateDimension(StringBounder stringBounder) {
+ final UTranslate lastTranslate = getUTranslateForPlayer(null, stringBounder);
+ final double withBeforeRuler = getWithBeforeRuler(stringBounder);
+ final double totalWith = withBeforeRuler + ruler.getWidth() + marginX1 + marginX2;
+ return new Dimension2DDouble(totalWith, lastTranslate.getDy() + ruler.getHeight(stringBounder));
+ }
+
+ public MinMax getMinMax(StringBounder stringBounder) {
+ throw new UnsupportedOperationException();
+ }
+
+ public HtmlColor getBackcolor() {
+ return null;
+ }
};
}
@@ -151,7 +186,7 @@ public class TimingDiagram extends UmlDiagram implements Clock {
}
final TimeArrow timeArrow = TimeArrow.create(pt1.translated(translate1), pt2.translated(translate2),
- message.getLabel(), getSkinParam());
+ message.getLabel(), getSkinParam(), message);
timeArrow.drawU(ug);
}
@@ -177,10 +212,11 @@ public class TimingDiagram extends UmlDiagram implements Clock {
lastPlayer = player;
}
- public void createTimeMessage(Player player1, TimeTick time1, Player player2, TimeTick time2, String label) {
+ public TimeMessage createTimeMessage(Player player1, TimeTick time1, Player player2, TimeTick time2, String label) {
final TimeMessage message = new TimeMessage(new TickInPlayer(player1, time1), new TickInPlayer(player2, time2),
label);
messages.add(message);
+ return message;
}
public void addTime(TimeTick time) {
diff --git a/src/net/sourceforge/plantuml/timingdiagram/TimingDiagramFactory.java b/src/net/sourceforge/plantuml/timingdiagram/TimingDiagramFactory.java
index b4f7045..4112fa5 100644
--- a/src/net/sourceforge/plantuml/timingdiagram/TimingDiagramFactory.java
+++ b/src/net/sourceforge/plantuml/timingdiagram/TimingDiagramFactory.java
@@ -56,11 +56,15 @@ public class TimingDiagramFactory extends UmlDiagramFactory {
addCommonCommands(cmds);
cmds.add(new CommandLifeLine());
+ cmds.add(new CommandDefineStateShort());
+ cmds.add(new CommandDefineStateLong());
cmds.add(new CommandChangeStateByPlayerCode());
cmds.add(new CommandChangeStateByTime());
cmds.add(new CommandAtTime());
cmds.add(new CommandAtPlayer());
cmds.add(new CommandTimeMessage());
+ cmds.add(new CommandNote());
+ cmds.add(new CommandNoteLong());
cmds.add(new CommandConstraint());
cmds.add(new CommandScalePixel());
diff --git a/src/net/sourceforge/plantuml/timingdiagram/TimingNote.java b/src/net/sourceforge/plantuml/timingdiagram/TimingNote.java
new file mode 100644
index 0000000..3186436
--- /dev/null
+++ b/src/net/sourceforge/plantuml/timingdiagram/TimingNote.java
@@ -0,0 +1,103 @@
+/* ========================================================================
+ * 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.timingdiagram;
+
+import net.sourceforge.plantuml.ColorParam;
+import net.sourceforge.plantuml.FontParam;
+import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.LineBreakStrategy;
+import net.sourceforge.plantuml.command.Position;
+import net.sourceforge.plantuml.creole.CreoleMode;
+import net.sourceforge.plantuml.creole.CreoleParser;
+import net.sourceforge.plantuml.creole.Sheet;
+import net.sourceforge.plantuml.creole.SheetBlock1;
+import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.skin.rose.Rose;
+import net.sourceforge.plantuml.svek.image.Opale;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+
+public class TimingNote {
+
+ private final TimeTick when;
+ private final Player player;
+ private final Display note;
+ private final Position position;
+ private final ISkinParam skinParam;
+
+ public TimingNote(TimeTick when, Player player, Display note, Position position, ISkinParam skinParam) {
+ this.note = note;
+ this.player = player;
+ this.when = when;
+ this.skinParam = skinParam;
+ this.position = position;
+ }
+
+ public void drawU(UGraphic ug) {
+ final Opale opale = createOpale();
+ opale.drawU(ug);
+
+ }
+
+ private Opale createOpale() {
+ final FontConfiguration fc = new FontConfiguration(skinParam, FontParam.NOTE, null);
+ final Rose rose = new Rose();
+
+ final HtmlColor noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground);
+ final HtmlColor borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder);
+
+ final Sheet sheet = new CreoleParser(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT),
+ skinParam, CreoleMode.FULL).createSheet(note);
+ final SheetBlock1 sheet1 = new SheetBlock1(sheet, LineBreakStrategy.NONE, skinParam.getPadding());
+ final Opale opale = new Opale(borderColor, noteBackgroundColor, sheet1, skinParam.shadowing(), false);
+ return opale;
+ }
+
+ public double getHeight(StringBounder stringBounder) {
+ return createOpale().calculateDimension(stringBounder).getHeight();
+ }
+
+ public TimeTick getWhen() {
+ return when;
+ }
+
+ public final Position getPosition() {
+ return position;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/timingdiagram/TimingRuler.java b/src/net/sourceforge/plantuml/timingdiagram/TimingRuler.java
index 9bb012f..7e2b63a 100644
--- a/src/net/sourceforge/plantuml/timingdiagram/TimingRuler.java
+++ b/src/net/sourceforge/plantuml/timingdiagram/TimingRuler.java
@@ -47,6 +47,7 @@ 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.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
@@ -63,6 +64,11 @@ public class TimingRuler {
private long tickIntervalInPixels = 50;
private long tickUnitary;
+ public TimingRuler(ISkinParam skinParam) {
+ this.skinParam = skinParam;
+ this.times.add(new TimeTick(BigDecimal.ZERO));
+ }
+
public void scaleInPixels(long tick, long pixel) {
this.tickIntervalInPixels = pixel;
this.tickUnitary = tick;
@@ -77,7 +83,11 @@ public class TimingRuler {
}
private int getNbTick() {
- return (int) (1 + getMax().getTime().longValue() / tickUnitary());
+ if (times.size() == 0) {
+ return 1;
+ }
+ final long delta = getMax().getTime().longValue() - getMin().getTime().longValue();
+ return (int) (1 + delta / tickUnitary());
}
public double getWidth() {
@@ -85,13 +95,10 @@ public class TimingRuler {
}
private double getPosInPixel(double time) {
+ time -= getMin().getTime().doubleValue();
return time / tickUnitary() * tickIntervalInPixels;
}
- public TimingRuler(ISkinParam skinParam) {
- this.skinParam = skinParam;
- }
-
public void addTime(TimeTick time) {
final boolean added = times.add(time);
if (added) {
@@ -100,7 +107,8 @@ public class TimingRuler {
if (highestCommonFactor == -1) {
highestCommonFactor = time.getTime().longValue();
} else {
- highestCommonFactor = computeHighestCommonFactor(highestCommonFactor, time.getTime().longValue());
+ highestCommonFactor = computeHighestCommonFactor(highestCommonFactor,
+ Math.abs(time.getTime().longValue()));
}
}
}
@@ -132,6 +140,10 @@ public class TimingRuler {
}
}
+ public double getHeight(StringBounder stringBounder) {
+ return getTimeTextBlock(0).calculateDimension(stringBounder).getHeight();
+ }
+
private Collection<Long> roundValues() {
final Set<Long> result = new TreeSet<Long>();
if (tickUnitary == 0) {
@@ -150,12 +162,19 @@ public class TimingRuler {
}
private TimeTick getMax() {
- if (times.size() == 0) {
- throw new IllegalStateException("Empty list!");
- }
+ // if (times.size() == 0) {
+ // throw new IllegalStateException("Empty list!");
+ // }
return times.last();
}
+ private TimeTick getMin() {
+ // if (times.size() == 0) {
+ // throw new IllegalStateException("Empty list!");
+ // }
+ return times.first();
+ }
+
private static long computeHighestCommonFactor(long a, long b) {
long r = a;
while (r != 0) {
diff --git a/src/net/sourceforge/plantuml/ugraphic/AbstractCommonUGraphic.java b/src/net/sourceforge/plantuml/ugraphic/AbstractCommonUGraphic.java
index 8384231..097d3fb 100644
--- a/src/net/sourceforge/plantuml/ugraphic/AbstractCommonUGraphic.java
+++ b/src/net/sourceforge/plantuml/ugraphic/AbstractCommonUGraphic.java
@@ -51,6 +51,10 @@ public abstract class AbstractCommonUGraphic implements UGraphic {
private UClip clip;
private double scale = 1;
+ public double dpiFactor() {
+ return 1;
+ }
+
public UGraphic apply(UChange change) {
final AbstractCommonUGraphic copy = copyUGraphic();
if (change instanceof UTranslate) {
@@ -142,10 +146,9 @@ public abstract class AbstractCommonUGraphic implements UGraphic {
public void flushUg() {
}
-
+
public boolean matchesProperty(String propertyName) {
return false;
}
-
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/FontChecker.java b/src/net/sourceforge/plantuml/ugraphic/FontChecker.java
index 39508eb..68a6d7d 100644
--- a/src/net/sourceforge/plantuml/ugraphic/FontChecker.java
+++ b/src/net/sourceforge/plantuml/ugraphic/FontChecker.java
@@ -48,7 +48,6 @@ import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashSet;
-import java.util.Random;
import java.util.Set;
import javax.imageio.ImageIO;
@@ -158,7 +157,7 @@ public class FontChecker {
}
private String getSvgImage(char c) throws IOException, TransformerException {
- final SvgGraphics svg = new SvgGraphics(new Dimension2DDouble(0, 0), 1.0, null, 42);
+ final SvgGraphics svg = new SvgGraphics(true, new Dimension2DDouble(0, 0), 1.0, null, 42);
svg.setStrokeColor("black");
svg.svgImage(getBufferedImage(c), 0, 0);
final ByteArrayOutputStream os = new ByteArrayOutputStream();
diff --git a/src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java b/src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java
index a8139a3..e0ee57a 100644
--- a/src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java
+++ b/src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java
@@ -55,6 +55,7 @@ import javax.swing.ImageIcon;
import net.sourceforge.plantuml.AnimatedGifEncoder;
import net.sourceforge.plantuml.CMapData;
import net.sourceforge.plantuml.ColorParam;
+import net.sourceforge.plantuml.CornerParam;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.EmptyImageBuilder;
import net.sourceforge.plantuml.FileFormat;
@@ -88,6 +89,7 @@ import net.sourceforge.plantuml.ugraphic.hand.UGraphicHandwritten;
import net.sourceforge.plantuml.ugraphic.html5.UGraphicHtml5;
import net.sourceforge.plantuml.ugraphic.svg.UGraphicSvg;
import net.sourceforge.plantuml.ugraphic.tikz.UGraphicTikz;
+import net.sourceforge.plantuml.ugraphic.txt.UGraphicTxt;
import net.sourceforge.plantuml.ugraphic.visio.UGraphicVdx;
public class ImageBuilder {
@@ -109,9 +111,12 @@ public class ImageBuilder {
private UStroke borderStroke;
private HtmlColor borderColor;
private double borderCorner;
+
+ private boolean svgDimensionStyle;
public ImageBuilder(ColorMapper colorMapper, double dpiFactor, HtmlColor mybackcolor, String metadata,
String warningOrError, double margin1, double margin2, Animation animation, boolean useHandwritten) {
+ this.svgDimensionStyle = true;
this.colorMapper = colorMapper;
this.dpiFactor = dpiFactor;
this.mybackcolor = mybackcolor;
@@ -139,12 +144,13 @@ public class ImageBuilder {
final Rose rose = new Rose();
this.borderColor = rose.getHtmlColor(skinParam, ColorParam.diagramBorder);
this.borderStroke = skinParam.getThickness(LineParam.diagramBorder, null);
- this.borderCorner = skinParam.getRoundCorner("diagramBorder", null);
+ this.borderCorner = skinParam.getRoundCorner(CornerParam.diagramBorder, null);
if (borderStroke == null && borderColor != null) {
this.borderStroke = new UStroke();
}
this.colorMapper = skinParam.getColorMapper();
+ this.svgDimensionStyle = skinParam.svgDimensionStyle();
this.dpiFactor = dpiFactor;
this.mybackcolor = backColor;
this.metadata = metadata;
@@ -165,9 +171,9 @@ public class ImageBuilder {
throws IOException {
final FileFormat fileFormat = fileFormatOption.getFileFormat();
if (fileFormat == FileFormat.MJPEG) {
- return writeImageMjpeg(os, fileFormat.getDefaultStringBounder());
+ return writeImageMjpeg(os, fileFormatOption.getDefaultStringBounder());
} else if (fileFormat == FileFormat.ANIMATED_GIF) {
- return writeImageAnimatedGif(os, fileFormat.getDefaultStringBounder());
+ return writeImageAnimatedGif(os, fileFormatOption.getDefaultStringBounder());
}
return writeImageInternal(fileFormatOption, seed, os, animation);
}
@@ -376,30 +382,33 @@ public class ImageBuilder {
case VDX:
return new UGraphicVdx(colorMapper);
case LATEX:
- return new UGraphicTikz(colorMapper, dpiFactor, true);
+ return new UGraphicTikz(colorMapper, dpiFactor, true, fileFormatOption.getTikzFontDistortion());
case LATEX_NO_PREAMBLE:
- return new UGraphicTikz(colorMapper, dpiFactor, false);
+ return new UGraphicTikz(colorMapper, dpiFactor, false, fileFormatOption.getTikzFontDistortion());
case BRAILLE_PNG:
return new UGraphicBraille(colorMapper, fileFormat);
+ case ATXT:
+ return new UGraphicTxt();
default:
throw new UnsupportedOperationException(fileFormat.toString());
}
}
- private UGraphic2 createUGraphicSVG(ColorMapper colorMapper, double scale, Dimension2D dim, HtmlColor mybackcolor,
- String svgLinkTarget, String hover, long seed) {
+ private UGraphic2 createUGraphicSVG(ColorMapper colorMapper, double scale,
+ Dimension2D dim, HtmlColor mybackcolor, String svgLinkTarget, String hover, long seed) {
Color backColor = Color.WHITE;
if (mybackcolor instanceof HtmlColorSimple) {
backColor = colorMapper.getMappedColor(mybackcolor);
}
final UGraphicSvg ug;
if (mybackcolor instanceof HtmlColorGradient) {
- ug = new UGraphicSvg(dim, colorMapper, (HtmlColorGradient) mybackcolor, false, scale, svgLinkTarget, hover, seed);
+ ug = new UGraphicSvg(svgDimensionStyle, dim, colorMapper, (HtmlColorGradient) mybackcolor, false, scale,
+ svgLinkTarget, hover, seed);
} else if (backColor == null || backColor.equals(Color.WHITE)) {
- ug = new UGraphicSvg(dim, colorMapper, false, scale, svgLinkTarget, hover, seed);
+ ug = new UGraphicSvg(svgDimensionStyle, dim, colorMapper, false, scale, svgLinkTarget, hover, seed);
} else {
- ug = new UGraphicSvg(dim, colorMapper, StringUtils.getAsHtml(backColor), false, scale, svgLinkTarget, hover,
- seed);
+ ug = new UGraphicSvg(svgDimensionStyle, dim, colorMapper, StringUtils.getAsHtml(backColor), false, scale,
+ svgLinkTarget, hover, seed);
}
return ug;
diff --git a/src/net/sourceforge/plantuml/ugraphic/LimitFinder.java b/src/net/sourceforge/plantuml/ugraphic/LimitFinder.java
index c58d96c..9ef1b44 100644
--- a/src/net/sourceforge/plantuml/ugraphic/LimitFinder.java
+++ b/src/net/sourceforge/plantuml/ugraphic/LimitFinder.java
@@ -47,6 +47,10 @@ public class LimitFinder implements UGraphic {
public boolean matchesProperty(String propertyName) {
return false;
}
+
+ public double dpiFactor() {
+ return 1;
+ }
public UGraphic apply(UChange change) {
if (change instanceof UTranslate) {
@@ -61,6 +65,8 @@ public class LimitFinder implements UGraphic {
return new LimitFinder(this);
} else if (change instanceof UAntiAliasing) {
return new LimitFinder(this);
+ } else if (change instanceof UScale) {
+ return new LimitFinder(this);
} else if (change instanceof UClip) {
final LimitFinder copy = new LimitFinder(this);
copy.clip = (UClip) change;
diff --git a/src/net/sourceforge/plantuml/ugraphic/MinMax.java b/src/net/sourceforge/plantuml/ugraphic/MinMax.java
index e7ffddd..59fd594 100644
--- a/src/net/sourceforge/plantuml/ugraphic/MinMax.java
+++ b/src/net/sourceforge/plantuml/ugraphic/MinMax.java
@@ -49,6 +49,26 @@ public class MinMax {
private final double minX;
private final double minY;
+ public boolean doesHorizontalCross(Point2D.Double pt1, Point2D.Double pt2) {
+ if (pt1.getY() != pt2.getY()) {
+ throw new IllegalArgumentException();
+ }
+ if (pt1.getX() == pt2.getX()) {
+ throw new IllegalArgumentException();
+ }
+ final double y = pt1.getY();
+ if (y < minY || y > maxY) {
+ return false;
+ }
+ if (pt1.getX() < minX && pt2.getX() > maxX) {
+ return true;
+ }
+ if (pt2.getX() < minX && pt1.getX() > maxX) {
+ return true;
+ }
+ return false;
+ }
+
public static MinMax getEmpty(boolean initToZero) {
if (initToZero) {
return new MinMax(0, 0, 0, 0);
@@ -81,7 +101,8 @@ public class MinMax {
}
public MinMax addMinMax(MinMax other) {
- return new MinMax(Math.min(other.minX, minX), Math.min(other.minY, minY), Math.max(other.maxX, maxX), Math.max(other.maxY, maxY));
+ return new MinMax(Math.min(other.minX, minX), Math.min(other.minY, minY), Math.max(other.maxX, maxX), Math.max(
+ other.maxY, maxY));
}
public static MinMax fromMax(double maxX, double maxY) {
diff --git a/src/net/sourceforge/plantuml/ugraphic/SlotFinderX.java b/src/net/sourceforge/plantuml/ugraphic/SlotFinderX.java
deleted file mode 100644
index f907779..0000000
--- a/src/net/sourceforge/plantuml/ugraphic/SlotFinderX.java
+++ /dev/null
@@ -1,152 +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 net.sourceforge.plantuml.Url;
-import net.sourceforge.plantuml.graphic.StringBounder;
-
-public class SlotFinderX implements UGraphic {
-
- public boolean matchesProperty(String propertyName) {
- return false;
- }
-
- public UGraphic apply(UChange change) {
- if (change instanceof UTranslate) {
- return new SlotFinderX(stringBounder, xslot, yslot, translate.compose((UTranslate) change));
- } else if (change instanceof UStroke) {
- return new SlotFinderX(this);
- } else if (change instanceof UChangeBackColor) {
- return new SlotFinderX(this);
- } else if (change instanceof UChangeColor) {
- return new SlotFinderX(this);
- }
- throw new UnsupportedOperationException();
- }
-
- private final SlotSet xslot;
- private final SlotSet yslot;
- private final StringBounder stringBounder;
- private final UTranslate translate;
-
- public SlotFinderX(StringBounder stringBounder) {
- this(stringBounder, new SlotSet(), new SlotSet(), new UTranslate());
- }
-
- private SlotFinderX(StringBounder stringBounder, SlotSet xslot, SlotSet yslot, UTranslate translate) {
- this.stringBounder = stringBounder;
- this.xslot = xslot;
- this.yslot = yslot;
- this.translate = translate;
- }
-
- private SlotFinderX(SlotFinderX other) {
- this(other.stringBounder, other.xslot, other.yslot, other.translate);
- }
-
- public StringBounder getStringBounder() {
- return stringBounder;
- }
-
- public UParam getParam() {
- return new UParamNull();
- }
-
- public void draw(UShape shape) {
- final double x = translate.getDx();
- final double y = translate.getDy();
- if (shape instanceof URectangle) {
- drawRectangle(x, y, (URectangle) shape);
- } else if (shape instanceof UPolygon) {
- drawPolygon(x, y, (UPolygon) shape);
- } else if (shape instanceof UEllipse) {
- drawEllipse(x, y, (UEllipse) shape);
- } else if (shape instanceof UText) {
- drawText(x, y, (UText) shape);
- } else if (shape instanceof UEmpty) {
- drawEmpty(x, y, (UEmpty) shape);
- }
- }
-
- private void drawEmpty(double x, double y, UEmpty shape) {
- xslot.addSlot(x, x + shape.getWidth());
- yslot.addSlot(y, y + shape.getHeight());
- }
-
- private void drawText(double x, double y, UText shape) {
- final TextLimitFinder finder = new TextLimitFinder(stringBounder, false);
- finder.apply(new UTranslate(x, y)).draw(shape);
- xslot.addSlot(finder.getMinX(), finder.getMaxX());
- yslot.addSlot(finder.getMinY(), finder.getMaxY());
- }
-
- private void drawEllipse(double x, double y, UEllipse shape) {
- xslot.addSlot(x, x + shape.getWidth());
- yslot.addSlot(y, y + shape.getHeight());
- }
-
- private void drawPolygon(double x, double y, UPolygon shape) {
- xslot.addSlot(x + shape.getMinX(), x + shape.getMaxX());
- yslot.addSlot(y + shape.getMinY(), y + shape.getMaxY());
- }
-
- private void drawRectangle(double x, double y, URectangle shape) {
- xslot.addSlot(x, x + shape.getWidth());
- yslot.addSlot(y, y + shape.getHeight());
- }
-
- public ColorMapper getColorMapper() {
- return new ColorMapperIdentity();
- }
-
- public void startUrl(Url url) {
- }
-
- public void closeAction() {
- }
-
- public SlotSet getXSlotSet() {
- return xslot;
- }
-
- public SlotSet getYSlotSet() {
- return yslot;
- }
-
- public void flushUg() {
- }
-
-}
diff --git a/src/net/sourceforge/plantuml/ugraphic/TextLimitFinder.java b/src/net/sourceforge/plantuml/ugraphic/TextLimitFinder.java
index 5b8916d..b08ecfe 100644
--- a/src/net/sourceforge/plantuml/ugraphic/TextLimitFinder.java
+++ b/src/net/sourceforge/plantuml/ugraphic/TextLimitFinder.java
@@ -45,6 +45,11 @@ public class TextLimitFinder implements UGraphic {
public boolean matchesProperty(String propertyName) {
return false;
}
+
+ public double dpiFactor() {
+ return 1;
+ }
+
public UGraphic apply(UChange change) {
if (change instanceof UTranslate) {
diff --git a/src/net/sourceforge/plantuml/ugraphic/UEllipse.java b/src/net/sourceforge/plantuml/ugraphic/UEllipse.java
index 23e64fc..1b37b1f 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UEllipse.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UEllipse.java
@@ -39,7 +39,7 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
-public class UEllipse extends AbstractShadowable implements Scalable {
+public class UEllipse extends AbstractShadowable implements Scalable, UShapeSized {
private final double width;
private final double height;
diff --git a/src/net/sourceforge/plantuml/ugraphic/UFont.java b/src/net/sourceforge/plantuml/ugraphic/UFont.java
index 9852a70..6854518 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UFont.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UFont.java
@@ -70,6 +70,10 @@ public class UFont {
return sansSerif(12);
}
+ public UFont goTikz(int delta) {
+ return new UFont(new Font("Serif", getStyle(), getSize() + delta), "Serif");
+ }
+
public static UFont monospaced(int size) {
return new UFont("Monospaced", Font.PLAIN, size);
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/UGraphic.java b/src/net/sourceforge/plantuml/ugraphic/UGraphic.java
index 733ac75..e87b2fd 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UGraphic.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UGraphic.java
@@ -57,4 +57,6 @@ public interface UGraphic {
public void flushUg();
public boolean matchesProperty(String propertyName);
+
+ public double dpiFactor();
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/UGraphicCompress2.java b/src/net/sourceforge/plantuml/ugraphic/UGraphicCompress2.java
deleted file mode 100644
index e670639..0000000
--- a/src/net/sourceforge/plantuml/ugraphic/UGraphicCompress2.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.ugraphic;
-
-import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
-import net.sourceforge.plantuml.graphic.UGraphicDelegator;
-
-public class UGraphicCompress2 extends UGraphicDelegator {
-
- public UGraphic apply(UChange change) {
- if (change instanceof UTranslate) {
- return new UGraphicCompress2(getUg(), compressionTransform, translate.compose((UTranslate) change));
- } else if (change instanceof UStroke || change instanceof UChangeBackColor || change instanceof UChangeColor) {
- return new UGraphicCompress2(getUg().apply(change), compressionTransform, translate);
- }
- throw new UnsupportedOperationException();
- }
-
- private final CompressionTransform compressionTransform;
- private final UTranslate translate;
-
- public UGraphicCompress2(UGraphic ug, CompressionTransform compressionTransform) {
- this(ug, compressionTransform, new UTranslate());
- }
-
- private UGraphicCompress2(UGraphic ug, CompressionTransform compressionTransform, UTranslate translate) {
- super(ug);
- this.compressionTransform = compressionTransform;
- this.translate = translate;
- }
-
- public void draw(UShape shape) {
- final double x = translate.getDx();
- final double y = translate.getDy();
- if (shape instanceof ULine) {
- drawLine(x, y, (ULine) shape);
- } else if (shape instanceof Snake) {
- drawSnake(x, y, (Snake) shape);
- } else {
- getUg().apply(new UTranslate(ct(x), y)).draw(shape);
- }
- }
-
- private void drawSnake(double x, double y, Snake shape) {
- final Snake transformed = shape.translate(new UTranslate(x, y)).transformX(compressionTransform);
- getUg().draw(transformed);
- }
-
- private void drawLine(double x, double y, ULine shape) {
- drawLine(ct(x), y, ct(x + shape.getDX()), y + shape.getDY());
- }
-
- private double ct(double v) {
- return compressionTransform.transform(v);
- }
-
- private void drawLine(double x1, double y1, double x2, double y2) {
- final double xmin = Math.min(x1, x2);
- final double xmax = Math.max(x1, x2);
- final double ymin = Math.min(y1, y2);
- final double ymax = Math.max(y1, y2);
- getUg().apply(new UTranslate(xmin, ymin)).draw(new ULine(xmax - xmin, ymax - ymin));
- }
-
-}
diff --git a/src/net/sourceforge/plantuml/ugraphic/UGraphicNull.java b/src/net/sourceforge/plantuml/ugraphic/UGraphicNull.java
index 87dd99a..a20615c 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UGraphicNull.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UGraphicNull.java
@@ -40,6 +40,7 @@ import java.io.OutputStream;
import net.sourceforge.plantuml.EnsureVisible;
import net.sourceforge.plantuml.FileFormat;
+import net.sourceforge.plantuml.TikzFontDistortion;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.graphic.StringBounder;
@@ -59,7 +60,7 @@ public class UGraphicNull extends AbstractUGraphic<String> implements EnsureVisi
}
public StringBounder getStringBounder() {
- return FileFormat.PNG.getDefaultStringBounder();
+ return FileFormat.PNG.getDefaultStringBounder(TikzFontDistortion.getDefault());
}
public void startUrl(Url url) {
diff --git a/src/net/sourceforge/plantuml/ugraphic/UGraphicUtils.java b/src/net/sourceforge/plantuml/ugraphic/UGraphicUtils.java
index 64bfa08..0f2ec4e 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UGraphicUtils.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UGraphicUtils.java
@@ -63,7 +63,7 @@ public abstract class UGraphicUtils {
PngIO.write(im, os, fileFormatOption.isWithMetadata() ? metadata : null, 96);
} else if (fileFormat == FileFormat.SVG) {
final Dimension2D size = computeSize(colorMapper, background, image);
- final UGraphicSvg svg = new UGraphicSvg(size, colorMapper, StringUtils.getAsHtml(colorMapper
+ final UGraphicSvg svg = new UGraphicSvg(true, size, colorMapper, StringUtils.getAsHtml(colorMapper
.getMappedColor(background)), false, 1.0, fileFormatOption.getSvgLinkTarget(),
fileFormatOption.getHoverColor(), seed);
image.drawU(svg);
diff --git a/src/net/sourceforge/plantuml/ugraphic/UHorizontalLine.java b/src/net/sourceforge/plantuml/ugraphic/UHorizontalLine.java
index f506cd7..e9af688 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UHorizontalLine.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UHorizontalLine.java
@@ -144,6 +144,15 @@ public class UHorizontalLine implements UShape {
ug.apply(new UTranslate(startingX, y)).draw(new ULine(endingX - startingX, 0));
}
+// public void drawTitleInternalForFootprint(UGraphic ug, double x, double y) {
+// if (title == null || blankTitle) {
+// return;
+// }
+// final Dimension2D dimTitle = title.calculateDimension(ug.getStringBounder());
+// final double y1 = y - dimTitle.getHeight() / 2 - 0.5;
+// title.drawU(ug.apply(new UTranslate(skipAtStart, y1)));
+// }
+
public void drawTitleInternal(UGraphic ug, double startingX, double endingX, double y, boolean clearArea) {
if (title == null || blankTitle) {
return;
diff --git a/src/net/sourceforge/plantuml/ugraphic/UImage.java b/src/net/sourceforge/plantuml/ugraphic/UImage.java
index 8c4a3d1..41d3564 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UImage.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UImage.java
@@ -47,23 +47,25 @@ public class UImage implements UShape {
this.image = image;
}
- public UImage(BufferedImage before, double scale) {
+ public UImage scale(double scale) {
+ return scale(scale, AffineTransformOp.TYPE_BILINEAR);
+ }
+
+ public UImage scaleNearestNeighbor(double scale) {
+ return scale(scale, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
+ }
+
+ private UImage scale(double scale, final int type) {
if (scale == 1) {
- this.image = before;
- return;
+ return this;
}
-
- final int w = (int) Math.round(before.getWidth() * scale);
- final int h = (int) Math.round(before.getHeight() * scale);
- final BufferedImage after = new BufferedImage(w, h, before.getType());
+ final int w = (int) Math.round(image.getWidth() * scale);
+ final int h = (int) Math.round(image.getHeight() * scale);
+ final BufferedImage after = new BufferedImage(w, h, image.getType());
final AffineTransform at = new AffineTransform();
at.scale(scale, scale);
- final AffineTransformOp scaleOp = new AffineTransformOp(at, AffineTransformOp.TYPE_BILINEAR);
- this.image = scaleOp.filter(before, after);
- }
-
- public UImage scale(double scale) {
- return new UImage(image, scale);
+ final AffineTransformOp scaleOp = new AffineTransformOp(at, type);
+ return new UImage(scaleOp.filter(image, after));
}
public final BufferedImage getImage() {
@@ -71,11 +73,11 @@ public class UImage implements UShape {
}
public double getWidth() {
- return image.getWidth()-1;
+ return image.getWidth() - 1;
}
public double getHeight() {
- return image.getHeight()-1;
+ return image.getHeight() - 1;
}
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/ULine.java b/src/net/sourceforge/plantuml/ugraphic/ULine.java
index 966edb8..a42767f 100644
--- a/src/net/sourceforge/plantuml/ugraphic/ULine.java
+++ b/src/net/sourceforge/plantuml/ugraphic/ULine.java
@@ -35,7 +35,7 @@
*/
package net.sourceforge.plantuml.ugraphic;
-public class ULine extends AbstractShadowable implements Scalable {
+public class ULine extends AbstractShadowable implements Scalable, UShapeSized {
private final double dx;
private final double dy;
@@ -71,4 +71,12 @@ public class ULine extends AbstractShadowable implements Scalable {
return Math.sqrt(dx * dx + dy * dy);
}
+ public double getWidth() {
+ return dx;
+ }
+
+ public double getHeight() {
+ return dy;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/URectangle.java b/src/net/sourceforge/plantuml/ugraphic/URectangle.java
index 7c1ce10..0230333 100644
--- a/src/net/sourceforge/plantuml/ugraphic/URectangle.java
+++ b/src/net/sourceforge/plantuml/ugraphic/URectangle.java
@@ -36,7 +36,7 @@ package net.sourceforge.plantuml.ugraphic;
import java.awt.geom.Dimension2D;
-public class URectangle extends AbstractShadowable implements Scalable {
+public class URectangle extends AbstractShadowable implements Scalable, UShapeSized {
private final double width;
private final double height;
@@ -44,6 +44,20 @@ public class URectangle extends AbstractShadowable implements Scalable {
private final double ry;
private final String comment;
+ public URectangle withHeight(double newHeight) {
+ final URectangle result = new URectangle(width, newHeight, rx, ry, comment);
+ result.ignoreForCompression = this.ignoreForCompression;
+ result.setDeltaShadow(this.getDeltaShadow());
+ return result;
+ }
+
+ public URectangle withWidth(double newWidth) {
+ final URectangle result = new URectangle(newWidth, height, rx, ry, comment);
+ result.ignoreForCompression = this.ignoreForCompression;
+ result.setDeltaShadow(this.getDeltaShadow());
+ return result;
+ }
+
public UShape getScaled(double scale) {
if (scale == 1) {
return this;
@@ -112,4 +126,14 @@ public class URectangle extends AbstractShadowable implements Scalable {
return comment;
}
+ private boolean ignoreForCompression;
+
+ public final boolean isIgnoreForCompression() {
+ return ignoreForCompression;
+ }
+
+ public final void setIgnoreForCompression(boolean ignoreForCompression) {
+ this.ignoreForCompression = ignoreForCompression;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/UShapeSized.java b/src/net/sourceforge/plantuml/ugraphic/UShapeSized.java
new file mode 100644
index 0000000..cff295e
--- /dev/null
+++ b/src/net/sourceforge/plantuml/ugraphic/UShapeSized.java
@@ -0,0 +1,44 @@
+/* ========================================================================
+ * 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;
+
+public interface UShapeSized extends UShape {
+
+ public double getWidth();
+
+ public double getHeight();
+
+}
diff --git a/src/net/sourceforge/plantuml/ugraphic/UStroke.java b/src/net/sourceforge/plantuml/ugraphic/UStroke.java
index 7f3699d..337415f 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UStroke.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UStroke.java
@@ -60,6 +60,13 @@ public class UStroke implements UChange {
this(1.0);
}
+ private UStroke applyThickness(UStroke thickness) {
+ if (thickness == null) {
+ return this;
+ }
+ return new UStroke(dashVisible, dashSpace, thickness.thickness);
+ }
+
public double getDashVisible() {
return dashVisible;
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/UText.java b/src/net/sourceforge/plantuml/ugraphic/UText.java
index de7367a..b5e3964 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UText.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UText.java
@@ -44,6 +44,7 @@ public class UText implements UShape {
private final String text;
private final FontConfiguration font;
+ private final String ariaLabel;
@Override
public String toString() {
@@ -51,9 +52,18 @@ public class UText implements UShape {
}
public UText(String text, FontConfiguration font) {
+ this(text, font, null);
+ }
+
+ private UText(String text, FontConfiguration font, String ariaLabel) {
assert text.indexOf('\t') == -1;
this.text = text;
this.font = font;
+ this.ariaLabel = ariaLabel;
+ }
+
+ public UText withAriaLabel(String newAriaLabel) {
+ return new UText(text, font, newAriaLabel);
}
public String getText() {
@@ -70,6 +80,10 @@ public class UText implements UShape {
return descent;
}
+ public String getAriaLabel() {
+ return ariaLabel;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/comp/CompressionMode.java b/src/net/sourceforge/plantuml/ugraphic/comp/CompressionMode.java
new file mode 100644
index 0000000..d14d553
--- /dev/null
+++ b/src/net/sourceforge/plantuml/ugraphic/comp/CompressionMode.java
@@ -0,0 +1,41 @@
+/* ========================================================================
+ * 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.comp;
+
+public enum CompressionMode {
+ ON_X, ON_Y
+
+}
diff --git a/src/net/sourceforge/plantuml/ugraphic/CompressionTransform.java b/src/net/sourceforge/plantuml/ugraphic/comp/CompressionTransform.java
index c229442..9cc7bd3 100644
--- a/src/net/sourceforge/plantuml/ugraphic/CompressionTransform.java
+++ b/src/net/sourceforge/plantuml/ugraphic/comp/CompressionTransform.java
@@ -33,7 +33,7 @@
*
*
*/
-package net.sourceforge.plantuml.ugraphic;
+package net.sourceforge.plantuml.ugraphic.comp;
import java.util.List;
diff --git a/src/net/sourceforge/plantuml/ugraphic/Slot.java b/src/net/sourceforge/plantuml/ugraphic/comp/Slot.java
index 671d6a2..8c0bd5a 100644
--- a/src/net/sourceforge/plantuml/ugraphic/Slot.java
+++ b/src/net/sourceforge/plantuml/ugraphic/comp/Slot.java
@@ -33,7 +33,7 @@
*
*
*/
-package net.sourceforge.plantuml.ugraphic;
+package net.sourceforge.plantuml.ugraphic.comp;
public class Slot implements Comparable<Slot> {
diff --git a/src/net/sourceforge/plantuml/ugraphic/comp/SlotFinder.java b/src/net/sourceforge/plantuml/ugraphic/comp/SlotFinder.java
new file mode 100644
index 0000000..bf26fb9
--- /dev/null
+++ b/src/net/sourceforge/plantuml/ugraphic/comp/SlotFinder.java
@@ -0,0 +1,208 @@
+/* ========================================================================
+ * 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.comp;
+
+import net.sourceforge.plantuml.Url;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.ugraphic.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
+import net.sourceforge.plantuml.ugraphic.TextLimitFinder;
+import net.sourceforge.plantuml.ugraphic.UChange;
+import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
+import net.sourceforge.plantuml.ugraphic.UChangeColor;
+import net.sourceforge.plantuml.ugraphic.UEllipse;
+import net.sourceforge.plantuml.ugraphic.UEmpty;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UParam;
+import net.sourceforge.plantuml.ugraphic.UParamNull;
+import net.sourceforge.plantuml.ugraphic.UPath;
+import net.sourceforge.plantuml.ugraphic.UPolygon;
+import net.sourceforge.plantuml.ugraphic.URectangle;
+import net.sourceforge.plantuml.ugraphic.UShape;
+import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.UText;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class SlotFinder implements UGraphic {
+
+ public boolean matchesProperty(String propertyName) {
+ return false;
+ }
+
+ public double dpiFactor() {
+ return 1;
+ }
+
+ public UGraphic apply(UChange change) {
+ if (change instanceof UTranslate) {
+ return new SlotFinder(mode, stringBounder, slot, translate.compose((UTranslate) change));
+ } else if (change instanceof UStroke) {
+ return new SlotFinder(this);
+ } else if (change instanceof UChangeBackColor) {
+ return new SlotFinder(this);
+ } else if (change instanceof UChangeColor) {
+ return new SlotFinder(this);
+ }
+ throw new UnsupportedOperationException();
+ }
+
+ private final SlotSet slot;
+
+ private final StringBounder stringBounder;
+ private final UTranslate translate;
+ private final CompressionMode mode;
+
+ public SlotFinder(CompressionMode mode, StringBounder stringBounder) {
+ this(mode, stringBounder, new SlotSet(), new UTranslate());
+ }
+
+ private SlotFinder(CompressionMode mode, StringBounder stringBounder, SlotSet slot, UTranslate translate) {
+ this.stringBounder = stringBounder;
+ this.slot = slot;
+ this.translate = translate;
+ this.mode = mode;
+ }
+
+ private SlotFinder(SlotFinder other) {
+ this(other.mode, other.stringBounder, other.slot, other.translate);
+ }
+
+ public StringBounder getStringBounder() {
+ return stringBounder;
+ }
+
+ public UParam getParam() {
+ return new UParamNull();
+ }
+
+ public void draw(UShape shape) {
+ final double x = translate.getDx();
+ final double y = translate.getDy();
+ if (shape instanceof URectangle) {
+ final URectangle rect = (URectangle) shape;
+ if (mode == CompressionMode.ON_X && rect.isIgnoreForCompression()) {
+ drawRectangle(x, y, new URectangle(2, rect.getHeight()));
+ drawRectangle(x + rect.getWidth() - 2, y, new URectangle(2, rect.getHeight()));
+ return;
+ }
+ if (mode == CompressionMode.ON_Y && rect.isIgnoreForCompression()) {
+ drawRectangle(x, y, new URectangle(rect.getWidth(), 2));
+ drawRectangle(x, y + rect.getHeight() - 2, new URectangle(rect.getWidth(), 2));
+ return;
+ }
+ drawRectangle(x, y, (URectangle) shape);
+ } else if (shape instanceof UPath) {
+ drawPath(x, y, (UPath) shape);
+ } else if (shape instanceof UPolygon) {
+ drawPolygon(x, y, (UPolygon) shape);
+ } else if (shape instanceof UEllipse) {
+ drawEllipse(x, y, (UEllipse) shape);
+ } else if (shape instanceof UText) {
+ drawText(x, y, (UText) shape);
+ } else if (shape instanceof UEmpty) {
+ drawEmpty(x, y, (UEmpty) shape);
+ }
+ }
+
+ private void drawPath(double x, double y, UPath shape) {
+ if (mode == CompressionMode.ON_X) {
+ slot.addSlot(x + shape.getMinX(), x + shape.getMaxX());
+ } else {
+ slot.addSlot(y + shape.getMinY(), y + shape.getMaxY());
+ }
+
+ }
+
+ private void drawEmpty(double x, double y, UEmpty shape) {
+ if (mode == CompressionMode.ON_X) {
+ slot.addSlot(x, x + shape.getWidth());
+ } else {
+ slot.addSlot(y, y + shape.getHeight());
+ }
+ }
+
+ private void drawText(double x, double y, UText shape) {
+ final TextLimitFinder finder = new TextLimitFinder(stringBounder, false);
+ finder.apply(new UTranslate(x, y)).draw(shape);
+ if (mode == CompressionMode.ON_X) {
+ slot.addSlot(finder.getMinX(), finder.getMaxX());
+ } else {
+ slot.addSlot(finder.getMinY(), finder.getMaxY());
+ }
+ }
+
+ private void drawEllipse(double x, double y, UEllipse shape) {
+ if (mode == CompressionMode.ON_X) {
+ slot.addSlot(x, x + shape.getWidth());
+ } else {
+ slot.addSlot(y, y + shape.getHeight());
+ }
+ }
+
+ private void drawPolygon(double x, double y, UPolygon shape) {
+ if (mode == CompressionMode.ON_X) {
+ slot.addSlot(x + shape.getMinX(), x + shape.getMaxX());
+ } else {
+ slot.addSlot(y + shape.getMinY(), y + shape.getMaxY());
+ }
+ }
+
+ private void drawRectangle(double x, double y, URectangle shape) {
+ if (mode == CompressionMode.ON_X) {
+ slot.addSlot(x, x + shape.getWidth());
+ } else {
+ slot.addSlot(y, y + shape.getHeight());
+ }
+ }
+
+ public ColorMapper getColorMapper() {
+ return new ColorMapperIdentity();
+ }
+
+ public void startUrl(Url url) {
+ }
+
+ public void closeAction() {
+ }
+
+ public SlotSet getSlotSet() {
+ return slot;
+ }
+
+ public void flushUg() {
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/ugraphic/SlotSet.java b/src/net/sourceforge/plantuml/ugraphic/comp/SlotSet.java
index 1ad5fc8..0be097d 100644
--- a/src/net/sourceforge/plantuml/ugraphic/SlotSet.java
+++ b/src/net/sourceforge/plantuml/ugraphic/comp/SlotSet.java
@@ -33,13 +33,17 @@
*
*
*/
-package net.sourceforge.plantuml.ugraphic;
+package net.sourceforge.plantuml.ugraphic.comp;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.URectangle;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
public class SlotSet implements Iterable<Slot> {
private final List<Slot> all = new ArrayList<Slot>();
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockCompressed.java b/src/net/sourceforge/plantuml/ugraphic/comp/TextBlockCompressedOnXorY.java
index 835e993..a5c0320 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockCompressed.java
+++ b/src/net/sourceforge/plantuml/ugraphic/comp/TextBlockCompressedOnXorY.java
@@ -33,35 +33,57 @@
*
*
*/
-package net.sourceforge.plantuml.graphic;
+package net.sourceforge.plantuml.ugraphic.comp;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
-import net.sourceforge.plantuml.ugraphic.CompressionTransform;
-import net.sourceforge.plantuml.ugraphic.SlotFinder;
-import net.sourceforge.plantuml.ugraphic.SlotSet;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.graphic.TextBlockUtils;
+import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UGraphic;
-import net.sourceforge.plantuml.ugraphic.UGraphicCompress;
-public class TextBlockCompressed extends AbstractTextBlock implements TextBlock {
+public class TextBlockCompressedOnXorY extends AbstractTextBlock implements TextBlock {
private final TextBlock textBlock;
+ private final CompressionMode mode;
- public TextBlockCompressed(TextBlock textBlock) {
+ public TextBlockCompressedOnXorY(CompressionMode mode, TextBlock textBlock) {
this.textBlock = textBlock;
+ this.mode = mode;
}
public void drawU(final UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder();
final CompressionTransform compressionTransform = getCompressionTransform(stringBounder);
- textBlock.drawU(new UGraphicCompress(ug, compressionTransform));
+ textBlock.drawU(new UGraphicCompressOnXorY(mode, ug, compressionTransform));
}
+ private MinMax cachedMinMax;
+
+ @Override
+ public MinMax getMinMax(StringBounder stringBounder) {
+ if (cachedMinMax == null) {
+ cachedMinMax = TextBlockUtils.getMinMax(this, stringBounder);
+ }
+ return cachedMinMax;
+ }
+
+ private CompressionTransform cachedCompressionTransform;
+
private CompressionTransform getCompressionTransform(final StringBounder stringBounder) {
- final SlotFinder slotFinder = new SlotFinder(stringBounder);
+ if (cachedCompressionTransform == null) {
+ cachedCompressionTransform = getCompressionTransformSlow(stringBounder);
+ }
+ return cachedCompressionTransform;
+ }
+
+ private CompressionTransform getCompressionTransformSlow(final StringBounder stringBounder) {
+ final SlotFinder slotFinder = new SlotFinder(mode, stringBounder);
textBlock.drawU(slotFinder);
- final SlotSet ysSlotSet = slotFinder.getYSlotSet().reverse().smaller(5.0);
+ final SlotSet ysSlotSet = slotFinder.getSlotSet().reverse().smaller(5.0);
final CompressionTransform compressionTransform = new CompressionTransform(ysSlotSet);
return compressionTransform;
}
@@ -69,6 +91,10 @@ public class TextBlockCompressed extends AbstractTextBlock implements TextBlock
public Dimension2D calculateDimension(StringBounder stringBounder) {
final CompressionTransform compressionTransform = getCompressionTransform(stringBounder);
final Dimension2D dim = textBlock.calculateDimension(stringBounder);
- return new Dimension2DDouble(dim.getWidth(), compressionTransform.transform(dim.getHeight()));
+ if (mode == CompressionMode.ON_X) {
+ return new Dimension2DDouble(compressionTransform.transform(dim.getWidth()), dim.getHeight());
+ } else {
+ return new Dimension2DDouble(dim.getWidth(), compressionTransform.transform(dim.getHeight()));
+ }
}
} \ No newline at end of file
diff --git a/src/net/sourceforge/plantuml/ugraphic/UGraphicCompress.java b/src/net/sourceforge/plantuml/ugraphic/comp/UGraphicCompressOnXorY.java
index 0cfc65a..3986b21 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UGraphicCompress.java
+++ b/src/net/sourceforge/plantuml/ugraphic/comp/UGraphicCompressOnXorY.java
@@ -33,30 +33,42 @@
*
*
*/
-package net.sourceforge.plantuml.ugraphic;
+package net.sourceforge.plantuml.ugraphic.comp;
import net.sourceforge.plantuml.graphic.UGraphicDelegator;
+import net.sourceforge.plantuml.ugraphic.UChange;
+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.UShape;
+import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class UGraphicCompress extends UGraphicDelegator {
+public class UGraphicCompressOnXorY extends UGraphicDelegator {
public UGraphic apply(UChange change) {
if (change instanceof UTranslate) {
- return new UGraphicCompress(getUg(), compressionTransform, translate.compose((UTranslate) change));
+ return new UGraphicCompressOnXorY(mode, getUg(), compressionTransform, translate.compose((UTranslate) change));
} else if (change instanceof UStroke || change instanceof UChangeBackColor || change instanceof UChangeColor) {
- return new UGraphicCompress(getUg().apply(change), compressionTransform, translate);
+ return new UGraphicCompressOnXorY(mode, getUg().apply(change), compressionTransform, translate);
}
throw new UnsupportedOperationException();
}
+ private final CompressionMode mode;
private final CompressionTransform compressionTransform;
private final UTranslate translate;
- public UGraphicCompress(UGraphic ug, CompressionTransform compressionTransform) {
- this(ug, compressionTransform, new UTranslate());
+ public UGraphicCompressOnXorY(CompressionMode mode, UGraphic ug, CompressionTransform compressionTransform) {
+ this(mode, ug, compressionTransform, new UTranslate());
}
- private UGraphicCompress(UGraphic ug, CompressionTransform compressionTransform, UTranslate translate) {
+ private UGraphicCompressOnXorY(CompressionMode mode, UGraphic ug, CompressionTransform compressionTransform,
+ UTranslate translate) {
super(ug);
+ this.mode = mode;
this.compressionTransform = compressionTransform;
this.translate = translate;
}
@@ -64,15 +76,35 @@ public class UGraphicCompress extends UGraphicDelegator {
public void draw(UShape shape) {
final double x = translate.getDx();
final double y = translate.getDy();
+ if (shape instanceof URectangle) {
+ final URectangle rect = (URectangle) shape;
+ if (rect.isIgnoreForCompression()) {
+ if (mode == CompressionMode.ON_X) {
+ final double x2 = ct(x + rect.getWidth());
+ shape = rect.withWidth(x2 - ct(x));
+ } else {
+ final double y2 = ct(y + rect.getHeight());
+ shape = rect.withHeight(y2 - ct(y));
+ }
+ }
+ }
if (shape instanceof ULine) {
drawLine(x, y, (ULine) shape);
} else {
- getUg().apply(new UTranslate(x, ct(y))).draw(shape);
+ if (mode == CompressionMode.ON_X) {
+ getUg().apply(new UTranslate(ct(x), y)).draw(shape);
+ } else {
+ getUg().apply(new UTranslate(x, ct(y))).draw(shape);
+ }
}
}
private void drawLine(double x, double y, ULine shape) {
- drawLine(x, ct(y), x + shape.getDX(), ct(y + shape.getDY()));
+ if (mode == CompressionMode.ON_X) {
+ drawLine(ct(x), y, ct(x + shape.getDX()), y + shape.getDY());
+ } else {
+ drawLine(x, ct(y), x + shape.getDX(), ct(y + shape.getDY()));
+ }
}
private double ct(double v) {
@@ -85,15 +117,7 @@ public class UGraphicCompress extends UGraphicDelegator {
return;
}
assert y1 <= y2;
- final double xmin = Math.min(x1, x2);
- final double xmax = Math.max(x1, x2);
- final double ymin = Math.min(y1, y2);
- final double ymax = Math.max(y1, y2);
- if (x2 >= x1) {
- getUg().apply(new UTranslate(xmin, ymin)).draw(new ULine(xmax - xmin, ymax - ymin));
- } else {
- getUg().apply(new UTranslate(xmax, ymin)).draw(new ULine(-(xmax - xmin), ymax - ymin));
- }
+ getUg().apply(new UTranslate(x1, y1)).draw(new ULine(x2 - x1, y2 - y1));
}
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/crossing/UGraphicCrossing.java b/src/net/sourceforge/plantuml/ugraphic/crossing/UGraphicCrossing.java
index 16758fa..56e2d96 100644
--- a/src/net/sourceforge/plantuml/ugraphic/crossing/UGraphicCrossing.java
+++ b/src/net/sourceforge/plantuml/ugraphic/crossing/UGraphicCrossing.java
@@ -60,6 +60,11 @@ public class UGraphicCrossing implements UGraphic {
private final UGraphic ug;
private final List<Pending> lines;
private final UTranslate translate;
+
+ public double dpiFactor() {
+ return ug.dpiFactor();
+ }
+
static class Pending {
final UGraphic ug;
diff --git a/src/net/sourceforge/plantuml/ugraphic/eps/DriverTextEps.java b/src/net/sourceforge/plantuml/ugraphic/eps/DriverTextEps.java
index 9f4712d..605e149 100644
--- a/src/net/sourceforge/plantuml/ugraphic/eps/DriverTextEps.java
+++ b/src/net/sourceforge/plantuml/ugraphic/eps/DriverTextEps.java
@@ -43,6 +43,7 @@ import java.util.ArrayList;
import java.util.List;
import net.sourceforge.plantuml.FileFormat;
+import net.sourceforge.plantuml.TikzFontDistortion;
import net.sourceforge.plantuml.eps.EpsGraphics;
import net.sourceforge.plantuml.eps.EpsGraphicsMacroAndText;
import net.sourceforge.plantuml.eps.EpsStrategy;
@@ -69,7 +70,7 @@ public class DriverTextEps implements UDriver<EpsGraphics> {
private final EpsStrategy strategy;
public DriverTextEps(ClipContainer clipContainer, EpsStrategy strategy) {
- this.stringBounder = FileFormat.PNG.getDefaultStringBounder();
+ this.stringBounder = FileFormat.PNG.getDefaultStringBounder(TikzFontDistortion.getDefault());
this.clipContainer = clipContainer;
this.fontRenderContext = TextBlockUtils.getFontRenderContext();
this.strategy = strategy;
diff --git a/src/net/sourceforge/plantuml/ugraphic/eps/UGraphicEps.java b/src/net/sourceforge/plantuml/ugraphic/eps/UGraphicEps.java
index 493de27..351bd8b 100644
--- a/src/net/sourceforge/plantuml/ugraphic/eps/UGraphicEps.java
+++ b/src/net/sourceforge/plantuml/ugraphic/eps/UGraphicEps.java
@@ -38,6 +38,7 @@ import java.io.IOException;
import java.io.OutputStream;
import net.sourceforge.plantuml.FileFormat;
+import net.sourceforge.plantuml.TikzFontDistortion;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.eps.EpsGraphics;
import net.sourceforge.plantuml.eps.EpsStrategy;
@@ -83,7 +84,7 @@ public class UGraphicEps extends AbstractUGraphic<EpsGraphics> implements ClipCo
private UGraphicEps(ColorMapper colorMapper, EpsStrategy strategy, EpsGraphics eps) {
super(colorMapper, eps);
this.strategyTOBEREMOVED = strategy;
- this.stringBounder = FileFormat.PNG.getDefaultStringBounder();
+ this.stringBounder = FileFormat.PNG.getDefaultStringBounder(TikzFontDistortion.getDefault());
register(strategy);
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverEllipseG2d.java b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverEllipseG2d.java
index 89b46bd..b639b55 100644
--- a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverEllipseG2d.java
+++ b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverEllipseG2d.java
@@ -62,76 +62,45 @@ public class DriverEllipseG2d extends DriverShadowedG2d implements UDriver<Graph
}
public void draw(UShape ushape, double x, double y, ColorMapper mapper, UParam param, Graphics2D g2d) {
- final UEllipse shape = (UEllipse) ushape;
+ final UEllipse ellipse = (UEllipse) ushape;
g2d.setStroke(new BasicStroke((float) param.getStroke().getThickness()));
visible.ensureVisible(x, y);
- visible.ensureVisible(x + shape.getWidth(), y + shape.getHeight());
- if (shape.getStart() == 0 && shape.getExtend() == 0) {
- final Shape ellipse = new Ellipse2D.Double(x, y, shape.getWidth(), shape.getHeight());
+ visible.ensureVisible(x + ellipse.getWidth(), y + ellipse.getHeight());
+ final HtmlColor color = param.getColor();
+ if (ellipse.getStart() == 0 && ellipse.getExtend() == 0) {
+ final Shape shape = new Ellipse2D.Double(x, y, ellipse.getWidth(), ellipse.getHeight());
// Shadow
- if (shape.getDeltaShadow() != 0) {
- drawShadow(g2d, ellipse, shape.getDeltaShadow(), dpiFactor);
+ if (ellipse.getDeltaShadow() != 0) {
+ drawShadow(g2d, shape, ellipse.getDeltaShadow(), dpiFactor);
}
final HtmlColor back = param.getBackcolor();
if (back instanceof HtmlColorGradient) {
- final GradientPaint paint = getPaintGradient(x, y, mapper, shape, back);
+ final GradientPaint paint = DriverRectangleG2d.getPaintGradient(x, y, mapper, ellipse.getWidth(),
+ ellipse.getHeight(), back);
g2d.setPaint(paint);
- g2d.fill(ellipse);
-
- if (param.getColor() != null) {
- g2d.setColor(mapper.getMappedColor(param.getColor()));
- DriverLineG2d.manageStroke(param, g2d);
- g2d.draw(ellipse);
- }
+ g2d.fill(shape);
+ DriverRectangleG2d.drawBorder(param, color, mapper, ellipse, shape, g2d, x, y);
} else {
if (back != null) {
g2d.setColor(mapper.getMappedColor(param.getBackcolor()));
DriverRectangleG2d.managePattern(param, g2d);
- g2d.fill(ellipse);
+ g2d.fill(shape);
}
- if (param.getColor() != null && param.getColor().equals(param.getBackcolor()) == false) {
- g2d.setColor(mapper.getMappedColor(param.getColor()));
- DriverLineG2d.manageStroke(param, g2d);
- g2d.draw(ellipse);
+ if (color != null && color.equals(param.getBackcolor()) == false) {
+ DriverRectangleG2d.drawBorder(param, color, mapper, ellipse, shape, g2d, x, y);
}
}
} else {
- final Shape arc = new Arc2D.Double(x, y, shape.getWidth(), shape.getHeight(), round(shape.getStart()),
- round(shape.getExtend()), Arc2D.OPEN);
- if (param.getColor() != null) {
- g2d.setColor(mapper.getMappedColor(param.getColor()));
+ final Shape arc = new Arc2D.Double(x, y, ellipse.getWidth(), ellipse.getHeight(),
+ round(ellipse.getStart()), round(ellipse.getExtend()), Arc2D.OPEN);
+ if (color != null) {
+ g2d.setColor(mapper.getMappedColor(color));
g2d.draw(arc);
}
}
}
-
- private GradientPaint getPaintGradient(double x, double y, ColorMapper mapper, final UEllipse shape,
- final HtmlColor back) {
- final HtmlColorGradient gr = (HtmlColorGradient) back;
- final char policy = gr.getPolicy();
- final GradientPaint paint;
- if (policy == '|') {
- paint = new GradientPaint((float) x, (float) (y + shape.getHeight()) / 2, mapper.getMappedColor(gr
- .getColor1()), (float) (x + shape.getWidth()), (float) (y + shape.getHeight()) / 2,
- mapper.getMappedColor(gr.getColor2()));
- } else if (policy == '\\') {
- paint = new GradientPaint((float) x, (float) (y + shape.getHeight()), mapper.getMappedColor(gr
- .getColor1()), (float) (x + shape.getWidth()), (float) y, mapper.getMappedColor(gr.getColor2()));
- } else if (policy == '-') {
- paint = new GradientPaint((float) (x + shape.getWidth()) / 2, (float) y, mapper.getMappedColor(gr
- .getColor1()), (float) (x + shape.getWidth()) / 2, (float) (y + shape.getHeight()),
- mapper.getMappedColor(gr.getColor2()));
- } else {
- // for /
- paint = new GradientPaint((float) x, (float) y, mapper.getMappedColor(gr.getColor1()),
- (float) (x + shape.getWidth()), (float) (y + shape.getHeight()), mapper.getMappedColor(gr
- .getColor2()));
- }
- return paint;
- }
-
private static final double ROU = 5.0;
diff --git a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverImageG2d.java b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverImageG2d.java
index 556d02d..e8ff789 100644
--- a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverImageG2d.java
+++ b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverImageG2d.java
@@ -36,6 +36,7 @@
package net.sourceforge.plantuml.ugraphic.g2d;
import java.awt.Graphics2D;
+import java.awt.geom.AffineTransform;
import net.sourceforge.plantuml.EnsureVisible;
import net.sourceforge.plantuml.ugraphic.ColorMapper;
@@ -48,19 +49,24 @@ import net.sourceforge.plantuml.ugraphic.UShape;
public class DriverImageG2d implements UDriver<Graphics2D> {
private final EnsureVisible visible;
+ private final double dpiFactor;
- public DriverImageG2d(EnsureVisible visible) {
+ public DriverImageG2d(double dpiFactor, EnsureVisible visible) {
this.visible = visible;
+ this.dpiFactor = dpiFactor;
}
public void draw(UShape ushape, double x, double y, ColorMapper mapper, UParam param, Graphics2D g2d) {
if (ushape instanceof UImageSvg) {
return;
}
- final UImage shape = (UImage) ushape;
+ final UImage shape = ((UImage) ushape);
visible.ensureVisible(x, y);
visible.ensureVisible(x + shape.getWidth(), y + shape.getHeight());
- g2d.drawImage(shape.getImage(), (int) x, (int) y, null);
+ final AffineTransform back = g2d.getTransform();
+ g2d.scale(1 / dpiFactor, 1 / dpiFactor);
+ g2d.drawImage(shape.getImage(), (int) (x * dpiFactor), (int) (y * dpiFactor), null);
+ g2d.setTransform(back);
}
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverLineG2d.java b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverLineG2d.java
index 6410c73..2c19283 100644
--- a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverLineG2d.java
+++ b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverLineG2d.java
@@ -40,6 +40,7 @@ import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.Line2D;
+import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.ugraphic.ColorMapper;
import net.sourceforge.plantuml.ugraphic.UDriver;
import net.sourceforge.plantuml.ugraphic.ULine;
@@ -64,8 +65,10 @@ public class DriverLineG2d extends DriverShadowedG2d implements UDriver<Graphics
if (shape.getDeltaShadow() != 0) {
drawShadow(g2d, line, shape.getDeltaShadow(), dpiFactor);
}
- g2d.setColor(mapper.getMappedColor(param.getColor()));
- g2d.draw(line);
+ final HtmlColor color = param.getColor();
+ DriverRectangleG2d.drawBorder(param, color, mapper, shape, line, g2d, x, y);
+// g2d.setColor(mapper.getMappedColor(color));
+// g2d.draw(line);
}
static void manageStroke(UParam param, Graphics2D g2d) {
diff --git a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverPathG2d.java b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverPathG2d.java
index 12bfec3..bc9cc7f 100644
--- a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverPathG2d.java
+++ b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverPathG2d.java
@@ -67,7 +67,7 @@ public class DriverPathG2d extends DriverShadowedG2d implements UDriver<Graphics
final ExtendedGeneralPath p = new ExtendedGeneralPath();
final MinMaxDouble minMax = new MinMaxDouble();
minMax.manage(x, y);
- boolean hasBezier = false;
+ boolean slowShadow = false;
for (USegment seg : shape) {
final USegmentType type = seg.getSegmentType();
final double coord[] = seg.getCoord();
@@ -80,7 +80,7 @@ public class DriverPathG2d extends DriverShadowedG2d implements UDriver<Graphics
} else if (type == USegmentType.SEG_CUBICTO) {
p.curveTo(x + coord[0], y + coord[1], x + coord[2], y + coord[3], x + coord[4], y + coord[5]);
minMax.manage(x + coord[4], y + coord[5]);
- hasBezier = true;
+ slowShadow = true;
} else if (type == USegmentType.SEG_ARCTO) {
p.arcTo(coord[0], coord[1], coord[2], coord[3] != 0, coord[4] != 0, x + coord[5], y + coord[6]);
} else {
@@ -96,8 +96,12 @@ public class DriverPathG2d extends DriverShadowedG2d implements UDriver<Graphics
}
// Shadow
+ final HtmlColor back = param.getBackcolor();
+ if (back != null) {
+ slowShadow = true;
+ }
if (shape.getDeltaShadow() != 0) {
- if (hasBezier) {
+ if (slowShadow) {
drawShadow(g2d, p, shape.getDeltaShadow(), dpiFactor);
} else {
double lastX = 0;
@@ -121,7 +125,6 @@ public class DriverPathG2d extends DriverShadowedG2d implements UDriver<Graphics
}
}
- final HtmlColor back = param.getBackcolor();
if (back instanceof HtmlColorGradient) {
final HtmlColorGradient gr = (HtmlColorGradient) back;
final char policy = gr.getPolicy();
diff --git a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverRectangleG2d.java b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverRectangleG2d.java
index c37ad0f..09c94a9 100644
--- a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverRectangleG2d.java
+++ b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverRectangleG2d.java
@@ -55,6 +55,7 @@ import net.sourceforge.plantuml.ugraphic.UParam;
import net.sourceforge.plantuml.ugraphic.UPattern;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UShape;
+import net.sourceforge.plantuml.ugraphic.UShapeSized;
public class DriverRectangleG2d extends DriverShadowedG2d implements UDriver<Graphics2D> {
@@ -68,57 +69,57 @@ public class DriverRectangleG2d extends DriverShadowedG2d implements UDriver<Gra
public void draw(UShape ushape, double x, double y, ColorMapper mapper, UParam param, Graphics2D g2d) {
g2d.setStroke(new BasicStroke((float) param.getStroke().getThickness()));
- final URectangle shape = (URectangle) ushape;
- final double rx = shape.getRx();
- final double ry = shape.getRy();
- final Shape rect;
+ final URectangle rect = (URectangle) ushape;
+ final double rx = rect.getRx();
+ final double ry = rect.getRy();
+ final Shape shape;
if (rx == 0 && ry == 0) {
- rect = new Rectangle2D.Double(x, y, shape.getWidth(), shape.getHeight());
+ shape = new Rectangle2D.Double(x, y, rect.getWidth(), rect.getHeight());
} else {
- rect = new RoundRectangle2D.Double(x, y, shape.getWidth(), shape.getHeight(), rx, ry);
+ shape = new RoundRectangle2D.Double(x, y, rect.getWidth(), rect.getHeight(), rx, ry);
}
visible.ensureVisible(x, y);
- visible.ensureVisible(x + shape.getWidth(), y + shape.getHeight());
+ visible.ensureVisible(x + rect.getWidth(), y + rect.getHeight());
// Shadow
- if (shape.getDeltaShadow() != 0) {
- drawShadow(g2d, rect, shape.getDeltaShadow(), dpiFactor);
+ if (rect.getDeltaShadow() != 0) {
+ drawShadow(g2d, shape, rect.getDeltaShadow(), dpiFactor);
}
final HtmlColor back = param.getBackcolor();
+ final HtmlColor color = param.getColor();
if (back instanceof HtmlColorGradient) {
- final GradientPaint paint = getPaintGradient(x, y, mapper, shape, back);
+ final GradientPaint paint = getPaintGradient(x, y, mapper, rect.getWidth(), rect.getHeight(), back);
g2d.setPaint(paint);
- g2d.fill(rect);
-
- if (param.getColor() != null && param.getColor() instanceof HtmlColorGradient == false) {
- g2d.setColor(mapper.getMappedColor(param.getColor()));
- DriverLineG2d.manageStroke(param, g2d);
- g2d.draw(rect);
- }
-
+ g2d.fill(shape);
+ drawBorder(param, color, mapper, rect, shape, g2d, x, y);
} else {
if (param.getBackcolor() != null) {
g2d.setColor(mapper.getMappedColor(param.getBackcolor()));
DriverLineG2d.manageStroke(param, g2d);
managePattern(param, g2d);
- g2d.fill(rect);
+ g2d.fill(shape);
}
- if (param.getColor() != null && param.getColor().equals(param.getBackcolor()) == false) {
- g2d.setColor(mapper.getMappedColor(param.getColor()));
- DriverLineG2d.manageStroke(param, g2d);
- g2d.draw(rect);
+ if (color != null && color.equals(param.getBackcolor()) == false) {
+ drawBorder(param, color, mapper, rect, shape, g2d, x, y);
}
}
}
- private GradientPaint getPaintGradient(double x, double y, ColorMapper mapper, final URectangle shape,
- final HtmlColor back) {
- final double width = shape.getWidth();
- final double height = shape.getHeight();
- return getPaintGradient(x, y, mapper, width, height, back);
-
+ public static void drawBorder(UParam param, HtmlColor color, ColorMapper mapper, UShapeSized sized, Shape shape,
+ Graphics2D g2d, double x, double y) {
+ if (color == null) {
+ return;
+ }
+ if (color instanceof HtmlColorGradient) {
+ final GradientPaint paint = getPaintGradient(x, y, mapper, sized.getWidth(), sized.getHeight(), color);
+ g2d.setPaint(paint);
+ } else {
+ g2d.setColor(mapper.getMappedColor(color));
+ }
+ DriverLineG2d.manageStroke(param, g2d);
+ g2d.draw(shape);
}
public static GradientPaint getPaintGradient(double x, double y, ColorMapper mapper, double width, double height,
diff --git a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverTextAsPathG2d.java b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverTextAsPathG2d.java
index dc25efa..642417b 100644
--- a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverTextAsPathG2d.java
+++ b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverTextAsPathG2d.java
@@ -49,6 +49,7 @@ import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.EnsureVisible;
import net.sourceforge.plantuml.FileFormat;
import net.sourceforge.plantuml.Log;
+import net.sourceforge.plantuml.TikzFontDistortion;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.FontStyle;
import net.sourceforge.plantuml.graphic.HtmlColor;
@@ -84,7 +85,7 @@ public class DriverTextAsPathG2d implements UDriver<Graphics2D> {
final FontConfiguration fontConfiguration = shape.getFontConfiguration();
final UFont font = fontConfiguration.getFont().scaled(param.getScale());
- final Dimension2D dimBack = calculateDimension(FileFormat.PNG.getDefaultStringBounder(), font, shape.getText());
+ final Dimension2D dimBack = calculateDimension(FileFormat.PNG.getDefaultStringBounder(TikzFontDistortion.getDefault()), font, shape.getText());
if (fontConfiguration.containsStyle(FontStyle.BACKCOLOR)) {
final Color extended = mapper.getMappedColor(fontConfiguration.getExtendedColor());
if (extended != null) {
@@ -109,14 +110,14 @@ public class DriverTextAsPathG2d implements UDriver<Graphics2D> {
if (extended != null) {
g2d.setColor(mapper.getMappedColor(extended));
}
- final Dimension2D dim = calculateDimension(FileFormat.PNG.getDefaultStringBounder(), font, shape.getText());
+ final Dimension2D dim = calculateDimension(FileFormat.PNG.getDefaultStringBounder(TikzFontDistortion.getDefault()), font, shape.getText());
final int ypos = (int) (y + 2.5);
g2d.setStroke(new BasicStroke((float) 1));
g2d.drawLine((int) x, ypos, (int) (x + dim.getWidth()), ypos);
g2d.setStroke(new BasicStroke());
}
if (fontConfiguration.containsStyle(FontStyle.WAVE)) {
- final Dimension2D dim = calculateDimension(FileFormat.PNG.getDefaultStringBounder(), font, shape.getText());
+ final Dimension2D dim = calculateDimension(FileFormat.PNG.getDefaultStringBounder(TikzFontDistortion.getDefault()), font, shape.getText());
final int ypos = (int) (y + 2.5) - 1;
final HtmlColor extended = fontConfiguration.getExtendedColor();
if (extended != null) {
@@ -128,7 +129,7 @@ public class DriverTextAsPathG2d implements UDriver<Graphics2D> {
}
}
if (fontConfiguration.containsStyle(FontStyle.STRIKE)) {
- final Dimension2D dim = calculateDimension(FileFormat.PNG.getDefaultStringBounder(), font, shape.getText());
+ final Dimension2D dim = calculateDimension(FileFormat.PNG.getDefaultStringBounder(TikzFontDistortion.getDefault()), font, shape.getText());
final FontMetrics fm = g2d.getFontMetrics(font.getFont());
final int ypos = (int) (y - fm.getDescent() - 0.5);
final HtmlColor extended = fontConfiguration.getExtendedColor();
diff --git a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverTextG2d.java b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverTextG2d.java
index a02c2ac..4b653cb 100644
--- a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverTextG2d.java
+++ b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverTextG2d.java
@@ -48,6 +48,7 @@ import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.EnsureVisible;
import net.sourceforge.plantuml.FileFormat;
import net.sourceforge.plantuml.Log;
+import net.sourceforge.plantuml.TikzFontDistortion;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.FontStyle;
import net.sourceforge.plantuml.graphic.HtmlColor;
@@ -82,7 +83,7 @@ public class DriverTextG2d implements UDriver<Graphics2D> {
final FontConfiguration fontConfiguration = shape.getFontConfiguration();
final UFont font = fontConfiguration.getFont().scaled(param.getScale());
- final Dimension2D dimBack = calculateDimension(FileFormat.PNG.getDefaultStringBounder(), font, shape.getText());
+ final Dimension2D dimBack = calculateDimension(FileFormat.PNG.getDefaultStringBounder(TikzFontDistortion.getDefault()), font, shape.getText());
final HtmlColor extended = fontConfiguration.getExtendedColor();
if (fontConfiguration.containsStyle(FontStyle.BACKCOLOR)) {
final Rectangle2D.Double area = new Rectangle2D.Double(x, y - dimBack.getHeight() + 1.5,
@@ -112,14 +113,14 @@ public class DriverTextG2d implements UDriver<Graphics2D> {
if (extended != null) {
g2d.setColor(mapper.getMappedColor(extended));
}
- final Dimension2D dim = calculateDimension(FileFormat.PNG.getDefaultStringBounder(), font, shape.getText());
+ final Dimension2D dim = calculateDimension(FileFormat.PNG.getDefaultStringBounder(TikzFontDistortion.getDefault()), font, shape.getText());
final int ypos = (int) (y + 2.5);
g2d.setStroke(new BasicStroke((float) 1));
g2d.drawLine((int) x, ypos, (int) (x + dim.getWidth()), ypos);
g2d.setStroke(new BasicStroke());
}
if (fontConfiguration.containsStyle(FontStyle.WAVE)) {
- final Dimension2D dim = calculateDimension(FileFormat.PNG.getDefaultStringBounder(), font, shape.getText());
+ final Dimension2D dim = calculateDimension(FileFormat.PNG.getDefaultStringBounder(TikzFontDistortion.getDefault()), font, shape.getText());
final int ypos = (int) (y + 2.5) - 1;
if (extended != null) {
g2d.setColor(mapper.getMappedColor(extended));
@@ -130,7 +131,7 @@ public class DriverTextG2d implements UDriver<Graphics2D> {
}
}
if (fontConfiguration.containsStyle(FontStyle.STRIKE)) {
- final Dimension2D dim = calculateDimension(FileFormat.PNG.getDefaultStringBounder(), font, shape.getText());
+ final Dimension2D dim = calculateDimension(FileFormat.PNG.getDefaultStringBounder(TikzFontDistortion.getDefault()), font, shape.getText());
final FontMetrics fm = g2d.getFontMetrics(font.getFont());
final int ypos = (int) (y - fm.getDescent() - 0.5);
if (extended != null) {
diff --git a/src/net/sourceforge/plantuml/ugraphic/g2d/UGraphicG2d.java b/src/net/sourceforge/plantuml/ugraphic/g2d/UGraphicG2d.java
index 5f59f50..04311a3 100644
--- a/src/net/sourceforge/plantuml/ugraphic/g2d/UGraphicG2d.java
+++ b/src/net/sourceforge/plantuml/ugraphic/g2d/UGraphicG2d.java
@@ -50,6 +50,7 @@ import java.util.Set;
import net.sourceforge.plantuml.EnsureVisible;
import net.sourceforge.plantuml.FileFormat;
+import net.sourceforge.plantuml.TikzFontDistortion;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.anim.AffineTransformation;
import net.sourceforge.plantuml.graphic.StringBounder;
@@ -149,8 +150,8 @@ public class UGraphicG2d extends AbstractUGraphic<Graphics2D> implements EnsureV
registerDriver(UPixel.class, new DriverPixelG2d());
registerDriver(UPolygon.class, new DriverPolygonG2d(dpiFactor, this));
registerDriver(UEllipse.class, new DriverEllipseG2d(dpiFactor, this));
- registerDriver(UImageSvg.class, new DriverImageG2d(this));
- registerDriver(UImage.class, new DriverImageG2d(this));
+ registerDriver(UImageSvg.class, new DriverImageG2d(dpiFactor, this));
+ registerDriver(UImage.class, new DriverImageG2d(dpiFactor, this));
registerDriver(DotPath.class, new DriverDotPathG2d(this));
registerDriver(UPath.class, new DriverPathG2d(dpiFactor));
registerDriver(UCenteredCharacter.class, new DriverCenteredCharacterG2d());
@@ -160,7 +161,7 @@ public class UGraphicG2d extends AbstractUGraphic<Graphics2D> implements EnsureV
// if (hasAffineTransform) {
// return TextBlockUtils.getDummyStringBounder();
// }
- return FileFormat.PNG.getDefaultStringBounder();
+ return FileFormat.PNG.getDefaultStringBounder(TikzFontDistortion.getDefault());
}
@Override
@@ -198,7 +199,9 @@ public class UGraphicG2d extends AbstractUGraphic<Graphics2D> implements EnsureV
public void ensureVisible(double x, double y) {
for (Url u : urls) {
- u.ensureVisible(x, y);
+ if (getClip() == null || getClip().isInside(x, y)) {
+ u.ensureVisible(x, y);
+ }
}
}
@@ -219,4 +222,9 @@ public class UGraphicG2d extends AbstractUGraphic<Graphics2D> implements EnsureV
PngIO.write(im, os, metadata, dpi);
}
+ @Override
+ public double dpiFactor() {
+ return dpiFactor;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/hand/UGraphicHandwritten.java b/src/net/sourceforge/plantuml/ugraphic/hand/UGraphicHandwritten.java
index 0bffcd7..25c18e4 100644
--- a/src/net/sourceforge/plantuml/ugraphic/hand/UGraphicHandwritten.java
+++ b/src/net/sourceforge/plantuml/ugraphic/hand/UGraphicHandwritten.java
@@ -52,6 +52,10 @@ public class UGraphicHandwritten implements UGraphic {
private final UGraphic ug;
+ public double dpiFactor() {
+ return ug.dpiFactor();
+ }
+
public UGraphicHandwritten(UGraphic ug) {
this.ug = ug;
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/hand/UPathHand.java b/src/net/sourceforge/plantuml/ugraphic/hand/UPathHand.java
index ee023ee..afad570 100644
--- a/src/net/sourceforge/plantuml/ugraphic/hand/UPathHand.java
+++ b/src/net/sourceforge/plantuml/ugraphic/hand/UPathHand.java
@@ -76,6 +76,7 @@ public class UPathHand {
}
}
this.path = jigglePath;
+ this.path.setDeltaShadow(source.getDeltaShadow());
}
public UPath getHanddrawn() {
diff --git a/src/net/sourceforge/plantuml/ugraphic/html5/UGraphicHtml5.java b/src/net/sourceforge/plantuml/ugraphic/html5/UGraphicHtml5.java
index 74e3426..5a5c532 100644
--- a/src/net/sourceforge/plantuml/ugraphic/html5/UGraphicHtml5.java
+++ b/src/net/sourceforge/plantuml/ugraphic/html5/UGraphicHtml5.java
@@ -38,6 +38,7 @@ import java.io.IOException;
import java.io.OutputStream;
import net.sourceforge.plantuml.FileFormat;
+import net.sourceforge.plantuml.TikzFontDistortion;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.AbstractCommonUGraphic;
@@ -61,7 +62,7 @@ public class UGraphicHtml5 extends AbstractUGraphic<Html5Drawer> implements Clip
public UGraphicHtml5(ColorMapper colorMapper) {
super(colorMapper, new Html5Drawer());
- stringBounder = FileFormat.PNG.getDefaultStringBounder();
+ stringBounder = FileFormat.PNG.getDefaultStringBounder(TikzFontDistortion.getDefault());
registerDriver(URectangle.class, new DriverRectangleHtml5(this));
// registerDriver(UText.class, new DriverTextEps(imDummy, this, strategy));
registerDriver(UText.class, new DriverNopHtml5());
diff --git a/src/net/sourceforge/plantuml/ugraphic/sprite/ColorPalette.java b/src/net/sourceforge/plantuml/ugraphic/sprite/ColorPalette.java
new file mode 100644
index 0000000..58df55e
--- /dev/null
+++ b/src/net/sourceforge/plantuml/ugraphic/sprite/ColorPalette.java
@@ -0,0 +1,85 @@
+/* ========================================================================
+ * 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.sprite;
+
+import java.awt.Color;
+
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.HtmlColorSimple;
+
+public class ColorPalette {
+
+ private static final String colorValue = "!#$%&*+-:;<=>?@^_~GHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+
+ public char getCharFor(Color dest) {
+ return getCharFor(new HtmlColorSimple(dest, false));
+ }
+
+ public char getCharFor(HtmlColor dest) {
+ char result = 0;
+ double resultDist = Double.MAX_VALUE;
+ for (int i = 0; i < colorValue.length(); i++) {
+ final char c = colorValue.charAt(i);
+ final double dist = ((HtmlColorSimple) dest).distance(getHtmlColorSimpleFor(c));
+ if (dist < resultDist) {
+ result = c;
+ resultDist = dist;
+ }
+ }
+ assert result != 0;
+ return result;
+ }
+
+ private HtmlColorSimple getHtmlColorSimpleFor(char c) {
+ final Color color = getColorFor(c);
+ if (color == null) {
+ throw new IllegalArgumentException();
+ }
+ return new HtmlColorSimple(color, false);
+ }
+
+ public Color getColorFor(char c) {
+ final int col = colorValue.indexOf(c);
+ if (col == -1) {
+ return null;
+ }
+ final int blue = (col % 4) * 85;
+ final int green = ((col / 4) % 4) * 85;
+ final int red = ((col / 16) % 4) * 85;
+ return new Color(red, green, blue);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/ugraphic/sprite/ColorPalette4096.java b/src/net/sourceforge/plantuml/ugraphic/sprite/ColorPalette4096.java
new file mode 100644
index 0000000..f615e24
--- /dev/null
+++ b/src/net/sourceforge/plantuml/ugraphic/sprite/ColorPalette4096.java
@@ -0,0 +1,107 @@
+/* ========================================================================
+ * 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.sprite;
+
+import java.awt.Color;
+
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.HtmlColorSimple;
+
+public class ColorPalette4096 {
+
+ private static final String colorValue = "!#$%&*+-:;<=>?@^_~GHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+
+ public String getStringFor(Color dest) {
+ return getStringFor(new HtmlColorSimple(dest, false));
+ }
+
+ public String getStringFor(HtmlColor dest) {
+ int result = 0;
+ double resultDist = Double.MAX_VALUE;
+ for (int i = 0; i < 4096; i++) {
+ final double dist = ((HtmlColorSimple) dest).distance(getHtmlColorSimpleFor(i));
+ if (dist < resultDist) {
+ result = i;
+ resultDist = dist;
+ }
+ }
+ return encodeInt(result);
+ }
+
+ protected String encodeInt(int result) {
+ final int v2 = result % 64;
+ final int v1 = result / 64;
+ assert v1 >= 0 && v1 <= 63 && v2 >= 0 && v2 <= 63;
+ return "" + colorValue.charAt(v1) + colorValue.charAt(v2);
+ }
+
+ private HtmlColorSimple getHtmlColorSimpleFor(int s) {
+ final Color color = getColorFor(s);
+ if (color == null) {
+ throw new IllegalArgumentException();
+ }
+ return new HtmlColorSimple(color, false);
+ }
+
+ public Color getColorFor(String s) {
+ if (s.length() != 2) {
+ throw new IllegalArgumentException();
+ }
+ final int v1 = colorValue.indexOf(s.charAt(0));
+ if (v1 == -1) {
+ return null;
+ }
+ final int v2 = colorValue.indexOf(s.charAt(1));
+ if (v2 == -1) {
+ return null;
+ }
+ final int code = v1 * 64 + v2;
+ return getColorFor(code);
+ }
+
+ protected Color getColorFor(final int code) {
+ final int blue = code % 16;
+ final int green = (code / 16) % 16;
+ final int red = (code / 256) % 16;
+ return new Color(dup(red), dup(green), dup(blue));
+ }
+
+ private int dup(int v) {
+ assert v >= 0 && v <= 15;
+ return v * 16 + v;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/ugraphic/sprite/RessourcesUtils.java b/src/net/sourceforge/plantuml/ugraphic/sprite/RessourcesUtils.java
index 7ec7caf..b1e088f 100644
--- a/src/net/sourceforge/plantuml/ugraphic/sprite/RessourcesUtils.java
+++ b/src/net/sourceforge/plantuml/ugraphic/sprite/RessourcesUtils.java
@@ -55,8 +55,7 @@ public class RessourcesUtils {
if (path.startsWith("/") || path.endsWith("/")) {
throw new IllegalArgumentException();
}
- final URL resource = Version.class.getClassLoader().getResource("net/sourceforge/plantuml/version/logo.png");
- final String protocol = resource.getProtocol();
+ final String protocol = getProtocol();
if ("file".equals(protocol)) {
final URL local = Version.class.getClassLoader().getResource(path);
try {
@@ -80,6 +79,11 @@ public class RessourcesUtils {
return Collections.<String> emptySet();
}
+ private static String getProtocol() {
+ final URL resource = Version.class.getClassLoader().getResource("net/sourceforge/plantuml/version/logo.png");
+ return resource.getProtocol();
+ }
+
private static Set<String> listFiles(JarFile jarFile, String path) {
final Enumeration<JarEntry> entries = jarFile.entries();
final Set<String> result = new TreeSet<String>();
diff --git a/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteColor.java b/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteColor.java
new file mode 100644
index 0000000..5f0b307
--- /dev/null
+++ b/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteColor.java
@@ -0,0 +1,139 @@
+/* ========================================================================
+ * 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.sprite;
+
+import java.awt.Color;
+import java.awt.geom.Dimension2D;
+import java.awt.image.BufferedImage;
+
+import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.HtmlColorGradient;
+import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.ugraphic.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UImage;
+
+public class SpriteColor implements Sprite {
+
+ private final int width;
+ private final int height;
+ private final int grey[][];
+ private final int color[][];
+
+ public SpriteColor(int width, int height) {
+ this.width = width;
+ this.height = height;
+ this.grey = new int[height][width];
+ this.color = new int[height][width];
+ }
+
+ public void setGrey(int x, int y, int level) {
+ if (x < 0 || x >= width) {
+ return;
+ }
+ if (y < 0 || y >= height) {
+ return;
+ }
+ if (level < 0 || level >= 16) {
+ throw new IllegalArgumentException();
+ }
+ grey[y][x] = level;
+ color[y][x] = -1;
+ }
+
+ public void setColor(int x, int y, int col) {
+ if (x < 0 || x >= width) {
+ return;
+ }
+ if (y < 0 || y >= height) {
+ return;
+ }
+ grey[y][x] = -1;
+ color[y][x] = col;
+ }
+
+ public int getHeight() {
+ return height;
+ }
+
+ public int getWidth() {
+ return width;
+ }
+
+ public UImage toUImage(ColorMapper colorMapper, HtmlColor backcolor, HtmlColor forecolor) {
+ final BufferedImage im = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
+
+ if (backcolor == null) {
+ backcolor = HtmlColorUtils.WHITE;
+ }
+ if (forecolor == null) {
+ forecolor = HtmlColorUtils.BLACK;
+ }
+ final HtmlColorGradient gradient = new HtmlColorGradient(backcolor, forecolor, '\0');
+ for (int col = 0; col < width; col++) {
+ for (int line = 0; line < height; line++) {
+ final int localColor = color[line][col];
+ if (localColor == -1) {
+ final double coef = 1.0 * grey[line][col] / (16 - 1);
+ final Color c = gradient.getColor(colorMapper, coef);
+ im.setRGB(col, line, c.getRGB());
+ } else {
+ im.setRGB(col, line, localColor);
+ }
+ }
+ }
+ return new UImage(im);
+ }
+
+ public TextBlock asTextBlock(final HtmlColor color, final double scale) {
+ return new AbstractTextBlock() {
+
+ public void drawU(UGraphic ug) {
+ final UImage image = toUImage(ug.getColorMapper(), ug.getParam().getBackcolor(), color);
+ ug.draw(image.scale(scale));
+ }
+
+ public Dimension2D calculateDimension(StringBounder stringBounder) {
+ return new Dimension2DDouble(getWidth() * scale, getHeight() * scale);
+ }
+ };
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteColorBuilder.java b/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteColorBuilder.java
new file mode 100644
index 0000000..1dc783b
--- /dev/null
+++ b/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteColorBuilder.java
@@ -0,0 +1,86 @@
+/* ========================================================================
+ * 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.sprite;
+
+import java.awt.Color;
+import java.awt.image.BufferedImage;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public class SpriteColorBuilder {
+
+ private final static ColorPalette COLOR_PALETTE = new ColorPalette();
+
+ public static Sprite buildSprite(List<CharSequence> strings) {
+ final SpriteColor result = new SpriteColor(strings.get(0).length(), strings.size());
+ for (int col = 0; col < result.getWidth(); col++) {
+ for (int line = 0; line < result.getHeight(); line++) {
+ if (col >= strings.get(line).length()) {
+ continue;
+ }
+ final char charColor = strings.get(line).charAt(col);
+ final int idx = "0123456789ABCDEF".indexOf(charColor);
+ if (idx != -1) {
+ result.setGrey(col, line, idx);
+ } else {
+ final Color rgb = COLOR_PALETTE.getColorFor(charColor);
+ result.setColor(col, line, rgb.getRGB() & 0xFFFFFF);
+ }
+ }
+ }
+ return result;
+ }
+
+ static public List<String> encodeColor(BufferedImage img) {
+ final int width = img.getWidth();
+ final int height = img.getHeight();
+
+ final List<String> result = new ArrayList<String>();
+
+ for (int y = 0; y < height; y++) {
+ final StringBuilder sb = new StringBuilder();
+ for (int x = 0; x < width; x++) {
+ final int rgb = (img.getRGB(x, y) & 0xFFFFFF);
+ final char code = COLOR_PALETTE.getCharFor(new Color(rgb));
+ sb.append(code);
+ }
+ result.add(sb.toString());
+ }
+ return Collections.unmodifiableList(result);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteColorBuilder4096.java b/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteColorBuilder4096.java
new file mode 100644
index 0000000..2d55f2c
--- /dev/null
+++ b/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteColorBuilder4096.java
@@ -0,0 +1,81 @@
+/* ========================================================================
+ * 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.sprite;
+
+import java.awt.Color;
+import java.awt.image.BufferedImage;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public class SpriteColorBuilder4096 {
+
+ private final static ColorPalette4096 COLOR_PALETTE = new ColorPalette4096();
+
+ public static Sprite buildSprite(List<CharSequence> strings) {
+ final SpriteColor result = new SpriteColor(strings.get(0).length() / 2, strings.size());
+ for (int col = 0; col < result.getWidth(); col++) {
+ for (int line = 0; line < result.getHeight(); line++) {
+ if (col * 2 >= strings.get(line).length()) {
+ continue;
+ }
+ final String charColor = strings.get(line).toString().substring(col * 2, col * 2 + 2);
+ final Color rgb = COLOR_PALETTE.getColorFor(charColor);
+ result.setColor(col, line, rgb.getRGB() & 0xFFFFFF);
+ }
+ }
+ return result;
+ }
+
+ static public List<String> encodeColor(BufferedImage img) {
+ final int width = img.getWidth();
+ final int height = img.getHeight();
+
+ final List<String> result = new ArrayList<String>();
+
+ for (int y = 0; y < height; y++) {
+ final StringBuilder sb = new StringBuilder();
+ for (int x = 0; x < width; x++) {
+ final int rgb = (img.getRGB(x, y) & 0xFFFFFF);
+ final String code = COLOR_PALETTE.getStringFor(new Color(rgb));
+ sb.append(code);
+ }
+ result.add(sb.toString());
+ }
+ return Collections.unmodifiableList(result);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteGrayLevel.java b/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteGrayLevel.java
index b0c2066..2d1951c 100644
--- a/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteGrayLevel.java
+++ b/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteGrayLevel.java
@@ -44,7 +44,11 @@ import java.util.List;
import net.sourceforge.plantuml.StringUtils;
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 {
@@ -113,7 +117,6 @@ public enum SpriteGrayLevel {
// final int type = img.getType();
final List<String> result = new ArrayList<String>();
- final AsciiEncoder encoder = new AsciiEncoder();
for (int y = 0; y < height; y += 2) {
final StringBuilder sb = new StringBuilder();
@@ -123,7 +126,7 @@ public enum SpriteGrayLevel {
final int level2 = getGrayOn16(img, x, y + 1) / 2;
assert level2 >= 0 && level2 <= 7;
final int v = level1 * 8 + level2;
- sb.append(encoder.encode6bit((byte) v));
+ sb.append(AsciiEncoder.encode6bit((byte) v));
}
result.add(sb.toString());
}
@@ -136,7 +139,6 @@ public enum SpriteGrayLevel {
// final int type = img.getType();
final List<String> result = new ArrayList<String>();
- final AsciiEncoder encoder = new AsciiEncoder();
for (int y = 0; y < height; y += 3) {
final StringBuilder sb = new StringBuilder();
@@ -148,7 +150,7 @@ public enum SpriteGrayLevel {
final int level3 = getGrayOn16(img, x, y + 2) / 4;
assert level3 >= 0 && level3 <= 3;
final int v = level1 * 16 + level2 * 4 + level3;
- sb.append(encoder.encode6bit((byte) v));
+ sb.append(AsciiEncoder.encode6bit((byte) v));
}
result.add(sb.toString());
}
@@ -190,7 +192,7 @@ public enum SpriteGrayLevel {
if (strings.get(line).charAt(col) != '0') {
final String s = "" + strings.get(line).charAt(col);
final int x = Integer.parseInt(StringUtils.goUpperCase(s), 16);
- result.setPixel(col, line, x);
+ result.setGrey(col, line, x);
}
}
}
@@ -198,18 +200,17 @@ public enum SpriteGrayLevel {
}
private Sprite buildSprite8(int width, int height, List<CharSequence> strings) {
- final AsciiEncoder encoder = new AsciiEncoder();
final SpriteMonochrome result = new SpriteMonochrome(width, height, 8);
for (int col = 0; col < result.getWidth(); col++) {
for (int line = 0; line < strings.size(); line++) {
if (col >= strings.get(line).length()) {
continue;
}
- final int v = encoder.decode6bit(strings.get(line).charAt(col));
+ final int v = AsciiEncoder.decode6bit(strings.get(line).charAt(col));
final int w1 = v / 8;
final int w2 = v % 8;
- result.setPixel(col, line * 2, w1);
- result.setPixel(col, line * 2 + 1, w2);
+ result.setGrey(col, line * 2, w1);
+ result.setGrey(col, line * 2 + 1, w2);
}
}
@@ -217,21 +218,20 @@ public enum SpriteGrayLevel {
}
private Sprite buildSprite4(int width, int height, List<CharSequence> strings) {
- final AsciiEncoder encoder = new AsciiEncoder();
final SpriteMonochrome result = new SpriteMonochrome(width, height, 4);
for (int col = 0; col < result.getWidth(); col++) {
for (int line = 0; line < strings.size(); line++) {
if (col >= strings.get(line).length()) {
continue;
}
- int v = encoder.decode6bit(strings.get(line).charAt(col));
+ int v = AsciiEncoder.decode6bit(strings.get(line).charAt(col));
final int w1 = v / 16;
v = v % 16;
final int w2 = v / 4;
final int w3 = v % 4;
- result.setPixel(col, line * 3, w1);
- result.setPixel(col, line * 3 + 1, w2);
- result.setPixel(col, line * 3 + 2, w3);
+ result.setGrey(col, line * 3, w1);
+ result.setGrey(col, line * 3 + 1, w2);
+ result.setGrey(col, line * 3 + 2, w3);
}
}
@@ -242,18 +242,33 @@ public enum SpriteGrayLevel {
final int width = img.getWidth();
final int height = img.getHeight();
final byte raw[] = new byte[width * height];
- final BufferedImage grayImg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
int cpt = 0;
final int coef = 16 / nbColor;
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
final int color = getGrayOn16(img, x, y) / coef;
raw[cpt++] = (byte) color;
- grayImg.setRGB(x, y, color * coef);
}
}
- final byte[] comp = new CompressionZlib().compress(raw);
- return cut(new AsciiEncoder().encode(comp));
+ // final byte[] comp = new CompressionZlib().compress(raw);
+ final byte[] comp = new CompressionZopfliZlib().compress(raw);
+ return cut(new AsciiEncoderFinalZeros().encode(comp));
+ }
+
+ private List<String> 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<String> cut(String s) {
@@ -273,7 +288,7 @@ public enum SpriteGrayLevel {
int cpt = 0;
for (int line = 0; line < result.getHeight(); line++) {
for (int col = 0; col < result.getWidth(); col++) {
- result.setPixel(col, line, img[cpt++]);
+ result.setGrey(col, line, img[cpt++]);
}
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteMonochrome.java b/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteMonochrome.java
index 3afaadd..e1bf77e 100644
--- a/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteMonochrome.java
+++ b/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteMonochrome.java
@@ -38,6 +38,8 @@ package net.sourceforge.plantuml.ugraphic.sprite;
import java.awt.Color;
import java.awt.geom.Dimension2D;
import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.io.OutputStream;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
@@ -55,19 +57,99 @@ public class SpriteMonochrome implements Sprite {
private final int width;
private final int height;
private final int grayLevel;
- private final int pixels[][];
+ private final int grey[][];
- SpriteMonochrome(int width, int height, int grayLevel) {
+ public boolean isSameKind(SpriteMonochrome other) {
+ if (this.width != other.width) {
+ return false;
+ }
+ if (this.height != other.height) {
+ return false;
+ }
+ if (this.grayLevel != other.grayLevel) {
+ return false;
+ }
+ return true;
+ }
+
+ public boolean isSame(SpriteMonochrome other) {
+ if (isSameKind(other) == false) {
+ return false;
+ }
+ for (int i = 0; i < width; i++) {
+ for (int j = 0; j < height; j++) {
+ if (this.grey[j][i] != other.grey[j][i]) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ public SpriteMonochrome xor(SpriteMonochrome other) {
+ if (this.width != other.width) {
+ throw new IllegalStateException();
+ }
+ if (this.height != other.height) {
+ throw new IllegalStateException();
+ }
+ if (this.grayLevel != other.grayLevel) {
+ throw new IllegalStateException();
+ }
+ final SpriteMonochrome result = new SpriteMonochrome(width, height, grayLevel);
+ for (int i = 0; i < width; i++) {
+ for (int j = 0; j < height; j++) {
+ result.grey[j][i] = this.grey[j][i] ^ other.grey[j][i];
+ }
+ }
+ return result;
+ }
+
+ public SpriteMonochrome(int width, int height, int grayLevel) {
if (grayLevel != 2 && grayLevel != 4 && grayLevel != 8 && grayLevel != 16) {
throw new IllegalArgumentException();
}
this.width = width;
this.height = height;
this.grayLevel = grayLevel;
- this.pixels = new int[height][width];
+ this.grey = new int[height][width];
}
- void setPixel(int x, int y, int level) {
+ public SpriteMonochrome xSymetric() {
+ final SpriteMonochrome result = new SpriteMonochrome(width, height, grayLevel);
+ for (int i = 0; i < width; i++) {
+ for (int j = 0; j < height; j++) {
+ result.setGrey(i, j, this.getGrey(i, j));
+ }
+ }
+ for (int j = 0; j < height; j++) {
+ for (int i = 0; i < width / 2; i++) {
+ final int i2 = width - 1 - i;
+ final int level = result.getGrey(i, j) ^ result.getGrey(i2, j);
+ result.setGrey(i2, j, level);
+ }
+ }
+ return result;
+ }
+
+ public SpriteMonochrome ySymetric() {
+ final SpriteMonochrome result = new SpriteMonochrome(width, height, grayLevel);
+ for (int i = 0; i < width; i++) {
+ for (int j = 0; j < height; j++) {
+ result.setGrey(i, j, this.getGrey(i, j));
+ }
+ }
+ for (int i = 0; i < width; i++) {
+ for (int j = 0; j < height / 2; j++) {
+ final int j2 = height - 1 - j;
+ final int level = result.getGrey(i, j) ^ result.getGrey(i, j2);
+ result.setGrey(i, j2, level);
+ }
+ }
+ return result;
+ }
+
+ public void setGrey(int x, int y, int level) {
if (x < 0 || x >= width) {
return;
}
@@ -77,14 +159,24 @@ public class SpriteMonochrome implements Sprite {
if (level < 0 || level >= grayLevel) {
throw new IllegalArgumentException("level=" + level + " grayLevel=" + grayLevel);
}
- pixels[y][x] = level;
+ grey[y][x] = level;
+ }
+
+ public int getGrey(int x, int y) {
+ if (x >= width) {
+ throw new IllegalArgumentException("x=" + x + " width=" + width);
+ }
+ if (y >= height) {
+ throw new IllegalArgumentException("y=" + y + " height=" + height);
+ }
+ return grey[y][x];
}
public int getHeight() {
return height;
}
- int getWidth() {
+ public int getWidth() {
return width;
}
@@ -100,7 +192,7 @@ public class SpriteMonochrome implements Sprite {
final HtmlColorGradient gradient = new HtmlColorGradient(backcolor, color, '\0');
for (int col = 0; col < width; col++) {
for (int line = 0; line < height; line++) {
- final double coef = 1.0 * pixels[line][col] / (grayLevel - 1);
+ final double coef = 1.0 * grey[line][col] / (grayLevel - 1);
final Color c = gradient.getColor(colorMapper, coef);
im.setRGB(col, line, c.getRGB());
}
@@ -122,4 +214,14 @@ public class SpriteMonochrome implements Sprite {
};
}
+ public void exportSprite1(OutputStream fos) throws IOException {
+ for (int y = 0; y < this.getHeight(); y += 2) {
+ for (int x = 0; x < this.getWidth(); x += 1) {
+ int b1 = this.getGrey(x, y);
+ int b2 = y + 1 < this.getHeight() ? this.getGrey(x, y + 1) : b1;
+ fos.write(b1 * 16 + b2);
+ }
+ }
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteUtils.java b/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteUtils.java
index 06dd662..8cad8da 100644
--- a/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteUtils.java
+++ b/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteUtils.java
@@ -47,6 +47,18 @@ public class SpriteUtils {
private SpriteUtils() {
}
+ public static String encodeColor(BufferedImage img, String name) {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("sprite $" + name + " [" + img.getWidth() + "x" + img.getHeight() + "/color] {\n");
+ final List<String> result = SpriteColorBuilder4096.encodeColor(img);
+ for (String s : result) {
+ sb.append(s);
+ sb.append(BackSlash.NEWLINE);
+ }
+ sb.append("}\n");
+ return sb.toString();
+ }
+
public static String encode(BufferedImage img, String name, SpriteGrayLevel level) {
final StringBuilder sb = new StringBuilder();
sb.append("sprite $" + name + " [" + img.getWidth() + "x" + img.getHeight() + "/" + level.getNbColor()
diff --git a/src/net/sourceforge/plantuml/ugraphic/svg/DriverEllipseSvg.java b/src/net/sourceforge/plantuml/ugraphic/svg/DriverEllipseSvg.java
index 581b5ed..c24e8bc 100644
--- a/src/net/sourceforge/plantuml/ugraphic/svg/DriverEllipseSvg.java
+++ b/src/net/sourceforge/plantuml/ugraphic/svg/DriverEllipseSvg.java
@@ -82,8 +82,8 @@ public class DriverEllipseSvg implements UDriver<SvgGraphics> {
final String backcolor = StringUtils.getAsSvg(mapper, back);
svg.setFillColor(backcolor);
}
- final String color = StringUtils.getAsSvg(mapper, param.getColor());
- svg.setStrokeColor(color);
+ DriverRectangleSvg.applyColor(svg, mapper, param);
+ // svg.setStrokeColor(StringUtils.getAsSvg(mapper, param.getColor()));
svg.setStrokeWidth(param.getStroke().getThickness(), param.getStroke().getDasharraySvg());
double start = shape.getStart();
diff --git a/src/net/sourceforge/plantuml/ugraphic/svg/DriverLineSvg.java b/src/net/sourceforge/plantuml/ugraphic/svg/DriverLineSvg.java
index cc29a42..0478f06 100644
--- a/src/net/sourceforge/plantuml/ugraphic/svg/DriverLineSvg.java
+++ b/src/net/sourceforge/plantuml/ugraphic/svg/DriverLineSvg.java
@@ -37,6 +37,8 @@ package net.sourceforge.plantuml.ugraphic.svg;
import java.awt.geom.Line2D;
import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.HtmlColorGradient;
import net.sourceforge.plantuml.svg.SvgGraphics;
import net.sourceforge.plantuml.ugraphic.ClipContainer;
import net.sourceforge.plantuml.ugraphic.ColorMapper;
@@ -77,10 +79,13 @@ public class DriverLineSvg implements UDriver<SvgGraphics> {
// svg.svgLineShadow(x, y, x2, y2, shape.getDeltaShadow());
// }
- // svg.setStroke(new BasicStroke((float)
- // param.getStroke().getThickness()));
- final String color = StringUtils.getAsSvg(mapper, param.getColor());
- svg.setStrokeColor(color);
+ final HtmlColor color = param.getColor();
+ if (color instanceof HtmlColorGradient) {
+ final HtmlColorGradient gr = (HtmlColorGradient) color;
+ svg.setStrokeColor(StringUtils.getAsSvg(mapper, gr.getColor1()));
+ } else {
+ svg.setStrokeColor(StringUtils.getAsSvg(mapper, color));
+ }
svg.setStrokeWidth(param.getStroke().getThickness(), param.getStroke().getDasharraySvg());
svg.svgLine(x, y, x2, y2, shape.getDeltaShadow());
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/svg/DriverRectangleSvg.java b/src/net/sourceforge/plantuml/ugraphic/svg/DriverRectangleSvg.java
index 28fa2c1..4bebbef 100644
--- a/src/net/sourceforge/plantuml/ugraphic/svg/DriverRectangleSvg.java
+++ b/src/net/sourceforge/plantuml/ugraphic/svg/DriverRectangleSvg.java
@@ -64,18 +64,17 @@ public class DriverRectangleSvg implements UDriver<SvgGraphics> {
double width = rect.getWidth();
double height = rect.getHeight();
- final String color = StringUtils.getAsSvg(mapper, param.getColor());
final HtmlColor back = param.getBackcolor();
if (back instanceof HtmlColorGradient) {
final HtmlColorGradient gr = (HtmlColorGradient) back;
final String id = svg.createSvgGradient(StringUtils.getAsHtml(mapper.getMappedColor(gr.getColor1())),
StringUtils.getAsHtml(mapper.getMappedColor(gr.getColor2())), gr.getPolicy());
svg.setFillColor("url(#" + id + ")");
- svg.setStrokeColor(color);
+ applyColor(svg, mapper, param);
} else {
final String backcolor = StringUtils.getAsSvg(mapper, back);
svg.setFillColor(backcolor);
- svg.setStrokeColor(color);
+ applyColor(svg, mapper, param);
}
svg.setStrokeWidth(param.getStroke().getThickness(), param.getStroke().getDasharraySvg());
@@ -93,4 +92,16 @@ public class DriverRectangleSvg implements UDriver<SvgGraphics> {
}
svg.svgRectangle(x, y, width, height, rx / 2, ry / 2, rect.getDeltaShadow(), rect.getComment());
}
+
+ public static void applyColor(SvgGraphics svg, ColorMapper mapper, UParam param) {
+ final HtmlColor color = param.getColor();
+ if (color instanceof HtmlColorGradient) {
+ final HtmlColorGradient gr = (HtmlColorGradient) color;
+ final String id = svg.createSvgGradient(StringUtils.getAsHtml(mapper.getMappedColor(gr.getColor1())),
+ StringUtils.getAsHtml(mapper.getMappedColor(gr.getColor2())), gr.getPolicy());
+ svg.setStrokeColor("url(#" + id + ")");
+ } else {
+ svg.setStrokeColor(StringUtils.getAsSvg(mapper, color));
+ }
+ }
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/svg/UGraphicSvg.java b/src/net/sourceforge/plantuml/ugraphic/svg/UGraphicSvg.java
index 70e5233..986338a 100644
--- a/src/net/sourceforge/plantuml/ugraphic/svg/UGraphicSvg.java
+++ b/src/net/sourceforge/plantuml/ugraphic/svg/UGraphicSvg.java
@@ -41,6 +41,7 @@ import java.io.OutputStream;
import javax.xml.transform.TransformerException;
import net.sourceforge.plantuml.FileFormat;
+import net.sourceforge.plantuml.TikzFontDistortion;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.graphic.HtmlColorGradient;
import net.sourceforge.plantuml.graphic.StringBounder;
@@ -69,6 +70,10 @@ public class UGraphicSvg extends AbstractUGraphic<SvgGraphics> implements ClipCo
private final boolean textAsPath2;
private final String target;
+ public double dpiFactor() {
+ return 1;
+ }
+
@Override
protected AbstractCommonUGraphic copyUGraphic() {
return new UGraphicSvg(this);
@@ -82,19 +87,21 @@ public class UGraphicSvg extends AbstractUGraphic<SvgGraphics> implements ClipCo
register();
}
- public UGraphicSvg(Dimension2D minDim, ColorMapper colorMapper, String backcolor, boolean textAsPath, double scale,
- String linkTarget, String hover, long seed) {
- this(minDim, colorMapper, new SvgGraphics(minDim, backcolor, scale, hover, seed), textAsPath, linkTarget);
+ public UGraphicSvg(boolean svgDimensionStyle, Dimension2D minDim, ColorMapper colorMapper, String backcolor,
+ boolean textAsPath, double scale, String linkTarget, String hover, long seed) {
+ this(minDim, colorMapper, new SvgGraphics(svgDimensionStyle, minDim, backcolor, scale, hover, seed),
+ textAsPath, linkTarget);
}
- public UGraphicSvg(Dimension2D minDim, ColorMapper colorMapper, boolean textAsPath, double scale,
- String linkTarget, String hover, long seed) {
- this(minDim, colorMapper, new SvgGraphics(minDim, scale, hover, seed), textAsPath, linkTarget);
+ public UGraphicSvg(boolean svgDimensionStyle, Dimension2D minDim, ColorMapper colorMapper, boolean textAsPath,
+ double scale, String linkTarget, String hover, long seed) {
+ this(minDim, colorMapper, new SvgGraphics(svgDimensionStyle, minDim, scale, hover, seed), textAsPath,
+ linkTarget);
}
- public UGraphicSvg(Dimension2D minDim, ColorMapper mapper, HtmlColorGradient gr, boolean textAsPath, double scale,
- String linkTarget, String hover, long seed) {
- this(minDim, mapper, new SvgGraphics(minDim, scale, hover, seed), textAsPath, linkTarget);
+ public UGraphicSvg(boolean svgDimensionStyle, Dimension2D minDim, ColorMapper mapper, HtmlColorGradient gr,
+ boolean textAsPath, double scale, String linkTarget, String hover, long seed) {
+ this(minDim, mapper, new SvgGraphics(svgDimensionStyle, minDim, scale, hover, seed), textAsPath, linkTarget);
final SvgGraphics svg = getGraphicObject();
svg.paintBackcolorGradient(mapper, gr);
@@ -118,7 +125,7 @@ public class UGraphicSvg extends AbstractUGraphic<SvgGraphics> implements ClipCo
private UGraphicSvg(Dimension2D minDim, ColorMapper colorMapper, SvgGraphics svg, boolean textAsPath,
String linkTarget) {
super(colorMapper, svg);
- this.stringBounder = FileFormat.PNG.getDefaultStringBounder();
+ this.stringBounder = FileFormat.PNG.getDefaultStringBounder(TikzFontDistortion.getDefault());
this.textAsPath2 = textAsPath;
this.target = linkTarget;
register();
diff --git a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverAtomTextTikz.java b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverAtomTextTikz.java
index 69d87e3..a2fa16c 100644
--- a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverAtomTextTikz.java
+++ b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverAtomTextTikz.java
@@ -35,9 +35,13 @@
package net.sourceforge.plantuml.ugraphic.tikz;
import net.sourceforge.plantuml.creole.AtomText;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
+import net.sourceforge.plantuml.graphic.FontStyle;
+import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.tikz.TikzGraphics;
import net.sourceforge.plantuml.ugraphic.ColorMapper;
import net.sourceforge.plantuml.ugraphic.UDriver;
+import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UParam;
import net.sourceforge.plantuml.ugraphic.UShape;
@@ -45,8 +49,14 @@ public class DriverAtomTextTikz implements UDriver<TikzGraphics> {
public void draw(UShape shape, double x, double y, ColorMapper mapper, UParam param, TikzGraphics tikz) {
final AtomText text = (AtomText) shape;
-
- tikz.text(x, y, text.getText());
+ final FontConfiguration fontConfiguration = text.getFontConfiguration();
+ final UFont font = fontConfiguration.getFont();
+ final HtmlColor col = fontConfiguration.getColor();
+ tikz.setStrokeColor(mapper.getMappedColor(col));
+ final boolean underline = fontConfiguration.containsStyle(FontStyle.UNDERLINE);
+ final boolean italic = font.isItalic();
+ final boolean bold = font.isBold();
+ tikz.text(x, y, text.getText(), underline, italic, bold);
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverCenteredCharacterTikz2.java b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverCenteredCharacterTikz2.java
new file mode 100644
index 0000000..f18a65a
--- /dev/null
+++ b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverCenteredCharacterTikz2.java
@@ -0,0 +1,55 @@
+/* ========================================================================
+ * 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.tikz;
+
+import net.sourceforge.plantuml.tikz.TikzGraphics;
+import net.sourceforge.plantuml.ugraphic.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.UCenteredCharacter;
+import net.sourceforge.plantuml.ugraphic.UDriver;
+import net.sourceforge.plantuml.ugraphic.UParam;
+import net.sourceforge.plantuml.ugraphic.UShape;
+
+public class DriverCenteredCharacterTikz2 implements UDriver<TikzGraphics> {
+
+ public void draw(UShape ushape, double x, double y, ColorMapper mapper, UParam param, TikzGraphics tikz) {
+ final UCenteredCharacter centeredCharacter = (UCenteredCharacter) ushape;
+ final char c = centeredCharacter.getChar();
+
+ tikz.setStrokeColor(mapper.getMappedColor(param.getColor()));
+ tikz.drawSingleCharacter(x, y, c);
+
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverDotPathTikz.java b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverDotPathTikz.java
index 8dd7956..119c3db 100644
--- a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverDotPathTikz.java
+++ b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverDotPathTikz.java
@@ -45,6 +45,7 @@ public class DriverDotPathTikz implements UDriver<TikzGraphics> {
public void draw(UShape shape, double x, double y, ColorMapper mapper, UParam param, TikzGraphics tikz) {
final DotPath path = (DotPath) shape;
+ tikz.setFillColor(null);
tikz.setStrokeColor(mapper.getMappedColor(param.getColor()));
tikz.setStrokeWidth(param.getStroke().getThickness(), param.getStroke().getDashTikz());
tikz.upath(x, y, path.toUPath());
diff --git a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverPolygonTikz.java b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverPolygonTikz.java
index f001e31..42a147c 100644
--- a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverPolygonTikz.java
+++ b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverPolygonTikz.java
@@ -34,6 +34,10 @@
*/
package net.sourceforge.plantuml.ugraphic.tikz;
+import java.awt.Color;
+
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.HtmlColorGradient;
import net.sourceforge.plantuml.tikz.TikzGraphics;
import net.sourceforge.plantuml.ugraphic.ColorMapper;
import net.sourceforge.plantuml.ugraphic.UDriver;
@@ -47,7 +51,15 @@ public class DriverPolygonTikz implements UDriver<TikzGraphics> {
final UPolygon poly = (UPolygon) shape;
final double points[] = poly.getPointArray(x, y);
- tikz.setFillColor(mapper.getMappedColor(param.getBackcolor()));
+ final HtmlColor back = param.getBackcolor();
+ if (back instanceof HtmlColorGradient) {
+ final HtmlColorGradient gr = (HtmlColorGradient) back;
+ final Color color1 = mapper.getMappedColor(gr.getColor1());
+ final Color color2 = mapper.getMappedColor(gr.getColor2());
+ tikz.setGradientColor(color1, color2, gr.getPolicy());
+ } else {
+ tikz.setFillColor(mapper.getMappedColor(back));
+ }
tikz.setStrokeColor(mapper.getMappedColor(param.getColor()));
tikz.setStrokeWidth(param.getStroke().getThickness(), param.getStroke().getDashTikz());
diff --git a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverRectangleTikz.java b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverRectangleTikz.java
index ada6cf2..afaa015 100644
--- a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverRectangleTikz.java
+++ b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverRectangleTikz.java
@@ -34,6 +34,10 @@
*/
package net.sourceforge.plantuml.ugraphic.tikz;
+import java.awt.Color;
+
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.HtmlColorGradient;
import net.sourceforge.plantuml.tikz.TikzGraphics;
import net.sourceforge.plantuml.ugraphic.ColorMapper;
import net.sourceforge.plantuml.ugraphic.UDriver;
@@ -51,7 +55,15 @@ public class DriverRectangleTikz implements UDriver<TikzGraphics> {
final double height = rect.getHeight();
final double r = MathUtils.min(rect.getRx(), rect.getRy(), width / 2, height / 2);
- tikz.setFillColor(mapper.getMappedColor(param.getBackcolor()));
+ final HtmlColor back = param.getBackcolor();
+ if (back instanceof HtmlColorGradient) {
+ final HtmlColorGradient gr = (HtmlColorGradient) back;
+ final Color color1 = mapper.getMappedColor(gr.getColor1());
+ final Color color2 = mapper.getMappedColor(gr.getColor2());
+ tikz.setGradientColor(color1, color2, gr.getPolicy());
+ } else {
+ tikz.setFillColor(mapper.getMappedColor(back));
+ }
tikz.setStrokeColor(mapper.getMappedColor(param.getColor()));
tikz.setStrokeWidth(param.getStroke().getThickness(), param.getStroke().getDashTikz());
if (r == 0) {
diff --git a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverUPathTikz.java b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverUPathTikz.java
index 8518246..bb68a9d 100644
--- a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverUPathTikz.java
+++ b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverUPathTikz.java
@@ -34,6 +34,10 @@
*/
package net.sourceforge.plantuml.ugraphic.tikz;
+import java.awt.Color;
+
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.HtmlColorGradient;
import net.sourceforge.plantuml.tikz.TikzGraphics;
import net.sourceforge.plantuml.ugraphic.ColorMapper;
import net.sourceforge.plantuml.ugraphic.UDriver;
@@ -45,6 +49,15 @@ public class DriverUPathTikz implements UDriver<TikzGraphics> {
public void draw(UShape shape, double x, double y, ColorMapper mapper, UParam param, TikzGraphics tikz) {
final UPath path = (UPath) shape;
+ final HtmlColor back = param.getBackcolor();
+ if (back instanceof HtmlColorGradient) {
+ final HtmlColorGradient gr = (HtmlColorGradient) back;
+ final Color color1 = mapper.getMappedColor(gr.getColor1());
+ final Color color2 = mapper.getMappedColor(gr.getColor2());
+ tikz.setGradientColor(color1, color2, gr.getPolicy());
+ } else {
+ tikz.setFillColor(mapper.getMappedColor(back));
+ }
tikz.setStrokeColor(mapper.getMappedColor(param.getColor()));
tikz.setStrokeWidth(param.getStroke().getThickness(), param.getStroke().getDashTikz());
tikz.upath(x, y, path);
diff --git a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverUTextTikz.java b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverUTextTikz.java
index d1bd0d7..2e378af 100644
--- a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverUTextTikz.java
+++ b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverUTextTikz.java
@@ -34,19 +34,29 @@
*/
package net.sourceforge.plantuml.ugraphic.tikz;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
+import net.sourceforge.plantuml.graphic.FontStyle;
+import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.tikz.TikzGraphics;
import net.sourceforge.plantuml.ugraphic.ColorMapper;
import net.sourceforge.plantuml.ugraphic.UDriver;
+import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UParam;
import net.sourceforge.plantuml.ugraphic.UShape;
import net.sourceforge.plantuml.ugraphic.UText;
public class DriverUTextTikz implements UDriver<TikzGraphics> {
- public void draw(UShape shape, double x, double y, ColorMapper mapper, UParam param, TikzGraphics tikz) {
- final UText text = (UText) shape;
-
- tikz.text(x, y, text.getText());
+ public void draw(UShape ushape, double x, double y, ColorMapper mapper, UParam param, TikzGraphics tikz) {
+ final UText shape = (UText) ushape;
+ final FontConfiguration fontConfiguration = shape.getFontConfiguration();
+ final UFont font = fontConfiguration.getFont();
+ final HtmlColor col = fontConfiguration.getColor();
+ tikz.setStrokeColor(mapper.getMappedColor(col));
+ final boolean underline = fontConfiguration.containsStyle(FontStyle.UNDERLINE);
+ final boolean italic = font.isItalic();
+ final boolean bold = font.isBold();
+ tikz.text(x, y, shape.getText(), underline, italic, bold);
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/tikz/UGraphicTikz.java b/src/net/sourceforge/plantuml/ugraphic/tikz/UGraphicTikz.java
index 8efac5a..cd85031 100644
--- a/src/net/sourceforge/plantuml/ugraphic/tikz/UGraphicTikz.java
+++ b/src/net/sourceforge/plantuml/ugraphic/tikz/UGraphicTikz.java
@@ -38,6 +38,7 @@ import java.io.IOException;
import java.io.OutputStream;
import net.sourceforge.plantuml.FileFormat;
+import net.sourceforge.plantuml.TikzFontDistortion;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.creole.AtomText;
import net.sourceforge.plantuml.graphic.StringBounder;
@@ -61,16 +62,19 @@ import net.sourceforge.plantuml.ugraphic.UText;
public class UGraphicTikz extends AbstractUGraphic<TikzGraphics> implements ClipContainer, UGraphic2 {
private final StringBounder stringBounder;
+ private final TikzFontDistortion tikzFontDistortion;
- private UGraphicTikz(ColorMapper colorMapper, TikzGraphics tikz) {
+ private UGraphicTikz(ColorMapper colorMapper, TikzGraphics tikz, TikzFontDistortion tikzFontDistortion) {
super(colorMapper, tikz);
- this.stringBounder = FileFormat.PNG.getDefaultStringBounder();
+ this.tikzFontDistortion = tikzFontDistortion;
+ this.stringBounder = FileFormat.LATEX.getDefaultStringBounder(tikzFontDistortion);
register();
}
- public UGraphicTikz(ColorMapper colorMapper, double scale, boolean withPreamble) {
- this(colorMapper, new TikzGraphics(scale, withPreamble));
+ public UGraphicTikz(ColorMapper colorMapper, double scale, boolean withPreamble,
+ TikzFontDistortion tikzFontDistortion) {
+ this(colorMapper, new TikzGraphics(scale, withPreamble), tikzFontDistortion);
}
@@ -81,6 +85,7 @@ public class UGraphicTikz extends AbstractUGraphic<TikzGraphics> implements Clip
private UGraphicTikz(UGraphicTikz other) {
super(other);
+ this.tikzFontDistortion = other.tikzFontDistortion;
this.stringBounder = other.stringBounder;
register();
}
@@ -96,7 +101,8 @@ public class UGraphicTikz extends AbstractUGraphic<TikzGraphics> implements Clip
registerDriver(UImageSvg.class, new DriverNoneTikz());
registerDriver(UPath.class, new DriverUPathTikz());
registerDriver(DotPath.class, new DriverDotPathTikz());
- registerDriver(UCenteredCharacter.class, new DriverCenteredCharacterTikz());
+ // registerDriver(UCenteredCharacter.class, new DriverCenteredCharacterTikz());
+ registerDriver(UCenteredCharacter.class, new DriverCenteredCharacterTikz2());
}
public StringBounder getStringBounder() {
diff --git a/src/net/sourceforge/plantuml/ugraphic/txt/UGraphicTxt.java b/src/net/sourceforge/plantuml/ugraphic/txt/UGraphicTxt.java
index 801a537..56ea48a 100644
--- a/src/net/sourceforge/plantuml/ugraphic/txt/UGraphicTxt.java
+++ b/src/net/sourceforge/plantuml/ugraphic/txt/UGraphicTxt.java
@@ -35,8 +35,12 @@
package net.sourceforge.plantuml.ugraphic.txt;
import java.awt.geom.Dimension2D;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintStream;
import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.FileFormat;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.asciiart.TextStringBounder;
import net.sourceforge.plantuml.asciiart.TranslatedCharArea;
@@ -47,11 +51,12 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.AbstractCommonUGraphic;
import net.sourceforge.plantuml.ugraphic.ClipContainer;
import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
+import net.sourceforge.plantuml.ugraphic.UGraphic2;
import net.sourceforge.plantuml.ugraphic.UImage;
import net.sourceforge.plantuml.ugraphic.UShape;
import net.sourceforge.plantuml.ugraphic.UText;
-public class UGraphicTxt extends AbstractCommonUGraphic implements ClipContainer {
+public class UGraphicTxt extends AbstractCommonUGraphic implements ClipContainer, UGraphic2 {
private final UmlCharArea charArea;
@@ -81,15 +86,16 @@ public class UGraphicTxt extends AbstractCommonUGraphic implements ClipContainer
final int y = ((int) (getTranslateY() + txt.getDescent())) / 10;
if (txt.getFontConfiguration().containsStyle(FontStyle.WAVE)) {
charArea.drawHLine('^', y, getDx(), txt.getText().length());
- charArea.drawStringLR(txt.getText(), 0, y + 1);
+ charArea.drawStringLR(txt.getText(), getDx(), y + 1);
} else {
- charArea.drawStringLR(txt.getText(), 0, y);
+ charArea.drawStringLR(txt.getText(), getDx(), y);
}
return;
} else if (shape instanceof UImage) {
return;
}
- throw new UnsupportedOperationException("cl=" + shape.getClass());
+ return;
+ // throw new UnsupportedOperationException("cl=" + shape.getClass());
}
public final UmlCharArea getCharArea() {
@@ -114,4 +120,9 @@ public class UGraphicTxt extends AbstractCommonUGraphic implements ClipContainer
return new Dimension2DDouble(0, 0);
}
+ public void writeImageTOBEMOVED(OutputStream os, String metadata, int dpi) throws IOException {
+ final PrintStream ps = new PrintStream(os, true, "UTF-8");
+ getCharArea().print(ps);
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/visio/UGraphicVdx.java b/src/net/sourceforge/plantuml/ugraphic/visio/UGraphicVdx.java
index dbe5954..b7d4262 100644
--- a/src/net/sourceforge/plantuml/ugraphic/visio/UGraphicVdx.java
+++ b/src/net/sourceforge/plantuml/ugraphic/visio/UGraphicVdx.java
@@ -38,6 +38,7 @@ import java.io.IOException;
import java.io.OutputStream;
import net.sourceforge.plantuml.FileFormat;
+import net.sourceforge.plantuml.TikzFontDistortion;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.creole.AtomText;
import net.sourceforge.plantuml.graphic.StringBounder;
@@ -61,9 +62,13 @@ public class UGraphicVdx extends AbstractUGraphic<VisioGraphics> implements Clip
private final StringBounder stringBounder;
+ public double dpiFactor() {
+ return 1;
+ }
+
private UGraphicVdx(ColorMapper colorMapper, VisioGraphics visio) {
super(colorMapper, visio);
- this.stringBounder = FileFormat.PNG.getDefaultStringBounder();
+ this.stringBounder = FileFormat.PNG.getDefaultStringBounder(TikzFontDistortion.getDefault());
register();
}
diff --git a/src/net/sourceforge/plantuml/utils/Cypher.java b/src/net/sourceforge/plantuml/utils/Cypher.java
new file mode 100644
index 0000000..6588a2a
--- /dev/null
+++ b/src/net/sourceforge/plantuml/utils/Cypher.java
@@ -0,0 +1,98 @@
+/* ========================================================================
+ * 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.utils;
+
+import java.security.SecureRandom;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class Cypher {
+
+ final private static Pattern p = Pattern.compile("[\\p{L}\\p{N}]+");
+
+ private final SecureRandom rnd = new SecureRandom();
+ private final Map<String, String> convert = new HashMap<String, String>();
+ private final Set<String> except = new HashSet<String>();
+
+ public synchronized String cypher(String s) {
+
+ final Matcher m = p.matcher(s);
+ final StringBuffer sb = new StringBuffer();
+ while (m.find()) {
+ final String word = m.group(0);
+ m.appendReplacement(sb, changeWord(word));
+ }
+ m.appendTail(sb);
+
+ return sb.toString();
+ }
+
+ private String changeWord(final String word) {
+ final String lower = word.toLowerCase();
+ if (except.contains(lower) || lower.matches("^[a-f0-9]{6}$")) {
+ return word;
+ }
+ String res = convert.get(word);
+ if (res != null) {
+ return res;
+ }
+ int len = word.length();
+ if (len < 4) {
+ len = 4;
+ }
+ while (true) {
+ final StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < len; i++) {
+ final char letter = (char) ('a' + rnd.nextInt(26));
+ sb.append(letter);
+ }
+ res = sb.toString();
+ if (convert.containsValue(res) == false) {
+ convert.put(word, res);
+ return res;
+ }
+ }
+ }
+
+ public void addException(String word) {
+ except.add(word.toLowerCase());
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/utils/StartUtils.java b/src/net/sourceforge/plantuml/utils/StartUtils.java
index 8381272..979886e 100644
--- a/src/net/sourceforge/plantuml/utils/StartUtils.java
+++ b/src/net/sourceforge/plantuml/utils/StartUtils.java
@@ -106,6 +106,11 @@ public class StartUtils {
return startsWithSymbolAnd("unpause", s2);
}
+ public static boolean isExit(CharSequence s) {
+ final String s2 = StringUtils.trinNoTrace(s);
+ return s2.equals("!exit");
+ }
+
private static final Pattern2 append = MyPattern.cmpile("^\\W*[@\\\\]append");
public static CharSequence2 getPossibleAppend(CharSequence2 s) {
diff --git a/src/net/sourceforge/plantuml/version/IteratorCounter2.java b/src/net/sourceforge/plantuml/version/IteratorCounter2.java
index 8c83340..9283e25 100644
--- a/src/net/sourceforge/plantuml/version/IteratorCounter2.java
+++ b/src/net/sourceforge/plantuml/version/IteratorCounter2.java
@@ -48,4 +48,6 @@ public interface IteratorCounter2 extends Iterator<CharSequence2> {
public CharSequence2 peekPrevious();
+ public void copyStateFrom(IteratorCounter2 other);
+
}
diff --git a/src/net/sourceforge/plantuml/version/IteratorCounter2Impl.java b/src/net/sourceforge/plantuml/version/IteratorCounter2Impl.java
index 5e299ac..1ff9c92 100644
--- a/src/net/sourceforge/plantuml/version/IteratorCounter2Impl.java
+++ b/src/net/sourceforge/plantuml/version/IteratorCounter2Impl.java
@@ -40,9 +40,15 @@ import net.sourceforge.plantuml.CharSequence2;
public class IteratorCounter2Impl implements IteratorCounter2 {
- private final List<CharSequence2> data;
+ private List<CharSequence2> data;
private int nb;
+ public void copyStateFrom(IteratorCounter2 other) {
+ final IteratorCounter2Impl source = (IteratorCounter2Impl) other;
+ this.nb = source.nb;
+ this.data = source.data;
+ }
+
public IteratorCounter2Impl(List<CharSequence2> data) {
this(data, 0);
}
diff --git a/src/net/sourceforge/plantuml/version/License.java b/src/net/sourceforge/plantuml/version/License.java
index 90090a5..6d7a0e3 100644
--- a/src/net/sourceforge/plantuml/version/License.java
+++ b/src/net/sourceforge/plantuml/version/License.java
@@ -34,6 +34,7 @@
*/
package net.sourceforge.plantuml.version;
+import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -48,81 +49,81 @@ public enum License {
return GPL;
}
- private void addMit(final List<String> text) {
+ private void addMit(final LicenseInfo licenseInfo, final List<String> text) {
text.add("PlantUML is free software; you can redistribute it and/or modify it");
text.add("under the terms of the MIT License.");
- text.add("");
+ text.add(" ");
text.add("See http://opensource.org/licenses/MIT");
- text.add("");
+ text.add(" ");
text.add("Permission is hereby granted, free of charge, to any person obtaining");
text.add("a copy of this software and associated documentation files (the \"Software\"),");
text.add("to deal in the Software without restriction, including without limitation");
text.add("the rights to use, copy, modify, merge, publish, distribute, sublicense,");
text.add("and/or sell copies of the Software, and to permit persons to whom the");
text.add("Software is furnished to do so, subject to the following conditions:");
- text.add("");
+ text.add(" ");
text.add("The above copyright notice and this permission notice shall be included");
text.add("in all copies or substantial portions of the Software.");
- text.add("");
+ text.add(" ");
text.add("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS");
text.add("OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,");
text.add("FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE");
text.add("AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,");
text.add("WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR");
text.add("IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.");
- text.add("");
- addSupplementary(text);
+ text.add(" ");
+ addSupplementary(licenseInfo, text);
text.add("the MIT License.");
- text.add("");
+ text.add(" ");
text.add("The generated images can then be used without any reference to the MIT License.");
text.add("It is not even necessary to stipulate that they have been generated with PlantUML,");
text.add("also this will be appreciate by PlantUML team.");
- text.add("");
+ text.add(" ");
text.add("There is an exception : if the textual description in PlantUML language is also covered");
text.add("by a license (like the MIT), then the generated images are logically covered");
text.add("by the very same license.");
}
- private void addEpl(final List<String> text) {
+ private void addEpl(final LicenseInfo licenseInfo, final List<String> text) {
text.add("PlantUML is free software; you can redistribute it and/or modify it");
text.add("under the terms of the Eclipse Public License.");
- text.add("");
+ text.add(" ");
text.add("THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC");
text.add("LICENSE (\"AGREEMENT\"). [Eclipse Public License - v 1.0]");
- text.add("");
+ text.add(" ");
text.add("ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES");
text.add("RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.");
- text.add("");
+ text.add(" ");
text.add("You may obtain a copy of the License at");
- text.add("");
+ text.add(" ");
text.add("http://www.eclipse.org/legal/epl-v10.html");
- text.add("");
+ text.add(" ");
text.add("Unless required by applicable law or agreed to in writing, software");
text.add("distributed under the License is distributed on an \"AS IS\" BASIS,");
text.add("WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.");
text.add("See the License for the specific language governing permissions and");
text.add("limitations under the License.");
- text.add("");
- addSupplementary(text);
+ text.add(" ");
+ addSupplementary(licenseInfo, text);
text.add("the Eclipse Public License.");
- text.add("");
+ text.add(" ");
text.add("The generated images can then be used without any reference to the Eclipse Public License.");
text.add("It is not even necessary to stipulate that they have been generated with PlantUML,");
text.add("also this will be appreciate by PlantUML team.");
- text.add("");
+ text.add(" ");
text.add("There is an exception : if the textual description in PlantUML language is also covered");
text.add("by a license (like the EPL), then the generated images are logically covered");
text.add("by the very same license.");
}
- private void addBsd(final List<String> text) {
+ private void addBsd(final LicenseInfo licenseInfo, final List<String> text) {
text.add("PlantUML is free software; you can redistribute it and/or modify it");
text.add("under the terms of the Revised BSD License.");
- text.add("");
+ text.add(" ");
text.add("All rights reserved.");
text.add("Redistribution and use in source and binary forms, with or without");
text.add("modification, are permitted provided that the following conditions are met:");
- text.add("");
+ text.add(" ");
text.add("* Redistributions of source code must retain the above copyright");
text.add(" notice, this list of conditions and the following disclaimer.");
text.add("* Redistributions in binary form must reproduce the above copyright");
@@ -131,7 +132,7 @@ public enum License {
text.add("* Neither the name of the University of California, Berkeley nor the");
text.add(" names of its contributors may be used to endorse or promote products");
text.add(" derived from this software without specific prior written permission.");
- text.add("");
+ text.add(" ");
text.add("THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY");
text.add("EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED");
text.add("WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE");
@@ -142,159 +143,180 @@ public enum License {
text.add("ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT");
text.add("(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS");
text.add("SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.");
- text.add("");
- addSupplementary(text);
+ text.add(" ");
+ addSupplementary(licenseInfo, text);
text.add("the Eclipse Public License.");
- text.add("");
+ text.add(" ");
text.add("The generated images can then be used without any reference to the Eclipse Public License.");
text.add("It is not even necessary to stipulate that they have been generated with PlantUML,");
text.add("also this will be appreciate by PlantUML team.");
- text.add("");
+ text.add(" ");
text.add("There is an exception : if the textual description in PlantUML language is also covered");
text.add("by a license (like the BSD), then the generated images are logically covered");
text.add("by the very same license.");
}
- private void addApache(final List<String> text) {
+ private void addApache(final LicenseInfo licenseInfo, final List<String> text) {
text.add("PlantUML is free software; you can redistribute it and/or modify it");
text.add("under the terms of the Apache Software License.");
- text.add("");
+ text.add(" ");
text.add("Licensed under the Apache License, Version 2.0 (the \"License\");");
text.add("you may not use this file except in compliance with the License.");
text.add("You may obtain a copy of the License at");
- text.add("");
+ text.add(" ");
text.add("http://www.apache.org/licenses/LICENSE-2.0");
- text.add("");
+ text.add(" ");
text.add("Unless required by applicable law or agreed to in writing, software");
text.add("distributed under the License is distributed on an \"AS IS\" BASIS,");
text.add("WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.");
text.add("See the License for the specific language governing permissions and");
text.add("limitations under the License.");
- text.add("");
- addSupplementary(text);
+ text.add(" ");
+ addSupplementary(licenseInfo, text);
text.add("the Apache license.");
- text.add("");
+ text.add(" ");
text.add("The generated images can then be used without any reference to the Apache license.");
text.add("It is not even necessary to stipulate that they have been generated with PlantUML,");
text.add("also this will be appreciate by PlantUML team.");
- text.add("");
+ text.add(" ");
text.add("There is an exception : if the textual description in PlantUML language is also covered");
text.add("by a license (like the Apache), then the generated images are logically covered");
text.add("by the very same license.");
}
- private void addGpl(final List<String> text) {
+ private void addGpl(final LicenseInfo licenseInfo, final List<String> text) {
text.add("PlantUML is free software; you can redistribute it and/or modify it");
text.add("under the terms of the GNU General Public License as published by");
text.add("the Free Software Foundation, either version 3 of the License, or");
text.add("(at your option) any later version.");
- text.add("");
+ text.add(" ");
text.add("PlantUML distributed in the hope that it will be useful, but");
text.add("WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY");
text.add("or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public");
text.add("License for more details.");
- text.add("");
+ text.add(" ");
text.add("You should have received a copy of the GNU General Public");
text.add("License along with this library; if not, write to the Free Software");
text.add("Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,");
text.add("USA.");
- text.add("");
- addSupplementary(text);
+ text.add(" ");
+ addSupplementary(licenseInfo, text);
text.add("the GPL license.");
- text.add("");
+ text.add(" ");
text.add("The generated images can then be used without any reference to the GPL license.");
text.add("It is not even necessary to stipulate that they have been generated with PlantUML,");
text.add("also this will be appreciate by PlantUML team.");
- text.add("");
+ text.add(" ");
text.add("There is an exception : if the textual description in PlantUML language is also covered");
text.add("by a license (like the GPL), then the generated images are logically covered");
text.add("by the very same license.");
}
- private void addGplV2(final List<String> text) {
+ private void addGplV2(final LicenseInfo licenseInfo, final List<String> text) {
text.add("PlantUML is free software; you can redistribute it and/or modify it");
text.add("under the terms of the GNU General Public License as published by");
text.add("the Free Software Foundation, either version 2 of the License, or");
text.add("(at your option) any later version.");
- text.add("");
+ text.add(" ");
text.add("PlantUML distributed in the hope that it will be useful, but");
text.add("WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY");
text.add("or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public");
text.add("License for more details.");
- text.add("");
+ text.add(" ");
text.add("You should have received a copy of the GNU General Public");
text.add("License along with this library; if not, write to the Free Software");
text.add("Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,");
text.add("USA.");
- text.add("");
- addSupplementary(text);
+ text.add(" ");
+ addSupplementary(licenseInfo, text);
text.add("the GPL license.");
- text.add("");
+ text.add(" ");
text.add("The generated images can then be used without any reference to the GPL license.");
text.add("It is not even necessary to stipulate that they have been generated with PlantUML,");
text.add("also this will be appreciate by PlantUML team.");
- text.add("");
+ text.add(" ");
text.add("There is an exception : if the textual description in PlantUML language is also covered");
text.add("by a license (like the GPL), then the generated images are logically covered");
text.add("by the very same license.");
}
- private void addLgpl(final List<String> text) {
+ private void addLgpl(final LicenseInfo licenseInfo, final List<String> text) {
text.add("PlantUML is free software; you can redistribute it and/or modify it");
text.add("under the terms of the GNU Lesser General Public License as published by");
text.add("the Free Software Foundation, either version 3 of the License, or");
text.add("(at your option) any later version.");
- text.add("");
+ text.add(" ");
text.add("PlantUML distributed in the hope that it will be useful, but");
text.add("WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY");
text.add("or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public");
text.add("License for more details.");
- text.add("");
+ text.add(" ");
text.add("You should have received a copy of the GNU Lesser General Public");
text.add("License along with this library; if not, write to the Free Software");
text.add("Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,");
text.add("USA.");
- text.add("");
- addSupplementary(text);
+ text.add(" ");
+ addSupplementary(licenseInfo, text);
text.add("the LGPL license.");
- text.add("");
+ text.add(" ");
text.add("The generated images can then be used without any reference to the LGPL license.");
text.add("It is not even necessary to stipulate that they have been generated with PlantUML,");
text.add("although this will be appreciate by PlantUML team.");
- text.add("");
+ text.add(" ");
text.add("There is an exception : if the textual description in PlantUML language is also covered");
text.add("by a license (like the LGPL), then the generated images are logically covered");
text.add("by the very same license.");
}
- private void addSupplementary(final List<String> text) {
- text.add("PlantUML can occasionally display sponsored or advertising messages. Those");
- text.add("messages are usually generated on welcome or error images and never on");
- text.add("functional diagrams.");
- text.add(" ");
+ private void addSupplementary(final LicenseInfo licenseInfo, final List<String> text) {
+ if (licenseInfo.isValid() == false) {
+ text.add("PlantUML can occasionally display sponsored or advertising messages. Those");
+ text.add("messages are usually generated on welcome or error images and never on");
+ text.add("functional diagrams.");
+ text.add(" ");
+ }
text.add("Images (whatever their format : PNG, SVG, EPS...) generated by running PlantUML");
text.add("are owned by the author of their corresponding sources code (that is, their");
text.add("textual description in PlantUML language). Those images are not covered by");
}
- private List<String> getHeaderStart() {
+ private List<String> getHeaderStart(LicenseInfo licenseInfo) {
final List<String> text = new ArrayList<String>();
- text.add("========================================================================");
- text.add("PlantUML : a free UML diagram generator");
- text.add("========================================================================");
- text.add("");
+ if (licenseInfo.isNone()) {
+ text.add("========================================================================");
+ text.add("PlantUML : a free UML diagram generator");
+ text.add("========================================================================");
+ text.add(" ");
+ } else {
+ text.add("========================================================================");
+ text.add("This is PlantUML Professional Edition");
+ text.add("========================================================================");
+ addLicenseInfo(text, licenseInfo);
+ text.add("========================================================================");
+ text.add(" ");
+ }
text.add("(C) Copyright 2009-2017, Arnaud Roques");
- text.add("");
+ text.add(" ");
text.add("Project Info: http://plantuml.com");
- text.add("");
- text.add("If you like this project or if you find it useful, you can support us at:");
- text.add("");
- text.add("http://plantuml.com/patreon (only 1$ per month!)");
- text.add("http://plantuml.com/paypal");
- text.add("");
+ text.add(" ");
+ if (licenseInfo.isValid() == false) {
+ text.add("If you like this project or if you find it useful, you can support us at:");
+ text.add(" ");
+ text.add("http://plantuml.com/patreon (only 1$ per month!)");
+ text.add("http://plantuml.com/paypal");
+ text.add(" ");
+ }
return text;
}
+ public static void addLicenseInfo(final List<String> text, LicenseInfo licenseInfo) {
+ text.add("LICENSED TO : " + licenseInfo.getOwner());
+ text.add("EXPIRATION DATE : " + DateFormat.getDateInstance().format(licenseInfo.getExpirationDate()));
+ if (licenseInfo.hasExpired()) {
+ text.add("<i>Warning: Your license has expired.");
+ }
+ }
+
public List<String> getJavaHeader() {
final List<String> h = new ArrayList<String>();
h.add("/* ========================================================================");
@@ -430,36 +452,40 @@ public enum License {
}
public List<String> getText() {
- final List<String> text = getHeaderStart();
+ final LicenseInfo licenseInfo = LicenseInfo.retrieveSlow();
+ final List<String> text = getHeaderStart(licenseInfo);
if (this == License.GPL) {
- addGpl(text);
+ addGpl(licenseInfo, text);
} else if (this == License.GPLV2) {
- addGplV2(text);
+ addGplV2(licenseInfo, text);
} else if (this == License.MIT) {
- addMit(text);
+ addMit(licenseInfo, text);
} else if (this == License.EPL) {
- addEpl(text);
+ addEpl(licenseInfo, text);
} else if (this == License.BSD) {
- addBsd(text);
+ addBsd(licenseInfo, text);
} else if (this == License.APACHE) {
- addApache(text);
+ addApache(licenseInfo, text);
} else if (this == License.LGPL) {
- addLgpl(text);
+ addLgpl(licenseInfo, text);
} else {
throw new IllegalStateException();
}
if (OptionFlags.getInstance().isEnableStats()) {
- text.add("");
+ text.add(" ");
text.add("This version of PlantUML records general local statistics about usage.");
text.add("(more info on http://plantuml.com/statistics-report)");
}
- text.add("");
+ text.add(" ");
text.add("Icons provided by OpenIconic : https://useiconic.com/open");
text.add("Archimate sprites provided by Archi : http://www.archimatetool.com");
+ text.add("Stdlib AWS provided by https://github.com/milo-minderbinder/AWS-PlantUML");
+ text.add("Stdlib Icons provided https://github.com/tupadr3/plantuml-icon-font-sprites");
text.add("ASCIIMathML (c) Peter Jipsen http://www.chapman.edu/~jipsen");
text.add("ASCIIMathML (c) David Lippman http://www.pierce.ctc.edu/dlippman");
- text.add("");
+ text.add("CafeUndZopfli ported by Eugene Klyuchnikov https://github.com/eustas/CafeUndZopfli");
+ text.add("Brotli (c) by the Brotli Authors https://github.com/google/brotli");
+ text.add(" ");
return text;
}
-
}
diff --git a/src/net/sourceforge/plantuml/version/LicenseInfo.java b/src/net/sourceforge/plantuml/version/LicenseInfo.java
new file mode 100644
index 0000000..1f842c4
--- /dev/null
+++ b/src/net/sourceforge/plantuml/version/LicenseInfo.java
@@ -0,0 +1,221 @@
+/* ========================================================================
+ * 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.version;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.math.BigInteger;
+import java.security.NoSuchAlgorithmException;
+import java.util.Collection;
+import java.util.Date;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.prefs.BackingStoreException;
+import java.util.prefs.Preferences;
+
+import net.sourceforge.plantuml.Log;
+import net.sourceforge.plantuml.SignatureUtils;
+import net.sourceforge.plantuml.dedication.Dedication;
+import net.sourceforge.plantuml.dedication.QBlock;
+
+public class LicenseInfo {
+
+ private final static Preferences prefs = Preferences.userNodeForPackage(LicenseInfo.class);
+ private final static LicenseInfo NONE = new LicenseInfo();
+
+ public static final int POS_TYPE = 2;
+ public static final int POS_SIGNATURE = 10;
+ public static final int POS_GENERATION = 100;
+ public static final int POS_EXPIRATION = 108;
+ public static final int POS_OWNER = 128;
+
+ private final long generationDate;
+ private final long expirationDate;
+ private final String owner;
+
+ private LicenseInfo() {
+ this.expirationDate = 0;
+ this.generationDate = 0;
+ this.owner = null;
+ }
+
+ private LicenseInfo(Magic magic) throws NoSuchAlgorithmException, IOException {
+ final String signature = SignatureUtils.toHexString(magic.get(LicenseInfo.POS_SIGNATURE, 64));
+ final String local = SignatureUtils.toHexString(Magic.signature());
+ if (local.equals(signature) == false) {
+ throw new IOException();
+ }
+ final int type = magic.getByte(Magic.signature(), LicenseInfo.POS_TYPE);
+ this.generationDate = bytesToLong(magic.get(LicenseInfo.POS_GENERATION, 8));
+ this.expirationDate = bytesToLong(magic.get(LicenseInfo.POS_EXPIRATION, 8));
+ this.owner = magic.getString(LicenseInfo.POS_OWNER);
+ }
+
+ public static long bytesToLong(byte[] b) {
+ long result = 0;
+ for (int i = 0; i < 8; i++) {
+ result <<= 8;
+ result |= (b[i] & 0xFF);
+ }
+ return result;
+ }
+
+ public static void persistMe(String key) throws BackingStoreException {
+ prefs.sync();
+ prefs.put("license", key);
+ }
+
+ private static LicenseInfo cache;
+
+ public static synchronized LicenseInfo retrieveQuick() {
+ if (cache == null) {
+ return retrieveSlow();
+ }
+ return cache;
+ }
+
+ public static synchronized LicenseInfo retrieveSlow() {
+ cache = LicenseInfo.NONE;
+ final String key = prefs.get("license", "");
+ if (key.length() > 0) {
+ cache = setIfValid(retrieve(key), cache);
+ if (cache.isValid()) {
+ return cache;
+ }
+ }
+ for (File f : fileCandidates()) {
+ try {
+ if (f.exists() && f.canRead()) {
+ final LicenseInfo result = retrieve(f);
+ cache = setIfValid(result, cache);
+ if (cache.isValid()) {
+ return cache;
+ }
+ }
+ } catch (IOException e) {
+ Log.info("Error " + e);
+ // e.printStackTrace();
+ }
+ }
+ return cache;
+ }
+
+ private static LicenseInfo setIfValid(LicenseInfo value, LicenseInfo def) {
+ if (value.isValid() || def.isNone()) {
+ return value;
+ }
+ return def;
+ }
+
+ private static LicenseInfo retrieve(File f) throws IOException {
+ final BufferedReader br = new BufferedReader(new FileReader(f));
+ final String s = br.readLine();
+ br.close();
+ final LicenseInfo result = retrieve(s);
+ if (result != null) {
+ Log.info("Reading license from " + f.getAbsolutePath());
+ }
+ return result;
+ }
+
+ public static LicenseInfo retrieve(final String key) {
+ if (key.matches("^[0-9a-z]+$")) {
+ try {
+ final BigInteger lu = new BigInteger(key, 36);
+ final QBlock qb2 = new QBlock(lu);
+ final QBlock qb3 = qb2.change(Dedication.E, Dedication.N);
+ final Magic magic = qb3.toMagic();
+
+ final String sig = SignatureUtils.toHexString(Magic.signature());
+ magic.xor(SignatureUtils.getSHA512raw(SignatureUtils.salting(sig, Magic.getSalt(sig))));
+ return new LicenseInfo(magic);
+ } catch (Exception e) {
+ // e.printStackTrace();
+ Log.info("Error " + e);
+ }
+ }
+ return LicenseInfo.NONE;
+ }
+
+ public static Collection<File> fileCandidates() {
+ final Set<File> result = new TreeSet<File>();
+ final String classpath = System.getProperty("java.class.path");
+ String[] classpathEntries = classpath.split(File.pathSeparator);
+ for (String s : classpathEntries) {
+ File dir = new File(s);
+ if (dir.isFile()) {
+ dir = dir.getParentFile();
+ }
+ if (dir.isDirectory()) {
+ result.add(new File(dir, "license.txt"));
+ }
+ }
+ return result;
+ }
+
+ public static void main(String[] args) {
+ LicenseInfo info = retrieveSlow();
+ System.err.println("valid=" + info.isValid());
+ System.err.println("info=" + info.owner);
+
+ }
+
+ public final Date getGenerationDate() {
+ return new Date(generationDate);
+ }
+
+ public final Date getExpirationDate() {
+ return new Date(expirationDate);
+ }
+
+ public final String getOwner() {
+ return owner;
+ }
+
+ public boolean isNone() {
+ return owner == null;
+ }
+
+ public boolean isValid() {
+ return owner != null && System.currentTimeMillis() <= this.expirationDate;
+ }
+
+ public boolean hasExpired() {
+ return owner != null && System.currentTimeMillis() > this.expirationDate;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/version/Magic.java b/src/net/sourceforge/plantuml/version/Magic.java
new file mode 100644
index 0000000..a5e7d2c
--- /dev/null
+++ b/src/net/sourceforge/plantuml/version/Magic.java
@@ -0,0 +1,192 @@
+/* ========================================================================
+ * 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.version;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.NetworkInterface;
+import java.security.NoSuchAlgorithmException;
+import java.util.Enumeration;
+import java.util.Random;
+
+import net.sourceforge.plantuml.OptionPrint;
+import net.sourceforge.plantuml.SignatureUtils;
+import net.sourceforge.plantuml.dedication.TurningBytes;
+
+public class Magic {
+
+ private final byte buffer[] = new byte[512];
+
+ @Override
+ public String toString() {
+ return SignatureUtils.toString(buffer);
+ }
+
+ public String toHexString() {
+ return SignatureUtils.toHexString(buffer);
+ }
+
+ private void xor(TurningBytes turningBytes) {
+ for (int i = 0; i < buffer.length; i++) {
+ buffer[i] ^= turningBytes.nextByte();
+ }
+ }
+
+ public void xor(byte[] key) {
+ xor(new TurningBytes(key));
+ }
+
+ public static Magic fromHexString(String s) {
+ if (s.length() != 1024) {
+ throw new IllegalArgumentException();
+ }
+ final Magic result = new Magic();
+ for (int i = 0; i < 512; i++) {
+ result.buffer[i] = (byte) (Integer.parseInt(s.substring(i * 2, i * 2 + 2), 16) & 0xFF);
+ }
+ return result;
+ }
+
+ public final byte[] getBuffer() {
+ return buffer;
+ }
+
+ public void setByte(byte[] shrink, int pos, int data) {
+ buffer[pos] = (byte) (0xFF & (data ^ shrink(shrink)));
+ }
+
+ public int getByte(byte[] shrink, int pos) {
+ return buffer[pos] ^ shrink(shrink);
+ }
+
+ public void set(int pos, byte[] data) {
+ for (int i = 0; i < data.length; i++) {
+ buffer[pos + i] = data[i];
+ }
+ }
+
+ public void setString(int pos, String s) throws UnsupportedEncodingException, NoSuchAlgorithmException {
+ final byte[] tmp = s.getBytes("UTF-8");
+ buffer[pos] = (byte) tmp.length;
+ set(pos + 1, tmp);
+ // set(pos + 1 + tmp.length, SignatureUtils.getSHA512raw(s));
+ }
+
+ public String getString(int pos) throws UnsupportedEncodingException, NoSuchAlgorithmException {
+ final int len = buffer[pos];
+ if (len < 0 || len > 127) {
+ throw new IllegalArgumentException();
+ }
+ final String result = new String(get(pos + 1, len), "UTF-8");
+ // if (isEquals(SignatureUtils.getSHA512raw(result), get(pos + 1 + len, 64)) == false) {
+ // throw new UnsupportedEncodingException();
+ // }
+ return result;
+ }
+
+ public byte[] get(int pos, int len) {
+ final byte result[] = new byte[len];
+ System.arraycopy(buffer, pos, result, 0, len);
+ return result;
+ }
+
+ private boolean isEquals(byte data1[], byte[] data2) {
+ if (data1.length != data2.length) {
+ return false;
+ }
+ for (int i = 0; i < data1.length; i++) {
+ if (data1[i] != data2[i]) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public static byte[] signature() throws IOException {
+ final String signature = OptionPrint.getHostName() + getMacAddress();
+ try {
+ return SignatureUtils.getSHA512raw(SignatureUtils.salting(signature, getSalt(signature)));
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new IOException();
+ }
+ }
+
+ public static byte shrink(byte data[]) {
+ byte result = 42;
+ for (byte b : data) {
+ result ^= b;
+ }
+ return result;
+ }
+
+ public static byte[] getSalt(final String signature) throws UnsupportedEncodingException {
+ final Random rnd = new Random(getSeed(signature.getBytes("UTF-8")));
+ final byte salt[] = new byte[512];
+ rnd.nextBytes(salt);
+ return salt;
+ }
+
+ private static long getSeed(byte[] bytes) {
+ long result = 19;
+ for (byte b : bytes) {
+ result = result * 41 + b;
+ }
+ return result;
+ }
+
+ private static String getMacAddress() throws IOException {
+
+ final Enumeration<NetworkInterface> net = NetworkInterface.getNetworkInterfaces();
+ final StringBuilder result = new StringBuilder();
+ while (net.hasMoreElements()) {
+ final NetworkInterface element = net.nextElement();
+ byte[] mac = element.getHardwareAddress();
+ if (mac != null) {
+ for (byte b : mac) {
+ result.append(String.format("%02x", b));
+ }
+ }
+ }
+ return result.toString();
+ }
+
+ public static void main(String[] args) throws IOException {
+ System.err.println(SignatureUtils.toHexString(signature()));
+ System.out.println("Mac: " + getMacAddress());
+
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/version/PSystemKeygen.java b/src/net/sourceforge/plantuml/version/PSystemKeygen.java
new file mode 100644
index 0000000..2693ac8
--- /dev/null
+++ b/src/net/sourceforge/plantuml/version/PSystemKeygen.java
@@ -0,0 +1,169 @@
+/* ========================================================================
+ * 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.version;
+
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.prefs.BackingStoreException;
+
+import net.sourceforge.plantuml.AbstractPSystem;
+import net.sourceforge.plantuml.FileFormatOption;
+import net.sourceforge.plantuml.SignatureUtils;
+import net.sourceforge.plantuml.core.DiagramDescription;
+import net.sourceforge.plantuml.core.ImageData;
+import net.sourceforge.plantuml.flashcode.FlashCodeFactory;
+import net.sourceforge.plantuml.flashcode.FlashCodeUtils;
+import net.sourceforge.plantuml.graphic.GraphicStrings;
+import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+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.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UImage;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class PSystemKeygen extends AbstractPSystem {
+
+ final private String key;
+
+ public PSystemKeygen(String key) {
+ this.key = key;
+ }
+
+ @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(new UDrawable() {
+ public void drawU(UGraphic ug) {
+ try {
+ drawInternal(ug);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ });
+ return imageBuilder.writeImageTOBEMOVED(fileFormat, seed, os);
+ }
+
+ public DiagramDescription getDescription() {
+ return new DiagramDescription("(Genkey)");
+ }
+
+ private void drawInternal(UGraphic ug) throws IOException {
+ if (key.length() == 0) {
+ drawFlash(ug);
+ return;
+ }
+ final LicenseInfo info = LicenseInfo.retrieve(key);
+ if (info.isNone()) {
+ drawFlash(ug);
+ return;
+ }
+ final List<String> strings = header();
+ strings.add("<u>Provided license information</u>:");
+ License.addLicenseInfo(strings, info);
+ strings.add(" ");
+ strings.add("========================================================================");
+ try {
+ LicenseInfo.persistMe(key);
+ } catch (BackingStoreException e) {
+ strings.add("<i>Error: Cannot store license key.</i>");
+ }
+
+ final LicenseInfo installed = LicenseInfo.retrieveSlow();
+ if (installed.isNone()) {
+ strings.add("No license currently installed.");
+ strings.add(" ");
+ strings.add("<b>Please copy license.txt to one of those files</b>:");
+ for (File f : LicenseInfo.fileCandidates()) {
+ strings.add(f.getAbsolutePath());
+ }
+ strings.add(" ");
+ } else {
+ strings.add("<u>Installed license</u>:");
+ License.addLicenseInfo(strings, installed);
+ strings.add(" ");
+ }
+
+ final TextBlock disp = GraphicStrings.createBlackOnWhite(strings);
+ disp.drawU(ug);
+ }
+
+ private ArrayList<String> header() {
+ final ArrayList<String> strings = new ArrayList<String>();
+ strings.add("<b>PlantUML version " + Version.versionString() + "</b> (" + Version.compileTimeString() + ")");
+ strings.add("(" + License.getCurrent() + " source distribution)");
+ strings.add("Loaded from " + Version.getJarPath());
+ strings.add(" ");
+ return strings;
+ }
+
+ public void drawFlash(UGraphic ug) throws IOException {
+ final List<String> strings = header();
+ strings.add("To get your <i>Professional Edition License</i>,");
+ strings.add("please send this flashcode to <b>plantuml@gmail.com</b> :");
+
+ TextBlock disp = GraphicStrings.createBlackOnWhite(strings);
+ disp.drawU(ug);
+
+ ug = ug.apply(new UTranslate(0, disp.calculateDimension(ug.getStringBounder()).getHeight()));
+ final FlashCodeUtils utils = FlashCodeFactory.getFlashCodeUtils();
+ final BufferedImage im = utils.exportFlashcode(Version.versionString() + "\n"
+ + SignatureUtils.toHexString(Magic.signature()));
+ final UImage flash = new UImage(im).scaleNearestNeighbor(4);
+ ug.draw(flash);
+
+ ug = ug.apply(new UTranslate(0, flash.getHeight()));
+
+ final LicenseInfo info = LicenseInfo.retrieveSlow();
+ if (info.isNone() == false) {
+ strings.clear();
+ strings.add("<u>Installed license</u>:");
+ License.addLicenseInfo(strings, info);
+ strings.add(" ");
+ disp = GraphicStrings.createBlackOnWhite(strings);
+ disp.drawU(ug);
+ }
+
+ }
+}
diff --git a/src/net/sourceforge/plantuml/version/PSystemVersion.java b/src/net/sourceforge/plantuml/version/PSystemVersion.java
index fc35f56..967bf93 100644
--- a/src/net/sourceforge/plantuml/version/PSystemVersion.java
+++ b/src/net/sourceforge/plantuml/version/PSystemVersion.java
@@ -62,8 +62,8 @@ import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.dot.GraphvizUtils;
import net.sourceforge.plantuml.graphic.GraphicPosition;
import net.sourceforge.plantuml.graphic.GraphicStrings;
-import net.sourceforge.plantuml.preproc.Preprocessor;
import net.sourceforge.plantuml.preproc.PreprocessorInclude;
+import net.sourceforge.plantuml.preproc.Stdlib;
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
@@ -173,6 +173,9 @@ public class PSystemVersion extends AbstractPSystem {
strings.add("plantuml.include.path: " + PreprocessorInclude.getenv("plantuml.include.path"));
}
strings.add(" ");
+ strings.add("<b>Stdlib:");
+ Stdlib.addInfoVersion(strings, false);
+ strings.add(" ");
strings.addAll(GraphvizUtils.getTestDotStrings(true));
strings.add(" ");
@@ -186,6 +189,14 @@ public class PSystemVersion extends AbstractPSystem {
return new PSystemVersion(true, strings);
}
+ public static PSystemVersion createStdLib() {
+ final List<String> strings = new ArrayList<String>();
+ Stdlib.addInfoVersion(strings, true);
+ strings.add(" ");
+
+ return new PSystemVersion(true, strings);
+ }
+
public static PSystemVersion createShowAuthors() {
// Duplicate in OptionPrint
final List<String> strings = getAuthorsStrings(true);
@@ -205,6 +216,9 @@ public class PSystemVersion extends AbstractPSystem {
add(strings, "<u>Official Eclipse Plugin</u>: Hallvard Tr\u00E6tteberg", withTag);
add(strings, "<u>Original Eclipse Plugin</u>: Claude Durif & Anne Pecoil", withTag);
add(strings, "<u>Servlet & XWiki</u>: Maxime Sinclair", withTag);
+ add(strings, "<u>Docker</u>: David Ducatel", withTag);
+ add(strings, "<u>AWS lib</u>: Chris Passarello", withTag);
+ add(strings, "<u>Stdlib Icons</u>: tupadr3", withTag);
add(strings, "<u>Site design</u>: Raphael Cotisson", withTag);
add(strings, "<u>Logo</u>: Benjamin Croizet", withTag);
diff --git a/src/net/sourceforge/plantuml/version/PSystemVersionFactory.java b/src/net/sourceforge/plantuml/version/PSystemVersionFactory.java
index 7b50286..a492e4f 100644
--- a/src/net/sourceforge/plantuml/version/PSystemVersionFactory.java
+++ b/src/net/sourceforge/plantuml/version/PSystemVersionFactory.java
@@ -53,12 +53,20 @@ public class PSystemVersionFactory extends PSystemSingleLineFactory {
if (line.matches("(?i)^version\\s*$")) {
return PSystemVersion.createShowVersion();
}
+ if (line.matches("(?i)^stdlib\\s*$")) {
+ return PSystemVersion.createStdLib();
+ }
if (line.matches("(?i)^testdot\\s*$")) {
return PSystemVersion.createTestDot();
}
if (line.matches("(?i)^checkversion\\s*$")) {
return PSystemVersion.createCheckVersions(null, null);
}
+ if (line.matches("(?i)^keygen(\\s+[0-9a-z]+)?\\s*$")) {
+ line = line.trim();
+ final String key = line.substring("keygen".length()).trim();
+ return new PSystemKeygen(key);
+ }
final Pattern p1 = Pattern.compile("(?i)^checkversion\\(proxy=([\\w.]+),port=(\\d+)\\)$");
final Matcher m1 = p1.matcher(line);
if (m1.matches()) {
@@ -79,5 +87,4 @@ public class PSystemVersionFactory extends PSystemSingleLineFactory {
}
return null;
}
-
}
diff --git a/src/net/sourceforge/plantuml/version/Professionnal.java b/src/net/sourceforge/plantuml/version/Professionnal.java
deleted file mode 100644
index edd9827..0000000
--- a/src/net/sourceforge/plantuml/version/Professionnal.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.version;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.DataInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Date;
-import java.util.prefs.Preferences;
-
-import net.sourceforge.plantuml.OptionPrint;
-import net.sourceforge.plantuml.dedication.DecoderInputStream;
-import net.sourceforge.plantuml.dedication.Dedication;
-import net.sourceforge.plantuml.dedication.QBlocks;
-
-public class Professionnal {
-
- final private static Preferences prefs = Preferences.userNodeForPackage(Professionnal.class);
-
- private final String hostname;
- private final String organization;
- private final String mail;
- private final Date date1;
- private final Date date2;
-
- private Professionnal(String hostname, String organization, String mail, int date1, int date2) {
- this.hostname = hostname;
- this.organization = organization;
- this.mail = mail;
- this.date1 = new Date(date1 * 1000L);
- this.date2 = new Date(date2 * 1000L);
- }
-
- public static Professionnal decodeNow(final String license) throws IOException {
- final QBlocks data = QBlocks.descodeAscii(license);
- final QBlocks decrypted = data.change(Dedication.E, Dedication.N);
-
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- decrypted.writeTo(baos, Dedication.SIZE);
- baos.close();
-
- final String hostname = OptionPrint.getHostName();
- InputStream source1 = null;
- try {
- source1 = new DecoderInputStream(new ByteArrayInputStream(baos.toByteArray()), hostname);
- final DataInputStream src = new DataInputStream(source1);
- final int version = src.readByte();
- if (version != 42) {
- throw new IOException();
- }
- final String host1 = src.readUTF();
- final String organization = src.readUTF();
- final String mail = src.readUTF();
- final int date1 = src.readInt();
- final int date2 = src.readInt();
-
- return new Professionnal(host1, organization, mail, date1, date2);
- } finally {
- if (source1 != null) {
- source1.close();
- }
- }
- }
-
- public String getHostname() {
- return hostname;
- }
-
- public String getMail() {
- return mail;
- }
-
- public String getOrganization() {
- return organization;
- }
-
- public Date getDate1() {
- return date1;
- }
-
- public Date getDate2() {
- return date2;
- }
-
-}
diff --git a/src/net/sourceforge/plantuml/version/Version.java b/src/net/sourceforge/plantuml/version/Version.java
index 702e4de..8bc63d1 100644
--- a/src/net/sourceforge/plantuml/version/Version.java
+++ b/src/net/sourceforge/plantuml/version/Version.java
@@ -43,7 +43,7 @@ public class Version {
private static final int MAJOR_SEPARATOR = 1000000;
public static int version() {
- return 1201715;
+ return 1201809;
}
public static int versionPatched() {
@@ -88,7 +88,7 @@ public class Version {
}
public static long compileTime() {
- return 1499100334843L;
+ return 1532710698423L;
}
public static String compileTimeString() {
diff --git a/src/net/sourceforge/plantuml/vizjs/GraphvizJs.java b/src/net/sourceforge/plantuml/vizjs/GraphvizJs.java
index fdde317..3035b6f 100644
--- a/src/net/sourceforge/plantuml/vizjs/GraphvizJs.java
+++ b/src/net/sourceforge/plantuml/vizjs/GraphvizJs.java
@@ -129,13 +129,17 @@ public class GraphvizJs implements Graphviz {
return true;
}
- public boolean modeSafe() {
+ public boolean useXLabelInsteadOfLabel() {
return modeSafe;
}
public boolean isVizjs() {
return true;
}
+
+ public boolean ignoreHorizontalLinks() {
+ return false;
+ }
};
}
diff --git a/src/net/sourceforge/plantuml/webp/Portraits.java b/src/net/sourceforge/plantuml/webp/Portraits.java
deleted file mode 100644
index 3c0145e..0000000
--- a/src/net/sourceforge/plantuml/webp/Portraits.java
+++ /dev/null
@@ -1,155 +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.webp;
-
-import java.io.DataInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.text.Normalizer;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Locale;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.regex.Pattern;
-
-import net.sourceforge.plantuml.version.PSystemVersion;
-
-public class Portraits {
-
- private final static List<Portrait> all = new ArrayList<Portrait>();
- private final static AtomicInteger current = new AtomicInteger();
-
- private static InputStream getInputStream() {
- return PSystemVersion.class.getResourceAsStream("out.png");
- }
-
- static {
- final InputStream is = getInputStream();
- if (is != null) {
- try {
- read(is);
- } catch (IOException e) {
- e.printStackTrace();
- } finally {
- try {
- is.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
-
- }
-
- private static void read(InputStream is) throws IOException {
- final DataInputStream dis = new DataInputStream(is);
- final int nb = dis.readShort();
- final List<String> names = new ArrayList<String>();
- final List<Integer> ages = new ArrayList<Integer>();
- final List<String> quotes = new ArrayList<String>();
- for (int i = 0; i < nb; i++) {
- names.add(dis.readUTF());
- ages.add((int) dis.readByte());
- quotes.add(dis.readUTF());
- }
- for (int i = 0; i < nb; i++) {
- final int len = dis.readShort();
- final byte data[] = new byte[len];
- dis.readFully(data);
- all.add(new Portrait(names.get(i), ages.get(i), quotes.get(i), data));
- }
- Collections.shuffle(all);
- }
-
- public static Portrait getOne() {
- if (all.size() == 0) {
- return null;
- }
- final int nb = current.get() % all.size();
- return all.get(nb);
- }
-
- public static void nextOne() {
- current.getAndIncrement();
- }
-
- public static Portrait getOne(String line) {
- Portrait candidat = null;
- for (Portrait p : all) {
- final int dist = similar(p.getName(), line);
- if (dist <= 3) {
- if (candidat != null && dist < similar(candidat.getName(), line)) {
- continue;
- }
- candidat = p;
- }
- }
- return candidat;
- }
-
- public static int similar(String s1, String s2) {
- final int[] tab1 = countLetter(s1);
- final int[] tab2 = countLetter(s2);
- int result = 0;
- for (int i = 0; i < tab1.length; i++) {
- result += Math.abs(tab1[i] - tab2[i]);
- }
- return result;
- }
-
- private static String noAccent(String str) {
- final String nfdNormalizedString = Normalizer.normalize(str, Normalizer.Form.NFD);
- final Pattern pattern = Pattern.compile("\\p{InCombiningDiacriticalMarks}+");
- return pattern.matcher(nfdNormalizedString).replaceAll("");
- }
-
- private static int[] countLetter(String s) {
- s = noAccent(s).toLowerCase(Locale.US);
- final int[] result = new int[26];
- for (int i = 0; i < s.length(); i++) {
- final char c = s.charAt(i);
- if (c >= 'a' && c <= 'z') {
- result[c - 'a']++;
- }
- }
- return result;
- }
-
- static final List<Portrait> getAll() {
- return all;
- }
-}
diff --git a/src/net/sourceforge/plantuml/webp/VP8Decoder.java b/src/net/sourceforge/plantuml/webp/VP8Decoder.java
index fa4b008..0a1ef96 100644
--- a/src/net/sourceforge/plantuml/webp/VP8Decoder.java
+++ b/src/net/sourceforge/plantuml/webp/VP8Decoder.java
@@ -30,8 +30,9 @@ public class VP8Decoder {
coefProbs = Globals.getDefaultCoefProbs();
}
- public void decodeFrame(ImageInputStream stream, boolean debug)
+ public void decodeFrame(ImageInputStream stream)
throws IOException {
+ final boolean debug = false;
coefProbs = Globals.getDefaultCoefProbs();
f = new VP8Frame(stream, coefProbs);
if (f.decodeFrame(debug)) {
@@ -52,27 +53,9 @@ public class VP8Decoder {
return f.getWidth();
}
- @SuppressWarnings("unused")
- private void writeFile(int[][] data) {
- FileOutputStream out;
- try {
- out = new FileOutputStream("outagain.raw");
- for (int y = 0; y < data[0].length; y++)
- for (int x = 0; x < data.length; x++) {
- out.write(data[x][y]);
- out.write(data[x][y]);
- out.write(data[x][y]);
- }
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
public void writePGMFile(String fileName, VP8Frame frame) {
-
FileOutputStream out;
try {
int[][] yData = frame.getYBuffer();
diff --git a/src/net/sourceforge/plantuml/zopfli/BlockSplitter.java b/src/net/sourceforge/plantuml/zopfli/BlockSplitter.java
new file mode 100644
index 0000000..e956394
--- /dev/null
+++ b/src/net/sourceforge/plantuml/zopfli/BlockSplitter.java
@@ -0,0 +1,159 @@
+/*
+Copyright 2014 Google Inc. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Author: eustas.ru@gmail.com (Eugene Klyuchnikov)
+*/
+
+package net.sourceforge.plantuml.zopfli;
+
+class BlockSplitter {
+
+ static int split(Cookie cookie, byte[] input, int from, int to) {
+ LzStore store = cookie.store1;
+ store.reset();
+ Deflate.greedy(cookie, null, input, from, to, store);
+
+ int nPoints = splitLz(cookie, store.litLens, store.dists, store.size);
+
+ int pos = from;
+ char[] dists = store.dists;
+ char[] litLens = store.litLens;
+ int[] points = cookie.splitPoints;
+
+ points[0] = pos;
+ for (int i = 0, j = 1; j <= nPoints; ++j) {
+ for (int pj = points[j]; i < pj; ++i) {
+ pos += (dists[i] == 0) ? 1 : litLens[i];
+ }
+ points[j] = pos;
+ }
+ return nPoints;
+ }
+
+ // TODO: May be use some kind of SORTED data-structure for splitPoints?
+ static int splitLz(Cookie cookie, char[] litLens, char[] dists, int llSize) {
+ int[] splitPoints = cookie.splitPoints;
+ int[] splitSize = cookie.splitSize;
+ splitPoints[0] = 0;
+ splitSize[0] = Deflate.calculateBlockSize(cookie, litLens, dists, 0, llSize);
+ splitPoints[1] = llSize;
+ splitSize[1] = -1;
+ int numBlocks = 1;
+ int maxBlocks = cookie.blockSplittingMax;
+
+ if (llSize < 10) {
+ return numBlocks;
+ }
+
+ int lStart = 0;
+ int lEnd = llSize;
+ int blockN = 0;
+ while (numBlocks < maxBlocks) {
+ int llPos = findMinimum(cookie, litLens, dists, lStart, lEnd);
+
+ int splitL = Deflate.calculateBlockSize(cookie, litLens, dists, lStart, llPos);
+ int splitR = Deflate.calculateBlockSize(cookie, litLens, dists, llPos, lEnd);
+
+ if (splitL + splitR > splitSize[blockN] || llPos == lStart + 1 || llPos == lEnd) {
+ splitSize[blockN] = -1;
+ } else {
+ splitSize[blockN] = splitL;
+ numBlocks++;
+ blockN++;
+ System.arraycopy(splitPoints, blockN, splitPoints, blockN + 1, numBlocks - blockN);
+ System.arraycopy(splitSize, blockN, splitSize, blockN + 1, numBlocks - blockN);
+ splitPoints[blockN] = llPos;
+ splitSize[blockN] = splitR;
+ }
+
+ int longest = 0;
+ boolean found = false;
+ for (int i = 0; i < numBlocks; i++) {
+ int start = splitPoints[i];
+ int end = splitPoints[i + 1];
+ if ((splitSize[i] != -1) && end - start > longest) {
+ lStart = start;
+ lEnd = end;
+ found = true;
+ longest = end - start;
+ blockN = i;
+ }
+ }
+ if (!found) {
+ break;
+ }
+
+ if (lEnd - lStart < 10) {
+ break;
+ }
+ }
+
+ return numBlocks;
+ }
+
+ private static int findMinimum(Cookie cookie, char[] litLens, char[] dists, int from, int to) {
+ int start = from + 1;
+ int end = to;
+ if (end - start < 1024) {
+ int best = Integer.MAX_VALUE;
+ int result = start;
+ for (int i = start; i < end; i++) {
+ int v = Deflate.calculateBlockSize(cookie, litLens, dists, from, i)
+ + Deflate.calculateBlockSize(cookie, litLens, dists, i, to);
+ if (v < best) {
+ best = v;
+ result = i;
+ }
+ }
+ return result;
+ } else {
+ int n = Cookie.SPLIT_PARTITIONS;
+ int[] p = cookie.p;
+ int[] vp = cookie.vp;
+ int lastBest = Integer.MAX_VALUE;
+ int pos = start;
+
+ while (true) {
+ if (end - start <= n) {
+ break;
+ }
+
+ for (int i = 0; i < n; i++) {
+ p[i] = start + (i + 1) * ((end - start) / (n + 1));
+ vp[i] = Deflate.calculateBlockSize(cookie, litLens, dists, from, p[i])
+ + Deflate.calculateBlockSize(cookie, litLens, dists, p[i], to);
+ }
+ int bestI = 0;
+ int best = vp[0];
+ for (int i = 1; i < n; i++) {
+ if (vp[i] < best) {
+ best = vp[i];
+ bestI = i;
+ }
+ }
+ if (best > lastBest) {
+ break;
+ }
+
+ start = bestI == 0 ? start : p[bestI - 1];
+ end = bestI == n - 1 ? end : p[bestI + 1];
+
+ pos = p[bestI];
+ lastBest = best;
+ }
+ return pos;
+ }
+ }
+}
diff --git a/src/net/sourceforge/plantuml/zopfli/Buffer.java b/src/net/sourceforge/plantuml/zopfli/Buffer.java
new file mode 100644
index 0000000..7d07e2b
--- /dev/null
+++ b/src/net/sourceforge/plantuml/zopfli/Buffer.java
@@ -0,0 +1,75 @@
+/*
+Copyright 2014 Google Inc. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Author: eustas.ru@gmail.com (Eugene Klyuchnikov)
+*/
+
+package net.sourceforge.plantuml.zopfli;
+
+public class Buffer {
+
+ byte[] data;
+ int size;
+ private int bp;
+
+ Buffer() {
+ data = new byte[65536];
+ }
+
+ public byte[] getData() {
+ return data;
+ }
+
+ public byte[] getResult() {
+ byte[] copy = new byte[size];
+ System.arraycopy(data,0,copy,0,size);
+ return copy;
+ }
+
+ public int getSize() {
+ return size;
+ }
+
+ void append(byte value) {
+ if (size == data.length) {
+ byte[] copy = new byte[size * 2];
+ System.arraycopy(data, 0, copy, 0, size);
+ data = copy;
+ }
+ data[size++] = value;
+ }
+
+ void addBits(int symbol, int length) {
+ for (int i = 0; i < length; i++) {
+ if (bp == 0) {
+ append((byte) 0);
+ }
+ int bit = (symbol >> i) & 1;
+ data[size - 1] |= bit << bp;
+ bp = (bp + 1) & 7;
+ }
+ }
+
+ void addHuffmanBits(int symbol, int length) {
+ for (int i = 0; i < length; i++) {
+ if (bp == 0) {
+ append((byte) 0);
+ }
+ int bit = (symbol >> (length - i - 1)) & 1;
+ data[size - 1] |= bit << bp;
+ bp = (bp + 1) & 7;
+ }
+ }
+}
diff --git a/src/net/sourceforge/plantuml/zopfli/Cookie.java b/src/net/sourceforge/plantuml/zopfli/Cookie.java
new file mode 100644
index 0000000..a26136d
--- /dev/null
+++ b/src/net/sourceforge/plantuml/zopfli/Cookie.java
@@ -0,0 +1,191 @@
+/*
+Copyright 2014 Google Inc. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Author: eustas.ru@gmail.com (Eugene Klyuchnikov)
+*/
+
+package net.sourceforge.plantuml.zopfli;
+
+class Cookie {
+
+ static class Node {
+ int weight;
+ Node tail;
+ int count;
+ }
+
+ static final int SPLIT_PARTITIONS = 9;
+ private static final int POOL_MAX = 10240;
+
+ final static int[] intZeroes = new int[65536];
+ final static char[] charZeroes = new char[65536];
+ final static byte[] byteZeroes = new byte[65536];
+ final static int[] intMOnes = new int[65536];
+ final static char[] charOnes = new char[65536];
+ final static long[] costMax = new long[65536];
+
+ static {
+ for (int i = 0; i < 64; ++i) {
+ intMOnes[i] = -1;
+ charOnes[i] = 1;
+ costMax[i] = Long.MAX_VALUE;
+ }
+ expand(intMOnes);
+ expand(charOnes);
+ expand(costMax);
+ }
+
+ static void expand(Object array) {
+ for (int i = 64; i < 65536; i = i + i) {
+ System.arraycopy(array, 0, array, i, i);
+ }
+ }
+
+ final Node[] list0 = new Node[15];
+ final Node[] list1 = new Node[15];
+ final Node[] leaves1 = new Node[288];
+ final Node[] leaves2 = new Node[288];
+ private final Node[] nodes = new Node[POOL_MAX];
+ private int nextNode;
+
+ //final Node[] leaves2 = new Node[288];
+
+ /*private final static Comparator<Node> wc = new Comparator<Node>() {
+ @Override
+ public int compare(Node node, Node node2) {
+ int r = node.weight - node2.weight;
+ return r == 0 ? node.count - node2.count : r;
+ }
+ };*/
+
+ final int[] i320a = new int[320];
+ final int[] i320b = new int[320];
+ final int[] i320c = new int[320];
+ final int[] i288a = new int[288];
+ final int[] i288b = new int[288];
+ final int[] i288c = new int[288];
+ final int[] i289a = new int[289];
+ final char[] c259a = new char[259];
+ final int[] i32a = new int[32];
+ final int[] i32b = new int[32];
+ final int[] i32c = new int[32];
+ final int[] i19a = new int[19];
+ final int[] i19b = new int[19];
+ final int[] i19c = new int[19];
+ final int[] i16a = new int[16];
+ final int[] i16b = new int[16];
+
+
+ final int[] p = new int[SPLIT_PARTITIONS];
+ final int[] vp = new int[SPLIT_PARTITIONS];
+
+ final char[] lengthArray; // unsigned short, but really values are 0..258 == MAX_MATCH
+ final long[] costs;
+ final char[] path;
+ final int[] splitPoints;
+ final int[] splitSize;
+
+
+ final SymbolStats stats = new SymbolStats();
+ final SymbolStats bestStats = new SymbolStats();
+ final SymbolStats lastStats = new SymbolStats();
+ final Hash h = new Hash();
+
+
+ int lenVal;
+ int distVal;
+ int rnd = 42;
+
+
+ final LzStore store1;
+ final LzStore store2;
+ final LongestMatchCache lmc;
+
+
+ final int masterBlockSize;
+
+ final Node node(int weight, int count, Node tail) {
+ Node result = nodes[nextNode++];
+ result.weight = weight;
+ result.count = count;
+ result.tail = tail;
+ return result;
+ }
+
+ final void resetPool() {
+ nextNode = 0;
+ }
+
+ static void fill0(int[] array, int length) {
+ int i = 0;
+ while (i < length) {
+ int j = i + 65536;
+ if (j > length) {
+ j = length;
+ }
+ System.arraycopy(intZeroes, 0, array, i, j - i);
+ i = j;
+ }
+ }
+
+ static void fill0(char[] array, int length) {
+ int i = 0;
+ while (i < length) {
+ int j = i + 65536;
+ if (j > length) {
+ j = length;
+ }
+ System.arraycopy(charZeroes, 0, array, i, j - i);
+ i = j;
+ }
+ }
+
+ static void fillCostMax(long[] array, int length) {
+ int i = 0;
+ while (i < length) {
+ int j = i + 65536;
+ if (j > length) {
+ j = length;
+ }
+ System.arraycopy(costMax, 0, array, i, j - i);
+ i = j;
+ }
+ }
+
+ /**
+ * Maximum amount of blocks to split into.
+ * <p/>
+ * {@code 0} for unlimited.
+ */
+ final int blockSplittingMax = 15;
+
+ Cookie(int masterBlockSize) { // TODO: + maxBlockSize?
+ this.masterBlockSize = masterBlockSize;
+
+ for (int i = 0; i < POOL_MAX; i++) {
+ nodes[i] = new Node();
+ }
+ splitPoints = new int[blockSplittingMax + 1];
+ splitSize = new int[blockSplittingMax + 1];
+
+ lengthArray = new char[masterBlockSize + 1]; // 2
+ costs = new long[masterBlockSize + 1]; // 8
+ path = new char[masterBlockSize + 1]; // 2
+ lmc = new LongestMatchCache(masterBlockSize); // 28
+ store1 = new LzStore(masterBlockSize); // 4
+ store2 = new LzStore(masterBlockSize); // 4
+ // 2 + 8 + 2 + 28 + 4 + 4 = 48
+ }
+}
diff --git a/src/net/sourceforge/plantuml/zopfli/Deflate.java b/src/net/sourceforge/plantuml/zopfli/Deflate.java
new file mode 100644
index 0000000..74a3b63
--- /dev/null
+++ b/src/net/sourceforge/plantuml/zopfli/Deflate.java
@@ -0,0 +1,796 @@
+/*
+Copyright 2014 Google Inc. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Author: eustas.ru@gmail.com (Eugene Klyuchnikov)
+*/
+
+package net.sourceforge.plantuml.zopfli;
+
+class Deflate {
+
+ static enum BlockType {
+ DYNAMIC,
+ FIXED
+ }
+
+ // final static int WINDOW_SIZE = 0x8000;
+ // final static int WINDOW_MASK = 0x7FFF;
+ // final static int MAX_MATCH = 258;
+ // final static int MIN_MATCH = 3;
+ // final static int MAX_CHAIN_HITS = 8192; // Should be less than WINDOW_SIZE
+
+ private static void getFixedTree(int[] llLengths, int[] dLengths) {
+ for (int i = 0; i < 144; i++) {
+ llLengths[i] = 8;
+ }
+ for (int i = 144; i < 256; i++) {
+ llLengths[i] = 9;
+ }
+ for (int i = 256; i < 280; i++) {
+ llLengths[i] = 7;
+ }
+ for (int i = 280; i < 288; i++) {
+ llLengths[i] = 8;
+ }
+ for (int i = 0; i < 32; i++) {
+ dLengths[i] = 5;
+ }
+ }
+
+ public static void greedy(Cookie cookie, LongestMatchCache lmc, byte[] input, int from, int to, LzStore store) {
+ Hash h = cookie.h;
+ h.init(input, Math.max(from - 0x8000, 0), from, to);
+ int prevLength = 0;
+ int prevMatch = 0;
+ char[] dummySubLen = cookie.c259a;
+ boolean matchAvailable = false;
+
+ for (int i = from; i < to; i++) {
+ h.updateHash(input, i, to);
+ findLongestMatch(cookie, lmc, from, h, input, i, to, 258, dummySubLen);
+ int len = cookie.lenVal;
+ int dist = cookie.distVal;
+ int lengthScore = dist > 1024 ? len - 1 : len;
+ int prevLengthScore = prevMatch > 1024 ? prevLength - 1 : prevLength;
+
+ if (matchAvailable) {
+ matchAvailable = false;
+ if (lengthScore > prevLengthScore + 1) {
+ store.append((char) (input[i - 1] & 0xFF), (char) 0);
+ if (lengthScore >= 3 && len < 258) {
+ matchAvailable = true;
+ prevLength = len;
+ prevMatch = dist;
+ continue;
+ }
+ } else {
+ store.append((char) prevLength, (char) prevMatch);
+ for (int j = 2; j < prevLength; j++) {
+ i++;
+ h.updateHash(input, i, to);
+ }
+ continue;
+ }
+ } else if (lengthScore >= 3 && len < 258) {
+ matchAvailable = true;
+ prevLength = len;
+ prevMatch = dist;
+ continue;
+ }
+
+ if (lengthScore >= 3) {
+ store.append((char) len, (char) dist);
+ } else {
+ len = 1;
+ store.append((char) (input[i] & 0xFF), (char) 0);
+ }
+ for (int j = 1; j < len; j++) {
+ i++;
+ h.updateHash(input, i, to);
+ }
+ }
+ }
+
+ static void findLongestMatch(Cookie cookie, LongestMatchCache lmc, int blockStart, Hash h, byte[] array,
+ int pos, int size, int limit, char[] subLen) {
+ //# WINDOW_SIZE = 0x8000
+ //# WINDOW_MASK = 0x7FFF
+ //# MIN_MATCH = 3
+ //# MAX_MATCH = 258
+
+ int offset = pos - blockStart;
+ char[] lmcLength = lmc != null ? lmc.length : null;
+ if (lmc != null && ((lmcLength[offset] == 0 || lmc.dist[offset] != 0))
+ && (limit == 258 || lmcLength[offset] <= limit
+ || subLen != null && lmc.maxCachedSubLen(offset) >= limit)) {
+ if (subLen == null || lmcLength[offset] <= lmc.maxCachedSubLen(offset)) {
+ cookie.lenVal = lmcLength[offset];
+ if (cookie.lenVal > limit) {
+ cookie.lenVal = limit;
+ }
+ if (subLen != null) {
+ lmc.cacheToSubLen(offset, cookie.lenVal, subLen);
+ cookie.distVal = subLen[cookie.lenVal];
+ } else {
+ cookie.distVal = lmc.dist[offset];
+ }
+ return;
+ }
+ limit = lmcLength[offset];
+ }
+
+ if (size - pos < 3) {
+ cookie.lenVal = 0;
+ cookie.distVal = 0;
+ return;
+ }
+
+ if (pos + limit > size) {
+ limit = size - pos;
+ }
+
+ int bestDist = 0;
+ int bestLength = 1;
+ int arrayEnd = pos + limit;
+ int chainCounter = 8192;
+ int[] hPrev = h.prev;
+ int[] hPrev2 = h.prev2;
+ int pp = h.head[h.val];
+ int threshold = h.same[pp];
+ int[] hashVal2 = h.hashVal2;
+ int marker = hashVal2[pp];
+ int p = hPrev[pp];
+ pp -= p;
+ int dist = pp > 0 ? pp : pp + 0x8000;
+
+ while (dist < 0x8000 && chainCounter > 0) {
+ int scan = pos;
+ int match = pos - dist;
+
+ if (array[scan + bestLength] == array[match + bestLength]) {
+ int same0 = h.same[pos & 0x7FFF];
+ if (same0 > 2 && array[scan] == array[match]) {
+ int same1 = h.same[match & 0x7FFF];
+ int same = same0 < same1 ? same0 : same1;
+ if (same > limit) {
+ same = limit;
+ }
+ scan += same;
+ match += same;
+ }
+ while (scan != arrayEnd && array[scan] == array[match]) {
+ scan++;
+ match++;
+ }
+ scan -= pos;
+
+ if (scan > bestLength) {
+ if (subLen != null) {
+ for (int j = bestLength + 1; j <= scan; j++) {
+ subLen[j] = (char) dist;
+ }
+ }
+ bestDist = dist;
+ bestLength = scan;
+ if (scan >= limit) {
+ break;
+ }
+ }
+ }
+
+ if (hPrev != hPrev2 && bestLength >= threshold && marker == hashVal2[p]) {
+ hPrev = hPrev2;
+ }
+
+ pp = p;
+ p = hPrev[p];
+ if (p == pp) {
+ break;
+ }
+ pp -= p;
+ dist += pp > 0 ? pp : 0x8000 + pp;
+
+ --chainCounter;
+ }
+
+ if (lmc != null && limit == 258 && subLen != null && lmcLength[offset] != 0 && lmc.dist[offset] == 0) {
+ if (bestLength < 3) {
+ lmc.dist[offset] = 0;
+ lmcLength[offset] = 0;
+ } else {
+ lmc.dist[offset] = (char)bestDist;
+ lmcLength[offset] = (char)bestLength;
+ }
+ lmc.subLenToCache(subLen, offset, bestLength);
+ }
+
+ cookie.distVal = bestDist;
+ cookie.lenVal = bestLength;
+ }
+
+ private static void deflatePart(Cookie cookie, Options options, byte[] input, int from, int to, boolean flush,
+ Buffer output) {
+ // assert from != to
+ switch (options.blockSplitting) {
+ case FIRST:
+ deflateSplittingFirst(cookie, options, flush, input, from, to, output);
+ break;
+
+ case LAST:
+ deflateSplittingLast(cookie, options, flush, input, from, to, output);
+ break;
+
+ case NONE:
+ deflateDynamicBlock(cookie, options, flush, input, from, to, output);
+ break;
+ }
+ }
+
+ private static void deflateDynamicBlock(Cookie cookie, Options options, boolean flush, byte[] input,
+ int from, int to, Buffer output) {
+ // assert from != to
+ LongestMatchCache lmc = cookie.lmc;
+ lmc.init(to - from);
+
+ BlockType type = BlockType.DYNAMIC;
+ LzStore store = Squeeze.optimal(cookie, options.numIterations, lmc, input, from, to);
+
+ if (store.size < 1000) {
+ LzStore fixedStore = cookie.store1;
+ fixedStore.reset();
+ Squeeze.bestFixedLengths(cookie, lmc, input, from, to, cookie.lengthArray, cookie.costs);
+ Squeeze.optimalRun(cookie, lmc, input, from, to, cookie.lengthArray, fixedStore);
+ int dynCost = calculateBlockSize(cookie, store.litLens, store.dists, 0, store.size);
+ int fixedCost = calculateFixedBlockSize(cookie, fixedStore.litLens,
+ fixedStore.dists, fixedStore.size);
+ if (fixedCost < dynCost) {
+ type = BlockType.FIXED;
+ store = fixedStore;
+ }
+ }
+
+ addLzBlock(cookie, type, flush, store.litLens, store.dists, 0, store.size, output);
+ }
+
+ private static void deflateSplittingLast(Cookie cookie, Options options, boolean flush,
+ byte[] input, int from, int to, Buffer output) {
+ // assert from != to
+ LongestMatchCache lmc = cookie.lmc;
+ lmc.init(to - from);
+
+ LzStore store = Squeeze.optimal(cookie, options.numIterations, lmc, input, from, to);
+
+ int nPoints = BlockSplitter.splitLz(cookie, store.litLens, store.dists, store.size);
+
+ int[] splitPoints = cookie.splitPoints;
+ for (int i = 1; i <= nPoints; i++) {
+ int start = splitPoints[i - 1];
+ int end = splitPoints[i];
+ addLzBlock(cookie, BlockType.DYNAMIC, i == nPoints && flush, store.litLens, store.dists, start, end, output);
+ }
+ }
+
+ private static void deflateSplittingFirst(Cookie cookie, Options options, boolean flush,
+ byte[] input, int from, int to, Buffer output) {
+ // assert from != to
+ int nPoints = BlockSplitter.split(cookie, input, from, to);
+ int[] splitPoints = cookie.splitPoints;
+ for (int i = 1; i <= nPoints; ++i) {
+ deflateDynamicBlock(cookie, options, i == nPoints && flush, input, splitPoints[i - 1], splitPoints[i], output);
+ }
+ }
+
+ static int calculateBlockSize(Cookie cookie, char[] litLens, char[] dists, int lStart, int lEnd) {
+ int[] llLengths = cookie.i288a;
+ System.arraycopy(Cookie.intZeroes, 0, llLengths, 0, 288);
+ int[] dLengths = cookie.i32a;
+ System.arraycopy(Cookie.intZeroes, 0, dLengths, 0, 32);
+
+ int result = 3;
+
+ int[] llCounts = cookie.i288b;
+ System.arraycopy(Cookie.intZeroes, 0, llCounts, 0, 288);
+ int[] dCounts = cookie.i32b;
+ System.arraycopy(Cookie.intZeroes, 0, dCounts, 0, 32);
+
+ int[] lengthSymbol = Util.LENGTH_SYMBOL;
+ int[] cachedDistSymbol = Util.CACHED_DIST_SYMBOL;
+ int[] lengthExtraBits = Util.LENGTH_EXTRA_BITS;
+ for (int i = lStart; i < lEnd; i++) {
+ int d = dists[i];
+ int l = litLens[i];
+ if (d == 0) {
+ llCounts[l]++;
+ } else {
+ llCounts[lengthSymbol[l]]++;
+ int distSymbol = cachedDistSymbol[d];
+ dCounts[distSymbol]++;
+ result += lengthExtraBits[l];
+ if (distSymbol > 3) {
+ result += (distSymbol / 2) - 1;
+ }
+ }
+ }
+ llCounts[256] = 1;
+
+
+ int[] llCountsCopy = cookie.i288c;
+ System.arraycopy(llCounts, 0, llCountsCopy, 0, 288);
+ optimizeHuffmanForRle(cookie, llCountsCopy);
+ Katajainen.lengthLimitedCodeLengths(cookie, llCountsCopy, 15, llLengths);
+
+ int[] dCountsCopy = cookie.i32c;
+ System.arraycopy(dCounts, 0, dCountsCopy, 0, 32);
+ optimizeHuffmanForRle(cookie, dCountsCopy);
+ Katajainen.lengthLimitedCodeLengths(cookie, dCountsCopy, 15, dLengths);
+ patchDistanceCodesForBuggyDecoders(dLengths);
+
+ result += simulateAddDynamicTree(cookie, llLengths, dLengths);
+
+ for (int i = 0; i < 288; ++i) {
+ result += llCounts[i] * llLengths[i];
+ }
+ for (int i = 0; i < 32; ++i) {
+ result += dCounts[i] * dLengths[i];
+ }
+ return result;
+ }
+
+ private static int calculateFixedBlockSize(Cookie cookie, char[] litLens, char[] dists, int size) {
+ int[] llLengths = cookie.i288a;
+ int[] dLengths = cookie.i32a;
+ getFixedTree(llLengths, dLengths);
+
+ int result = 3;
+
+ int[] cachedDistExtraBits = Util.CACHED_DIST_EXTRA_BITS;
+ int[] lengthExtraBits = Util.LENGTH_EXTRA_BITS;
+ int[] lengthSymbol = Util.LENGTH_SYMBOL;
+
+ for (int i = 0; i < size; i++) {
+ int d = dists[i];
+ int l = litLens[i];
+ if (d == 0) {
+ result += llLengths[l];
+ } else {
+ result += llLengths[lengthSymbol[l]];
+ result += lengthExtraBits[l];
+ result += 5;
+ result += d < 4097 ? cachedDistExtraBits[d] : d < 16385 ? d < 8193 ? 11 : 12 : 13;
+ }
+ }
+ result += llLengths[256];
+
+ return result;
+ }
+
+ private static void lzCounts(char[] litLens, char[] dists, int start, int end, int[] llCount, int[] dCount) {
+ int[] lengthSymbol = Util.LENGTH_SYMBOL;
+ int[] cachedDistSymbol = Util.CACHED_DIST_SYMBOL;
+ for (int i = start; i < end; i++) {
+ int d = dists[i];
+ int l = litLens[i];
+ if (d == 0) {
+ llCount[l]++;
+ } else {
+ llCount[lengthSymbol[l]]++;
+ dCount[cachedDistSymbol[d]]++;
+ }
+ }
+
+ llCount[256] = 1;
+ }
+
+ static void compress(Cookie cookie, Options options, byte[] input, Buffer output) {
+ int i = 0;
+ while (i < input.length) {
+ int j = Math.min(i + cookie.masterBlockSize, input.length);
+ deflatePart(cookie, options, input, i, j, j == input.length, output);
+ i = j;
+ }
+ }
+
+ private static void patchDistanceCodesForBuggyDecoders(int[] dLengths) {
+ int numDistCodes = 0;
+ for (int i = 0; i < 30; i++) {
+ if (dLengths[i] != 0) {
+ numDistCodes++;
+ if (numDistCodes == 2) {
+ return;
+ }
+ }
+ }
+
+ if (numDistCodes == 0) {
+ dLengths[0] = 1;
+ dLengths[1] = 1;
+ } else if (numDistCodes == 1) {
+ dLengths[dLengths[0] != 0 ? 1 : 0] = 1;
+ }
+ }
+
+ private static void addDynamicTree(Cookie cookie, int[] llLengths, int[] dLengths, Buffer output) {
+ int best = 0;
+ int bestSize = Integer.MAX_VALUE;
+
+ for(int i = 0; i < 8; i++) {
+ int size = simulateEncodeTree(cookie, llLengths, dLengths, (i & 1) != 0, (i & 2) != 0, (i & 4) != 0);
+ if (size < bestSize) {
+ bestSize = size;
+ best = i;
+ }
+ }
+
+ encodeTree(cookie, llLengths, dLengths, (best & 1) != 0, (best & 2) != 0, (best & 4) != 0, output);
+ }
+
+ private static void encodeTree(Cookie cookie, int[] llLengths, int[] dLengths,
+ boolean use16, boolean use17, boolean use18, Buffer output) {
+ int hLit = 29;
+ int hDist = 29;
+
+ while (hLit > 0 && llLengths[256 + hLit] == 0) {
+ hLit--;
+ }
+ while (hDist > 0 && dLengths[hDist] == 0) {
+ hDist--;
+ }
+
+ int lldTotal = hLit + 258 + hDist;
+ int[] lldLengths = cookie.i320b;
+ System.arraycopy(llLengths, 0, lldLengths, 0, 257 + hLit);
+ System.arraycopy(dLengths, 0, lldLengths, 257 + hLit, hDist + 1);
+
+ int rleSize = 0;
+ int[] rle = cookie.i320a;
+ int[] rleBits = cookie.i320c;
+
+ for (int i = 0; i < lldTotal; i++) {
+ int count = 1;
+ int symbol = lldLengths[i];
+ if (use16 || (symbol == 0 && (use17 || use18))) {
+ for (int j = i + 1; j < lldTotal && symbol == lldLengths[j]; j++) {
+ count++;
+ }
+ }
+ i += count - 1;
+
+ if (symbol == 0 && count > 2) {
+ if (use18) {
+ while (count > 10) {
+ int delta = count > 138 ? 138 : count;
+ rle[rleSize] = 18;
+ rleBits[rleSize++] = delta - 11;
+ count -= delta;
+ }
+ }
+ if (use17) {
+ while (count > 2) {
+ int delta = count > 10 ? 10 : count;
+ rle[rleSize] = 17;
+ rleBits[rleSize++] = delta - 3;
+ count -= delta;
+ }
+ }
+ }
+
+ if (use16 && count > 3) {
+ count--;
+ rle[rleSize] = symbol;
+ rleBits[rleSize++] = 0;
+ while (count > 2) {
+ int delta = count > 6 ? 6 : count;
+ rle[rleSize] = 16;
+ rleBits[rleSize++] = delta - 3;
+ count -= delta;
+ }
+ }
+
+ while (count != 0) {
+ rle[rleSize] = symbol;
+ rleBits[rleSize++] = 0;
+ count--;
+ }
+ }
+
+ int[] clCounts = cookie.i19a;
+ System.arraycopy(Cookie.intZeroes, 0, clCounts, 0, 19);
+ for (int i = 0; i < rleSize; ++i) {
+ clCounts[rle[i]]++;
+ }
+
+ int[] clCl = cookie.i19b;
+ System.arraycopy(Cookie.intZeroes, 0, clCl, 0, 19);
+ Katajainen.lengthLimitedCodeLengths(cookie, clCounts, 7, clCl);
+ int[] clSymbols = cookie.i19c;
+ lengthsToSymbols(clCl, 19, 7, clSymbols, cookie.i16a, cookie.i16b);
+
+ int[] order = Util.ORDER;
+ int hcLen = 15;
+ while (hcLen > 0 && clCounts[order[hcLen + 3]] == 0) {
+ hcLen--;
+ }
+
+ output.addBits(hLit, 5);
+ output.addBits(hDist, 5);
+ output.addBits(hcLen, 4);
+
+ for (int i = 0; i < hcLen + 4; i++) {
+ output.addBits(clCl[order[i]], 3);
+ }
+
+ for (int i = 0; i < rleSize; i++) {
+ int symbol = clSymbols[rle[i]];
+ output.addHuffmanBits(symbol, clCl[rle[i]]);
+ if (rle[i] == 16) {
+ output.addBits(rleBits[i], 2);
+ } else if (rle[i] == 17) {
+ output.addBits(rleBits[i], 3);
+ } else if (rle[i] == 18) {
+ output.addBits(rleBits[i], 7);
+ }
+ }
+ }
+
+ private static int simulateAddDynamicTree(Cookie cookie, int[] llLengths, int[] dLengths) {
+ int bestSize = Integer.MAX_VALUE;
+
+ for(int i = 0; i < 8; i++) {
+ int size = simulateEncodeTree(cookie, llLengths, dLengths, (i & 1) != 0, (i & 2) != 0, (i & 4) != 0);
+ if (size < bestSize) {
+ bestSize = size;
+ }
+ }
+ return bestSize;
+ }
+
+ // TODO: GetRid of RLE
+ private static int simulateEncodeTree(Cookie cookie, int[] llLengths, int[] dLengths,
+ boolean use16, boolean use17, boolean use18) {
+ int hLit = 29;
+ int hDist = 29;
+
+ while (hLit > 0 && llLengths[256 + hLit] == 0) {
+ hLit--;
+ }
+ while (hDist > 0 && dLengths[hDist] == 0) {
+ hDist--;
+ }
+
+ int lldTotal = hLit + 258 + hDist;
+ int[] lldLengths = cookie.i320b;
+ System.arraycopy(llLengths, 0, lldLengths, 0, 257 + hLit);
+ System.arraycopy(dLengths, 0, lldLengths, 257 + hLit, hDist + 1);
+
+ int[] rle = cookie.i320a;
+ int rleSize = 0;
+
+ for (int i = 0; i < lldTotal; i++) {
+ int count = 1;
+ int symbol = lldLengths[i];
+ if (use16 || (symbol == 0 && (use17 || use18))) {
+ for (int j = i + 1; j < lldTotal && symbol == lldLengths[j]; j++) {
+ count++;
+ }
+ }
+ i += count - 1;
+
+ if (symbol == 0 && count > 2) {
+ if (use18) {
+ while (count > 10) {
+ rle[rleSize++] = 18;
+ count -= count > 138 ? 138 : count;
+ }
+ }
+ if (use17) {
+ while (count > 2) {
+ rle[rleSize++] = 17;
+ count -= count > 10 ? 10 : count;
+ }
+ }
+ }
+
+ if (use16 && count > 3) {
+ count--;
+ rle[rleSize++] = symbol;
+ while (count > 2) {
+ rle[rleSize++] = 16;
+ count -= count > 6 ? 6 : count;
+ }
+ }
+
+ while (count != 0) {
+ rle[rleSize++] = symbol;
+ count--;
+ }
+ }
+
+ int[] clCounts = cookie.i19a;
+ System.arraycopy(Cookie.intZeroes, 0, clCounts, 0, 19);
+ for (int i = 0; i < rleSize; ++i) {
+ clCounts[rle[i]]++;
+ }
+
+ int[] clCl = cookie.i19b;
+ System.arraycopy(Cookie.intZeroes, 0, clCl, 0, 19);
+ Katajainen.lengthLimitedCodeLengths(cookie, clCounts, 7, clCl);
+ clCl[16] += 2;
+ clCl[17] += 3;
+ clCl[18] += 7;
+
+ int[] order = Util.ORDER;
+ int hcLen = 15;
+ while (hcLen > 0 && clCounts[order[hcLen + 3]] == 0) {
+ hcLen--;
+ }
+
+ int result = 5 + 5 + 4 + (hcLen + 4) * 3;
+ for (int i = 0; i < 19; i++) {
+ result += clCl[i] * clCounts[i];
+ }
+
+ return result;
+ }
+
+ private static void addLzBlock(Cookie cookie, BlockType type, boolean last, char[] litLens, char[] dists,
+ int lStart, int lEnd, Buffer output) {
+ int[] llLengths = cookie.i288a;
+ System.arraycopy(Cookie.intZeroes, 0, llLengths, 0, 288);
+ int[] dLengths = cookie.i32a;
+ System.arraycopy(Cookie.intZeroes, 0, dLengths, 0, 32);
+ int[] llCounts = cookie.i288b;
+ System.arraycopy(Cookie.intZeroes, 0, llCounts, 0, 288);
+ int[] dCounts = cookie.i32b;
+ System.arraycopy(Cookie.intZeroes, 0, dCounts, 0, 32);
+
+ output.addHuffmanBits(last ? 1 : 0, 1);
+ if (type == BlockType.FIXED) {
+ output.addHuffmanBits(2, 2); // 1, 0
+ } else { // DYNAMIC
+ output.addHuffmanBits(1, 2); // 0, 1
+ }
+
+ if (type == BlockType.FIXED) {
+ getFixedTree(llLengths, dLengths);
+ } else { // DYNAMIC
+ lzCounts(litLens, dists, lStart, lEnd, llCounts, dCounts);
+ optimizeHuffmanForRle(cookie, llCounts);
+ Katajainen.lengthLimitedCodeLengths(cookie, llCounts, 15, llLengths);
+ optimizeHuffmanForRle(cookie, dCounts);
+ Katajainen.lengthLimitedCodeLengths(cookie, dCounts, 15, dLengths);
+ patchDistanceCodesForBuggyDecoders(dLengths);
+ addDynamicTree(cookie, llLengths, dLengths, output);
+ }
+
+ int[] llSymbols = cookie.i288c;
+ System.arraycopy(Cookie.intZeroes, 0, llSymbols, 0, 288);
+ lengthsToSymbols(llLengths, 288, 15, llSymbols, cookie.i16a, cookie.i16b);
+
+ int[] dSymbols = cookie.i32b;
+ System.arraycopy(Cookie.intZeroes, 0, dSymbols, 0, 32);
+ lengthsToSymbols(dLengths, 32, 15, dSymbols, cookie.i16a, cookie.i16b);
+
+ addLzData(litLens, dists, lStart, lEnd, llSymbols, llLengths, dSymbols, dLengths, output);
+ output.addHuffmanBits(llSymbols[256], llLengths[256]);
+ }
+
+ private static void addLzData(char[] litLens, char[] dists, int lStart, int lEnd,
+ int[] llSymbols, int[] llLengths, int[] dSymbols, int[] dLengths, Buffer output) {
+ int[] cachedDistExtraBits = Util.CACHED_DIST_EXTRA_BITS;
+ int[] lengthExtraBits = Util.LENGTH_EXTRA_BITS;
+ int[] lengthExtraBitsValue = Util.LENGTH_EXTRA_BITS_VALUE;
+ int[] lengthSymbol = Util.LENGTH_SYMBOL;
+ int[] cachedDistSymbol = Util.CACHED_DIST_SYMBOL;
+ for (int i = lStart; i < lEnd; i++) {
+ int dist = dists[i];
+ int litLen = litLens[i];
+ if (dist == 0) {
+ output.addHuffmanBits(llSymbols[litLen], llLengths[litLen]);
+ } else {
+ int lls = lengthSymbol[litLen];
+ int ds = cachedDistSymbol[dist];
+ output.addHuffmanBits(llSymbols[lls], llLengths[lls]);
+ output.addBits(lengthExtraBitsValue[litLen], lengthExtraBits[litLen]);
+ output.addHuffmanBits(dSymbols[ds], dLengths[ds]);
+ output.addBits(Util.distExtraBitsValue(dist),
+ dist < 4097 ? cachedDistExtraBits[dist] : dist < 16385 ? dist < 8193 ? 11 : 12 : 13);
+ }
+ }
+ }
+
+ private static void lengthsToSymbols(int[] lengths, int n, int maxBits, int[] symbols, int[] blCount, int[] nextCode) {
+ System.arraycopy(Cookie.intZeroes, 0, blCount, 0, maxBits + 1);
+ System.arraycopy(Cookie.intZeroes, 0, nextCode, 0, maxBits + 1);
+ for (int i = 0; i < n; ++i) {
+ blCount[lengths[i]]++;
+ }
+ int code = 0;
+ blCount[0] = 0;
+ for (int bits = 1; bits <= maxBits; bits++) {
+ code = (code + blCount[bits - 1]) << 1;
+ nextCode[bits] = code;
+ }
+ for (int i = 0; i < n; i++) {
+ int len = lengths[i];
+ if (len != 0) {
+ symbols[i] = nextCode[len];
+ nextCode[len]++;
+ }
+ }
+ }
+
+ private static void optimizeHuffmanForRle(Cookie cookie, int[] counts) {
+ int[] goodForRle = cookie.i289a;
+ int length = counts.length;
+ for (; length >= 0; --length) {
+ if (length == 0) {
+ return;
+ }
+ if (counts[length - 1] != 0) {
+ break;
+ }
+ }
+ System.arraycopy(Cookie.intZeroes, 0, goodForRle, 0, length + 1);
+
+ int symbol = counts[0];
+ int stride = 0;
+ for (int i = 0; i < length + 1; ++i) {
+ if (i == length || counts[i] != symbol) {
+ if ((symbol == 0 && stride >= 5) || (symbol != 0 && stride >= 7)) {
+ for (int k = 0; k < stride; ++k) {
+ goodForRle[i - k - 1] = 1;
+ }
+ }
+ stride = 1;
+ if (i != length) {
+ symbol = counts[i];
+ }
+ } else {
+ ++stride;
+ }
+ }
+
+ stride = 0;
+ int limit = counts[0];
+ int sum = 0;
+ for (int i = 0; i < length + 1; ++i) {
+ if ((i == length) || (goodForRle[i] != 0) || (counts[i] - limit >= 4) || (limit - counts[i] >= 4)) {
+ if ((stride >= 4) || ((stride >= 3) && (sum == 0))) {
+ int count = (sum + stride / 2) / stride;
+ if (count < 1) count = 1;
+ if (sum == 0) {
+ count = 0;
+ }
+ for (int k = 0; k < stride; ++k) {
+ counts[i - k - 1] = count;
+ }
+ }
+ stride = 0;
+ sum = 0;
+ if (i < length - 3) {
+ limit = (counts[i] + counts[i + 1] + counts[i + 2] + counts[i + 3] + 2) / 4;
+ } else if (i < length) {
+ limit = counts[i];
+ } else {
+ limit = 0;
+ }
+ }
+ ++stride;
+ if (i != length) {
+ sum += counts[i];
+ }
+ }
+ }
+}
diff --git a/src/net/sourceforge/plantuml/zopfli/Hash.java b/src/net/sourceforge/plantuml/zopfli/Hash.java
new file mode 100644
index 0000000..5f7a49e
--- /dev/null
+++ b/src/net/sourceforge/plantuml/zopfli/Hash.java
@@ -0,0 +1,136 @@
+/*
+Copyright 2014 Google Inc. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Author: eustas.ru@gmail.com (Eugene Klyuchnikov)
+*/
+
+package net.sourceforge.plantuml.zopfli;
+
+class Hash {
+
+ // HASH_SHIFT = 5;
+ // HASH_MASK = 32767;
+
+ private static final int[] seq = new int[0x8000];
+
+ static {
+ int[] seq = Hash.seq;
+ for (int i = 0, l = 0x8000; i < l; ++i) {
+ seq[i] = i;
+ }
+ }
+
+ final int[] head = new int[0x10000];
+ final int[] prev = new int[0x8000];
+ private final int[] hashVal = new int[0x8000];
+ final int[] same = new int[0x8000];
+ int val;
+
+ private final int[] head2 = new int[0x10000];
+ final int[] prev2 = new int[0x8000];
+ final int[] hashVal2 = new int[0x8000];
+
+ public Hash() {
+ }
+
+ public void init(byte[] input, int windowStart, int from, int to) {
+ int[] hashVal = this.hashVal;
+ int[] head = this.head;
+ int[] same = this.same;
+ int[] prev = this.prev;
+ int[] hashVal2 = this.hashVal2;
+ int[] head2 = this.head2;
+ int[] prev2 = this.prev2;
+
+ System.arraycopy(Cookie.intMOnes, 0, head, 0, 0x10000);
+ System.arraycopy(Cookie.intMOnes, 0, hashVal, 0, 0x8000);
+ System.arraycopy(Cookie.intZeroes, 0, same, 0x8000, 0);
+ System.arraycopy(seq, 0, prev, 0, 0x8000);
+
+ System.arraycopy(Cookie.intMOnes, 0, head2, 0, 0x10000);
+ System.arraycopy(Cookie.intMOnes, 0, hashVal2, 0, 0x8000);
+ System.arraycopy(seq, 0, prev2, 0, 0x8000);
+
+ int val = (((input[windowStart] & 0xFF) << 5) ^ input[windowStart + 1] & 0xFF) & 0x7FFF;
+
+ for (int i = windowStart; i < from; ++i) {
+ int hPos = i & 0x7FFF;
+ val = ((val << 5) ^ (i + 2 < to ? input[i + 2] & 0xFF : 0)) & 0x7FFF;
+
+ hashVal[hPos] = val;
+ int tmp = head[val];
+ prev[hPos] = tmp != -1 && hashVal[tmp] == val ? tmp : hPos;
+ head[val] = hPos;
+
+ tmp = same[(i - 1) & 0x7FFF];
+ if (tmp < 1) {
+ tmp = 1;
+ }
+ tmp += i;
+ byte b = input[i];
+ while (tmp < to && b == input[tmp]) {
+ tmp++;
+ }
+ tmp -= i;
+ tmp--;
+ same[hPos] = tmp;
+
+ tmp = ((tmp - 3) & 0xFF) ^ val;
+ hashVal2[hPos] = tmp;
+ int h = head2[tmp];
+ prev2[hPos] = h != -1 && hashVal2[h] == tmp ? h : hPos;
+ head2[tmp] = hPos;
+ }
+ this.val = val;
+ }
+
+ /*private void updateHashValue(int c) {
+ val = ((val << HASH_SHIFT) ^ c) & HASH_MASK;
+ }*/
+
+ public void updateHash(byte[] input, int pos, int end) {
+ // WINDOW_MASK
+ int hPos = pos & 0x7FFF;
+ int val = this.val;
+
+ val = ((val << 5) ^ (pos + 2 < end ? input[pos + 2] & 0xFF : 0)) & 0x7FFF;
+
+ hashVal[hPos] = val;
+ int tmp = head[val];
+ prev[hPos] = (tmp != -1 && hashVal[tmp] == val) ? tmp : hPos;
+ head[val] = hPos;
+
+ tmp = same[(pos - 1) & 0x7FFF];
+ if (tmp < 1) {
+ tmp = 1;
+ }
+ tmp += pos;
+ byte b = input[pos];
+ while (tmp < end && b == input[tmp]) {
+ tmp++;
+ }
+ tmp -= pos;
+ tmp--;
+ same[hPos] = tmp;
+
+ tmp = ((tmp - 3) & 0xFF) ^ val;
+ hashVal2[hPos] = tmp;
+ int h = head2[tmp];
+ prev2[hPos] = h != -1 && hashVal2[h] == tmp ? h : hPos;
+ head2[tmp] = hPos;
+
+ this.val = val;
+ }
+}
diff --git a/src/net/sourceforge/plantuml/zopfli/Katajainen.java b/src/net/sourceforge/plantuml/zopfli/Katajainen.java
new file mode 100644
index 0000000..b66103e
--- /dev/null
+++ b/src/net/sourceforge/plantuml/zopfli/Katajainen.java
@@ -0,0 +1,124 @@
+/*
+Copyright 2014 Google Inc. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Author: eustas.ru@gmail.com (Eugene Klyuchnikov)
+*/
+
+package net.sourceforge.plantuml.zopfli;
+
+import net.sourceforge.plantuml.zopfli.Cookie.Node;
+
+class Katajainen {
+
+ static void lengthLimitedCodeLengths(Cookie cookie, int[] frequencies, int maxBits,
+ int[] bitLengths) {
+ cookie.resetPool();
+ int n = frequencies.length;
+ int nn = 0;
+ Node[] leaves = cookie.leaves1;
+ for (int i = 0; i < n; i++) {
+ if (frequencies[i] != 0) {
+ leaves[nn] = cookie.node(frequencies[i], i, null);
+ nn++;
+ }
+ }
+
+ if (nn == 0) {
+ return;
+ }
+ if (nn == 1) {
+ bitLengths[leaves[0].count] = 1;
+ return;
+ }
+
+ Node[] leaves2 = cookie.leaves2;
+ System.arraycopy(leaves, 0, leaves2, 0, nn);
+ sort(leaves2, leaves, 0, nn);
+
+ Node[] list0 = cookie.list0;
+ Node node0 = cookie.node(leaves[0].weight, 1, null);
+
+ Node[] list1 = cookie.list1;
+ Node node1 = cookie.node(leaves[1].weight, 2, null);
+
+ for (int i = 0; i < maxBits; ++i) {
+ list0[i] = node0;
+ list1[i] = node1;
+ }
+
+ int numBoundaryPmRuns = 2 * nn - 4;
+ for (int i = 0; i < numBoundaryPmRuns; i++) {
+ boolean last = i == numBoundaryPmRuns - 1;
+ boundaryPm(cookie, leaves, list0, list1, nn, maxBits - 1, last);
+ }
+
+ for (Node node = list1[maxBits - 1]; node != null; node = node.tail) {
+ for (int i = node.count - 1; i >= 0; --i) {
+ bitLengths[leaves[i].count]++;
+ }
+ }
+ }
+
+ private static void boundaryPm(Cookie cookie, Node[] leaves, Node[] list0, Node[] list1, int numSymbols, int index,
+ boolean last) {
+ int lastCount = list1[index].count;
+
+ if (index == 0 && lastCount >= numSymbols) {
+ return;
+ }
+
+ list0[index] = list1[index];
+
+ if (index == 0) {
+ list1[index] = cookie.node(leaves[lastCount].weight, lastCount + 1, null);
+ } else {
+ int sum = list0[index - 1].weight + list1[index - 1].weight;
+ if (lastCount < numSymbols && sum > leaves[lastCount].weight) {
+ list1[index] = cookie.node(leaves[lastCount].weight, lastCount + 1, list1[index].tail);
+ } else {
+ list1[index] = cookie.node(sum, lastCount, list1[index - 1]);
+ if (!last) {
+ boundaryPm(cookie, leaves, list0, list1, numSymbols, index - 1, false);
+ boundaryPm(cookie, leaves, list0, list1, numSymbols, index - 1, false);
+ }
+ }
+ }
+ }
+
+ private static void sort(Node[] src, Node[] dest, int low, int high) {
+ int length = high - low;
+
+ if (length < 7) {
+ for (int i = low + 1; i < high; i++)
+ for (int j = i, k = i - 1; j > low && (dest[k].weight > dest[j].weight); --j, --k) {
+ Node t = dest[j];
+ dest[j] = dest[k];
+ dest[k] = t;
+ }
+ return;
+ }
+
+ int mid = (low + high) >>> 1;
+ sort(dest, src, low, mid);
+ sort(dest, src, mid, high);
+
+ for (int i = low, p = low, q = mid; i < high; i++) {
+ if (q >= high || p < mid && (src[p].weight <= src[q].weight))
+ dest[i] = src[p++];
+ else
+ dest[i] = src[q++];
+ }
+ }
+}
diff --git a/src/net/sourceforge/plantuml/zopfli/LongestMatchCache.java b/src/net/sourceforge/plantuml/zopfli/LongestMatchCache.java
new file mode 100644
index 0000000..30cc4eb
--- /dev/null
+++ b/src/net/sourceforge/plantuml/zopfli/LongestMatchCache.java
@@ -0,0 +1,126 @@
+/*
+Copyright 2014 Google Inc. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Author: eustas.ru@gmail.com (Eugene Klyuchnikov)
+*/
+
+package net.sourceforge.plantuml.zopfli;
+
+class LongestMatchCache {
+
+ private final static int CACHE_LENGTH = 8;
+
+ public final char[] length;
+ public final char[] dist;
+ private final char[] subLenPos;
+ private final byte[] subLenLen;
+
+ LongestMatchCache(int maxBlockSize) {
+ length = new char[maxBlockSize];
+ dist = new char[maxBlockSize];
+ subLenPos = new char[CACHE_LENGTH * maxBlockSize];
+ subLenLen = new byte[CACHE_LENGTH * maxBlockSize];
+ }
+
+ void init(int blockSize) {
+ Cookie.fill0(dist, blockSize);
+ int n = blockSize << 3; // * CACHE_LENGTH
+ char[] subLenPos = this.subLenPos;
+ byte[] subLenLen = this.subLenLen;
+ char[] length = this.length;
+
+ char[] charZeroes = Cookie.charZeroes;
+ byte[] byteZeroes = Cookie.byteZeroes;
+ char[] charOnes = Cookie.charOnes;
+
+ int i = 0;
+ while (i < n) {
+ int j = i + 65536;
+ if (j > n) {
+ j = n;
+ }
+ int l = j - i;
+ System.arraycopy(byteZeroes, 0, subLenLen, i, l);
+ System.arraycopy(charZeroes, 0, subLenPos, i, l);
+ i = j;
+ }
+
+ i = 0;
+ while (i < blockSize) {
+ int j = i + 65536;
+ if (j > blockSize) {
+ j = blockSize;
+ }
+ int l = j - i;
+ System.arraycopy(charOnes, 0, length, i, l);
+ System.arraycopy(charZeroes, 0, subLenPos, i, l);
+ i = j;
+ }
+ }
+
+ void subLenToCache(char[] input, int pos, int len) {
+ if (len < 3) {
+ return;
+ }
+
+ int bestLength = 0;
+ int j = pos * CACHE_LENGTH;
+ int last = j + CACHE_LENGTH - 1;
+ for (int i = 3; i <= len; ++i) {
+ if (i == len || input[i] != input[i + 1]) {
+ subLenPos[j] = input[i];
+ subLenLen[j] = (byte) (i - 3);
+ bestLength = i;
+ j++;
+ if (j > last) {
+ break;
+ }
+ }
+ }
+ if (j <= last) {
+ subLenLen[last] = (byte) (bestLength - 3);
+ }
+ }
+
+ void cacheToSubLen(int pos, int len, char[] output) {
+ if (len < 3) {
+ return;
+ }
+
+ int maxLength = maxCachedSubLen(pos);
+ int prevLength = 0;
+ int j = CACHE_LENGTH * pos;
+ int last = j + CACHE_LENGTH;
+ for (; j < last; ++j) {
+ int cLen = (subLenLen[j] & 0xFF) + 3;
+ char dist = subLenPos[j];
+ for (int i = prevLength; i <= cLen; ++i) {
+ output[i] = dist;
+ }
+ if (cLen == maxLength) {
+ break;
+ }
+ prevLength = cLen + 1;
+ }
+ }
+
+ int maxCachedSubLen(int pos) {
+ pos = pos * CACHE_LENGTH;
+ if (subLenPos[pos] == 0) {
+ return 0;
+ }
+ return (subLenLen[pos + CACHE_LENGTH - 1] & 0xFF) + 3;
+ }
+}
diff --git a/src/net/sourceforge/plantuml/zopfli/LzStore.java b/src/net/sourceforge/plantuml/zopfli/LzStore.java
new file mode 100644
index 0000000..6035b09
--- /dev/null
+++ b/src/net/sourceforge/plantuml/zopfli/LzStore.java
@@ -0,0 +1,45 @@
+/*
+Copyright 2014 Google Inc. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Author: eustas.ru@gmail.com (Eugene Klyuchnikov)
+*/
+
+package net.sourceforge.plantuml.zopfli;
+
+final class LzStore {
+ final char[] litLens;
+ final char[] dists;
+ int size;
+
+ LzStore(final int maxBlockSize) {
+ litLens = new char[maxBlockSize];
+ dists = new char[maxBlockSize];
+ }
+
+ final void append(final char length, final char dist) {
+ litLens[size] = length;
+ dists[size++] = dist;
+ }
+
+ final void reset() {
+ size = 0;
+ }
+
+ final void copy(final LzStore source) {
+ size = source.size;
+ System.arraycopy(source.litLens, 0, litLens, 0, size);
+ System.arraycopy(source.dists, 0, dists, 0, size);
+ }
+}
diff --git a/src/net/sourceforge/plantuml/zopfli/Options.java b/src/net/sourceforge/plantuml/zopfli/Options.java
new file mode 100644
index 0000000..a253c51
--- /dev/null
+++ b/src/net/sourceforge/plantuml/zopfli/Options.java
@@ -0,0 +1,48 @@
+/*
+Copyright 2014 Google Inc. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Author: eustas.ru@gmail.com (Eugene Klyuchnikov)
+*/
+
+package net.sourceforge.plantuml.zopfli;
+
+public class Options {
+ public static enum BlockSplitting {
+ FIRST,
+ LAST,
+ NONE
+ }
+
+ public static enum OutputFormat {
+ DEFLATE,
+ GZIP,
+ ZLIB
+ }
+
+ public final int numIterations;
+ public final BlockSplitting blockSplitting;
+ public final OutputFormat outputType;
+
+ public Options(OutputFormat outputType, BlockSplitting blockSplitting,
+ int numIterations) {
+ this.outputType = outputType;
+ this.blockSplitting = blockSplitting;
+ this.numIterations = numIterations;
+ }
+
+ public Options() {
+ this(OutputFormat.GZIP, BlockSplitting.FIRST, 15);
+ }
+}
diff --git a/src/net/sourceforge/plantuml/zopfli/Squeeze.java b/src/net/sourceforge/plantuml/zopfli/Squeeze.java
new file mode 100644
index 0000000..7df399f
--- /dev/null
+++ b/src/net/sourceforge/plantuml/zopfli/Squeeze.java
@@ -0,0 +1,241 @@
+/*
+Copyright 2014 Google Inc. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Author: eustas.ru@gmail.com (Eugene Klyuchnikov)
+*/
+
+package net.sourceforge.plantuml.zopfli;
+
+class Squeeze {
+
+ static LzStore optimal(Cookie cookie, int numIterations, LongestMatchCache lmc, byte[] input, int from, int to) {
+ LzStore currentStore = cookie.store1;
+ currentStore.reset();
+ LzStore store = cookie.store2;
+ Deflate.greedy(cookie, lmc, input, from, to, currentStore);
+ SymbolStats stats = cookie.stats;
+ SymbolStats bestStats = cookie.bestStats;
+ SymbolStats lastStats = cookie.lastStats;
+ stats.getFreqs(currentStore);
+
+ char[] lengthArray = cookie.lengthArray;
+ long[] costs = cookie.costs;
+
+ int cost;
+ int bestCost = Integer.MAX_VALUE;
+ int lastCost = 0;
+ int lastRandomStep = -1;
+
+ for (int i = 0; i < numIterations; i++) {
+ currentStore.reset();
+ bestLengths(cookie, lmc, from, input, from, to, stats.minCost(), stats, lengthArray, costs);
+ optimalRun(cookie, lmc, input, from, to, lengthArray, currentStore);
+ cost = Deflate.calculateBlockSize(cookie, currentStore.litLens, currentStore.dists, 0, currentStore.size);
+ if (cost < bestCost) {
+ store.copy(currentStore);
+ bestStats.copy(stats);
+ bestCost = cost;
+ }
+ lastStats.copy(stats);
+ stats.getFreqs(currentStore);
+ if (lastRandomStep != -1) {
+ stats.alloy(lastStats);
+ stats.calculate();
+ }
+ if (i > 5 && cost == lastCost) {
+ stats.copy(bestStats);
+ cookie.rnd = stats.randomizeFreqs(cookie.rnd);
+ stats.calculate();
+ lastRandomStep = i;
+ }
+ lastCost = cost;
+ }
+ return store;
+ }
+
+ static void optimalRun(Cookie cookie, LongestMatchCache lmc, byte[] input, int from, int to,
+ char[] lengthArray, LzStore store) {
+ // assert from != to
+ char[] path = cookie.path;
+ int pathSize = 0;
+ int size = to - from;
+ do {
+ char las = lengthArray[size];
+ path[pathSize++] = las;
+ size -= las;
+ } while (size != 0);
+
+ int windowStart = Math.max(from - 0x8000, 0);
+ Hash h = cookie.h;
+ h.init(input, windowStart, from, to);
+ int pos = from;
+
+ do {
+ h.updateHash(input, pos, to);
+ int length = path[--pathSize];
+ if (length >= 3) {
+ Deflate.findLongestMatch(cookie, lmc, from, h, input, pos, to, length, null);
+ store.append((char) length, (char) cookie.distVal);
+ } else {
+ length = 1;
+ store.append((char) (input[pos] & 0xFF), (char) 0);
+ }
+
+ for (int j = 1; j < length; ++j) {
+ h.updateHash(input, pos + j, to);
+ }
+ pos += length;
+ } while (pathSize != 0);
+ }
+
+ private static long fixedCost(int litLen, int dist) {
+ if (dist == 0) {
+ if (litLen <= 143) {
+ return 8;
+ }
+ return 9;
+ } else {
+ long cost = 12 + (dist < 4097 ? Util.CACHED_DIST_EXTRA_BITS[dist] : dist < 16385 ? dist < 8193 ? 11 : 12 : 13)
+ + Util.LENGTH_EXTRA_BITS[litLen];
+ if (Util.LENGTH_SYMBOL[litLen] > 279) {
+ return cost + 1;
+ }
+ return cost;
+ }
+ }
+
+ private static void bestLengths(Cookie cookie, LongestMatchCache lmc, int blockStart, byte[] input, int from, int to,
+ long minCost, SymbolStats stats, char[] lengthArray, long[] costs) {
+ //# WINDOW_SIZE = 0x8000
+ //# WINDOW_MASK = 0x7FFF
+ //# MAX_MATCH = 258
+
+ int windowStart = Math.max(from - 0x8000, 0);
+ Hash h = cookie.h;
+ h.init(input, windowStart, from, to);
+ Cookie.fillCostMax(costs, to - from + 1);
+ costs[0] = 0L;
+ lengthArray[0] = 0;
+ int[] same = h.same;
+
+ char[] subLen = cookie.c259a;
+ System.arraycopy(Cookie.charZeroes, 0, subLen, 0, 259);
+
+ long[] slLiterals = stats.lLiterals;
+ long[] slLengths = stats.lLengths;
+ long[] sdSymbols = stats.dSymbols;
+ long stepCost = slLengths[258] + sdSymbols[0];
+
+ int[] cachedDistSymbol = Util.CACHED_DIST_SYMBOL;
+
+ int i = from;
+ int j = 0;
+ while (i < to) {
+ h.updateHash(input, i, to);
+
+ if (same[i & 0x7FFF] > 516 && i > from + 259 && i + 517 < to && same[(i - 258) & 0x7FFF] > 258) {
+ for (int k = 0; k < 258; ++k) {
+ costs[j + 258] = costs[j] + stepCost;
+ lengthArray[j + 258] = 258;
+ i++;
+ j++;
+ h.updateHash(input, i, to);
+ }
+ }
+
+ Deflate.findLongestMatch(cookie, lmc, blockStart, h, input, i, to, 258, subLen);
+
+ long costsJ = costs[j];
+ if (i + 1 <= to) {
+ long newCost = costsJ + slLiterals[input[i] & 0xFF];
+ if (newCost < costs[j + 1]) {
+ costs[j + 1] = newCost;
+ lengthArray[j + 1] = 1;
+ }
+ }
+ int lenValue = cookie.lenVal;
+ long baseCost = minCost + costsJ;
+ if (lenValue > to - i) {
+ lenValue = to - i;
+ }
+ int jpk = j + 3;
+ for (char k = 3; k <= lenValue; k++, jpk++) {
+ if (costs[jpk] > baseCost) {
+ long newCost = costsJ + (slLengths[k] + sdSymbols[cachedDistSymbol[subLen[k]]]);
+ if (costs[jpk] > newCost) {
+ costs[jpk] = newCost;
+ lengthArray[jpk] = k;
+ }
+ }
+ }
+
+ i++;
+ j++;
+ }
+ }
+
+ static void bestFixedLengths(Cookie cookie, LongestMatchCache lmc, byte[] input, int from, int to,
+ char[] lengthArray, long[] costs) {
+ int windowStart = Math.max(from - 0x8000, 0);
+ Hash h = cookie.h;
+ h.init(input, windowStart, from, to);
+ Cookie.fillCostMax(costs, to - from + 1);
+ costs[0] = 0L;
+ lengthArray[0] = 0;
+
+ char[] subLen = cookie.c259a;
+ for (int i = from; i < to; i++) {
+ int j = i - from;
+ h.updateHash(input, i, to);
+
+ if (h.same[i & 0x7FFF] > 258 * 2
+ && i > from + 258 + 1
+ && i + 258 * 2 + 1 < to
+ && h.same[(i - 258) & 0x7FFF]
+ > 258) {
+ long symbolCost = fixedCost(258, 1);
+ for (int k = 0; k < 258; k++) {
+ costs[j + 258] = costs[j] + symbolCost;
+ lengthArray[j + 258] = 258;
+ i++;
+ j++;
+ h.updateHash(input, i, to);
+ }
+ }
+
+ Deflate.findLongestMatch(cookie, lmc, from, h, input, i, to, 258, subLen);
+
+ if (i + 1 <= to) {
+ long newCost = costs[j] + fixedCost(input[i] & 0xFF, 0);
+ if (newCost < costs[j + 1]) {
+ costs[j + 1] = newCost;
+ lengthArray[j + 1] = 1;
+ }
+ }
+ int lenValue = cookie.lenVal;
+ for (char k = 3; k <= lenValue && i + k <= to; k++) {
+ if (costs[j + k] - costs[j] <= 12.0) {
+ continue;
+ }
+
+ long newCost = costs[j] + fixedCost(k, subLen[k]);
+ if (newCost < costs[j + k]) {
+ costs[j + k] = newCost;
+ lengthArray[j + k] = k;
+ }
+ }
+ }
+ }
+}
diff --git a/src/net/sourceforge/plantuml/zopfli/SymbolStats.java b/src/net/sourceforge/plantuml/zopfli/SymbolStats.java
new file mode 100644
index 0000000..2378187
--- /dev/null
+++ b/src/net/sourceforge/plantuml/zopfli/SymbolStats.java
@@ -0,0 +1,181 @@
+/*
+Copyright 2014 Google Inc. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Author: eustas.ru@gmail.com (Eugene Klyuchnikov)
+*/
+
+package net.sourceforge.plantuml.zopfli;
+
+final class SymbolStats {
+ private final static double INV_LOG_2 = 1.4426950408889 * 0x10000L; /* 1.0 / log(2.0) */
+ private final int[] litLens = new int[288];
+ private final int[] dists = new int[32]; // Why 32? Expect 30.
+ final long[] lLiterals = new long[288];
+ final long[] lLengths = new long[259];
+ final long[] dSymbols = new long[32];
+
+ void getFreqs(LzStore store) {
+ int[] sLitLens = this.litLens;
+ int[] sDists = this.dists;
+ System.arraycopy(Cookie.intZeroes, 0, sLitLens, 0, 288);
+ System.arraycopy(Cookie.intZeroes, 0, sDists, 0, 32);
+
+ int size = store.size;
+ char[] litLens = store.litLens;
+ char[] dists = store.dists;
+ int[] lengthSymbol = Util.LENGTH_SYMBOL;
+ int[] cachedDistSymbol = Util.CACHED_DIST_SYMBOL;
+ for (int i = 0; i < size; i++) {
+ int d = dists[i];
+ int l = litLens[i];
+ if (d == 0) {
+ sLitLens[l]++;
+ } else {
+ sLitLens[lengthSymbol[l]]++;
+ sDists[cachedDistSymbol[d]]++;
+ }
+ }
+ sLitLens[256] = 1;
+ calculate();
+ }
+
+ final void copy(final SymbolStats source) {
+ System.arraycopy(source.litLens, 0, litLens, 0, 288);
+ System.arraycopy(source.dists, 0, dists, 0, 32);
+ System.arraycopy(source.lLiterals, 0, lLiterals, 0, 288);
+ System.arraycopy(source.lLengths, 0, lLengths, 0, 259);
+ System.arraycopy(source.dSymbols, 0, dSymbols, 0, 32);
+ }
+
+ final void calculate() {
+ calculateLens();
+ calculateDists();
+ }
+
+ final void calculateLens() {
+ int sum = 0;
+ int[] litLens = this.litLens;
+ for (int i = 0; i < 288; ++i) {
+ sum += litLens[i];
+ }
+ double log2sum = (sum == 0 ? Math.log(288) : Math.log(sum)) * INV_LOG_2;
+ long[] lLiterals = this.lLiterals;
+ for (int i = 0; i < 288; ++i) {
+ if (litLens[i] == 0) {
+ lLiterals[i] = (long)log2sum;
+ } else {
+ lLiterals[i] = (long)(log2sum - Math.log(litLens[i]) * INV_LOG_2);
+ }
+ if (lLiterals[i] < 0) {
+ lLiterals[i] = 0;
+ }
+ }
+ long[] lLengths = this.lLengths;
+ int[] lengthSymbol = Util.LENGTH_SYMBOL;
+ int[] lengthExtraBits = Util.LENGTH_EXTRA_BITS;
+ for (int i = 0; i < 259; ++i) {
+ lLengths[i] = lLiterals[lengthSymbol[i]] + (lengthExtraBits[i] * 0x10000L);
+ }
+ }
+
+ final void calculateDists() {
+ int sum = 0;
+ int[] dists = this.dists;
+ for (int i = 0; i < 32; ++i) {
+ sum += dists[i];
+ }
+ double log2sum = (sum == 0 ? Math.log(32) : Math.log(sum)) * INV_LOG_2;
+ long[] dSymbols = this.dSymbols;
+ for (int i = 0; i < 32; ++i) {
+ if (dists[i] == 0) {
+ dSymbols[i] = (long)log2sum;
+ } else {
+ dSymbols[i] = (long)(log2sum - Math.log(dists[i]) * INV_LOG_2);
+ }
+ if (dSymbols[i] < 0) {
+ dSymbols[i] = 0;
+ }
+ }
+ for (int i = 4; i < 30; ++i) {
+ dSymbols[i] += 0x10000L * ((i / 2) - 1);
+ }
+ }
+
+ final void alloy(final SymbolStats ligand) {
+ int[] ligandLitLens = ligand.litLens;
+ for (int i = 0; i < 288; i++) {
+ litLens[i] += ligandLitLens[i] / 2;
+ }
+ litLens[256] = 1;
+
+ int[] ligandDists = ligand.dists;
+ for (int i = 0; i < 32; i++) {
+ dists[i] += ligandDists[i] / 2;
+ }
+ }
+
+ final int randomizeFreqs(int z) {
+ int[] data = litLens;
+ int n = data.length;
+ for (int i = 0; i < n; i++) {
+ z = 0x7FFFFFFF & (1103515245 * z + 12345);
+ if ((z >>> 4) % 3 == 0) {
+ z = 0x7FFFFFFF & (1103515245 * z + 12345);
+ int p = z % n;
+ if (data[i] < data[p]) {
+ data[i] = data[p];
+ }
+ }
+ }
+ data[256] = 1;
+
+ data = dists;
+ n = data.length;
+ for (int i = 0; i < n; i++) {
+ z = 0x7FFFFFFF & (1103515245 * z + 12345);
+ if ((z >>> 4) % 3 == 0) {
+ z = 0x7FFFFFFF & (1103515245 * z + 12345);
+ int p = z % n;
+ if (data[i] < data[p]) {
+ data[i] = data[p];
+ }
+ }
+ }
+
+ return z;
+ }
+
+ final long minCost() {
+ long[] lLengths = this.lLengths;
+ long minLengthCost = lLengths[3];
+ for (int i = 4; i < 259; i++) {
+ long c = lLengths[i];
+ if (c < minLengthCost) {
+ minLengthCost = c;
+ }
+ }
+
+ long[] dSymbols = this.dSymbols;
+ long minDistCost = dSymbols[0];
+ for (int i = 1; i < 30; i++) {
+ long c = dSymbols[i];
+ if (c < minDistCost) {
+ minDistCost = c;
+ }
+ }
+
+ return minDistCost + minLengthCost;
+ }
+}
diff --git a/src/net/sourceforge/plantuml/zopfli/Util.java b/src/net/sourceforge/plantuml/zopfli/Util.java
new file mode 100644
index 0000000..bfd867c
--- /dev/null
+++ b/src/net/sourceforge/plantuml/zopfli/Util.java
@@ -0,0 +1,226 @@
+/*
+Copyright 2014 Google Inc. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Author: eustas.ru@gmail.com (Eugene Klyuchnikov)
+*/
+
+package net.sourceforge.plantuml.zopfli;
+
+class Util {
+
+ static final int[] LENGTH_SYMBOL = new int[]{
+ 0, 0, 0,
+ 257, 258, 259, 260, 261, 262, 263, 264,
+ 265, 265,
+ 266, 266,
+ 267, 267,
+ 268, 268,
+ 269, 269, 269, 269,
+ 270, 270, 270, 270,
+ 271, 271, 271, 271,
+ 272, 272, 272, 272,
+ 273, 273, 273, 273, 273, 273, 273, 273,
+ 274, 274, 274, 274, 274, 274, 274, 274,
+ 275, 275, 275, 275, 275, 275, 275, 275,
+ 276, 276, 276, 276, 276, 276, 276, 276,
+ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277,
+ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
+ 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279,
+ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282,
+ 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283,
+ 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
+ 285
+ };
+
+ static final int[] LENGTH_EXTRA_BITS = new int[]{
+ 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1,
+ 1, 1,
+ 1, 1,
+ 1, 1,
+ 2, 2, 2, 2,
+ 2, 2, 2, 2,
+ 2, 2, 2, 2,
+ 2, 2, 2, 2,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 0
+ };
+
+ static final int[] LENGTH_EXTRA_BITS_VALUE = new int[]{
+ 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1,
+ 0, 1,
+ 0, 1,
+ 0, 1,
+ 0, 1, 2, 3,
+ 0, 1, 2, 3,
+ 0, 1, 2, 3,
+ 0, 1, 2, 3,
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
+ 0
+ };
+
+ static final int[] ORDER = new int[]{
+ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
+ };
+
+ static final int[] CACHED_DIST_SYMBOL = cacheDistSymbol();
+
+ private static int[] cacheDistSymbol() {
+ int[] r = new int[32768];
+ for (int i = 0; i < 32768; ++i) {
+ r[i] = distSymbol(i);
+ }
+ return r;
+ }
+
+ private static int distSymbol(int dist) {
+ if (dist < 193) {
+ if (dist < 13) { /* dist 0..13. */
+ if (dist < 5) return dist - 1;
+ else if (dist < 7) return 4;
+ else if (dist < 9) return 5;
+ else return 6;
+ } else { /* dist 13..193. */
+ if (dist < 17) return 7;
+ else if (dist < 25) return 8;
+ else if (dist < 33) return 9;
+ else if (dist < 49) return 10;
+ else if (dist < 65) return 11;
+ else if (dist < 97) return 12;
+ else if (dist < 129) return 13;
+ else return 14;
+ }
+ } else {
+ if (dist < 2049) { /* dist 193..2049. */
+ if (dist < 257) return 15;
+ else if (dist < 385) return 16;
+ else if (dist < 513) return 17;
+ else if (dist < 769) return 18;
+ else if (dist < 1025) return 19;
+ else if (dist < 1537) return 20;
+ else return 21;
+ } else { /* dist 2049..32768. */
+ if (dist < 3073) return 22;
+ else if (dist < 4097) return 23;
+ else if (dist < 6145) return 24;
+ else if (dist < 8193) return 25;
+ else if (dist < 12289) return 26;
+ else if (dist < 16385) return 27;
+ else if (dist < 24577) return 28;
+ else return 29;
+ }
+ }
+ }
+
+ static final int[] CACHED_DIST_EXTRA_BITS = precacheDistExtraBits();
+
+ private static int[] precacheDistExtraBits() {
+ int[] r = new int[4097];
+ for (int i = 0; i < 4097; ++i) {
+ r[i] = distExtraBits(i);
+ }
+ return r;
+ }
+
+ private static int distExtraBits(int dist) {
+ if (dist < 5) {
+ return 0;
+ } else if (dist < 9) {
+ return 1;
+ } else if (dist < 17) {
+ return 2;
+ } else if (dist < 33) {
+ return 3;
+ } else if (dist < 65) {
+ return 4;
+ } else if (dist < 129) {
+ return 5;
+ } else if (dist < 257) {
+ return 6;
+ } else if (dist < 513) {
+ return 7;
+ } else if (dist < 1025) {
+ return 8;
+ } else if (dist < 2049) {
+ return 9;
+ } else if (dist < 4097) {
+ return 10;
+ } else if (dist < 8193) {
+ return 11;
+ } else if (dist < 16385) {
+ return 12;
+ }
+ return 13;
+ }
+
+ static int distExtraBitsValue(int dist) {
+ if (dist < 5) {
+ return 0;
+ } else if (dist < 9) {
+ return (dist - 5) & 1;
+ } else if (dist < 17) {
+ return (dist - 9) & 3;
+ } else if (dist < 33) {
+ return (dist - 17) & 7;
+ } else if (dist < 65) {
+ return (dist - 33) & 15;
+ } else if (dist < 129) {
+ return (dist - 65) & 31;
+ } else if (dist < 257) {
+ return (dist - 129) & 63;
+ } else if (dist < 513) {
+ return (dist - 257) & 127;
+ } else if (dist < 1025) {
+ return (dist - 513) & 255;
+ } else if (dist < 2049) {
+ return (dist - 1025) & 511;
+ } else if (dist < 4097) {
+ return (dist - 2049) & 1023;
+ } else if (dist < 8193) {
+ return (dist - 4097) & 2047;
+ } else if (dist < 16385) {
+ return (dist - 8193) & 4095;
+ }
+ return (dist - 16385) & 8191;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/zopfli/Zopfli.java b/src/net/sourceforge/plantuml/zopfli/Zopfli.java
new file mode 100644
index 0000000..14a2cca
--- /dev/null
+++ b/src/net/sourceforge/plantuml/zopfli/Zopfli.java
@@ -0,0 +1,144 @@
+/*
+Copyright 2014 Google Inc. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Author: eustas.ru@gmail.com (Eugene Klyuchnikov)
+*/
+
+package net.sourceforge.plantuml.zopfli;
+
+public class Zopfli {
+
+ private static class Crc {
+
+ private final static int[] table = makeTable();
+
+ private static int[] makeTable() {
+ int[] result = new int[256];
+
+ for (int n = 0; n < 256; ++n) {
+ int c = n;
+ for (int k = 0; k < 8; ++k) {
+ if ((c & 1) == 1) {
+ c = 0xEDB88320 ^ (c >>> 1);
+ } else {
+ c = c >>> 1;
+ }
+ }
+ result[n] = c;
+ }
+
+ return result;
+ }
+
+ public static int calculate(byte[] input) {
+ int c = ~0;
+ for (int i = 0, n = input.length; i < n; ++i) {
+ c = table[(c ^ input[i]) & 0xFF] ^ (c >>> 8);
+ }
+ return ~c;
+ }
+ }
+
+ private final Cookie cookie;
+
+ public synchronized Buffer compress(Options options, byte[] input) {
+ Buffer output = new Buffer();
+ switch (options.outputType) {
+ case GZIP:
+ compressGzip(options, input, output);
+ break;
+
+ case ZLIB:
+ compressZlib(options, input, output);
+ break;
+ case DEFLATE:
+ Deflate.compress(cookie, options, input, output);
+ break;
+ default:
+ throw new IllegalArgumentException(
+ "Unexpected output format: " + options.outputType);
+ }
+ return output;
+ }
+
+ /**
+ * Calculates the adler32 checksum of the data
+ */
+ private static int adler32(byte[] data) {
+ int s1 = 1;
+ int s2 = 1 >> 16;
+ int i = 0;
+ while (i < data.length) {
+ int tick = Math.min(data.length, i + 1024);
+ while (i < tick) {
+ s1 += data[i++];
+ s2 += s1;
+ }
+ s1 %= 65521;
+ s2 %= 65521;
+ }
+
+ return (s2 << 16) | s1;
+ }
+
+
+ private void compressZlib(Options options, byte[] input,
+ Buffer output) {
+ output.append((byte) 0x78);
+ output.append((byte) 0x1E);
+
+ Deflate.compress(cookie, options, input, output);
+
+ int checksum = adler32(input);
+ output.append((byte) ((checksum >> 24) & 0xFF));
+ output.append((byte) ((checksum >> 16) & 0xFF));
+ output.append((byte) ((checksum >> 8) & 0xFF));
+ output.append((byte) (checksum & 0xFF));
+ }
+
+ private void compressGzip(Options options, byte[] input,
+ Buffer output) {
+ output.append((byte) 31);
+ output.append((byte) 139);
+ output.append((byte) 8);
+ output.append((byte) 0);
+
+ output.append((byte) 0);
+ output.append((byte) 0);
+ output.append((byte) 0);
+ output.append((byte) 0);
+
+ output.append((byte) 2);
+ output.append((byte) 3);
+
+ Deflate.compress(cookie, options, input, output);
+
+ int crc = Crc.calculate(input);
+ output.append((byte) (crc & 0xFF));
+ output.append((byte) ((crc >> 8) & 0xFF));
+ output.append((byte) ((crc >> 16) & 0xFF));
+ output.append((byte) ((crc >> 24) & 0xFF));
+
+ int size = input.length;
+ output.append((byte) (size & 0xFF));
+ output.append((byte) ((size >> 8) & 0xFF));
+ output.append((byte) ((size >> 16) & 0xFF));
+ output.append((byte) ((size >> 24) & 0xFF));
+ }
+
+ public Zopfli(int masterBlockSize) {
+ cookie = new Cookie(masterBlockSize);
+ }
+}
diff --git a/src/smetana/core/AllH.java b/src/smetana/core/AllH.java
index 41c0a09..5128503 100644
--- a/src/smetana/core/AllH.java
+++ b/src/smetana/core/AllH.java
@@ -44,6 +44,8 @@ public interface AllH extends Agraph_s, Agobj_s, Agrec_s, Agdesc_s, Agmemdisc_s,
pack_info, aspect_t, fontinfo, shape_functions, polygon_t, shape_desc, textlabel_t, IMapEntry_t, textspan_t,
textfont_t, point, port, elist, Dtmemory_f, nlist_t, nodequeue, Agnodeinfo_t, Agedgeinfo_t, spline_info_t,
splineInfo, path, pathend_t, boxf, Ppoly_t, pointnlink_t, deque_t, triangle_t, tna_t, Pedge_t, splines, bezier,
- inside_t, arrowdir_t, arrowtype_t, label_params_t, object_t, xlabel_t, adjmatrix_t {
+ inside_t, arrowdir_t, arrowtype_t, label_params_t, object_t, xlabel_t, adjmatrix_t, _Node_t___, RTree,
+ HDict_t, XLabels_t
+ {
}
diff --git a/src/smetana/core/ArrayOfInteger.java b/src/smetana/core/ArrayOfInteger.java
new file mode 100644
index 0000000..b141731
--- /dev/null
+++ b/src/smetana/core/ArrayOfInteger.java
@@ -0,0 +1,92 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program.
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package smetana.core;
+
+import smetana.core.amiga.Area;
+
+public class ArrayOfInteger implements __array_of_integer__ {
+
+ private final int[] data;
+ private final int position;
+
+ public ArrayOfInteger(int[] data, int position) {
+ this.data = data;
+ this.position = position;
+
+ }
+
+ public String getUID36() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void swap(int i, int j) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void realloc(int nb) {
+ throw new UnsupportedOperationException();
+ }
+
+ public int comparePointerInternal(__array_of_integer__ other) {
+ throw new UnsupportedOperationException();
+ }
+
+ public final __array_of_integer__ move(int delta) {
+ return plus(delta);
+ }
+
+ public __array_of_integer__ plus(int delta) {
+ return new ArrayOfInteger(data, position + delta);
+ }
+
+ public Area getInternal(int idx) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void memcopyFrom(Area source) {
+ throw new UnsupportedOperationException();
+ }
+
+ public int getInt() {
+ return data[position];
+ }
+
+ public void setInt(int value) {
+ data[position] = value;
+ }
+
+}
diff --git a/src/smetana/core/JUtils.java b/src/smetana/core/JUtils.java
index e409d38..44477b5 100644
--- a/src/smetana/core/JUtils.java
+++ b/src/smetana/core/JUtils.java
@@ -36,36 +36,11 @@
package smetana.core;
-import h.Agdesc_s;
-import h.Agedge_s;
-import h.Agedgeinfo_t;
-import h.Agiddisc_s;
-import h.Agmemdisc_s;
-import h.Agtag_s;
-import h.ST_Agdesc_s;
-import h.ST_Agiddisc_s;
-import h.ST_Agmemdisc_s;
-import h.ST_Agtag_s;
-import h.ST_arrowname_t;
-import h.ST_arrowtype_t;
-import h.ST_boxf;
-import h.ST_dtdisc_s;
-import h.ST_dtmethod_s;
-import h.ST_elist;
-import h.ST_nlist_t;
-import h.ST_pointf;
-import h.ST_port;
-import h._dtdisc_s;
-import h._dtmethod_s;
-import h.arrowname_t;
-import h.arrowtype_t;
-import h.bezier;
-import h.boxf;
-import h.elist;
-import h.nlist_t;
-import h.pointf;
-import h.port;
-import h.splines;
+import h.*;
+
+import java.util.LinkedHashSet;
+import java.util.Set;
+
import smetana.core.amiga.StarArrayOfInteger;
import smetana.core.amiga.StarArrayOfPtr;
import smetana.core.amiga.StarArrayOfStruct;
@@ -96,6 +71,50 @@ public class JUtils {
}
public static size_t sizeof(Class cl, int nb) {
+ if (cl == pointf.class) {
+ return ST_pointf.sizeof(nb);
+ }
+ if (cl == boxf.class) {
+ return ST_boxf.sizeof(nb);
+ }
+ if (cl == pointnlink_t.class) {
+ return ST_pointnlink_t.sizeof(nb);
+ }
+ if (cl == textspan_t.class) {
+ return ST_textspan_t.sizeof(nb);
+ }
+ // if (UmlDiagram.SMETANA_BETA) {
+ if (cl == Agraph_s.class) {
+ return ST_Agraph_s.sizeof(nb);
+ }
+ if (cl == rank_t.class) {
+ return ST_rank_t.sizeof(nb);
+ }
+ if (cl == Agnode_s.class) {
+ return ST_Agnode_s.sizeof(nb);
+ }
+ if (cl == bezier.class) {
+ return ST_bezier.sizeof(nb);
+ }
+ if (cl == triangle_t.class) {
+ return ST_triangle_t.sizeof(nb);
+ }
+ if (cl == Pedge_t.class) {
+ return ST_Pedge_t.sizeof(nb);
+ }
+ if (cl == tna_t.class) {
+ return ST_tna_t.sizeof(nb);
+ }
+ if (cl == object_t.class) {
+ return ST_object_t.sizeof(nb);
+ }
+ if (cl == xlabel_t.class) {
+ return ST_xlabel_t.sizeof(nb);
+ }
+ // }
+ if (from(cl) instanceof __struct_impl__ == false) {
+ throw new IllegalArgumentException(cl.getName());
+ }
return new size_t_array_of_something(cl, nb);
}
@@ -104,6 +123,18 @@ public class JUtils {
}
public static size_t sizeof_starstar_empty(Class cl, int nb) {
+ if (cl == Agedge_s.class) {
+ return ST_Agedge_s.sizeof_starstar_empty(nb);
+ }
+ if (cl == Agnode_s.class) {
+ return ST_Agnode_s.sizeof_starstar_empty(nb);
+ }
+ if (cl == pointnlink_t.class) {
+ return ST_pointnlink_t.sizeof_starstar_empty(nb);
+ }
+ if (from(cl) instanceof __struct_impl__ == false) {
+ throw new IllegalArgumentException(cl.getName());
+ }
return new size_t_array_of_array_of_something_empty(cl, nb);
}
@@ -312,6 +343,8 @@ public class JUtils {
change = true;
if (array instanceof StarArrayOfInteger) {
((StarArrayOfInteger) array).swap(i, i + 1);
+ } else if (array instanceof STStarArrayOfPointer) {
+ ((STStarArrayOfPointer) array).swap(i, i + 1);
} else {
((StarStar) array).swap(i, i + 1);
}
@@ -426,6 +459,206 @@ public class JUtils {
if (theClass == port.class) {
return new ST_port();
}
+ if (theClass == polygon_t.class) {
+ return new ST_polygon_t();
+ }
+ if (theClass == shape_functions.class) {
+ return new ST_shape_functions();
+ }
+ if (theClass == shape_desc.class) {
+ return new ST_shape_desc();
+ }
+ if (theClass == deque_t.class) {
+ return new ST_deque_t();
+ }
+ if (theClass == pointnlink_t.class) {
+ return new ST_pointnlink_t();
+ }
+ if (theClass == Ppoly_t.class) {
+ return new ST_Ppoly_t();
+ }
+ if (theClass == splineInfo.class) {
+ return new ST_splineInfo();
+ }
+ if (theClass == textfont_t.class) {
+ return new ST_textfont_t();
+ }
+ //
+ // if (UmlDiagram.SMETANA_BETA) {
+ if (theClass == Agsubnode_s.class) {
+ return new ST_Agsubnode_s();
+ }
+ if (theClass == _dtlink_s.class) {
+ return new ST_dtlink_s();
+ }
+ if (theClass == refstr_t.class) {
+ return new ST_refstr_t();
+ }
+ if (theClass == Agsym_s.class) {
+ return new ST_Agsym_s();
+ }
+ if (theClass == Agedge_s.class) {
+ return new ST_Agedge_s();
+ }
+ if (theClass == Agobj_s.class) {
+ return new ST_Agobj_s();
+ }
+ if (theClass == Agrec_s.class) {
+ return new ST_Agrec_s();
+ }
+ if (theClass == Agraph_s.class) {
+ return new ST_Agraph_s();
+ }
+ if (theClass == Agclos_s.class) {
+ return new ST_Agclos_s();
+ }
+ if (theClass == Agdisc_s.class) {
+ return new ST_Agdisc_s();
+ }
+ if (theClass == Agdstate_s.class) {
+ return new ST_Agdstate_s();
+ }
+ if (theClass == Agiodisc_s.class) {
+ return new ST_Agiodisc_s();
+ }
+ if (theClass == _dt_s.class) {
+ return new ST_dt_s();
+ }
+ if (theClass == _dtdata_s.class) {
+ return new ST_dtdata_s();
+ }
+ if (theClass == Agdatadict_s.class) {
+ return new ST_Agdatadict_s();
+ }
+ if (theClass == Agattr_s.class) {
+ return new ST_Agattr_s();
+ }
+ if (theClass == Agcbstack_s.class) {
+ return new ST_Agcbstack_s();
+ }
+ if (theClass == Agnode_s.class) {
+ return new ST_Agnode_s();
+ }
+ if (theClass == Agedgepair_s.class) {
+ return new ST_Agedgepair_s();
+ }
+ if (theClass == Agraphinfo_t.class) {
+ return new ST_Agraphinfo_t();
+ }
+ if (theClass == GVC_s.class) {
+ return new ST_GVC_s();
+ }
+ if (theClass == GVCOMMON_t.class) {
+ return new ST_GVCOMMON_t();
+ }
+ if (theClass == gvlayout_engine_s.class) {
+ return new ST_gvlayout_engine_s();
+ }
+ if (theClass == gvlayout_features_t.class) {
+ return new ST_gvlayout_features_t();
+ }
+ if (theClass == gvplugin_active_layout_t.class) {
+ return new ST_gvplugin_active_layout_t();
+ }
+ if (theClass == gvplugin_installed_t.class) {
+ return new ST_gvplugin_installed_t();
+ }
+ if (theClass == layout_t.class) {
+ return new ST_layout_t();
+ }
+ if (theClass == Agnodeinfo_t.class) {
+ return new ST_Agnodeinfo_t();
+ }
+ if (theClass == textlabel_t.class) {
+ return new ST_textlabel_t();
+ }
+ if (theClass == textspan_t.class) {
+ return new ST_textspan_t();
+ }
+ if (theClass == rank_t.class) {
+ return new ST_rank_t();
+ }
+ if (theClass == adjmatrix_t.class) {
+ return new ST_adjmatrix_t();
+ }
+ if (theClass == Agedgeinfo_t.class) {
+ return new ST_Agedgeinfo_t();
+ }
+ if (theClass == splines.class) {
+ return new ST_splines();
+ }
+ if (theClass == bezier.class) {
+ return new ST_bezier();
+ }
+ if (theClass == _dthold_s.class) {
+ return new ST_dthold_s();
+ }
+ //
+ if (theClass == pack_info.class) {
+ return new ST_pack_info();
+ }
+ if (theClass == aspect_t.class) {
+ return new ST_aspect_t();
+ }
+ if (theClass == fontinfo.class) {
+ return new ST_fontinfo();
+ }
+ if (theClass == IMapEntry_t.class) {
+ return new ST_IMapEntry_t();
+ }
+ if (theClass == point.class) {
+ return new ST_point();
+ }
+ if (theClass == nodequeue.class) {
+ return new ST_nodequeue();
+ }
+ if (theClass == spline_info_t.class) {
+ return new ST_spline_info_t();
+ }
+ if (theClass == path.class) {
+ return new ST_path();
+ }
+ if (theClass == pathend_t.class) {
+ return new ST_pathend_t();
+ }
+ if (theClass == inside_t.class) {
+ return new ST_inside_t();
+ }
+ if (theClass == triangle_t.class) {
+ return new ST_triangle_t();
+ }
+ if (theClass == tedge_t.class) {
+ return new ST_tedge_t();
+ }
+ if (theClass == Pedge_t.class) {
+ return new ST_Pedge_t();
+ }
+ if (theClass == tna_t.class) {
+ return new ST_tna_t();
+ }
+ if (theClass == label_params_t.class) {
+ return new ST_label_params_t();
+ }
+ if (theClass == object_t.class) {
+ return new ST_object_t();
+ }
+ if (theClass == xlabel_t.class) {
+ return new ST_xlabel_t();
+ }
+ if (theClass == XLabels_t.class) {
+ return new ST_XLabels_t();
+ }
+ if (theClass == HDict_t.class) {
+ return new ST_HDict_t();
+ }
+ if (theClass == RTree.class) {
+ return new ST_RTree();
+ }
+ if (theClass == _Node_t___.class) {
+ return new ST_Node_t___();
+ }
+ // }
+ notFound(theClass);
return new __struct_impl__<C>(theClass);
}
@@ -469,7 +702,214 @@ public class JUtils {
if (theClass == port.class) {
return new ST_port(parent);
}
+ if (theClass == polygon_t.class) {
+ return new ST_polygon_t(parent);
+ }
+ if (theClass == shape_functions.class) {
+ return new ST_shape_functions(parent);
+ }
+ if (theClass == shape_desc.class) {
+ return new ST_shape_desc(parent);
+ }
+ if (theClass == deque_t.class) {
+ return new ST_deque_t(parent);
+ }
+ if (theClass == pointnlink_t.class) {
+ return new ST_pointnlink_t(parent);
+ }
+ if (theClass == Ppoly_t.class) {
+ return new ST_Ppoly_t(parent);
+ }
+ if (theClass == splineInfo.class) {
+ return new ST_splineInfo(parent);
+ }
+ if (theClass == textfont_t.class) {
+ return new ST_textfont_t(parent);
+ }
+ //
+ // if (UmlDiagram.SMETANA_BETA) {
+ if (theClass == Agsubnode_s.class) {
+ return new ST_Agsubnode_s(parent);
+ }
+ if (theClass == _dtlink_s.class) {
+ return new ST_dtlink_s(parent);
+ }
+ if (theClass == refstr_t.class) {
+ return new ST_refstr_t(parent);
+ }
+ if (theClass == Agsym_s.class) {
+ return new ST_Agsym_s(parent);
+ }
+ if (theClass == Agedge_s.class) {
+ return new ST_Agedge_s(parent);
+ }
+ if (theClass == Agobj_s.class) {
+ return new ST_Agobj_s(parent);
+ }
+ if (theClass == Agrec_s.class) {
+ return new ST_Agrec_s(parent);
+ }
+ if (theClass == Agraph_s.class) {
+ return new ST_Agraph_s(parent);
+ }
+ if (theClass == Agclos_s.class) {
+ return new ST_Agclos_s(parent);
+ }
+ if (theClass == Agdisc_s.class) {
+ return new ST_Agdisc_s(parent);
+ }
+ if (theClass == Agdstate_s.class) {
+ return new ST_Agdstate_s(parent);
+ }
+ if (theClass == _dt_s.class) {
+ return new ST_dt_s(parent);
+ }
+ if (theClass == _dtdata_s.class) {
+ return new ST_dtdata_s(parent);
+ }
+ if (theClass == Agdatadict_s.class) {
+ return new ST_Agdatadict_s(parent);
+ }
+ if (theClass == Agattr_s.class) {
+ return new ST_Agattr_s(parent);
+ }
+ if (theClass == Agcbstack_s.class) {
+ return new ST_Agcbstack_s(parent);
+ }
+ if (theClass == Agnode_s.class) {
+ return new ST_Agnode_s(parent);
+ }
+ if (theClass == Agedgepair_s.class) {
+ return new ST_Agedgepair_s(parent);
+ }
+ if (theClass == Agraphinfo_t.class) {
+ return new ST_Agraphinfo_t(parent);
+ }
+ if (theClass == GVC_s.class) {
+ return new ST_GVC_s(parent);
+ }
+ if (theClass == GVCOMMON_t.class) {
+ return new ST_GVCOMMON_t(parent);
+ }
+ if (theClass == gvlayout_engine_s.class) {
+ throw new UnsupportedOperationException();
+ // return new ST_gvlayout_engine_s(parent);
+ }
+ if (theClass == gvlayout_features_t.class) {
+ throw new UnsupportedOperationException();
+ // return new ST_gvlayout_features_t(parent);
+ }
+ if (theClass == gvplugin_active_layout_t.class) {
+ throw new UnsupportedOperationException();
+ // return new ST_gvplugin_active_layout_t(parent);
+ }
+ if (theClass == gvplugin_installed_t.class) {
+ return new ST_gvplugin_installed_t(parent);
+ }
+ if (theClass == layout_t.class) {
+ return new ST_layout_t(parent);
+ }
+ if (theClass == Agnodeinfo_t.class) {
+ return new ST_Agnodeinfo_t(parent);
+ }
+ if (theClass == textlabel_t.class) {
+ return new ST_textlabel_t(parent);
+ }
+ if (theClass == textspan_t.class) {
+ return new ST_textspan_t(parent);
+ }
+ if (theClass == rank_t.class) {
+ return new ST_rank_t(parent);
+ }
+ if (theClass == adjmatrix_t.class) {
+ return new ST_adjmatrix_t(parent);
+ }
+ if (theClass == Agedgeinfo_t.class) {
+ return new ST_Agedgeinfo_t(parent);
+ }
+ if (theClass == splines.class) {
+ return new ST_splines(parent);
+ }
+ if (theClass == bezier.class) {
+ return new ST_bezier(parent);
+ }
+ if (theClass == _dthold_s.class) {
+ return new ST_dthold_s(parent);
+ }
+ //
+ if (theClass == pack_info.class) {
+ return new ST_pack_info(parent);
+ }
+ if (theClass == aspect_t.class) {
+ return new ST_aspect_t(parent);
+ }
+ if (theClass == fontinfo.class) {
+ return new ST_fontinfo(parent);
+ }
+ if (theClass == IMapEntry_t.class) {
+ return new ST_IMapEntry_t(parent);
+ }
+ if (theClass == point.class) {
+ return new ST_point(parent);
+ }
+ if (theClass == nodequeue.class) {
+ return new ST_nodequeue(parent);
+ }
+ if (theClass == spline_info_t.class) {
+ return new ST_spline_info_t(parent);
+ }
+ if (theClass == path.class) {
+ return new ST_path(parent);
+ }
+ if (theClass == pathend_t.class) {
+ return new ST_pathend_t(parent);
+ }
+ if (theClass == inside_t.class) {
+ return new ST_inside_t(parent);
+ }
+ if (theClass == triangle_t.class) {
+ return new ST_triangle_t(parent);
+ }
+ if (theClass == tedge_t.class) {
+ return new ST_tedge_t(parent);
+ }
+ if (theClass == Pedge_t.class) {
+ return new ST_Pedge_t(parent);
+ }
+ if (theClass == tna_t.class) {
+ return new ST_tna_t(parent);
+ }
+ if (theClass == label_params_t.class) {
+ return new ST_label_params_t(parent);
+ }
+ if (theClass == object_t.class) {
+ return new ST_object_t(parent);
+ }
+ if (theClass == xlabel_t.class) {
+ return new ST_xlabel_t(parent);
+ }
+ if (theClass == XLabels_t.class) {
+ return new ST_XLabels_t(parent);
+ }
+ if (theClass == HDict_t.class) {
+ return new ST_HDict_t(parent);
+ }
+ if (theClass == RTree.class) {
+ return new ST_RTree(parent);
+ }
+ if (theClass == _Node_t___.class) {
+ return new ST_Node_t___(parent);
+ }
+ // }
+ notFound(theClass);
return new StarStructImpl(theClass, parent);
}
+ private static final Set<String> todo = new LinkedHashSet<String>();
+
+ private static void notFound(Class theClass) {
+ todo.add(theClass.getName());
+ System.err.println("todo=" + todo);
+ }
+
}
diff --git a/src/smetana/core/JUtilsOk1.java b/src/smetana/core/JUtilsOk1.java
new file mode 100644
index 0000000..c9a5966
--- /dev/null
+++ b/src/smetana/core/JUtilsOk1.java
@@ -0,0 +1,652 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program.
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package smetana.core;
+
+import h.Agclos_s;
+import h.Agdesc_s;
+import h.Agdisc_s;
+import h.Agdstate_s;
+import h.Agedge_s;
+import h.Agedgeinfo_t;
+import h.Agiddisc_s;
+import h.Agiodisc_s;
+import h.Agmemdisc_s;
+import h.Agobj_s;
+import h.Agraph_s;
+import h.Agrec_s;
+import h.Agsubnode_s;
+import h.Agsym_s;
+import h.Agtag_s;
+import h.Ppoly_t;
+import h.ST_Agclos_s;
+import h.ST_Agdesc_s;
+import h.ST_Agdisc_s;
+import h.ST_Agdstate_s;
+import h.ST_Agedge_s;
+import h.ST_Agiddisc_s;
+import h.ST_Agiodisc_s;
+import h.ST_Agmemdisc_s;
+import h.ST_Agobj_s;
+import h.ST_Agraph_s;
+import h.ST_Agrec_s;
+import h.ST_Agsubnode_s;
+import h.ST_Agsym_s;
+import h.ST_Agtag_s;
+import h.ST_Ppoly_t;
+import h.ST_arrowname_t;
+import h.ST_arrowtype_t;
+import h.ST_boxf;
+import h.ST_deque_t;
+import h.ST_dtdisc_s;
+import h.ST_dtlink_s;
+import h.ST_dtmethod_s;
+import h.ST_elist;
+import h.ST_nlist_t;
+import h.ST_pointf;
+import h.ST_pointnlink_t;
+import h.ST_polygon_t;
+import h.ST_port;
+import h.ST_refstr_t;
+import h.ST_shape_desc;
+import h.ST_shape_functions;
+import h.ST_splineInfo;
+import h.ST_textfont_t;
+import h._dtdisc_s;
+import h._dtlink_s;
+import h._dtmethod_s;
+import h.arrowname_t;
+import h.arrowtype_t;
+import h.bezier;
+import h.boxf;
+import h.deque_t;
+import h.elist;
+import h.nlist_t;
+import h.pointf;
+import h.pointnlink_t;
+import h.polygon_t;
+import h.port;
+import h.refstr_t;
+import h.shape_desc;
+import h.shape_functions;
+import h.splineInfo;
+import h.splines;
+import h.textfont_t;
+import smetana.core.amiga.StarArrayOfInteger;
+import smetana.core.amiga.StarArrayOfPtr;
+import smetana.core.amiga.StarArrayOfStruct;
+import smetana.core.amiga.StarStar;
+import smetana.core.amiga.StarStruct;
+import smetana.core.amiga.StarStructImpl;
+
+// http://docs.oracle.com/javase/specs/jls/se5.0/html/expressions.html#15.7.4
+// http://www.jbox.dk/sanos/source/lib/string.c.html
+
+public class JUtilsOk1 {
+
+ public static int USHRT_MAX = 65535;
+
+ public static size_t sizeof(Class cl) {
+ return new size_t_struct(cl);
+ }
+
+ public static size_t sizeof(__ptr__ element) {
+ return new size_t_of_element(element);
+ }
+
+ public static size_t sizeof(String name, int sz) {
+ if (name.equals("char*")) {
+ return new size_t_array_of_charstars(sz);
+ }
+ throw new UnsupportedOperationException();
+ }
+
+ public static size_t sizeof(Class cl, int nb) {
+ if (cl == pointf.class) {
+ return ST_pointf.sizeof(nb);
+ }
+ if (cl == boxf.class) {
+ return ST_boxf.sizeof(nb);
+ }
+ if (cl == pointnlink_t.class) {
+ return ST_pointnlink_t.sizeof(nb);
+ }
+ if (from(cl) instanceof __struct_impl__ == false) {
+ throw new IllegalArgumentException(cl.getName());
+ }
+ return new size_t_array_of_something(cl, nb);
+ }
+
+ public static size_t size_t_array_of_integer(int nb) {
+ return new size_t_array_of_integer(nb);
+ }
+
+ public static size_t sizeof_starstar_empty(Class cl, int nb) {
+ if (cl == pointnlink_t.class) {
+ return ST_pointnlink_t.sizeof_starstar_empty(nb);
+ }
+ if (from(cl) instanceof __struct_impl__ == false) {
+ throw new IllegalArgumentException(cl.getName());
+ }
+ return new size_t_array_of_array_of_something_empty(cl, nb);
+ }
+
+ public static int strcmp(CString s1, CString s2) {
+ return s1.compareTo(s2);
+ }
+
+ public static int strncmp(CString s1, CString s2, int n) {
+ return s1.compareTo(s2, n);
+ }
+
+ public static CString strstr(CString s1, CString s2) {
+ throw new UnsupportedOperationException("s1=" + s1 + " s2=" + s2);
+ }
+
+ public static void strncpy(CString destination, CString source, int nb) {
+ destination.copyFrom(source, nb);
+ }
+
+ public static CString strchr(CString str, char c) {
+ return str.strchr(c);
+ }
+
+ public static int strtol(CString str, CString[] endptr, int base) {
+ if (base != 10) {
+ throw new IllegalArgumentException();
+ }
+ CString end = str;
+ int result = Integer.parseInt(end.getContent());
+ endptr[0] = end.plus(("" + result).length());
+ return result;
+ }
+
+ public static double strtod(CString str, CString[] endptr) {
+ final double result = Double.parseDouble(str.getContent());
+ return result;
+ }
+
+ public static double atof(CString str) {
+ return Double.parseDouble(str.getContent());
+ }
+
+ public static int memcmp(__ptr__ s1, __ptr__ s2, int sz) {
+ throw new UnsupportedOperationException("s1=" + s1 + " s2=" + s2 + " sz=" + sz);
+ }
+
+ public static void memset(__ptr__ obj, int value, size_t nbytes) {
+ if (value != 0) {
+ throw new UnsupportedOperationException();
+ }
+ }
+
+ public static int strlen(CString s) {
+ return s.length();
+ }
+
+ public static double abs(double x) {
+ return Math.abs(x);
+ }
+
+ public static double cos(double x) {
+ return Math.cos(x);
+ }
+
+ public static double sin(double x) {
+ return Math.sin(x);
+ }
+
+ public static double sqrt(double x) {
+ return Math.sqrt(x);
+ }
+
+ public static double atan2(double a, double b) {
+ return Math.atan2(a, b);
+ }
+
+ public static double pow(double a, double b) {
+ return Math.pow(a, b);
+ }
+
+ public static boolean isdigit(char c) {
+ return Character.isDigit(c);
+ }
+
+ public static int atoi(CString s) {
+ return Integer.parseInt(s.getContent());
+ }
+
+ public static char tolower(char c) {
+ return Character.toLowerCase(c);
+ }
+
+ public static CFunction function(Class codingClass, String name) {
+ return CFunctionImpl.create(codingClass, name);
+ }
+
+ public static int enumAsInt(Class enumClass, String name) {
+ CEnumInterpretor interpretor = new CEnumInterpretor(enumClass);
+ final int result = interpretor.valueOf(name);
+ JUtilsOk1.LOG("result for " + name + " is " + result);
+ return result;
+ }
+
+ public static CString getenv(CString var) {
+ return null;
+ }
+
+ public static void LOG(String s) {
+ // System.err.println(s);
+ }
+
+ public static void LOG2(String s) {
+ // System.err.println(s);
+ }
+
+ public static boolean EQ(Object o1, Object o2) {
+ if (o1 == o2) {
+ return true;
+ }
+ if (o1 == null && o2 != null) {
+ return false;
+ }
+ if (o2 == null && o1 != null) {
+ return false;
+ }
+ // if (o1 instanceof AreaArray && o2 instanceof AreaArray) {
+ // return ((AreaArray) o1).isSameThan((AreaArray) o2);
+ // }
+ if (o1 instanceof StarStruct && o2 instanceof StarStruct) {
+ return ((StarStruct) o1).isSameThan((StarStruct) o2);
+ }
+ if (o1 instanceof CString && o2 instanceof CString) {
+ return ((CString) o1).isSameThan((CString) o2);
+ }
+ if (o1 instanceof StarArrayOfPtr && o2 instanceof StarArrayOfPtr) {
+ return ((StarArrayOfPtr) o1).isSameThan((StarArrayOfPtr) o2);
+ }
+ if (o1 instanceof StarStar && o2 instanceof StarStruct) {
+ __ptr__ o1b = ((StarStar) o1).getPtr();
+ if (((StarStruct) o1b).getRealClass() != ((StarStruct) o2).getRealClass()) {
+ throw new UnsupportedOperationException();
+ }
+ return EQ(o1b, o2);
+ }
+ if (o1 instanceof StarStruct && o2 instanceof StarArrayOfPtr) {
+ __ptr__ o2b = ((StarArrayOfPtr) o2).getPtrForEquality();
+ if (((StarStruct) o1).getRealClass() != ((StarStruct) o2b).getRealClass()) {
+ throw new UnsupportedOperationException();
+ }
+ return EQ(o1, o2b);
+ }
+ if (o1 instanceof StarStruct && o2 instanceof StarArrayOfStruct) {
+ __ptr__ o2b = ((StarArrayOfStruct) o2).getPtrForEquality();
+ if (((StarStruct) o1).getRealClass() != ((StarStruct) o2b).getRealClass()) {
+ throw new UnsupportedOperationException();
+ }
+ return EQ(o1, o2b);
+ }
+ if (o1 instanceof StarStar && o2 instanceof StarArrayOfPtr) {
+ __ptr__ o1b = ((StarStar) o1).getPtr();
+ __ptr__ o2b = ((StarArrayOfPtr) o2).getPtr();
+ if (((StarStruct) o1b).getRealClass() != ((StarStruct) o2b).getRealClass()) {
+ throw new UnsupportedOperationException();
+ }
+ return EQ(o1b, o2b);
+ }
+ if (o1 instanceof StarArrayOfStruct && o2 instanceof StarArrayOfStruct) {
+ StarArrayOfStruct oo1 = (StarArrayOfStruct) o1;
+ StarArrayOfStruct oo2 = (StarArrayOfStruct) o2;
+ return oo1.isSameThan(oo2);
+ }
+ if (o1 instanceof StarArrayOfPtr && o2 instanceof StarArrayOfStruct) {
+ StarArrayOfPtr oo1 = (StarArrayOfPtr) o1;
+ StarArrayOfStruct oo2 = (StarArrayOfStruct) o2;
+ __struct__ s1 = oo1.getStruct();
+ __struct__ s2 = oo2.getStruct();
+ boolean result = s1.getInternalData().isSameThan(s2.getInternalData());
+ return result;
+ }
+ System.err.println("o1=" + o1.getClass() + " " + o1);
+ System.err.println("o2=" + o2.getClass() + " " + o2);
+ throw new UnsupportedOperationException();
+ }
+
+ public static boolean NEQ(Object o1, Object o2) {
+ return EQ(o1, o2) == false;
+ }
+
+ public static void qsort(__ptr__ array, int nb, size_t size, CFunction compare) {
+ if (nb <= 1) {
+ return;
+ }
+ JUtilsOk1.LOG("array=" + array);
+ JUtilsOk1.LOG("nb=" + nb);
+ JUtilsOk1.LOG("size=" + size);
+ JUtilsOk1.LOG("compare=" + compare);
+ boolean change;
+ do {
+ change = false;
+ for (int i = 0; i < nb - 1; i++) {
+ __ptr__ element1 = array.plus(i);
+ __ptr__ element2 = array.plus(i + 1);
+ Integer cmp = (Integer) compare.exe(element1, element2);
+ JUtilsOk1.LOG("cmp=" + cmp);
+ if (cmp.intValue() > 0) {
+ change = true;
+ if (array instanceof StarArrayOfInteger) {
+ ((StarArrayOfInteger) array).swap(i, i + 1);
+ } else {
+ ((StarStar) array).swap(i, i + 1);
+ }
+ }
+ }
+ } while (change);
+ for (int i = 0; i < nb - 1; i++) {
+ __ptr__ element1 = array.plus(i);
+ __ptr__ element2 = array.plus(i + 1);
+ JUtilsOk1.LOG("element1=" + element1);
+ JUtilsOk1.LOG("element2=" + element2);
+ Integer cmp = (Integer) compare.exe(element1, element2);
+ JUtilsOk1.LOG("cmp=" + cmp);
+ if (cmp.intValue() > 0) {
+ throw new IllegalStateException();
+ }
+ }
+ }
+
+ static public int setjmp(jmp_buf jmp) {
+ // if (jmp.hasBeenCalled()) {
+ // throw new UnsupportedOperationException();
+ // }
+ jmp.saveCallingEnvironment();
+ return 0;
+ }
+
+ // DEBUG
+
+ public static void printDebugEdge(Agedge_s e) {
+ System.err.println("*********** PRINT EDGE ********** ");
+ final Agedgeinfo_t data = (Agedgeinfo_t) Macro.AGDATA(e).castTo(Agedgeinfo_t.class);
+ final splines splines = (splines) data.getPtr("spl");
+ __struct__<boxf> bb = splines.getStruct("bb");
+ final bezier list = (bezier) splines.getPtr("list");
+ System.err.println("splines.size=" + splines.getInt("size"));
+ System.err.println("bb.LL=" + pointftoString(bb.getStruct("LL")));
+ System.err.println("bb.UR=" + pointftoString(bb.getStruct("UR")));
+ printDebugBezier((bezier) splines.getPtr("list").getPtr());
+
+ }
+
+ private static String pointftoString(__struct__<pointf> point) {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("(");
+ sb.append(point.getDouble("x"));
+ sb.append(" ; ");
+ sb.append(point.getDouble("y"));
+ sb.append(")");
+ return sb.toString();
+ }
+
+ private static void printDebugBezier(bezier bezier) {
+ System.err.println("bezier.size=" + bezier.getInt("size"));
+ System.err.println("bezier.sflag=" + bezier.getInt("sflag"));
+ System.err.println("splines.eflag=" + bezier.getInt("eflag"));
+ System.err.println("bezier.sp=" + pointftoString(bezier.getStruct("sp")));
+ System.err.println("bezier.ep=" + pointftoString(bezier.getStruct("ep")));
+ for (int i = 0; i < bezier.getInt("size"); i++) {
+ final __ptr__ pt = bezier.getPtr("list").plus(i).getPtr();
+ System.err.println("pt=" + pointftoString(pt));
+ }
+ }
+
+ private static String pointftoString(__ptr__ point) {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("(");
+ sb.append(point.getDouble("x"));
+ sb.append(" ; ");
+ sb.append(point.getDouble("y"));
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public static <C extends __ptr__> __struct__<C> from(Class<C> theClass) {
+ if (theClass == _dtmethod_s.class) {
+ return new ST_dtmethod_s();
+ }
+ if (theClass == _dtdisc_s.class) {
+ return new ST_dtdisc_s();
+ }
+ if (theClass == Agdesc_s.class) {
+ return new ST_Agdesc_s();
+ }
+ if (theClass == Agtag_s.class) {
+ return new ST_Agtag_s();
+ }
+ if (theClass == Agiddisc_s.class) {
+ return new ST_Agiddisc_s();
+ }
+ if (theClass == Agmemdisc_s.class) {
+ return new ST_Agmemdisc_s();
+ }
+ if (theClass == nlist_t.class) {
+ return new ST_nlist_t();
+ }
+ if (theClass == arrowname_t.class) {
+ return new ST_arrowname_t();
+ }
+ if (theClass == arrowtype_t.class) {
+ return new ST_arrowtype_t();
+ }
+ if (theClass == elist.class) {
+ return new ST_elist();
+ }
+ if (theClass == pointf.class) {
+ return new ST_pointf();
+ }
+ if (theClass == boxf.class) {
+ return new ST_boxf();
+ }
+ if (theClass == port.class) {
+ return new ST_port();
+ }
+ if (theClass == polygon_t.class) {
+ return new ST_polygon_t();
+ }
+ if (theClass == shape_functions.class) {
+ return new ST_shape_functions();
+ }
+ if (theClass == shape_desc.class) {
+ return new ST_shape_desc();
+ }
+ if (theClass == deque_t.class) {
+ return new ST_deque_t();
+ }
+ if (theClass == pointnlink_t.class) {
+ return new ST_pointnlink_t();
+ }
+ if (theClass == Ppoly_t.class) {
+ return new ST_Ppoly_t();
+ }
+ if (theClass == splineInfo.class) {
+ return new ST_splineInfo();
+ }
+ if (theClass == textfont_t.class) {
+ return new ST_textfont_t();
+ }
+ //
+// if (theClass == Agsubnode_s.class) {
+// return new ST_Agsubnode_s();
+// }
+// if (theClass == _dtlink_s.class) {
+// return new ST_dtlink_s();
+// }
+// if (theClass == refstr_t.class) {
+// return new ST_refstr_t();
+// }
+// if (theClass == Agsym_s.class) {
+// return new ST_Agsym_s();
+// }
+// if (theClass == Agedge_s.class) {
+// return new ST_Agedge_s();
+// }
+// if (theClass == Agobj_s.class) {
+// return new ST_Agobj_s();
+// }
+// if (theClass == Agrec_s.class) {
+// return new ST_Agrec_s();
+// }
+// if (theClass == Agraph_s.class) {
+// return new ST_Agraph_s();
+// }
+// if (theClass == Agclos_s.class) {
+// return new ST_Agclos_s();
+// }
+// if (theClass == Agdisc_s.class) {
+// return new ST_Agdisc_s();
+// }
+// if (theClass == Agdstate_s.class) {
+// return new ST_Agdstate_s();
+// }
+// if (theClass == Agiodisc_s.class) {
+// return new ST_Agiodisc_s();
+// }
+
+ return new __struct_impl__<C>(theClass);
+ }
+
+ public static StarStruct create(Class theClass, StarStruct parent) {
+ if (theClass == _dtmethod_s.class) {
+ throw new IllegalArgumentException(theClass.toString());
+ }
+ if (theClass == _dtdisc_s.class) {
+ return new ST_dtdisc_s(parent);
+ }
+ if (theClass == Agdesc_s.class) {
+ return new ST_Agdesc_s(parent);
+ }
+ if (theClass == Agtag_s.class) {
+ return new ST_Agtag_s(parent);
+ }
+ if (theClass == Agiddisc_s.class) {
+ throw new IllegalArgumentException(theClass.toString());
+ }
+ if (theClass == Agmemdisc_s.class) {
+ throw new IllegalArgumentException(theClass.toString());
+ }
+ if (theClass == nlist_t.class) {
+ return new ST_nlist_t(parent);
+ }
+ if (theClass == arrowname_t.class) {
+ throw new IllegalArgumentException(theClass.toString());
+ }
+ if (theClass == arrowtype_t.class) {
+ throw new IllegalArgumentException(theClass.toString());
+ }
+ if (theClass == elist.class) {
+ return new ST_elist(parent);
+ }
+ if (theClass == pointf.class) {
+ return new ST_pointf(parent);
+ }
+ if (theClass == boxf.class) {
+ return new ST_boxf(parent);
+ }
+ if (theClass == port.class) {
+ return new ST_port(parent);
+ }
+ if (theClass == polygon_t.class) {
+ return new ST_polygon_t(parent);
+ }
+ if (theClass == shape_functions.class) {
+ return new ST_shape_functions(parent);
+ }
+ if (theClass == shape_desc.class) {
+ return new ST_shape_desc(parent);
+ }
+ if (theClass == deque_t.class) {
+ return new ST_deque_t(parent);
+ }
+ if (theClass == pointnlink_t.class) {
+ return new ST_pointnlink_t(parent);
+ }
+ if (theClass == Ppoly_t.class) {
+ return new ST_Ppoly_t(parent);
+ }
+ if (theClass == splineInfo.class) {
+ return new ST_splineInfo(parent);
+ }
+ if (theClass == textfont_t.class) {
+ return new ST_textfont_t(parent);
+ }
+ //
+// if (theClass == Agsubnode_s.class) {
+// return new ST_Agsubnode_s(parent);
+// }
+// if (theClass == _dtlink_s.class) {
+// return new ST_dtlink_s(parent);
+// }
+// if (theClass == refstr_t.class) {
+// return new ST_refstr_t(parent);
+// }
+// if (theClass == Agsym_s.class) {
+// return new ST_Agsym_s(parent);
+// }
+// if (theClass == Agedge_s.class) {
+// return new ST_Agedge_s(parent);
+// }
+// if (theClass == Agobj_s.class) {
+// return new ST_Agobj_s(parent);
+// }
+// if (theClass == Agrec_s.class) {
+// return new ST_Agrec_s(parent);
+// }
+// if (theClass == Agraph_s.class) {
+// return new ST_Agraph_s(parent);
+// }
+// if (theClass == Agclos_s.class) {
+// return new ST_Agclos_s(parent);
+// }
+// if (theClass == Agdisc_s.class) {
+// return new ST_Agdisc_s(parent);
+// }
+// if (theClass == Agdstate_s.class) {
+// return new ST_Agdstate_s(parent);
+// }
+ return new StarStructImpl(theClass, parent);
+ }
+
+}
diff --git a/src/smetana/core/Macro.java b/src/smetana/core/Macro.java
index 097a913..e01cb47 100644
--- a/src/smetana/core/Macro.java
+++ b/src/smetana/core/Macro.java
@@ -724,8 +724,8 @@ public class Macro {
}
// #define ND_xlabel(n) (((Agnodeinfo_t*)AGDATA(n))->xlabel)
- public static __ptr__ ND_xlabel(Agnode_s n) {
- return AGDATA(n).castTo(Agnodeinfo_t.class).getPtr("xlabel");
+ public static textlabel_t ND_xlabel(Agnode_s n) {
+ return (textlabel_t) AGDATA(n).castTo(Agnodeinfo_t.class).getPtr("xlabel");
}
// #define ND_lim(n) (((Agnodeinfo_t*)AGDATA(n))->lim)
@@ -984,8 +984,11 @@ public class Macro {
// #define ED_factor(e) (((Agedgeinfo_t*)AGDATA(e))->factor)
// #define ED_gui_state(e) (((Agedgeinfo_t*)AGDATA(e))->gui_state)
// #define ED_head_label(e) (((Agedgeinfo_t*)AGDATA(e))->head_label)
- public static __ptr__ ED_head_label(Agedge_s e) {
- return AGDATA(e).castTo(Agedgeinfo_t.class).getPtr("head_label");
+ public static textlabel_t ED_head_label(Agedge_s e) {
+ return (textlabel_t) AGDATA(e).castTo(Agedgeinfo_t.class).getPtr("head_label");
+ }
+ public static void ED_head_label(Agedge_s e, __ptr__ v) {
+ AGDATA(e).castTo(Agedgeinfo_t.class).setPtr("head_label", v);
}
// #define ED_head_port(e) (((Agedgeinfo_t*)AGDATA(e))->head_port)
@@ -1005,8 +1008,8 @@ public class Macro {
}
// #define ED_xlabel(e) (((Agedgeinfo_t*)AGDATA(e))->xlabel)
- public static __ptr__ ED_xlabel(Agedge_s e) {
- return AGDATA(e).castTo(Agedgeinfo_t.class).getPtr("xlabel");
+ public static textlabel_t ED_xlabel(Agedge_s e) {
+ return (textlabel_t) AGDATA(e).castTo(Agedgeinfo_t.class).getPtr("xlabel");
}
// #define ED_label_ontop(e) (((Agedgeinfo_t*)AGDATA(e))->label_ontop)
@@ -1043,8 +1046,8 @@ public class Macro {
}
// #define ED_tail_label(e) (((Agedgeinfo_t*)AGDATA(e))->tail_label)
- public static __ptr__ ED_tail_label(Agedge_s e) {
- return AGDATA(e).castTo(Agedgeinfo_t.class).getPtr("tail_label");
+ public static textlabel_t ED_tail_label(Agedge_s e) {
+ return (textlabel_t) AGDATA(e).castTo(Agedgeinfo_t.class).getPtr("tail_label");
}
// #define ED_tail_port(e) (((Agedgeinfo_t*)AGDATA(e))->tail_port)
diff --git a/src/smetana/core/Memory.java b/src/smetana/core/Memory.java
index be03357..c2aaf34 100644
--- a/src/smetana/core/Memory.java
+++ b/src/smetana/core/Memory.java
@@ -39,6 +39,7 @@ import h.Agdesc_s;
import h.Agiddisc_s;
import h.Agmemdisc_s;
import h.Agtag_s;
+import h.STStarArrayOfPointer;
import h.ST_Agtag_s;
import h._dtdisc_s;
import h._dtmethod_s;
@@ -59,14 +60,20 @@ public class Memory {
public static __ptr__ realloc(__ptr__ old, size_t size) {
if (old instanceof StarArrayOfPtr) {
- ((StarArrayOfPtr) old).realloc(((size_t_array_of_something) size).getNb());
+ // System.err.println("size="+size);
+ // ((StarArrayOfPtr) old).realloc(((size_t_array_of_something) size).getNb());
+ ((StarArrayOfPtr) old).realloc(size);
return old;
}
if (old instanceof StarStar) {
((StarStar) old).realloc(((size_t_array_of_array_of_something_empty) size).getNb());
return old;
}
- throw new UnsupportedOperationException();
+ if (old instanceof STStarArrayOfPointer) {
+ ((STStarArrayOfPointer) old).realloc(size.getInternalNb());
+ return old;
+ }
+ throw new UnsupportedOperationException("" + old.getClass());
}
public static void free(Object arg) {
diff --git a/src/smetana/core/UnsupportedArrayOfPtr.java b/src/smetana/core/UnsupportedArrayOfPtr.java
index dc74c34..fb3b4fb 100644
--- a/src/smetana/core/UnsupportedArrayOfPtr.java
+++ b/src/smetana/core/UnsupportedArrayOfPtr.java
@@ -200,6 +200,10 @@ public class UnsupportedArrayOfPtr implements __array_of_ptr__ {
public void realloc(int nb) {
throw new UnsupportedOperationException(getClass().toString());
}
+
+ public void realloc(size_t nb) {
+ throw new UnsupportedOperationException(getClass().toString());
+ }
public __ptr__ asPtr() {
throw new UnsupportedOperationException(getClass().toString());
@@ -233,4 +237,5 @@ public class UnsupportedArrayOfPtr implements __array_of_ptr__ {
throw new UnsupportedOperationException(getClass().toString());
}
+
}
diff --git a/src/smetana/core/UnsupportedArrayOfStruct.java b/src/smetana/core/UnsupportedArrayOfStruct.java
new file mode 100644
index 0000000..0ea2f74
--- /dev/null
+++ b/src/smetana/core/UnsupportedArrayOfStruct.java
@@ -0,0 +1,107 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program.
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package smetana.core;
+
+import smetana.core.amiga.Area;
+
+public class UnsupportedArrayOfStruct implements __array_of_struct__ {
+
+ public String getUID36() {
+ throw new UnsupportedOperationException(getClass().toString());
+ }
+
+ public void swap(int i, int j) {
+ throw new UnsupportedOperationException(getClass().toString());
+ }
+
+ public void realloc(int nb) {
+ throw new UnsupportedOperationException(getClass().toString());
+ }
+
+ public __ptr__ asPtr() {
+ throw new UnsupportedOperationException(getClass().toString());
+ }
+
+ public int comparePointerInternal(__array_of_struct__ other) {
+ throw new UnsupportedOperationException(getClass().toString());
+ }
+
+ public __array_of_struct__ move(int delta) {
+ throw new UnsupportedOperationException(getClass().toString());
+ }
+
+ public __array_of_struct__ plus(int delta) {
+ throw new UnsupportedOperationException(getClass().toString());
+ }
+
+ public Area getInternal(int idx) {
+ throw new UnsupportedOperationException(getClass().toString());
+ }
+
+ public void setInternalByIndex(int idx, Area value) {
+ throw new UnsupportedOperationException(getClass().toString());
+ }
+
+ public void memcopyFrom(Area source) {
+ throw new UnsupportedOperationException(getClass().toString());
+ }
+
+ public __ptr__ getPtr() {
+ throw new UnsupportedOperationException(getClass().toString());
+ }
+
+ public __struct__ getStruct() {
+ throw new UnsupportedOperationException(getClass().toString());
+ }
+
+ public void setStruct(__struct__ value) {
+ throw new UnsupportedOperationException(getClass().toString());
+ }
+
+ public double getDouble(String fieldName) {
+ throw new UnsupportedOperationException(getClass().toString());
+ }
+
+ public void setDouble(String fieldName, double value) {
+ throw new UnsupportedOperationException(getClass().toString());
+ }
+
+ public __struct__ getStruct(String fieldName) {
+ throw new UnsupportedOperationException(getClass().toString());
+ }
+
+}
diff --git a/src/smetana/core/UnsupportedSize_t.java b/src/smetana/core/UnsupportedSize_t.java
new file mode 100644
index 0000000..eba48a6
--- /dev/null
+++ b/src/smetana/core/UnsupportedSize_t.java
@@ -0,0 +1,80 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program.
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package smetana.core;
+
+public class UnsupportedSize_t implements size_t {
+
+ private final int size;
+
+ public UnsupportedSize_t(int size) {
+ this.size = size;
+ }
+
+ public Object malloc() {
+ throw new UnsupportedOperationException(getClass().getName());
+ }
+
+ public Object realloc(Object old) {
+ throw new UnsupportedOperationException(getClass().getName());
+ }
+
+ public size_t negate() {
+ throw new UnsupportedOperationException(getClass().getName());
+ }
+
+ public size_t plus(int length) {
+ throw new UnsupportedOperationException(getClass().getName());
+ }
+
+ public boolean isStrictPositive() {
+ throw new UnsupportedOperationException(getClass().getName());
+ }
+
+ public boolean isStrictNegative() {
+ throw new UnsupportedOperationException(getClass().getName());
+ }
+
+ final public boolean isZero() {
+ return size == 0;
+ }
+
+ public int getInternalNb() {
+ throw new UnsupportedOperationException(getClass().getName());
+ }
+
+
+}
diff --git a/src/smetana/core/UnsupportedStarStruct.java b/src/smetana/core/UnsupportedStarStruct.java
index 7b36dca..0ec7b20 100644
--- a/src/smetana/core/UnsupportedStarStruct.java
+++ b/src/smetana/core/UnsupportedStarStruct.java
@@ -130,27 +130,27 @@ public class UnsupportedStarStruct implements StarStruct {
}
public CString getCString(String fieldName) {
- throw new UnsupportedOperationException(getClass().toString());
+ throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
}
public __array_of_struct__ getArrayOfStruct(String fieldName) {
- throw new UnsupportedOperationException(getClass().toString());
+ throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
}
public __array_of_ptr__ getArrayOfPtr(String fieldName) {
- throw new UnsupportedOperationException(getClass().toString());
+ throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
}
public __array_of_cstring__ getArrayOfCString(String fieldName) {
- throw new UnsupportedOperationException(getClass().toString());
+ throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
}
public __array_of_integer__ getArrayOfInteger(String fieldName) {
- throw new UnsupportedOperationException(getClass().toString());
+ throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
}
public __struct__ getStruct(String fieldName) {
- throw new UnsupportedOperationException(getClass().toString());
+ throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
}
public __ptr__ getPtr(String fieldName) {
@@ -158,15 +158,15 @@ public class UnsupportedStarStruct implements StarStruct {
}
public void setStruct(String fieldName, __struct__ newData) {
- throw new UnsupportedOperationException(getClass().toString());
+ throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
}
public void setCString(String fieldName, CString newData) {
- throw new UnsupportedOperationException(getClass().toString());
+ throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
}
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
- throw new UnsupportedOperationException(getClass().toString());
+ throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
}
public void memcopyFrom(Area source) {
@@ -190,7 +190,7 @@ public class UnsupportedStarStruct implements StarStruct {
}
public __ptr__ castTo(Class dest) {
- throw new UnsupportedOperationException(getClass().toString());
+ throw new UnsupportedOperationException(dest + " " + getClass().toString());
}
public Object addVirtualBytes(int virtualBytes) {
diff --git a/src/smetana/core/Z.java b/src/smetana/core/Z.java
index c25fa7d..78e67ef 100644
--- a/src/smetana/core/Z.java
+++ b/src/smetana/core/Z.java
@@ -48,12 +48,14 @@ import gen.lib.cgraph.utils__c;
import gen.lib.common.arrows__c;
import gen.lib.common.shapes__c;
import gen.lib.dotgen.dotsplines__c;
+import gen.lib.label.xlabels__c;
import h.Agedge_s;
import h.Agnode_s;
import h.Agraph_s;
import h.Agsubnode_s;
import h.Agsym_s;
import h.Agtag_s;
+import h.HDict_t;
import h.ST_Agdesc_s;
import h.ST_Agiddisc_s;
import h.ST_Agmemdisc_s;
@@ -93,6 +95,9 @@ public class Z {
public final ST_dtmethod_s _Dttree = new ST_dtmethod_s();
public final _dtmethod_s Dttree = _Dttree.amp();
+ public final ST_dtmethod_s _Dtobag = new ST_dtmethod_s();
+ public final _dtmethod_s Dtobag = _Dtobag.amp();
+
public final ST_dtdisc_s AgDataDictDisc = new ST_dtdisc_s();
public final ST_Agdesc_s ProtoDesc = new ST_Agdesc_s();
@@ -122,18 +127,20 @@ public class Z {
public int CNT_BITS;
public final ST_dtdisc_s Refstrdisc = new ST_dtdisc_s();
+
+ public final ST_dtdisc_s Hdisc = new ST_dtdisc_s();
public _dt_s Refdict_default;
public Agraph_s Ag_dictop_G;
- public final __array_of_struct__ Arrowsynonyms = __array_of_struct__.malloc(arrowname_t.class, 1);
+ public final __array_of_struct__ Arrowsynonyms = __array_of_struct_impl__.malloc(arrowname_t.class, 1);
- public final __array_of_struct__ Arrownames = __array_of_struct__.malloc(arrowname_t.class, 3);
+ public final __array_of_struct__ Arrownames = __array_of_struct_impl__.malloc(arrowname_t.class, 3);
- public final __array_of_struct__ Arrowmods = __array_of_struct__.malloc(arrowname_t.class, 1);
+ public final __array_of_struct__ Arrowmods = __array_of_struct_impl__.malloc(arrowname_t.class, 1);
- public final __array_of_struct__ Arrowtypes = __array_of_struct__.malloc(arrowtype_t.class, 9);
+ public final __array_of_struct__ Arrowtypes = __array_of_struct_impl__.malloc(arrowtype_t.class, 9);
public __ptr__ Show_boxes;
@@ -204,7 +211,7 @@ public class Z {
public int edgen;
- public __array_of_struct__ boxes = __array_of_struct__.malloc(boxf.class, 1000);
+ public __array_of_struct__ boxes = __array_of_struct_impl__.malloc(boxf.class, 1000);
public int MinQuit;
@@ -334,6 +341,9 @@ public class Z {
_Dttree.searchf = function(dttree__c.class, "dttree");
_Dttree.type = 0000004;
+ _Dtobag.searchf = function(dttree__c.class, "dttree");
+ _Dtobag.type = 0000010;
+
AgDataDictDisc.key = OFFSET.create(Agsym_s.class, "name").toInt();
AgDataDictDisc.size = -1;
AgDataDictDisc.link = OFFSET.create(Agsym_s.class, "link").toInt();
@@ -438,6 +448,16 @@ public class Z {
Refstrdisc.memoryf = function(utils__c.class, "agdictobjmem");
Refstrdisc.eventf = null;
+ Hdisc.key = OFFSET.create(HDict_t.class, "key").toInt();
+ Hdisc.size = 4;
+ Hdisc.link = -1;
+ Hdisc.makef = null;
+ Hdisc.freef = null;
+ Hdisc.comparf = function(xlabels__c.class, "icompare");
+ Hdisc.hashf = null;
+ Hdisc.memoryf = null;
+ Hdisc.eventf = null;
+
Arrowsynonyms.plus(0).setStruct(create_arrowname_t(null, 0));
Arrownames.plus(0).setStruct(create_arrowname_t("normal", 1));
diff --git a/src/smetana/core/__array_of_cstring__.java b/src/smetana/core/__array_of_cstring__.java
index 4edbd06..17e0142 100644
--- a/src/smetana/core/__array_of_cstring__.java
+++ b/src/smetana/core/__array_of_cstring__.java
@@ -36,119 +36,30 @@
package smetana.core;
-import java.util.ArrayList;
-import java.util.List;
-
import smetana.core.amiga.Area;
-import smetana.core.amiga.BuilderArea;
-import smetana.core.amiga.StarStructImpl;
-
-public class __array_of_cstring__ implements Area {
-
- private final List<Area> data;
- private final int currentPos;
-
- private final int UID = StarStructImpl.CPT++;
-
- public String getUID36() {
- return Integer.toString(UID, 36);
- }
-
- public void swap(int i, int j) {
- Area e1 = data.get(i);
- Area e2 = data.get(j);
- data.set(i, e2);
- data.set(j, e1);
- }
-
- @Override
- public String toString() {
- if (data.get(0) != null) {
- return "__array__ " + getUID36() + " " + currentPos + "/" + data.size() + " " + data.get(0).toString();
- }
- return "__array__ " + getUID36() + " " + currentPos + "/" + data.size();
- }
-
- public void realloc(int nb) {
- while (data.size() < nb + currentPos) {
- data.add(null);
- }
- }
-
- // public __ptr__ asPtr() {
- // return new StarArray(this);
- // }
- public int comparePointerInternal(__array_of_cstring__ other) {
- if (this.data != other.data) {
- throw new IllegalArgumentException();
- }
- return this.currentPos - other.currentPos;
- }
- public static __array_of_cstring__ mallocStarChar(int nb) {
- return new __array_of_cstring__(nb, new BuilderArea() {
- public Area createArea() {
- return null;
- }
- });
- }
+public interface __array_of_cstring__ extends Area {
- private __array_of_cstring__(List<Area> data, int currentPos) {
- this.data = data;
- this.currentPos = currentPos;
- check();
- }
+ public String getUID36();
- private __array_of_cstring__(int size, BuilderArea builder) {
- this.data = new ArrayList<Area>();
- this.currentPos = 0;
- for (int i = 0; i < size; i++) {
- final Area tmp = builder.createArea();
- data.add(tmp);
- }
- check();
- }
+ public void swap(int i, int j);
- private void check() {
- if (getUID36().equals("194")) {
- JUtils.LOG("It's me");
- }
- }
+ public void realloc(int nb);
- public __array_of_cstring__ move(int delta) {
- return new __array_of_cstring__(data, currentPos + delta);
- }
+ public int comparePointerInternal(__array_of_cstring__ other);
- public __array_of_cstring__ plus(int delta) {
- return move(delta);
- }
+ public __array_of_cstring__ move(int delta);
- public Area getInternal(int idx) {
- return data.get(idx + currentPos);
- }
+ public __array_of_cstring__ plus(int delta);
- public void setInternalByIndex(int idx, Area value) {
- if (value == this) {
- throw new IllegalArgumentException();
- }
- if (value instanceof __array_of_cstring__) {
- throw new IllegalArgumentException();
- }
- data.set(idx + currentPos, value);
- }
+ public Area getInternal(int idx);
- public void memcopyFrom(Area source) {
- throw new UnsupportedOperationException();
- }
+ public void setInternalByIndex(int idx, Area value);
- //
+ public void memcopyFrom(Area source);
- public CString getCString() {
- return (CString) getInternal(0);
- }
+ public CString getCString();
- public void setCString(CString value) {
- setInternalByIndex(0, value);
- }
+ public void setCString(CString value);
}
diff --git a/src/smetana/core/__array_of_cstring_impl__.java b/src/smetana/core/__array_of_cstring_impl__.java
new file mode 100644
index 0000000..1ce5497
--- /dev/null
+++ b/src/smetana/core/__array_of_cstring_impl__.java
@@ -0,0 +1,156 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program.
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package smetana.core;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import smetana.core.amiga.Area;
+import smetana.core.amiga.BuilderArea;
+import smetana.core.amiga.StarStructImpl;
+
+public class __array_of_cstring_impl__ implements __array_of_cstring__ {
+
+ private final List<Area> data;
+ private final int currentPos;
+
+ private final int UID = StarStructImpl.CPT++;
+
+ public String getUID36() {
+ return Integer.toString(UID, 36);
+ }
+
+ public void swap(int i, int j) {
+ Area e1 = data.get(i);
+ Area e2 = data.get(j);
+ data.set(i, e2);
+ data.set(j, e1);
+ }
+
+ @Override
+ public String toString() {
+ if (data.get(0) != null) {
+ return "__array__ " + getUID36() + " " + currentPos + "/" + data.size() + " " + data.get(0).toString();
+ }
+ return "__array__ " + getUID36() + " " + currentPos + "/" + data.size();
+ }
+
+ public void realloc(int nb) {
+ while (data.size() < nb + currentPos) {
+ data.add(null);
+ }
+ }
+
+ // public __ptr__ asPtr() {
+ // return new StarArray(this);
+ // }
+
+ public int comparePointerInternal(__array_of_cstring__ other2) {
+ __array_of_cstring_impl__ other = (__array_of_cstring_impl__) other2;
+ if (this.data != other.data) {
+ throw new IllegalArgumentException();
+ }
+ return this.currentPos - other.currentPos;
+ }
+
+ public static __array_of_cstring_impl__ mallocStarChar(int nb) {
+ return new __array_of_cstring_impl__(nb, new BuilderArea() {
+ public Area createArea() {
+ return null;
+ }
+ });
+ }
+
+ private __array_of_cstring_impl__(List<Area> data, int currentPos) {
+ this.data = data;
+ this.currentPos = currentPos;
+ check();
+ }
+
+ private __array_of_cstring_impl__(int size, BuilderArea builder) {
+ this.data = new ArrayList<Area>();
+ this.currentPos = 0;
+ for (int i = 0; i < size; i++) {
+ final Area tmp = builder.createArea();
+ data.add(tmp);
+ }
+ check();
+ }
+
+ private void check() {
+ if (getUID36().equals("194")) {
+ JUtils.LOG("It's me");
+ }
+ }
+
+ public __array_of_cstring_impl__ move(int delta) {
+ return new __array_of_cstring_impl__(data, currentPos + delta);
+ }
+
+ public __array_of_cstring_impl__ plus(int delta) {
+ return move(delta);
+ }
+
+ public Area getInternal(int idx) {
+ return data.get(idx + currentPos);
+ }
+
+ public void setInternalByIndex(int idx, Area value) {
+ if (value == this) {
+ throw new IllegalArgumentException();
+ }
+ if (value instanceof __array_of_cstring_impl__) {
+ throw new IllegalArgumentException();
+ }
+ data.set(idx + currentPos, value);
+ }
+
+ public void memcopyFrom(Area source) {
+ throw new UnsupportedOperationException();
+ }
+
+ //
+
+ public CString getCString() {
+ return (CString) getInternal(0);
+ }
+
+ public void setCString(CString value) {
+ setInternalByIndex(0, value);
+ }
+
+}
diff --git a/src/smetana/core/__array_of_integer__.java b/src/smetana/core/__array_of_integer__.java
index 61063c7..6fe3184 100644
--- a/src/smetana/core/__array_of_integer__.java
+++ b/src/smetana/core/__array_of_integer__.java
@@ -36,113 +36,28 @@
package smetana.core;
-import java.util.ArrayList;
-import java.util.List;
-
import smetana.core.amiga.Area;
-import smetana.core.amiga.AreaInt;
-import smetana.core.amiga.BuilderArea;
-import smetana.core.amiga.StarStruct;
-import smetana.core.amiga.StarStructImpl;
-
-public class __array_of_integer__ implements Area {
-
- private final List<Area> data;
- private final int currentPos;
-
- private final int UID = StarStructImpl.CPT++;
-
- public String getUID36() {
- return Integer.toString(UID, 36);
- }
-
- public void swap(int i, int j) {
- Area e1 = data.get(i);
- Area e2 = data.get(j);
- data.set(i, e2);
- data.set(j, e1);
- }
-
- @Override
- public String toString() {
- if (data.get(0) != null) {
- return "__array__ " + getUID36() + " " + currentPos + "/" + data.size() + " " + data.get(0).toString();
- }
- return "__array__ " + getUID36() + " " + currentPos + "/" + data.size();
- }
-
- public void realloc(int nb) {
- while (data.size() < nb + currentPos) {
- data.add(new AreaInt());
- }
- }
-
- // public __ptr__ asPtr() {
- // return new StarArray(this);
- // }
-
- public int comparePointerInternal(__array_of_integer__ other) {
- if (this.data != other.data) {
- throw new IllegalArgumentException();
- }
- return this.currentPos - other.currentPos;
- }
-
- public static __array_of_integer__ mallocInteger(int nb) {
- return new __array_of_integer__(nb, new BuilderArea() {
- public Area createArea() {
- return new AreaInt();
- }
- });
- }
- private __array_of_integer__(List<Area> data, int currentPos) {
- this.data = data;
- this.currentPos = currentPos;
- check();
- }
+public interface __array_of_integer__ extends Area {
- private __array_of_integer__(int size, BuilderArea builder) {
- this.data = new ArrayList<Area>();
- this.currentPos = 0;
- for (int i = 0; i < size; i++) {
- final Area tmp = builder.createArea();
- data.add(tmp);
- }
- check();
- }
+ public String getUID36();
- private void check() {
- if (getUID36().equals("194")) {
- JUtils.LOG("It's me");
- }
- }
+ public void swap(int i, int j);
- public __array_of_integer__ move(int delta) {
- return new __array_of_integer__(data, currentPos + delta);
- }
+ public void realloc(int nb);
- public __array_of_integer__ plus(int delta) {
- return move(delta);
- }
+ public int comparePointerInternal(__array_of_integer__ other);
- public Area getInternal(int idx) {
- return data.get(idx + currentPos);
- }
+ public __array_of_integer__ move(int delta);
+ public __array_of_integer__ plus(int delta);
- public void memcopyFrom(Area source) {
- throw new UnsupportedOperationException();
- }
+ public Area getInternal(int idx);
- //
+ public void memcopyFrom(Area source);
- public int getInt() {
- return ((AreaInt) getInternal(0)).getInternal();
- }
+ public int getInt();
- public void setInt(int value) {
- ((AreaInt) getInternal(0)).setInternal(value);
- }
+ public void setInt(int value);
}
diff --git a/src/smetana/core/__array_of_integer_impl__.java b/src/smetana/core/__array_of_integer_impl__.java
new file mode 100644
index 0000000..1d9a762
--- /dev/null
+++ b/src/smetana/core/__array_of_integer_impl__.java
@@ -0,0 +1,147 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program.
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package smetana.core;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import smetana.core.amiga.Area;
+import smetana.core.amiga.AreaInt;
+import smetana.core.amiga.BuilderArea;
+import smetana.core.amiga.StarStructImpl;
+
+public class __array_of_integer_impl__ implements __array_of_integer__ {
+
+ private final List<Area> data;
+ private final int currentPos;
+
+ private final int UID = StarStructImpl.CPT++;
+
+ public String getUID36() {
+ return Integer.toString(UID, 36);
+ }
+
+ public void swap(int i, int j) {
+ Area e1 = data.get(i);
+ Area e2 = data.get(j);
+ data.set(i, e2);
+ data.set(j, e1);
+ }
+
+ @Override
+ public String toString() {
+ if (data.get(0) != null) {
+ return "__array__ " + getUID36() + " " + currentPos + "/" + data.size() + " " + data.get(0).toString();
+ }
+ return "__array__ " + getUID36() + " " + currentPos + "/" + data.size();
+ }
+
+ public void realloc(int nb) {
+ while (data.size() < nb + currentPos) {
+ data.add(new AreaInt());
+ }
+ }
+
+ // public __ptr__ asPtr() {
+ // return new StarArray(this);
+ // }
+
+ public int comparePointerInternal(__array_of_integer__ other2) {
+ __array_of_integer_impl__ other = (__array_of_integer_impl__) other2;
+ if (this.data != other.data) {
+ throw new IllegalArgumentException();
+ }
+ return this.currentPos - other.currentPos;
+ }
+
+ public static __array_of_integer_impl__ mallocInteger(int nb) {
+ return new __array_of_integer_impl__(nb, new BuilderArea() {
+ public Area createArea() {
+ return new AreaInt();
+ }
+ });
+ }
+
+ private __array_of_integer_impl__(List<Area> data, int currentPos) {
+ this.data = data;
+ this.currentPos = currentPos;
+ check();
+ }
+
+ private __array_of_integer_impl__(int size, BuilderArea builder) {
+ this.data = new ArrayList<Area>();
+ this.currentPos = 0;
+ for (int i = 0; i < size; i++) {
+ final Area tmp = builder.createArea();
+ data.add(tmp);
+ }
+ check();
+ }
+
+ private void check() {
+ if (getUID36().equals("194")) {
+ JUtils.LOG("It's me");
+ }
+ }
+
+ public __array_of_integer_impl__ move(int delta) {
+ return new __array_of_integer_impl__(data, currentPos + delta);
+ }
+
+ public __array_of_integer_impl__ plus(int delta) {
+ return move(delta);
+ }
+
+ public Area getInternal(int idx) {
+ return data.get(idx + currentPos);
+ }
+
+ public void memcopyFrom(Area source) {
+ throw new UnsupportedOperationException();
+ }
+
+ //
+
+ public int getInt() {
+ return ((AreaInt) getInternal(0)).getInternal();
+ }
+
+ public void setInt(int value) {
+ ((AreaInt) getInternal(0)).setInternal(value);
+ }
+
+}
diff --git a/src/smetana/core/__array_of_ptr__.java b/src/smetana/core/__array_of_ptr__.java
index 69776e9..dd7db2b 100644
--- a/src/smetana/core/__array_of_ptr__.java
+++ b/src/smetana/core/__array_of_ptr__.java
@@ -48,6 +48,8 @@ public interface __array_of_ptr__ extends Area {
public void realloc(int nb);
+ public void realloc(size_t nb);
+
public __ptr__ asPtr();
public int comparePointerInternal(__array_of_ptr__ other);
diff --git a/src/smetana/core/__array_of_ptr_impl__.java b/src/smetana/core/__array_of_ptr_impl__.java
index 9657379..3c562de 100644
--- a/src/smetana/core/__array_of_ptr_impl__.java
+++ b/src/smetana/core/__array_of_ptr_impl__.java
@@ -89,6 +89,15 @@ public class __array_of_ptr_impl__ implements __array_of_ptr__ {
}
}
+ public void realloc(size_t nb) {
+ // ((StarArrayOfPtr) old).realloc(((size_t_array_of_something) size).getNb());
+ if (nb instanceof size_t_array_of_something) {
+ this.realloc(((size_t_array_of_something) nb).getNb());
+ return;
+ }
+ throw new UnsupportedOperationException();
+ }
+
public __ptr__ asPtr() {
return new StarArrayOfPtr(this);
}
diff --git a/src/smetana/core/__array_of_struct__.java b/src/smetana/core/__array_of_struct__.java
index 688c88a..ab4d1dc 100644
--- a/src/smetana/core/__array_of_struct__.java
+++ b/src/smetana/core/__array_of_struct__.java
@@ -36,142 +36,40 @@
package smetana.core;
-import java.util.ArrayList;
-import java.util.List;
-
import smetana.core.amiga.Area;
-import smetana.core.amiga.BuilderArea;
-import smetana.core.amiga.StarArrayOfStruct;
-import smetana.core.amiga.StarStruct;
-import smetana.core.amiga.StarStructImpl;
-
-public class __array_of_struct__ implements Area {
-
- private final List<Area> data;
- private final int currentPos;
-
- private final int UID = StarStructImpl.CPT++;
-
- public String getUID36() {
- return Integer.toString(UID, 36);
- }
-
- public void swap(int i, int j) {
- Area e1 = data.get(i);
- Area e2 = data.get(j);
- data.set(i, e2);
- data.set(j, e1);
- }
-
- @Override
- public String toString() {
- if (data.get(0) != null) {
- return "__array_of_struct__ " + getUID36() + " " + currentPos + "/" + data.size() + " "
- + data.get(0).toString();
- }
- return "__array_of_struct__ " + getUID36() + " " + currentPos + "/" + data.size();
- }
-
- public void realloc(int nb) {
- while (data.size() < nb + currentPos) {
- data.add(null);
- }
- }
-
- public __ptr__ asPtr() {
- return new StarArrayOfStruct(this);
- }
-
- public int comparePointerInternal(__array_of_struct__ other) {
- if (this.data != other.data) {
- throw new IllegalArgumentException();
- }
- return this.currentPos - other.currentPos;
- }
-
- public static __array_of_struct__ malloc(final Class cl, int nb) {
- return new __array_of_struct__(nb, new BuilderArea() {
- public Area createArea() {
- return JUtils.from(cl);
- }
- });
- }
-
- private __array_of_struct__(List<Area> data, int currentPos) {
- this.data = data;
- this.currentPos = currentPos;
- check();
- }
-
- public __array_of_struct__(int size, BuilderArea builder) {
- this.data = new ArrayList<Area>();
- this.currentPos = 0;
- for (int i = 0; i < size; i++) {
- final Area tmp = builder.createArea();
- data.add(tmp);
- }
- check();
- }
-
- private void check() {
- if (getUID36().equals("194")) {
- JUtils.LOG("It's me");
- }
- }
-
- public __array_of_struct__ move(int delta) {
- return new __array_of_struct__(data, currentPos + delta);
- }
-
- public __array_of_struct__ plus(int delta) {
- return move(delta);
- }
-
- public Area getInternal(int idx) {
- return data.get(idx + currentPos);
- }
-
- public void setInternalByIndex(int idx, Area value) {
- if (value == this) {
- throw new IllegalArgumentException();
- }
- if (value instanceof __array_of_struct__) {
- throw new IllegalArgumentException();
- }
- data.set(idx + currentPos, value);
- }
-
- public void memcopyFrom(Area source) {
- throw new UnsupportedOperationException();
- }
-
- //
-
- public __ptr__ getPtr() {
- return ((__struct__) getInternal(0)).amp();
- }
-
- public __struct__ getStruct() {
- return (__struct__) getInternal(0);
- }
-
- public void setStruct(__struct__ value) {
- final Area area = getInternal(0);
- ((__struct__) area).___(value);
- }
-
- public double getDouble(String fieldName) {
- final Area tmp1 = getInternal(0);
- return ((__struct__) tmp1).getDouble(fieldName);
- }
-
- public void setDouble(String fieldName, double value) {
- final Area tmp1 = getInternal(0);
- ((__struct__) tmp1).setDouble(fieldName, value);
- }
-
- public __struct__ getStruct(String fieldName) {
- return ((StarStruct) getInternal(0)).getStruct(fieldName);
- }
+
+public interface __array_of_struct__ extends Area {
+
+ public String getUID36();
+
+ public void swap(int i, int j);
+
+ public void realloc(int nb);
+
+ public __ptr__ asPtr();
+
+ public int comparePointerInternal(__array_of_struct__ other);
+
+ public __array_of_struct__ move(int delta);
+
+ public __array_of_struct__ plus(int delta);
+
+ public Area getInternal(int idx);
+
+ public void setInternalByIndex(int idx, Area value);
+
+ public void memcopyFrom(Area source);
+
+ public __ptr__ getPtr();
+
+ public __struct__ getStruct();
+
+ public void setStruct(__struct__ value);
+
+ public double getDouble(String fieldName);
+
+ public void setDouble(String fieldName, double value);
+
+ public __struct__ getStruct(String fieldName);
}
diff --git a/src/smetana/core/__array_of_struct_impl__.java b/src/smetana/core/__array_of_struct_impl__.java
new file mode 100644
index 0000000..50f82b6
--- /dev/null
+++ b/src/smetana/core/__array_of_struct_impl__.java
@@ -0,0 +1,177 @@
+/* ========================================================================
+ * 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 Smetana.
+ * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * This translation is distributed under the same Licence as the original C program.
+ *
+ * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
+ * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
+ *
+ * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
+ * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ *
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package smetana.core;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import smetana.core.amiga.Area;
+import smetana.core.amiga.BuilderArea;
+import smetana.core.amiga.StarArrayOfStruct;
+import smetana.core.amiga.StarStruct;
+import smetana.core.amiga.StarStructImpl;
+
+public class __array_of_struct_impl__ implements __array_of_struct__ {
+
+ private final List<Area> data;
+ private final int currentPos;
+
+ private final int UID = StarStructImpl.CPT++;
+
+ public String getUID36() {
+ return Integer.toString(UID, 36);
+ }
+
+ public void swap(int i, int j) {
+ Area e1 = data.get(i);
+ Area e2 = data.get(j);
+ data.set(i, e2);
+ data.set(j, e1);
+ }
+
+ @Override
+ public String toString() {
+ if (data.get(0) != null) {
+ return "__array_of_struct__ " + getUID36() + " " + currentPos + "/" + data.size() + " "
+ + data.get(0).toString();
+ }
+ return "__array_of_struct__ " + getUID36() + " " + currentPos + "/" + data.size();
+ }
+
+ public void realloc(int nb) {
+ while (data.size() < nb + currentPos) {
+ data.add(null);
+ }
+ }
+
+ public __ptr__ asPtr() {
+ return new StarArrayOfStruct(this);
+ }
+
+ public int comparePointerInternal(__array_of_struct__ other) {
+ if (this.data != ((__array_of_struct_impl__) other).data) {
+ throw new IllegalArgumentException();
+ }
+ return this.currentPos - ((__array_of_struct_impl__) other).currentPos;
+ }
+
+ public static __array_of_struct_impl__ malloc(final Class cl, int nb) {
+ return new __array_of_struct_impl__(nb, new BuilderArea() {
+ public Area createArea() {
+ return JUtils.from(cl);
+ }
+ });
+ }
+
+ private __array_of_struct_impl__(List<Area> data, int currentPos) {
+ this.data = data;
+ this.currentPos = currentPos;
+ check();
+ }
+
+ public __array_of_struct_impl__(int size, BuilderArea builder) {
+ this.data = new ArrayList<Area>();
+ this.currentPos = 0;
+ for (int i = 0; i < size; i++) {
+ final Area tmp = builder.createArea();
+ data.add(tmp);
+ }
+ check();
+ }
+
+ private void check() {
+ if (getUID36().equals("194")) {
+ JUtils.LOG("It's me");
+ }
+ }
+
+ public __array_of_struct_impl__ move(int delta) {
+ return new __array_of_struct_impl__(data, currentPos + delta);
+ }
+
+ public __array_of_struct_impl__ plus(int delta) {
+ return move(delta);
+ }
+
+ public Area getInternal(int idx) {
+ return data.get(idx + currentPos);
+ }
+
+ public void setInternalByIndex(int idx, Area value) {
+ if (value == this) {
+ throw new IllegalArgumentException();
+ }
+ if (value instanceof __array_of_struct_impl__) {
+ throw new IllegalArgumentException();
+ }
+ data.set(idx + currentPos, value);
+ }
+
+ public void memcopyFrom(Area source) {
+ throw new UnsupportedOperationException();
+ }
+
+ //
+
+ public __ptr__ getPtr() {
+ return ((__struct__) getInternal(0)).amp();
+ }
+
+ public __struct__ getStruct() {
+ return (__struct__) getInternal(0);
+ }
+
+ public void setStruct(__struct__ value) {
+ final Area area = getInternal(0);
+ ((__struct__) area).___(value);
+ }
+
+ public double getDouble(String fieldName) {
+ final Area tmp1 = getInternal(0);
+ return ((__struct__) tmp1).getDouble(fieldName);
+ }
+
+ public void setDouble(String fieldName, double value) {
+ final Area tmp1 = getInternal(0);
+ ((__struct__) tmp1).setDouble(fieldName, value);
+ }
+
+ public __struct__ getStruct(String fieldName) {
+ return ((StarStruct) getInternal(0)).getStruct(fieldName);
+ }
+
+}
diff --git a/src/smetana/core/amiga/BucketToAreaFactory.java b/src/smetana/core/amiga/BucketToAreaFactory.java
index 9046b88..e381116 100644
--- a/src/smetana/core/amiga/BucketToAreaFactory.java
+++ b/src/smetana/core/amiga/BucketToAreaFactory.java
@@ -40,9 +40,9 @@ import smetana.core.Bucket;
import smetana.core.CType;
import smetana.core.JUtils;
import smetana.core.__array_of_double__;
-import smetana.core.__array_of_integer__;
+import smetana.core.__array_of_integer_impl__;
import smetana.core.__array_of_ptr_impl__;
-import smetana.core.__array_of_struct__;
+import smetana.core.__array_of_struct_impl__;
public class BucketToAreaFactory {
@@ -129,11 +129,11 @@ public class BucketToAreaFactory {
JUtils.LOG("BucketToAreaFactory:createAreaArray: type=" + bucket.ctype);
if (bucket.ctype.getType().matches("char \\w+\\[\\d+\\]")) {
// Array of char
- return __array_of_integer__.mallocInteger(arrayLength);
+ return __array_of_integer_impl__.mallocInteger(arrayLength);
}
if (bucket.ctype.getType().matches("int \\w+\\[\\d+\\]")) {
// Array of int
- return __array_of_integer__.mallocInteger(arrayLength);
+ return __array_of_integer_impl__.mallocInteger(arrayLength);
}
if (bucket.ctype.getType().matches("double \\w+\\[\\d+\\]")) {
// Array of double
@@ -153,7 +153,7 @@ public class BucketToAreaFactory {
JUtils.LOG("element=" + element);
final Class theClass = CType.getClassFrom(element);
JUtils.LOG("theClass=" + theClass);
- return __array_of_struct__.malloc(theClass, arrayLength);
+ return __array_of_struct_impl__.malloc(theClass, arrayLength);
}
throw new UnsupportedOperationException();
}
diff --git a/src/smetana/core/amiga/StarArrayOfInteger.java b/src/smetana/core/amiga/StarArrayOfInteger.java
index 4b63a9b..a52beab 100644
--- a/src/smetana/core/amiga/StarArrayOfInteger.java
+++ b/src/smetana/core/amiga/StarArrayOfInteger.java
@@ -81,7 +81,6 @@ public class StarArrayOfInteger extends UnsupportedC implements Area, AllH {
public void swap(int i, int j) {
((__array_of_integer__) array).swap(i, j);
-
}
}
diff --git a/src/smetana/core/amiga/StarArrayOfPtr.java b/src/smetana/core/amiga/StarArrayOfPtr.java
index 399441c..66f10c3 100644
--- a/src/smetana/core/amiga/StarArrayOfPtr.java
+++ b/src/smetana/core/amiga/StarArrayOfPtr.java
@@ -43,6 +43,7 @@ import smetana.core.__array_of_ptr__;
import smetana.core.__array_of_struct__;
import smetana.core.__ptr__;
import smetana.core.__struct__;
+import smetana.core.size_t;
public class StarArrayOfPtr extends UnsupportedC implements Area, AllH {
@@ -56,6 +57,10 @@ public class StarArrayOfPtr extends UnsupportedC implements Area, AllH {
array.realloc(nb);
}
+ public void realloc(size_t nb) {
+ array.realloc(nb);
+ }
+
public String getUID36() {
return array.getUID36();
}
diff --git a/src/smetana/core/amiga/StarStructImpl.java b/src/smetana/core/amiga/StarStructImpl.java
index 44ddc11..3cd8438 100644
--- a/src/smetana/core/amiga/StarStructImpl.java
+++ b/src/smetana/core/amiga/StarStructImpl.java
@@ -36,6 +36,8 @@
package smetana.core.amiga;
+import h.WithParent;
+
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
@@ -114,7 +116,7 @@ public class StarStructImpl extends UnsupportedC implements StarStruct {
this.theClass = theClass;
this.fields = new LinkedHashMap<String, Area>();
JUtils.LOG("Creation Struct " + getUID36());
- if (getUID36().equals("2tg")) {
+ if (getUID36().equals("1tq")) {
JUtils.LOG("It's me");
}
final StructureDefinition structureDefinition = StructureDefinition.from(theClass);
@@ -488,7 +490,15 @@ public class StarStructImpl extends UnsupportedC implements StarStruct {
return first2;
}
}
- throw new UnsupportedOperationException();
+ if (first instanceof WithParent) {
+ final WithParent first2 = (WithParent) first;
+ JUtils.LOG("first.parent=" + first2.getParent());
+ if (first2.getParent() != this) {
+ throw new IllegalStateException();
+ }
+ return (__ptr__) first2;
+ }
+ throw new UnsupportedOperationException("first=" + first.getClass());
}
public Object addVirtualBytes(int virtualBytes) {
diff --git a/src/smetana/core/size_t.java b/src/smetana/core/size_t.java
index 9a8d30f..1d064bb 100644
--- a/src/smetana/core/size_t.java
+++ b/src/smetana/core/size_t.java
@@ -51,5 +51,7 @@ public interface size_t {
boolean isStrictNegative();
boolean isZero();
+
+ int getInternalNb();
}
diff --git a/src/smetana/core/size_t_array_of_array_of_something_allocated.java b/src/smetana/core/size_t_array_of_array_of_something_allocated.java
index c2ce8d7..c9664f5 100644
--- a/src/smetana/core/size_t_array_of_array_of_something_allocated.java
+++ b/src/smetana/core/size_t_array_of_array_of_something_allocated.java
@@ -50,13 +50,18 @@ public class size_t_array_of_array_of_something_allocated implements size_t {
public boolean isZero() {
return nb == 0;
}
+
+ public int getInternalNb() {
+ return nb;
+ }
+
public __ptr__ realloc(Object old) {
throw new UnsupportedOperationException();
}
public __array_of_struct__ malloc() {
- return __array_of_struct__.malloc(cl, nb);
+ return __array_of_struct_impl__.malloc(cl, nb);
}
public size_t negate() {
diff --git a/src/smetana/core/size_t_array_of_array_of_something_empty.java b/src/smetana/core/size_t_array_of_array_of_something_empty.java
index e61b82d..1307f45 100644
--- a/src/smetana/core/size_t_array_of_array_of_something_empty.java
+++ b/src/smetana/core/size_t_array_of_array_of_something_empty.java
@@ -51,6 +51,11 @@ public class size_t_array_of_array_of_something_empty implements size_t {
public boolean isZero() {
return nb == 0;
}
+
+ public int getInternalNb() {
+ return nb;
+ }
+
public __ptr__ realloc(Object old) {
JUtils.LOG("realloc old1=" + old);
diff --git a/src/smetana/core/size_t_array_of_charstars.java b/src/smetana/core/size_t_array_of_charstars.java
index 88ee6ca..9183256 100644
--- a/src/smetana/core/size_t_array_of_charstars.java
+++ b/src/smetana/core/size_t_array_of_charstars.java
@@ -50,9 +50,14 @@ public class size_t_array_of_charstars implements size_t {
public boolean isZero() {
return size == 0;
}
+
+ public int getInternalNb() {
+ return size;
+ }
+
public __ptr__ malloc() {
- return new StarArrayOfCString(__array_of_cstring__.mallocStarChar(size));
+ return new StarArrayOfCString(__array_of_cstring_impl__.mallocStarChar(size));
// return new StarArray(__array__.mallocStarChar(size));
// return AreaArray.mallocStarChar(size);
}
diff --git a/src/smetana/core/size_t_array_of_integer.java b/src/smetana/core/size_t_array_of_integer.java
index 912695f..f61e573 100644
--- a/src/smetana/core/size_t_array_of_integer.java
+++ b/src/smetana/core/size_t_array_of_integer.java
@@ -53,12 +53,16 @@ public class size_t_array_of_integer implements size_t {
this.nb = nb;
}
+ public int getInternalNb() {
+ return nb;
+ }
+
public boolean isZero() {
return nb == 0;
}
public __ptr__ malloc() {
- return new StarArrayOfInteger(__array_of_integer__.mallocInteger(nb));
+ return new StarArrayOfInteger(__array_of_integer_impl__.mallocInteger(nb));
}
public size_t negate() {
diff --git a/src/smetana/core/size_t_array_of_something.java b/src/smetana/core/size_t_array_of_something.java
index 543abe6..24f095f 100644
--- a/src/smetana/core/size_t_array_of_something.java
+++ b/src/smetana/core/size_t_array_of_something.java
@@ -52,6 +52,11 @@ public class size_t_array_of_something implements size_t {
public boolean isZero() {
return nb == 0;
}
+
+ public int getInternalNb() {
+ return nb;
+ }
+
public __ptr__ malloc() {
return new StarArrayOfPtr(__array_of_ptr_impl__.malloc_allocated(cl, nb));
diff --git a/src/smetana/core/size_t_of_element.java b/src/smetana/core/size_t_of_element.java
index 796b8f9..5cce3a1 100644
--- a/src/smetana/core/size_t_of_element.java
+++ b/src/smetana/core/size_t_of_element.java
@@ -75,5 +75,10 @@ public class size_t_of_element implements size_t {
public boolean isZero() {
throw new UnsupportedOperationException();
}
+
+ public int getInternalNb() {
+ throw new UnsupportedOperationException();
+ }
+
}
diff --git a/src/smetana/core/size_t_struct.java b/src/smetana/core/size_t_struct.java
index 6633d2f..c219229 100644
--- a/src/smetana/core/size_t_struct.java
+++ b/src/smetana/core/size_t_struct.java
@@ -46,44 +46,24 @@ package smetana.core;
public class size_t_struct implements size_t {
public final Class tobeAllocated;
-// public final int bytes;
private boolean positive = true;
public size_t_struct(Class tobeAllocated) {
this.tobeAllocated = tobeAllocated;
}
-// public size_t_struct(Class tobeAllocated, int arraySize) {
-// this.tobeAllocated = tobeAllocated;
-// this.bytes = 1;
-// this.arraySize = arraySize;
-// JUtils.LOG("building " + this);
-// // Thread.dumpStack();
-// }
-//
+
public size_t_struct negate() {
final size_t_struct result = new size_t_struct(tobeAllocated);
result.positive = !result.positive;
return result;
}
-// private size_t_struct(int bytes) {
-// this.tobeAllocated = null;
-// this.arraySize = 0;
-// this.bytes = bytes;
-// JUtils.LOG("building " + this);
-// // Thread.dumpStack();
-// }
public size_t_struct multiply(int sz) {
-// if (tobeAllocated == null && arraySize == 0) {
-// return new size_t_struct(bytes * sz);
-// }
throw new UnsupportedOperationException();
}
- // public static final size_t_struct MINUS_ONE = new size_t_struct(-1);
-
// @Override
// public String toString() {
// return super.toString() + " size_t(" + tobeAllocated + "*" + arraySize + ", bytes=" + bytes + ")";
@@ -98,23 +78,6 @@ public class size_t_struct implements size_t {
}
- // public boolean isStrictNegative() {
- // return false;
- // }
-
- // public static boolean isStrictNegative(size_t_struct v) {
- // if (v == null) {
- // return false;
- // }
- // return v.bytes < 0;
- // }
- //
- // public static boolean isNegativeOrNull(size_t_struct v) {
- // if (v == null) {
- // return true;
- // }
- // return v.bytes <= 0;
- // }
public final Class getTobeAllocated() {
return tobeAllocated;
@@ -137,36 +100,15 @@ public class size_t_struct implements size_t {
return false;
}
-// public boolean isStrictLessThan(int v) {
-// return false;
-// }
-
-// public void setTo(int v) {
-// throw new UnsupportedOperationException();
-// }
-
-// public size_t_struct multiplyBySizeofStarChar() {
-// throw new UnsupportedOperationException();
-// }
-
-// public static size_t_struct fromInt(int bytes) {
-// return new size_t_struct(bytes);
-// }
-
-// public int getSizeInBytes() {
-// return bytes;
-// }
-//
-// /**
-// * @return the arraySize
-// */
-// public int getArraySize() {
-// return arraySize;
-// }
public __ptr__ realloc(Object old) {
throw new UnsupportedOperationException();
}
+ public int getInternalNb() {
+ throw new UnsupportedOperationException();
+ }
+
+
}
diff --git a/stdlib/aws-abx.repx b/stdlib/aws-abx.repx
new file mode 100644
index 0000000..137561c
--- /dev/null
+++ b/stdlib/aws-abx.repx
Binary files differ
diff --git a/stdlib/aws-dex.repx b/stdlib/aws-dex.repx
new file mode 100644
index 0000000..cfb8468
--- /dev/null
+++ b/stdlib/aws-dex.repx
Binary files differ
diff --git a/stdlib/cloudinsight-abx.repx b/stdlib/cloudinsight-abx.repx
new file mode 100644
index 0000000..6d6d783
--- /dev/null
+++ b/stdlib/cloudinsight-abx.repx
Binary files differ
diff --git a/stdlib/cloudinsight-dex.repx b/stdlib/cloudinsight-dex.repx
new file mode 100644
index 0000000..fb96b39
--- /dev/null
+++ b/stdlib/cloudinsight-dex.repx
Binary files differ
diff --git a/stdlib/cloudogu-abx.repx b/stdlib/cloudogu-abx.repx
new file mode 100644
index 0000000..7bf0221
--- /dev/null
+++ b/stdlib/cloudogu-abx.repx
Binary files differ
diff --git a/stdlib/cloudogu-dex.repx b/stdlib/cloudogu-dex.repx
new file mode 100644
index 0000000..fd6dbd4
--- /dev/null
+++ b/stdlib/cloudogu-dex.repx
Binary files differ
diff --git a/stdlib/devicons-abx.repx b/stdlib/devicons-abx.repx
new file mode 100644
index 0000000..0b444fc
--- /dev/null
+++ b/stdlib/devicons-abx.repx
Binary files differ
diff --git a/stdlib/devicons-dex.repx b/stdlib/devicons-dex.repx
new file mode 100644
index 0000000..85a474b
--- /dev/null
+++ b/stdlib/devicons-dex.repx
Binary files differ
diff --git a/stdlib/font-awesome-abx.repx b/stdlib/font-awesome-abx.repx
new file mode 100644
index 0000000..f965732
--- /dev/null
+++ b/stdlib/font-awesome-abx.repx
Binary files differ
diff --git a/stdlib/font-awesome-dex.repx b/stdlib/font-awesome-dex.repx
new file mode 100644
index 0000000..5b6824a
--- /dev/null
+++ b/stdlib/font-awesome-dex.repx
Binary files differ
diff --git a/stdlib/home.repx b/stdlib/home.repx
new file mode 100644
index 0000000..81206b6
--- /dev/null
+++ b/stdlib/home.repx
@@ -0,0 +1,7 @@
+aws
+cloudinsight
+cloudogu
+devicons
+font-awesome
+material
+office
diff --git a/stdlib/material-abx.repx b/stdlib/material-abx.repx
new file mode 100644
index 0000000..1e3a366
--- /dev/null
+++ b/stdlib/material-abx.repx
Binary files differ
diff --git a/stdlib/material-dex.repx b/stdlib/material-dex.repx
new file mode 100644
index 0000000..191233c
--- /dev/null
+++ b/stdlib/material-dex.repx
Binary files differ
diff --git a/stdlib/office-abx.repx b/stdlib/office-abx.repx
new file mode 100644
index 0000000..aab9620
--- /dev/null
+++ b/stdlib/office-abx.repx
Binary files differ
diff --git a/stdlib/office-dex.repx b/stdlib/office-dex.repx
new file mode 100644
index 0000000..801759a
--- /dev/null
+++ b/stdlib/office-dex.repx
Binary files differ
diff --git a/tools/create_sprites.sh b/tools/create_sprites.sh
new file mode 100755
index 0000000..31d9041
--- /dev/null
+++ b/tools/create_sprites.sh
@@ -0,0 +1,175 @@
+#!/usr/bin/env bash
+
+#
+# (C) Copyright 2017, Anthony Gaudino
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+
+#
+# Batch creates sprite files for PlantUml
+#
+# Given a directory can convert all SVG files to PNG, then on the same directory,
+# convert all PNG files to PlantUml sprite files.
+# To convert SVGs the -s flag must be set.
+#
+# The generated sprites files formats are based on the ones introduced in
+# PlantUml 1.2017.19.
+#
+# This script assumes InkScape and PlantUml are in PATH.
+#
+
+
+# Help usage message
+usage="Batch creates sprite files for PlantUml.
+
+$(basename "$0") [options] prefix
+
+options:
+ -p directory path to process Default: ./
+ -w width of PNG from SVG Default: 48
+ -h height of PNG from SVG Default: 48
+ -g sprite graylevel Default: 16
+ -s if set processes SVGs
+
+ prefix: a prefix that is added to the sprite name"
+
+
+
+# Default arguments values
+ dir="./" # Directory path to process Default: ./
+ width=48 # Width of PNG to generate Default: 48
+ height=48 # Height of PNG to generate Default: 48
+ graylevel=16 # Number of grayscale colors Default: 16
+ processsvg=0 # 1 if SVGs should be processed Default: 0
+
+ prefix="" # Prefix for sprites names, avoids having
+prefixupper="" # two sprites with same name on STDLIB
+
+
+
+########################################
+#
+# Main function
+#
+########################################
+main () {
+ # Get arguments
+ while getopts p:w:h:g:s option
+ do
+ case "$option" in
+ p) dir="$OPTARG";;
+ w) width="$OPTARG";;
+ h) height="$OPTARG";;
+ g) graylevel="$OPTARG";;
+ s) processsvg=1;;
+ :) echo "$usage"
+ exit 1
+ ;;
+ \?) echo "$usage"
+ exit 1
+ ;;
+ esac
+ done
+
+ # Get mandatory argument
+ shift $(($OPTIND-1))
+ prefix=$( echo $1 | tr '[:upper:]' '[:lower:]')
+ prefixupper=$(echo $1 | tr '[:lower:]' '[:upper:]')
+
+ # Check mandatory argument
+ if [ -z "$prefix" ]
+ then
+ echo "Please specify a prefix!"
+ echo "$usage"
+ exit 1
+ fi
+
+
+
+ # Change dir to where images are
+ if [ ! -d "${dir}" ]
+ then
+ echo "Please specify a valid directory"
+ echo "$usage"
+ exit 1
+ fi
+
+ cd "$dir"
+
+
+
+ # Processes dir
+ if [ "$processsvg" -eq 1 ]
+ then
+ process_svg
+ fi
+
+ process_png
+}
+
+
+########################################
+#
+# Convert all SVG files in directory to PNG
+#
+########################################
+process_svg () {
+ for i in *.svg
+ do
+ [ -f "$i" ] || continue
+
+ inkscape -z --export-png=`echo $i | sed -e 's/svg$/png/' | sed 's/[^a-zA-Z0-9._]/_/g'` -w $width -h $height -b white $i
+ done
+}
+
+
+
+########################################
+#
+# Generate PlantUml sprite
+#
+########################################
+process_png () {
+ for i in *.png
+ do
+ [ -f "$i" ] || continue
+
+ filename=$(echo $i | sed -e 's/.png$//') # Filename without extension
+ filenameupper=$(echo $filename | tr '[:lower:]' '[:upper:]') # Filename without extension in uppercase
+ spritename="${prefix}_$filename" # Sprite name is composed by prefix_filename
+ spritenameupper="${prefixupper}_$filenameupper" # Sprite name in uppercase
+ spritestereo="$prefixupper $filenameupper" # Sprite stereotype is uppercase prefix followed by uppercase filename
+ stereowhites=$(echo $spritestereo | sed -e 's/./ /g') # This is just whitespace to make output nicer
+
+ #echo "@startuml" >> $filename.puml
+
+ echo -e "$(plantuml -encodesprite $graylevel $i | sed '1!b;s/\$/$'${prefix}_'/')\n" >> $filename.puml
+
+ echo "!define $spritenameupper(_color) SPRITE_PUT( $stereowhites $spritename, _color)" >> $filename.puml
+ echo "!define $spritenameupper(_color, _scale) SPRITE_PUT( $stereowhites $spritename, _color, _scale)" >> $filename.puml
+
+ echo "!define $spritenameupper(_color, _scale, _alias) SPRITE_ENT( _alias, $spritestereo, $spritename, _color, _scale)" >> $filename.puml
+ echo "!define $spritenameupper(_color, _scale, _alias, _shape) SPRITE_ENT( _alias, $spritestereo, $spritename, _color, _scale, _shape)" >> $filename.puml
+ echo "!define $spritenameupper(_color, _scale, _alias, _shape, _label) SPRITE_ENT_L(_alias, $spritestereo, _label, $spritename, _color, _scale, _shape)" >> $filename.puml
+
+ echo "skinparam folderBackgroundColor<<$prefixupper $filenameupper>> White" >> $filename.puml
+
+ #echo "@enduml" >> $filename.puml
+ done
+}
+
+
+main "$@"