@armyc2.c5isr.renderer/mil-sym-ts-web 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/{dist/armyc2.c5isr.renderer-mil-sym-ts-web-2.2.0.tgz → armyc2.c5isr.renderer-mil-sym-ts-web-2.2.1.tgz} +0 -0
  2. package/package.json +15 -39
  3. package/buildNode.bat +0 -2
  4. package/buildWeb.bat +0 -2
  5. package/dist/LICENSE +0 -201
  6. package/dist/README.md +0 -57
  7. package/dist/package.json +0 -16
  8. package/index.ts +0 -169
  9. package/package.bak +0 -50
  10. package/package.node.json +0 -43
  11. package/package.pack.json +0 -19
  12. package/package.packWeb.json +0 -16
  13. package/package.web.json +0 -40
  14. package/src/main/ts/android/graphics/Bitmap.ts +0 -7
  15. package/src/main/ts/android/graphics/Paint.ts +0 -26
  16. package/src/main/ts/android/graphics/Path.ts +0 -78
  17. package/src/main/ts/android/graphics/PointF.ts +0 -14
  18. package/src/main/ts/android/graphics/Rect.ts +0 -18
  19. package/src/main/ts/android/graphics/RectF.ts +0 -50
  20. package/src/main/ts/android/graphics/Region.ts +0 -36
  21. package/src/main/ts/android/graphics/Typeface.ts +0 -11
  22. package/src/main/ts/armyc2/c5isr/JavaLineArray/BasicShapes.ts +0 -99
  23. package/src/main/ts/armyc2/c5isr/JavaLineArray/CChannelPoints2.ts +0 -34
  24. package/src/main/ts/armyc2/c5isr/JavaLineArray/CELineArray.ts +0 -193
  25. package/src/main/ts/armyc2/c5isr/JavaLineArray/Channels.ts +0 -2971
  26. package/src/main/ts/armyc2/c5isr/JavaLineArray/DISMSupport.ts +0 -4008
  27. package/src/main/ts/armyc2/c5isr/JavaLineArray/POINT2.ts +0 -93
  28. package/src/main/ts/armyc2/c5isr/JavaLineArray/Shape2.ts +0 -89
  29. package/src/main/ts/armyc2/c5isr/JavaLineArray/TacticalLines.ts +0 -515
  30. package/src/main/ts/armyc2/c5isr/JavaLineArray/arraysupport.ts +0 -5403
  31. package/src/main/ts/armyc2/c5isr/JavaLineArray/countsupport.ts +0 -1084
  32. package/src/main/ts/armyc2/c5isr/JavaLineArray/flot.ts +0 -2173
  33. package/src/main/ts/armyc2/c5isr/JavaLineArray/lineutility.ts +0 -4934
  34. package/src/main/ts/armyc2/c5isr/JavaLineArray/ref.ts +0 -7
  35. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/Modifier2.ts +0 -5601
  36. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/P1.ts +0 -14
  37. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/TGLight.ts +0 -648
  38. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/clsChannelUtility.ts +0 -647
  39. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/clsMETOC.ts +0 -2994
  40. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/clsUtility.ts +0 -2663
  41. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/mdlGeodesic.ts +0 -669
  42. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsClipPolygon2.ts +0 -971
  43. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsClipQuad.ts +0 -871
  44. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsRenderer.ts +0 -3507
  45. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsRenderer2.ts +0 -500
  46. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsUtility.ts +0 -1089
  47. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsUtilityCPOF.ts +0 -2656
  48. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsUtilityGE.ts +0 -1419
  49. package/src/main/ts/armyc2/c5isr/data/genc.json +0 -1407
  50. package/src/main/ts/armyc2/c5isr/data/msd.json +0 -17311
  51. package/src/main/ts/armyc2/c5isr/data/mse.json +0 -18500
  52. package/src/main/ts/armyc2/c5isr/data/svgd.json +0 -31214
  53. package/src/main/ts/armyc2/c5isr/data/svge.json +0 -30558
  54. package/src/main/ts/armyc2/c5isr/graphics2d/AffineTransform.ts +0 -10
  55. package/src/main/ts/armyc2/c5isr/graphics2d/Area.ts +0 -437
  56. package/src/main/ts/armyc2/c5isr/graphics2d/BasicStroke.ts +0 -429
  57. package/src/main/ts/armyc2/c5isr/graphics2d/BasicTypes.ts +0 -7
  58. package/src/main/ts/armyc2/c5isr/graphics2d/BufferedImage.ts +0 -35
  59. package/src/main/ts/armyc2/c5isr/graphics2d/Font.ts +0 -111
  60. package/src/main/ts/armyc2/c5isr/graphics2d/FontMetrics.ts +0 -29
  61. package/src/main/ts/armyc2/c5isr/graphics2d/FontRenderContext.ts +0 -18
  62. package/src/main/ts/armyc2/c5isr/graphics2d/GeneralPath.ts +0 -211
  63. package/src/main/ts/armyc2/c5isr/graphics2d/Graphics2D.ts +0 -80
  64. package/src/main/ts/armyc2/c5isr/graphics2d/IPathIterator.ts +0 -33
  65. package/src/main/ts/armyc2/c5isr/graphics2d/ImageIO.ts +0 -16
  66. package/src/main/ts/armyc2/c5isr/graphics2d/Line2D.ts +0 -726
  67. package/src/main/ts/armyc2/c5isr/graphics2d/PathIterator.ts +0 -141
  68. package/src/main/ts/armyc2/c5isr/graphics2d/Point.ts +0 -112
  69. package/src/main/ts/armyc2/c5isr/graphics2d/Point2D.ts +0 -261
  70. package/src/main/ts/armyc2/c5isr/graphics2d/Polygon.ts +0 -391
  71. package/src/main/ts/armyc2/c5isr/graphics2d/Rectangle.ts +0 -567
  72. package/src/main/ts/armyc2/c5isr/graphics2d/Rectangle2D.ts +0 -445
  73. package/src/main/ts/armyc2/c5isr/graphics2d/Shape.ts +0 -31
  74. package/src/main/ts/armyc2/c5isr/graphics2d/Stroke.ts +0 -18
  75. package/src/main/ts/armyc2/c5isr/graphics2d/TextLayout.ts +0 -45
  76. package/src/main/ts/armyc2/c5isr/graphics2d/TexturePaint.ts +0 -25
  77. package/src/main/ts/armyc2/c5isr/renderer/IIconRenderer.ts +0 -15
  78. package/src/main/ts/armyc2/c5isr/renderer/IconRenderer.ts +0 -22
  79. package/src/main/ts/armyc2/c5isr/renderer/MilStdIconRenderer.ts +0 -269
  80. package/src/main/ts/armyc2/c5isr/renderer/ModifierRenderer.ts +0 -9882
  81. package/src/main/ts/armyc2/c5isr/renderer/PatternFillRenderer.ts +0 -146
  82. package/src/main/ts/armyc2/c5isr/renderer/SinglePointSVGRenderer.ts +0 -1265
  83. package/src/main/ts/armyc2/c5isr/renderer/shapes/arc.ts +0 -64
  84. package/src/main/ts/armyc2/c5isr/renderer/shapes/bcurve.ts +0 -95
  85. package/src/main/ts/armyc2/c5isr/renderer/shapes/ellipse.ts +0 -93
  86. package/src/main/ts/armyc2/c5isr/renderer/shapes/line.ts +0 -114
  87. package/src/main/ts/armyc2/c5isr/renderer/shapes/path.ts +0 -555
  88. package/src/main/ts/armyc2/c5isr/renderer/shapes/pathiterator.ts +0 -62
  89. package/src/main/ts/armyc2/c5isr/renderer/shapes/point.ts +0 -120
  90. package/src/main/ts/armyc2/c5isr/renderer/shapes/rectangle.ts +0 -431
  91. package/src/main/ts/armyc2/c5isr/renderer/shapes/roundedrectangle.ts +0 -99
  92. package/src/main/ts/armyc2/c5isr/renderer/shapes/types.ts +0 -25
  93. package/src/main/ts/armyc2/c5isr/renderer/shapes/utilities.ts +0 -203
  94. package/src/main/ts/armyc2/c5isr/renderer/utilities/AffiliationColors.ts +0 -104
  95. package/src/main/ts/armyc2/c5isr/renderer/utilities/Color.ts +0 -481
  96. package/src/main/ts/armyc2/c5isr/renderer/utilities/DistanceUnit.ts +0 -40
  97. package/src/main/ts/armyc2/c5isr/renderer/utilities/DrawRules.ts +0 -1323
  98. package/src/main/ts/armyc2/c5isr/renderer/utilities/EntityCode.ts +0 -51
  99. package/src/main/ts/armyc2/c5isr/renderer/utilities/ErrorLogger.ts +0 -736
  100. package/src/main/ts/armyc2/c5isr/renderer/utilities/GENCLookup.ts +0 -106
  101. package/src/main/ts/armyc2/c5isr/renderer/utilities/GeoPixelConversion3D.ts +0 -84
  102. package/src/main/ts/armyc2/c5isr/renderer/utilities/IMultiPointRenderer.ts +0 -87
  103. package/src/main/ts/armyc2/c5isr/renderer/utilities/IPointConversion.ts +0 -34
  104. package/src/main/ts/armyc2/c5isr/renderer/utilities/ImageInfo.ts +0 -324
  105. package/src/main/ts/armyc2/c5isr/renderer/utilities/LRUCache.ts +0 -127
  106. package/src/main/ts/armyc2/c5isr/renderer/utilities/LRUEntry.ts +0 -18
  107. package/src/main/ts/armyc2/c5isr/renderer/utilities/LogLevel.ts +0 -111
  108. package/src/main/ts/armyc2/c5isr/renderer/utilities/MODrawRules.ts +0 -219
  109. package/src/main/ts/armyc2/c5isr/renderer/utilities/MSInfo.ts +0 -1008
  110. package/src/main/ts/armyc2/c5isr/renderer/utilities/MSLookup.ts +0 -882
  111. package/src/main/ts/armyc2/c5isr/renderer/utilities/MilStdAttributes.ts +0 -380
  112. package/src/main/ts/armyc2/c5isr/renderer/utilities/MilStdSymbol.ts +0 -797
  113. package/src/main/ts/armyc2/c5isr/renderer/utilities/Modifiers.ts +0 -1699
  114. package/src/main/ts/armyc2/c5isr/renderer/utilities/PointConversion.ts +0 -178
  115. package/src/main/ts/armyc2/c5isr/renderer/utilities/PointConversionDummy.ts +0 -45
  116. package/src/main/ts/armyc2/c5isr/renderer/utilities/PointConverter3D.ts +0 -126
  117. package/src/main/ts/armyc2/c5isr/renderer/utilities/RectUtilities.ts +0 -118
  118. package/src/main/ts/armyc2/c5isr/renderer/utilities/RendererException.ts +0 -11
  119. package/src/main/ts/armyc2/c5isr/renderer/utilities/RendererSettings.ts +0 -1201
  120. package/src/main/ts/armyc2/c5isr/renderer/utilities/RendererUtilities.ts +0 -591
  121. package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGInfo.ts +0 -29
  122. package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGLookup.ts +0 -753
  123. package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGSymbolInfo.ts +0 -137
  124. package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGTextInfo.ts +0 -438
  125. package/src/main/ts/armyc2/c5isr/renderer/utilities/SettingsChangedEvent.ts +0 -19
  126. package/src/main/ts/armyc2/c5isr/renderer/utilities/SettingsChangedEventListener.ts +0 -10
  127. package/src/main/ts/armyc2/c5isr/renderer/utilities/SettingsEventListener.ts +0 -5
  128. package/src/main/ts/armyc2/c5isr/renderer/utilities/Shape2SVG.ts +0 -404
  129. package/src/main/ts/armyc2/c5isr/renderer/utilities/ShapeInfo.ts +0 -525
  130. package/src/main/ts/armyc2/c5isr/renderer/utilities/ShapeUtilities.ts +0 -55
  131. package/src/main/ts/armyc2/c5isr/renderer/utilities/SymbolDimensionInfo.ts +0 -36
  132. package/src/main/ts/armyc2/c5isr/renderer/utilities/SymbolID.ts +0 -1055
  133. package/src/main/ts/armyc2/c5isr/renderer/utilities/SymbolUtilities.ts +0 -2085
  134. package/src/main/ts/armyc2/c5isr/renderer/utilities/TextInfo.ts +0 -157
  135. package/src/main/ts/armyc2/c5isr/web/render/GeoPixelConversion.ts +0 -86
  136. package/src/main/ts/armyc2/c5isr/web/render/MultiPointHandler.ts +0 -3798
  137. package/src/main/ts/armyc2/c5isr/web/render/MultiPointHandlerSVG.ts +0 -412
  138. package/src/main/ts/armyc2/c5isr/web/render/PointConverter.ts +0 -124
  139. package/src/main/ts/armyc2/c5isr/web/render/SymbolModifiers.ts +0 -26
  140. package/src/main/ts/armyc2/c5isr/web/render/WebRenderer.ts +0 -677
  141. package/src/main/ts/armyc2/c5isr/web/render/utilities/JavaRendererUtilities.ts +0 -484
  142. package/src/main/ts/armyc2/c5isr/web/render/utilities/LineInfo.ts +0 -62
  143. package/src/main/ts/armyc2/c5isr/web/render/utilities/SymbolInfo.ts +0 -46
  144. package/src/main/ts/armyc2/c5isr/web/render/utilities/TextInfo.ts +0 -51
  145. package/src/main/ts/org/gavaghan/geodesy/Angle.ts +0 -31
  146. package/src/main/ts/org/gavaghan/geodesy/Ellipsoid.ts +0 -71
  147. package/src/main/ts/org/gavaghan/geodesy/GeodeticCalculator.ts +0 -200
  148. package/src/main/ts/org/gavaghan/geodesy/GeodeticCurve.ts +0 -55
  149. package/src/main/ts/org/gavaghan/geodesy/GeodeticMeasurement.ts +0 -68
  150. package/src/main/ts/org/gavaghan/geodesy/GlobalCoordinates.ts +0 -103
  151. package/src/main/ts/org/gavaghan/geodesy/GlobalPosition.ts +0 -90
  152. package/test/ExportSPImages.js +0 -692
  153. package/test/MPWW.html +0 -556
  154. package/test/MPWorker.js +0 -318
  155. package/test/SPWorker.js +0 -233
  156. package/test/SVGWW.html +0 -363
  157. package/test/singlePointTester3.html +0 -751
  158. package/tsconfig.json +0 -54
  159. package/typedoc.json +0 -30
  160. package/updateVersion.js +0 -21
  161. package/webpack.config.js +0 -34
  162. package/webpackn.config.js +0 -28
  163. package/webpackr.config.js +0 -47
  164. package/webpackw.config.js +0 -23
  165. /package/{dist/C5Ren.d.ts → C5Ren.d.ts} +0 -0
  166. /package/{dist/C5Ren.js → C5Ren.js} +0 -0
  167. /package/{dist/C5Ren.js.map → C5Ren.js.map} +0 -0
  168. /package/{dist/manifest.json → manifest.json} +0 -0
@@ -1,404 +0,0 @@
1
- import { type int } from "../../graphics2d/BasicTypes";
2
-
3
- import { Font } from "../../graphics2d/Font"
4
- import { FontRenderContext } from "../../graphics2d/FontRenderContext"
5
- import { PathIterator } from "../../graphics2d/PathIterator"
6
- import { IPathIterator } from "../../graphics2d/IPathIterator"
7
- import { Point2D } from "../../graphics2d/Point2D"
8
- import { Rectangle2D } from "../../graphics2d/Rectangle2D"
9
- import { Shape } from "../../graphics2d/Shape"
10
- import { RendererSettings } from "../../renderer/utilities/RendererSettings"
11
- import { TextInfo } from "../../renderer/utilities/TextInfo"
12
-
13
-
14
- export class Shape2SVG {
15
-
16
- /**
17
- *
18
- * @param shape like {@link Shape}
19
- * @param stroke like "#000000
20
- * @param fill like "#0000FF" or "none"
21
- * @param strokeWidth "#"
22
- * @param strokeOpacity "1.0"
23
- * @param fillOpacity "1.0"
24
- * @param dashArray "4 1 2 3"
25
- * @return
26
- */
27
- //public static Convert(shape: Shape, stroke: string, fill: string, strokeWidth: string, strokeOpacity: string, fillOpacity: string, dashArray: string): string;
28
- public static Convert(textInfo: TextInfo, stroke: string, fill: string, strokeWidth: string, strokeOpacity: string, fillOpacity: string, dashArray: string): string;
29
- public static Convert(text: string, x: int, y: int, font: Font, frc: FontRenderContext, stroke: string, fill: string, strokeWidth: string, strokeOpacity: string, fillOpacity: string, dashArray: string): string;
30
- public static Convert(...args: unknown[]): string | null {
31
- switch (args.length) {
32
- /*case 7: {
33
- const [shape, stroke, fill, strokeWidth, strokeOpacity, fillOpacity, dashArray] = args as [Shape, string, string, string, string, string, string];
34
-
35
-
36
- if (shape instanceof Path2D) {
37
-
38
- return Shape2SVG.convertPath(shape as Path2D, stroke, fill, strokeWidth, strokeOpacity, fillOpacity, dashArray);
39
- }
40
-
41
- else {
42
- if (shape instanceof Rectangle2D) {
43
-
44
- return Shape2SVG.convertRect(shape as Rectangle2D, stroke, fill, strokeWidth, strokeOpacity, fillOpacity, dashArray);
45
- }
46
-
47
- else {
48
-
49
- return null;
50
- }
51
-
52
- }
53
-
54
-
55
-
56
- break;
57
- }//*/
58
-
59
- case 7: {
60
- const [textInfo, stroke, fill, strokeWidth, strokeOpacity, fillOpacity, dashArray] = args as [TextInfo, string, string, string, string, string, string];
61
-
62
- let res: string = "";
63
- if (textInfo != null) {
64
- let name: string = RendererSettings.getInstance().getLabelFont().getName() + ", sans-serif";//"SansSerif";
65
- let size: string = RendererSettings.getInstance().getLabelFont().getSize().toString();
66
- let weight: string;
67
- let anchor: string;//"start";
68
- let text: string = textInfo.getText();
69
-
70
- text = text.replace(/\&/g,"&");
71
- text = text.replace(/\</g,"&lt;");
72
- text = text.replace(/\</g,"&gt;");
73
-
74
- let location: Point2D = new Point2D(textInfo.getLocation().getX(), textInfo.getLocation().getY());
75
-
76
- if (textInfo.getLocation().getX() < 0) {
77
- if (textInfo.getLocation().getX() + textInfo.getTextBounds().getWidth() > 0) {
78
- anchor = "middle";
79
- location.setLocation(textInfo.getTextBounds().getCenterX(), location.getY());
80
- }
81
- else {
82
- anchor = "end";
83
- location.setLocation(textInfo.getTextBounds().getMaxX(), location.getY());
84
- }
85
- }
86
-
87
- if (RendererSettings.getInstance().getLabelFont().isBold()) {
88
-
89
- weight = "bold";
90
- }
91
-
92
-
93
- res += "<text x=\"" + location.getX() + "\" y=\"" + location.getY() + "\"";
94
-
95
- if (anchor != null) {
96
-
97
- res += " text-anchor=\"" + anchor + "\"";
98
- }
99
-
100
- res += " font-family=\"" + name + '"';
101
- res += " font-size=\"" + size + "px\"";
102
- if (weight != null) {
103
-
104
- res += " font-weight=\"" + weight + "\"";
105
- }
106
-
107
- res += " alignment-baseline=\"alphabetic\"";//
108
- res += " stroke-miterlimit=\"3\"";
109
-
110
- //sb.append(" text-anchor=\"" + anchor + "\"");//always start for single points and default SVG behavior
111
-
112
- /*if(this._angle)
113
- {
114
- se += ' transform="rotate(' + this._angle + ' ' + this._anchor.getX() + ' ' + this._anchor.getY() + ')"';
115
- }*/
116
-
117
- let seStroke: string = "";
118
- let seFill: string = "";
119
-
120
- if (stroke != null) {
121
- seStroke = res.toString();
122
-
123
- seStroke += " stroke=\"" + stroke + "\"";
124
- /*else
125
- seStroke = se + ' stroke="' + stroke.replace(/#/g,"&#35;") + '"';*/
126
-
127
- if (strokeWidth != null) {
128
-
129
- seStroke += " stroke-width=\"" + strokeWidth + "\"";
130
- }
131
-
132
- seStroke += " fill=\"none\"";
133
- seStroke += ">";
134
- seStroke += text;
135
- seStroke += "</text>";
136
- }
137
-
138
- if (fill != null) {
139
- seFill = res.toString();
140
-
141
- seFill += " fill=\"" + fill + "\"";
142
- seFill += ">";
143
- seFill += text;
144
- seFill += "</text>";
145
- }
146
-
147
- res = "";
148
- if (stroke != null && fill != null) {
149
- res += seStroke + "\n" + seFill + ("\n");
150
- } else if (fill != null) {
151
- res += seFill;
152
- } else {
153
- return null;
154
- }
155
-
156
- return res;
157
- }
158
- return null;
159
- }
160
-
161
- case 11: {
162
- const [text, x, y, font, frc, stroke, fill, strokeWidth, strokeOpacity, fillOpacity, dashArray] = args as [string, int, int, Font, OffscreenCanvasRenderingContext2D, string, string, string, string, string, string];
163
-
164
-
165
- //(String text, int x, int y, Font font, FontRenderContext frc)
166
- let textInfo: TextInfo = new TextInfo(text, x, y, font, frc);
167
- return Shape2SVG.Convert(textInfo, stroke, fill, strokeWidth, strokeOpacity, fillOpacity, dashArray);
168
- }
169
-
170
- default: {
171
- throw Error(`Invalid number of arguments`);
172
- }
173
- }
174
- }
175
-
176
-
177
- /**
178
- * Assumes common font properties will be defined in the group.
179
- * @param textInfo
180
- * @param stroke
181
- * @param fill
182
- * @param strokeWidth
183
- * @param strokeOpacity
184
- * @param fillOpacity
185
- * @param dashArray
186
- * @return
187
- */
188
- public static ConvertForGroup(textInfo: TextInfo, stroke: string, fill: string, strokeWidth: string, strokeOpacity: string, fillOpacity: string, dashArray: string): string | null {
189
- let res: string = "";
190
- if (textInfo != null) {
191
- let anchor: string;//"start";
192
- let text: string = textInfo.getText();
193
-
194
- text = text.replace(/\&/g,"&amp;");
195
- text = text.replace(/\</g,"&lt;");
196
- text = text.replace(/\</g,"&gt;");
197
-
198
- let location: Point2D = new Point2D(textInfo.getLocation().getX(), textInfo.getLocation().getY());
199
-
200
- if (textInfo.getLocation().getX() < 0) {
201
- if (textInfo.getLocation().getX() + textInfo.getTextBounds().getWidth() > 0) {
202
- anchor = "middle";
203
- location.setLocation(textInfo.getTextBounds().getCenterX(), location.getY());
204
- } else {
205
- anchor = "end";
206
- location.setLocation(textInfo.getTextBounds().getMaxX(), location.getY());
207
- }
208
- }
209
-
210
-
211
-
212
- res += "<text x=\"" + location.getX() + "\" y=\"" + location.getY() + "\"";
213
-
214
- if (anchor != null) {
215
- res += " text-anchor=\"" + anchor + "\"";
216
- }
217
-
218
-
219
- //sb.append(" text-anchor=\"" + anchor + "\"");//always start for single points and default SVG behavior
220
-
221
- /*if(this._angle)
222
- {
223
- se += ' transform="rotate(' + this._angle + ' ' + this._anchor.getX() + ' ' + this._anchor.getY() + ')"';
224
- }*/
225
-
226
- let seStroke: string = "";
227
- let seFill: string = "";
228
-
229
- if (stroke != null) {
230
- seStroke = res.toString();
231
-
232
- seStroke += " stroke=\"" + stroke + "\"";
233
- /*else
234
- seStroke = se + ' stroke="' + stroke.replace(/#/g,"&#35;") + '"';*/
235
-
236
- if (strokeWidth != null) {
237
- seStroke += " stroke-width=\"" + strokeWidth + "\"";
238
- }
239
-
240
- seStroke += " fill=\"none\"";
241
- seStroke += ">";
242
- seStroke += text;
243
- seStroke += "</text>";
244
- }
245
-
246
- if (fill != null) {
247
- seFill = res.toString();
248
-
249
-
250
- seFill += " fill=\"" + fill + "\"";
251
- seFill += ">";
252
- seFill += text;
253
- seFill += "</text>";
254
- }
255
-
256
- res = "";
257
- if (stroke != null && fill != null) {
258
- res += seStroke + "\n" + seFill + "\n";
259
- } else if (fill != null) {
260
- res += seFill;
261
- } else {
262
-
263
- return null;
264
- }
265
-
266
- return res;
267
- }
268
- return null;
269
- }
270
-
271
- public static makeBase64Safe(svg: string): string | null {
272
- if (svg != null) {
273
- //Base64 encoding
274
- //return new String(Base64.getEncoder().encode(svg.getBytes()));
275
- //URL-safe Base64 encoding
276
- return btoa(svg);
277
- }
278
- else {
279
- return null;
280
- }
281
-
282
- }
283
-
284
-
285
- /**
286
- *
287
- * @param path2D like {@link Path2D}
288
- * @param stroke like "#000000
289
- * @param fill like "#0000FF" or "none"
290
- * @param strokeWidth "#"
291
- * @param strokeOpacity "1.0"
292
- * @param fillOpacity "1.0"
293
- * @param dashArray "4 1 2 3"
294
- * @return
295
- */
296
- private static convertPath(path2D: Path2D, stroke: string, fill: string, strokeWidth: string, strokeOpacity: string, fillOpacity: string, dashArray: string): string
297
- {
298
- return null;
299
- /*
300
- let coords: number[] = new Array<number>(6);
301
- let path: string = "";
302
- let line: string = "";
303
- let moveTo: Point2D;
304
- let windingRule: int = IPathIterator.WIND_EVEN_ODD;
305
- let format: int = 1;
306
-
307
- let pitr: PathIterator = path2D.getPathIterator(null);
308
- windingRule = pitr.getWindingRule();
309
- do {
310
- let type: int = pitr.currentSegment(coords);
311
- if (type === IPathIterator.SEG_LINETO) {
312
- path += "L" + coords[0] + " " + coords[1];
313
- } else if (type === IPathIterator.SEG_MOVETO) {
314
- path += "M" + coords[0] + " " + coords[1];
315
- } else if (type === IPathIterator.SEG_QUADTO) {
316
- path += "Q" + coords[0] + " " + coords[1] + " " + coords[2] + " " + coords[3];
317
- } else if (type === IPathIterator.SEG_CUBICTO) {
318
- path += "C" + coords[0] + " " + coords[1] + " " + coords[2] + " " + coords[3] + " " + coords[4] + " " + coords[5];
319
- } else if (type === IPathIterator.SEG_CLOSE) {
320
- path += "Z";
321
- }
322
-
323
- pitr.next();
324
- } while (!pitr.isDone());
325
-
326
- line += "<path d=\"" + path + "\"";
327
-
328
- if (stroke != null) {
329
- if (format === 2) {
330
- line += " stroke=\"" + stroke.replace("#", "%23") + "\"";
331
- } else {
332
- line += " stroke=\"" + stroke + "\"";
333
- }
334
-
335
-
336
- if (strokeWidth != null) {
337
- line += " stroke-width=\"" + strokeWidth + "\"";
338
- } else {
339
-
340
- line += " stroke-width=\"2\"";
341
- }
342
-
343
-
344
- if (strokeOpacity != null && strokeOpacity !== "1.0") {
345
- line += " stroke-opacity=\"" + strokeOpacity + "\"";
346
- }
347
-
348
- //sbLine.append(" stroke-linecap=\"round\"");
349
-
350
- if (dashArray != null) {
351
- line += " stroke-dasharray=\"" + dashArray + "\"";
352
- }
353
-
354
-
355
- if (fill != null) {
356
- if (format === 2) {
357
- line += " fill=\"" + fill.replace("#", "%23") + "\"";
358
- } else {
359
- line += " fill=\"" + fill + "\"";
360
- }
361
-
362
- if (fillOpacity != null && fillOpacity !== "1.0") {
363
- line += " fill-opacity=\"" + fillOpacity + "\"";
364
- }
365
- }
366
- else {
367
- line += " fill=\"none\"";
368
- }
369
-
370
- line += " />";
371
- }
372
- return line;//*/
373
- }
374
-
375
- private static convertRect(rect: Rectangle2D, stroke: string, fill: string, strokeWidth: string, strokeOpacity: string, fillOpacity: string, dashArray: string): string | null {
376
- let res: string = "";
377
- if (rect != null && rect.isEmpty() !== true) {
378
- res += "<rect x=\"" + rect.getX() + "\" y=\"" + rect.getY();
379
- res += "\" width=\"" + rect.getWidth() + "\" height=\"" + rect.getHeight() + "\"";
380
-
381
- if (stroke != null) {
382
- res += " stroke=\"" + stroke + "\"";
383
-
384
- if (strokeWidth != null) {
385
- res += " stroke-width=\"" + strokeWidth + "\"";
386
- } else {
387
- res += " stroke-width=\"2\"";
388
- }
389
- }
390
-
391
- if (fill != null) {
392
- res += " fill=\"" + fill + "\"";
393
- } else {
394
- res += " fill=\"none\"";
395
- }
396
-
397
- res += "/>";
398
- return res;
399
- }
400
- else {
401
- return null;
402
- }
403
- }
404
- }