@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,484 +0,0 @@
1
- import { type int, type double } from "../../../graphics2d/BasicTypes";
2
- import { Point2D } from "../../../graphics2d/Point2D";
3
- import { MilStdAttributes } from "../../../renderer/utilities/MilStdAttributes";
4
- import { Modifiers } from "../../../renderer/utilities/Modifiers";
5
-
6
- /**
7
- *
8
- */
9
- export class JavaRendererUtilities {
10
-
11
- public static readonly HOSTILE_FILL_COLOR: string = "FFFF8080";
12
- public static readonly FRIENDLY_FILL_COLOR: string = "FF80E0FF";
13
- public static readonly NEUTRAL_FILL_COLOR: string = "FFAAFFAA";
14
- public static readonly UNKNOWN_FILL_COLOR: string = "FFFFFF80";
15
-
16
- /**
17
- * Converts ARGB string format to the Google used ABGR string format. Google
18
- * reverses the blue and red positioning.
19
- *
20
- * @param rgbString A color string of the format AARRGGBB in hex value.
21
- * @return the reverse of the input string in hex. The format should now be
22
- * AABBGGRR
23
- */
24
- public static ARGBtoABGR(rgbString: string): string {
25
- if (rgbString.length === 6) {
26
- let s: string = "FF";
27
- rgbString = s.concat(rgbString);
28
- }
29
-
30
- let bgrString: string = rgbString.toUpperCase();
31
-
32
- if (rgbString.length === 8) {
33
- let c: string[] = rgbString.split("");
34
- let temp1: string = c[2];
35
- let temp2: string = c[3];
36
- c[2] = c[6];
37
- c[3] = c[7];
38
- c[6] = temp1;
39
- c[7] = temp2;
40
- bgrString = c.join("");
41
- }
42
- else {
43
- if (rgbString.length === 6) {
44
- let c: string[] = rgbString.split("");
45
- let temp1: string = c[0];
46
- let temp2: string = c[1];
47
- c[0] = c[4];
48
- c[1] = c[5];
49
- c[4] = temp1;
50
- c[5] = temp2;
51
- bgrString = "FF" + c.join("");
52
- //bgrString = "FF" + bgrString;
53
- }
54
- else {
55
- console.error("JavaRendererUtilties.ARGBtoABGR(): " + "\"" + rgbString.toString() + "\" is not a 6 or 8 character String in the format of RRGGBB or AARRGGBB");
56
- }
57
- }
58
-
59
-
60
- return bgrString;
61
- }
62
-
63
- /**
64
- * Returns a symbolId with just the identifiable symbol Id pieces. All
65
- * variable information is returned as '*'. For example, a boundary,
66
- * "GFGPGLB----KUSX" returns "G*G*GLB---****X";
67
- *
68
- * @param symbolCode A 15 character symbol ID.
69
- * @return The normalized SymbolCode.
70
- * @deprecated
71
- */
72
- public static normalizeSymbolCode(symbolCode: string): string {
73
-
74
- let newSymbolCode: string = symbolCode;
75
-
76
- if (symbolCode.startsWith("G") || symbolCode.startsWith("S")) {
77
- // Remove Affiliation
78
- newSymbolCode = newSymbolCode.substring(0, 1) + '*' + newSymbolCode.substring(2);
79
- // Remove planned/present field
80
- newSymbolCode = newSymbolCode.substring(0, 3) + '*' + newSymbolCode.substring(4);
81
- // Remove echelon, special code and country codes
82
- newSymbolCode = newSymbolCode.substring(0, 10) + "****" + newSymbolCode.substring(14);
83
- }
84
-
85
- // If a unit replace last character with *.
86
- if (symbolCode.startsWith("S")) {
87
- newSymbolCode = newSymbolCode.substring(0, 14) + '*';
88
- }
89
-
90
- return newSymbolCode;
91
- }
92
-
93
- public static addAltModeToModifiersString(attributes: Map<string, string>, altMode: string): void {
94
- if (altMode === "relativeToGround") {
95
-
96
- attributes.set(MilStdAttributes.AltitudeMode, "AGL");
97
- }
98
-
99
- else {
100
- if (altMode === "absolute") {
101
-
102
- attributes.set(MilStdAttributes.AltitudeMode, "AMSL");
103
- }
104
-
105
- }
106
-
107
- }
108
-
109
- /**
110
- *
111
- * @param SymbolInfo something like
112
- * "SymbolID?LineColor=0x000000&amp;FillColor=0xFFFFFF&amp;size=35"
113
- */
114
- public static createParameterMapFromURL(SymbolInfo: string): Map<string, string> {
115
- let modifiers: Map<string, string> = new Map<string, string>();
116
- let symbolID: string;
117
- let parameters: string;
118
- let key: string;
119
- let value: string;
120
- let arrParameters: string[];
121
- let arrKeyValue: string[];
122
- let temp: string;
123
- let questionIndex: int = SymbolInfo.lastIndexOf('?');
124
-
125
- try {
126
- if (questionIndex === -1) {
127
- symbolID = decodeURI(SymbolInfo);
128
- } else {
129
- symbolID = decodeURI(SymbolInfo.substring(0, questionIndex));
130
- }
131
-
132
- } catch (exc) {
133
- if (exc instanceof Error) {
134
- console.error("Error parsing SymbolID");
135
- console.error(exc.message);
136
- } else {
137
- throw exc;
138
- }
139
- }
140
-
141
- try { //build a map for the other createMilstdSymbol function to use
142
- //to build a milstd symbol.
143
- if (questionIndex > 0 && (questionIndex + 1 < SymbolInfo.length)) {
144
- parameters = SymbolInfo.substring(questionIndex + 1, SymbolInfo.length);
145
- arrParameters = parameters.split("&");
146
- let n: int = arrParameters.length;
147
- //for(int i = 0; i < arrParameters.length; i++)
148
- for (let i: int = 0; i < n; i++) {
149
- arrKeyValue = arrParameters[i].split("=");
150
- if (arrKeyValue.length === 2 && arrKeyValue[1] != null && arrKeyValue[1] !== "") {
151
-
152
- key = arrKeyValue[0];
153
- value = arrKeyValue[1];
154
-
155
- temp = decodeURI(value);
156
- modifiers.set(key.toUpperCase(), temp);
157
-
158
- //console.log("key: " + key + " value: " + temp);
159
- }
160
- }
161
- }
162
- } catch (exc) {
163
- if (exc instanceof Error) {
164
- console.error("Error parsing \"" + key.toUpperCase() + "\" parameter from URL");
165
- console.error(exc.message);
166
- } else {
167
- throw exc;
168
- }
169
- }
170
- return modifiers;
171
- }
172
-
173
- /*
174
- * Try to turn a bad code into something renderable.
175
- *
176
- * @param symbolID
177
- * @return
178
- * @deprecated use SymbolUtilties.reconcileSymbolID() 9/5/2013
179
- */
180
- /*public static String ReconcileSymbolID(String symbolID) {
181
- StringBuilder sb = new StringBuilder("");
182
- char codingScheme = symbolID.charAt(0);
183
-
184
- if (symbolID.length < 15) {
185
- while (symbolID.length < 15) {
186
- symbolID += "-";
187
- }
188
- }
189
- if (symbolID.length > 15) {
190
- symbolID = symbolID.substring(0, 14);
191
- }
192
-
193
- if (symbolID != null && symbolID.length == 15) {
194
- if (codingScheme == 'S' || //warfighting
195
- codingScheme == 'I' ||//sigint
196
- codingScheme == 'O' ||//stability operation
197
- codingScheme == 'E')//emergency management
198
- {
199
- sb.append(codingScheme);
200
-
201
- if (SymbolUtilities.hasValidAffiliation(symbolID) == false) {
202
- sb.append('U');
203
- } else {
204
- sb.append(symbolID.charAt(1));
205
- }
206
-
207
- if (SymbolUtilities.hasValidBattleDimension(symbolID) == false) {
208
- sb.append('Z');
209
- sb.replace(0, 1, "S");
210
- } else {
211
- sb.append(symbolID.charAt(2));
212
- }
213
-
214
- if (SymbolUtilities.hasValidStatus(symbolID) == false) {
215
- sb.append('P');
216
- } else {
217
- sb.append(symbolID.charAt(3));
218
- }
219
-
220
- sb.append("------");
221
- sb.append(symbolID.substring(10, 15));
222
-
223
- } else if (codingScheme == 'G')//tactical
224
- {
225
- sb.append(codingScheme);
226
-
227
- if (SymbolUtilities.hasValidAffiliation(symbolID) == false) {
228
- sb.append('U');
229
- } else {
230
- sb.append(symbolID.charAt(1));
231
- }
232
-
233
- sb.append('G');
234
-
235
- if (SymbolUtilities.hasValidStatus(symbolID) == false) {
236
- sb.append('P');
237
- } else {
238
- sb.append(symbolID.charAt(3));
239
- }
240
-
241
- sb.append("GPP---");//return an action point
242
- sb.append(symbolID.substring(10, 15));
243
-
244
- } else if (codingScheme == 'W')//weather
245
- {//no default weather graphic
246
- return "SUZP-----------";//unknown
247
- } else//bad codingScheme
248
- {
249
- sb.append('S');
250
- if (SymbolUtilities.hasValidAffiliation(symbolID) == false) {
251
- sb.append('U');
252
- } else {
253
- sb.append(symbolID.charAt(1));
254
- }
255
-
256
- if (SymbolUtilities.hasValidBattleDimension(symbolID) == false) {
257
- sb.append('Z');
258
- } else {
259
- sb.append(symbolID.charAt(2));
260
- }
261
-
262
- if (SymbolUtilities.hasValidStatus(symbolID) == false) {
263
- sb.append('P');
264
- } else {
265
- sb.append(symbolID.charAt(3));
266
- }
267
-
268
- sb.append("------");
269
- sb.append(symbolID.substring(10, 15));
270
- }
271
- } else {
272
- return "SUZP-----------";//unknown
273
- }
274
-
275
- return sb.toString();
276
-
277
- }//*/
278
-
279
- /**
280
- * Checks symbolID and if the relevant modifiers are present
281
- *
282
- * @param symbolCode
283
- * @param modifiers
284
- * @return
285
- * @deprecated
286
- */
287
- public static is3dSymbol(symbolCode: string, modifiers: Map<string, string>): boolean {
288
- let returnValue: boolean = false;
289
-
290
- try {
291
- let symbolId: string = symbolCode.substring(4, 10);
292
-
293
- if (symbolId === "ACAI--" || // Airspace Coordination Area Irregular
294
- symbolId === "ACAR--" || // Airspace Coordination Area Rectangular
295
- symbolId === "ACAC--" || // Airspace Coordination Area Circular
296
- symbolId === "AKPC--" || // Kill box circular
297
- symbolId === "AKPR--" || // Kill box rectangular
298
- symbolId === "AKPI--" || // Kill box irregular
299
- symbolId === "ALC---" || // Air corridor
300
- symbolId === "ALM---" || //
301
- symbolId === "ALS---" || // SAAFR
302
- symbolId === "ALU---" || // UAV
303
- symbolId === "ALL---" || // Low level transit route
304
- symbolId === "AAR---"
305
- || symbolId === "AAF---"
306
- || symbolId === "AAH---"
307
- || symbolId === "AAM---" || // MEZ
308
- symbolId === "AAML--" || // LOMEZ
309
- symbolId === "AAMH--") {
310
-
311
- try {
312
- if (modifiers != null) {
313
-
314
- // These guys store array values. Put in appropriate data strucutre
315
- // for MilStdSymbol.
316
- if (modifiers.has(Modifiers.X_ALTITUDE_DEPTH)) {
317
- let altitudes: string[] = modifiers.get(Modifiers.X_ALTITUDE_DEPTH).split(",");
318
- if (altitudes.length < 2) {
319
- returnValue = false;
320
- } else {
321
- returnValue = true;
322
- }
323
- }
324
-
325
- }
326
- } catch (exc) {
327
- if (exc instanceof Error) {
328
- console.error(exc.message);
329
- } else {
330
- throw exc;
331
- }
332
- }
333
- }
334
- } catch (e) {
335
- if (e instanceof Error) {
336
- console.error(e.message);
337
- } else {
338
- throw e;
339
- }
340
- }
341
- return returnValue;
342
- }
343
-
344
- /**
345
- * Determines if a String represents a valid number
346
- *
347
- * @param text
348
- * @return "1.56" == true, "1ab" == false
349
- */
350
- public static isNumber(text: string): boolean {
351
- if (text != null && RegExp("((-|\\+)?[0-9]+(\\.[0-9]+)?)+").test(text)) {
352
- return true;
353
- } else {
354
- return false;
355
- }
356
- }
357
-
358
- /**
359
- * Takes a throwable and puts it's stacktrace into a string.
360
- *
361
- * @param thrown
362
- * @return
363
- */
364
- public static getStackTrace(thrown: Error): string {
365
- try {
366
- /*
367
- let writer: java.io.Writer = new java.io.StringWriter();
368
- let printWriter: java.io.PrintWriter = new java.io.PrintWriter(writer);
369
- thrown.printStackTrace(printWriter);
370
- return writer.toString();
371
- */
372
- return thrown.stack;
373
- } catch (exc) {
374
- if (exc instanceof Error) {
375
- //console.log("JavaRendererUtilties.getStackTrace()");
376
- //return "Error - couldn't retrieve stack trace";
377
- return "";
378
- } else {
379
- throw exc;
380
- }
381
- }
382
- }
383
-
384
- public static getEndPointWithAngle(ptStart: Point2D,
385
- //Point2D pt1,
386
- //Point2D pt2,
387
- angle: double,
388
- distance: double): Point2D {
389
- let newX: double = 0;
390
- let newY: double = 0;
391
- let pt: Point2D = new Point2D();
392
- try {
393
- //first get the angle psi between pt0 and pt1
394
- let psi: double = 0;//Math.atan((pt1.y - pt0.y) / (pt1.x - pt0.x));
395
- //double psi = Math.atan((ptStart.getY() - ptStart.getY()) / (ptStart.getX() - (ptStart.getX()+100)));
396
- //convert alpha to radians
397
- let alpha1: double = Math.PI * angle / 180;
398
-
399
- //theta is the angle of extension from the x axis
400
- let theta: double = psi + alpha1;
401
- //dx is the x extension from pt2
402
- let dx: double = distance * Math.cos(theta);
403
- //dy is the y extension form pt2
404
- let dy: double = distance * Math.sin(theta);
405
- newX = ptStart.getX() + dx;
406
- newY = ptStart.getY() + dy;
407
-
408
- pt.setLocation(newX, newY);
409
- } catch (exc) {
410
- if (exc instanceof Error) {
411
- console.log(exc.message);
412
- console.log(exc.stack)
413
- } else {
414
- throw exc;
415
- }
416
- }
417
- return pt;
418
- }
419
-
420
- /**
421
- *
422
- * @param latitude1
423
- * @param longitude1
424
- * @param latitude2
425
- * @param longitude2
426
- * @param unitOfMeasure meters, kilometers, miles, feet, yards, nautical,
427
- * nautical miles.
428
- * @return
429
- */
430
- public static measureDistance(latitude1: double, longitude1: double, latitude2: double, longitude2: double, unitOfMeasure: string): double {
431
- // latitude1,latitude2 = latitude, longitude1,longitude2 = longitude
432
- //Radius is 6378.1 (km), 3963.1 (mi), 3443.9 (nm
433
-
434
- let distance: double = -1;
435
- let
436
- rad: double = 0;
437
-
438
- let uom: string = unitOfMeasure.toLowerCase();
439
-
440
- if (uom === "meters") {
441
- rad = 6378137;
442
- } else {
443
- if (uom === "kilometers") {
444
- rad = 6378.137;
445
- } else {
446
- if (uom === "miles") {
447
- rad = 3963.1;
448
- } else {
449
- if (uom === "feet") {
450
- rad = 20925524.9;
451
- } else {
452
- if (uom === "yards") {
453
- rad = 6975174.98;
454
- } else {
455
- if (uom === "nautical") {
456
- rad = 3443.9;
457
- } else {
458
- if (uom === "nautical miles") {
459
- rad = 3443.9;
460
- } else {
461
- return -1.0;
462
- }
463
- }
464
-
465
- }
466
-
467
- }
468
-
469
- }
470
-
471
- }
472
-
473
- }
474
-
475
-
476
- latitude1 = latitude1 * (Math.PI / 180);
477
- latitude2 = latitude2 * (Math.PI / 180);
478
- longitude1 = longitude1 * (Math.PI / 180);
479
- longitude2 = longitude2 * (Math.PI / 180);
480
- distance = (Math.acos(Math.cos(latitude1) * Math.cos(longitude1) * Math.cos(latitude2) * Math.cos(longitude2) + Math.cos(latitude1) * Math.sin(longitude1) * Math.cos(latitude2) * Math.sin(longitude2) + Math.sin(latitude1) * Math.sin(latitude2)) * rad);
481
-
482
- return distance;
483
- }
484
- }
@@ -1,62 +0,0 @@
1
- import { BasicStroke } from "../../../graphics2d/BasicStroke";
2
- import { Point2D } from "../../../graphics2d/Point2D";
3
- import { Color } from "../../../renderer/utilities/Color";
4
-
5
-
6
- /**
7
- *
8
- *
9
- */
10
- export class LineInfo {
11
-
12
- private lineColor: Color;
13
- private fillColor: Color;
14
- //private int lineWidth = 2;
15
- private stroke: BasicStroke;
16
-
17
- private _Polylines: Array<Array<Point2D>>;
18
-
19
- public constructor() {
20
- }
21
-
22
- public setLineColor(value: Color): void {
23
- this.lineColor = value;
24
- }
25
- public getLineColor(): Color {
26
- return this.lineColor;
27
- }
28
-
29
- public setFillColor(value: Color): void {
30
- this.fillColor = value;
31
- }
32
- public getFillColor(): Color {
33
- return this.fillColor;
34
- }
35
-
36
- public getStroke(): BasicStroke {
37
- return this.stroke;
38
- }
39
- //client will use this to do fills (if it is not null)
40
- /*
41
- public TexturePaint getTexturePaint()
42
- {
43
- return texturePaint;
44
- }
45
- public void setTexturePaint(TexturePaint value)
46
- {
47
- texturePaint=value;
48
- }*/
49
-
50
- public setStroke(s: BasicStroke): void {
51
- this.stroke = s;
52
- }
53
-
54
- public getPolylines(): Array<Array<Point2D>> {
55
- return this._Polylines;
56
- }
57
-
58
- public setPolylines(value: Array<Array<Point2D>>): void {
59
- this._Polylines = value;
60
- }
61
-
62
- }
@@ -1,46 +0,0 @@
1
- import { LineInfo } from "./LineInfo";
2
- import { TextInfo } from "./TextInfo";
3
-
4
-
5
-
6
- /**
7
- *
8
- *
9
- */
10
- export class SymbolInfo {
11
-
12
- private _LineInfo: Array<LineInfo>;
13
- private _TextInfo: Array<TextInfo>;
14
-
15
- public constructor();
16
- public constructor(ti: Array<TextInfo>, li: Array<LineInfo>);
17
- public constructor(...args: unknown[]) {
18
- switch (args.length) {
19
- case 0: {
20
- break;
21
- }
22
-
23
- case 2: {
24
- const [ti, li] = args as [Array<TextInfo>, Array<LineInfo>];
25
-
26
- this._LineInfo = li;
27
- this._TextInfo = ti;
28
- break;
29
- }
30
-
31
- default: {
32
- throw Error(`Invalid number of arguments`);
33
- }
34
- }
35
- }
36
-
37
-
38
- public getTextInfoList(): Array<TextInfo> {
39
- return this._TextInfo;
40
- }
41
-
42
- public getLineInfoList(): Array<LineInfo> {
43
- return this._LineInfo;
44
- }
45
-
46
- }
@@ -1,51 +0,0 @@
1
- /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
4
- */
5
-
6
-
7
- //import java.awt.geom.Point2D;
8
-
9
-
10
- import { Point2D } from "../../../graphics2d/Point2D";
11
-
12
- type double = number;
13
-
14
- /**
15
- *
16
- *
17
- */
18
- export class TextInfo {
19
- private _ModifierString: string;
20
- private _ModifierStringPosition: Point2D;
21
- private _ModifierStringAngle: double = 0;
22
-
23
- public constructor() { }
24
-
25
- //set this when returning text string.
26
- public setModifierString(value: string): void {
27
- this._ModifierString = value;
28
- }
29
-
30
- public getModifierString(): string {
31
- return this._ModifierString;
32
- }
33
-
34
- //location to draw ModifierString.
35
- public setModifierStringPosition(value: Point2D): void {
36
- this._ModifierStringPosition = value;
37
- }
38
-
39
- public getModifierStringPosition(): Point2D {
40
- return this._ModifierStringPosition;
41
- }
42
-
43
- //angle to draw ModifierString.
44
- public setModifierStringAngle(value: double): void {
45
- this._ModifierStringAngle = value;
46
- }
47
-
48
- public getModifierStringAngle(): double {
49
- return this._ModifierStringAngle;
50
- }
51
- }
@@ -1,31 +0,0 @@
1
- /*
2
- * Geodesy by Mike Gavaghan
3
- *
4
- * http://www.gavaghan.org/blog/free-source-code/geodesy-library-vincentys-formula/
5
- *
6
- * Copyright 2007 Mike Gavaghan - mike@gavaghan.org
7
- *
8
- * Licensed under the Apache License, Version 2.0 (the "License");
9
- * you may not use this file except in compliance with the License.
10
- * You may obtain a copy of the License at
11
- *
12
- * http://www.apache.org/licenses/LICENSE-2.0
13
- *
14
- * Unless required by applicable law or agreed to in writing, software
15
- * distributed under the License is distributed on an "AS IS" BASIS,
16
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
- * See the License for the specific language governing permissions and
18
- * limitations under the License.
19
- */
20
-
21
- export class Angle {
22
- static readonly PiOver180: number = Math.PI / 180.0;
23
-
24
- public static toRadians(degrees: number): number {
25
- return degrees * Angle.PiOver180;
26
- }
27
-
28
- public static toDegrees(radians: number): number {
29
- return radians / Angle.PiOver180;
30
- }
31
- }