@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,481 +0,0 @@
1
- //import { RendererUtilities } from "../../renderer/utilities/RendererUtilities"
2
-
3
-
4
- /**
5
- * Integer based Color class with utility functions
6
- */
7
- export class Color {
8
-
9
- /**
10
- * The color white. In the default sRGB space.
11
- */
12
- public static readonly white: Color = new Color(255, 255, 255);
13
-
14
- /**
15
- * The color white. In the default sRGB space.
16
- *
17
- */
18
- public static readonly WHITE: Color = Color.white;
19
-
20
- /**
21
- * The color light gray. In the default sRGB space.
22
- */
23
- public static readonly lightGray: Color = new Color(192, 192, 192);
24
-
25
- /**
26
- * The color light gray. In the default sRGB space.
27
- *
28
- */
29
- public static readonly LIGHT_GRAY: Color = Color.lightGray;
30
-
31
- /**
32
- * The color gray. In the default sRGB space.
33
- */
34
- public static readonly gray: Color = new Color(128, 128, 128);
35
-
36
- /**
37
- * The color gray. In the default sRGB space.
38
- *
39
- */
40
- public static readonly GRAY: Color = Color.gray;
41
-
42
- /**
43
- * The color dark gray. In the default sRGB space.
44
- */
45
- public static readonly darkGray: Color = new Color(64, 64, 64);
46
-
47
- /**
48
- * The color dark gray. In the default sRGB space.
49
- *
50
- */
51
- public static readonly DARK_GRAY: Color = Color.darkGray;
52
-
53
- /**
54
- * The color black. In the default sRGB space.
55
- */
56
- public static readonly black: Color = new Color(0, 0, 0);
57
-
58
- /**
59
- * The color black. In the default sRGB space.
60
- *
61
- */
62
- public static readonly BLACK: Color = Color.black;
63
-
64
- /**
65
- * The color red. In the default sRGB space.
66
- */
67
- public static readonly red: Color = new Color(255, 0, 0);
68
-
69
- /**
70
- * The color red. In the default sRGB space.
71
- *
72
- */
73
- public static readonly RED: Color = Color.red;
74
-
75
- /**
76
- * The color pink. In the default sRGB space.
77
- */
78
- public static readonly pink: Color = new Color(255, 175, 175);
79
-
80
- /**
81
- * The color pink. In the default sRGB space.
82
- *
83
- */
84
- public static readonly PINK: Color = Color.pink;
85
-
86
- /**
87
- * The color orange. In the default sRGB space.
88
- */
89
- public static readonly orange: Color = new Color(255, 128, 0);
90
-
91
- /**
92
- * The color orange. In the default sRGB space.
93
- *
94
- */
95
- public static readonly ORANGE: Color = Color.orange;
96
-
97
- /**
98
- * The color yellow. In the default sRGB space.
99
- */
100
- public static readonly yellow: Color = new Color(255, 255, 0);
101
-
102
- /**
103
- * The color yellow. In the default sRGB space.
104
- *
105
- */
106
- public static readonly YELLOW: Color = Color.yellow;
107
-
108
- /**
109
- * The color green. In the default sRGB space.
110
- */
111
- public static readonly green: Color = new Color(0, 255, 0);
112
-
113
- /**
114
- * The color green. In the default sRGB space.
115
- *
116
- */
117
- public static readonly GREEN: Color = Color.green;
118
-
119
- /**
120
- * The color magenta. In the default sRGB space.
121
- */
122
- public static readonly magenta: Color = new Color(255, 0, 255);
123
-
124
- /**
125
- * The color magenta. In the default sRGB space.
126
- *
127
- */
128
- public static readonly MAGENTA: Color = Color.magenta;
129
-
130
- /**
131
- * The color cyan. In the default sRGB space.
132
- */
133
- public static readonly cyan: Color = new Color(0, 255, 255);
134
-
135
- /**
136
- * The color cyan. In the default sRGB space.
137
- *
138
- */
139
- public static readonly CYAN: Color = Color.cyan;
140
-
141
- /**
142
- * The color blue. In the default sRGB space.
143
- */
144
- public static readonly blue: Color = new Color(0, 0, 255);
145
-
146
- /**
147
- * The color blue. In the default sRGB space.
148
- *
149
- */
150
- public static readonly BLUE: Color = Color.blue;
151
-
152
- private _A: number = 255;
153
- private _R: number = 0;
154
- private _G: number = 0;
155
- private _B: number = 0;
156
-
157
- /**
158
- *
159
- * @param hexValue - String representing hex value (formatted "0xRRGGBB"
160
- * i.e. "0xFFFFFF") OR formatted "0xAARRGGBB" i.e. "0x00FFFFFF" for a color
161
- * with an alpha value I will also put up with "RRGGBB" and "AARRGGBB"
162
- * without the starting "0x" or "#"
163
- * @return
164
- */
165
- private getColorsFromHexString(hexValue: string): Array<number> | null
166
- {
167
-
168
- try {
169
- if (hexValue == null || hexValue.length === 0) {
170
-
171
- return null;
172
- }
173
-
174
- let hexOriginal: string = hexValue;
175
-
176
- let hexAlphabet: string = "0123456789ABCDEF";
177
-
178
- if (hexValue.charAt(0) === '#') {
179
- hexValue = hexValue.substring(1);
180
- }
181
- if (hexValue.substring(0, 2) === "0x" || hexValue.substring(0, 2) === "0X") {
182
- hexValue = hexValue.substring(2);
183
- }
184
-
185
- hexValue = hexValue.toUpperCase();
186
-
187
- let count: number = hexValue.length;
188
- let value: number[];
189
- let k: number = 0;
190
- let int1: number = 0;
191
- let int2: number = 0;
192
-
193
- if (count === 8 || count === 6) {
194
- value = new Array<number>((count / 2));
195
- for (let i: number = 0; i < count; i += 2) {
196
- int1 = hexAlphabet.indexOf(hexValue.charAt(i));
197
- int2 = hexAlphabet.indexOf(hexValue.charAt(i + 1));
198
-
199
- if (int1 === -1 || int2 === -1) {
200
- throw Error("Bad hex value: " + hexOriginal);
201
- }
202
-
203
- value[k] = (int1 * 16) + int2;
204
- k++;
205
- }
206
-
207
- return value;
208
- }
209
- else
210
- {
211
- throw Error("Bad hex value: " + hexValue);
212
- }
213
- return null;
214
- } catch (exc) {
215
- if (exc instanceof Error) {
216
- throw Error("Bad hex value: " + hexValue);
217
- } else {
218
- throw exc;
219
- }
220
- }
221
- return null;
222
- }
223
-
224
- public constructor();
225
- public constructor(color: Color);
226
-
227
- public constructor(color: number);
228
-
229
- public constructor(hexString: string);
230
-
231
- public constructor(R: number, G: number, B: number);
232
-
233
- public constructor(R: number, G: number, B: number, A: number);
234
- public constructor(...args: unknown[]) {
235
- switch (args.length)
236
- {
237
- case 1:
238
- {
239
- if(args[0] instanceof Color)
240
- {
241
- const [color] = args as [Color];
242
-
243
- if (color != null) {
244
- this._A = color.getAlpha();
245
- this._R = color.getRed();
246
- this._G = color.getGreen();
247
- this._B = color.getBlue();
248
- }
249
- else {
250
- this._A = 255;
251
- this._R = 0;
252
- this._G = 0;
253
- this._B = 0;
254
- }
255
- }
256
- else if(typeof args[0] === 'string')
257
- {
258
- const [hexString] = args as [string];
259
-
260
- let arr:Array<number> | null = this.getColorsFromHexString(hexString);
261
-
262
- if(arr != null && (arr.length === 4 || arr.length === 3) )
263
- {
264
- if(arr.length === 4)
265
- {
266
- this._A = arr[0];
267
- this._R = arr[1];
268
- this._G = arr[2];
269
- this._B = arr[3];
270
- }
271
- else
272
- {
273
- this._A = 255;
274
- this._R = arr[0];
275
- this._G = arr[1];
276
- this._B = arr[2];
277
- }
278
-
279
- }
280
- }
281
- else if(typeof args[0] === 'number')
282
- {
283
- const [color] = args as [number];
284
-
285
- this._A = this.getAlphaFromColor(color);
286
- this._R = this.getRedFromColor(color);
287
- this._G = this.getGreenFromColor(color);
288
- this._B = this.getBlueFromColor(color);
289
- }
290
- else
291
- {
292
- this._A = 255;
293
- this._R = 0;
294
- this._G = 0;
295
- this._B = 0;
296
- }
297
-
298
- break;
299
- }
300
-
301
- case 3: {
302
- const [R, G, B] = args as [number, number, number];
303
-
304
- this._A = 255;
305
- this._R = R;
306
- this._G = G;
307
- this._B = B;
308
-
309
-
310
- break;
311
- }
312
-
313
- case 4: {
314
- const [R, G, B, A] = args as [number, number, number, number];
315
-
316
- this._A = A;
317
- this._R = R;
318
- this._G = G;
319
- this._B = B;
320
-
321
-
322
- break;
323
- }
324
-
325
- case 0: {
326
-
327
- this._A = 255;
328
- this._R = 0;
329
- this._G = 0;
330
- this._B = 0;
331
-
332
- break;
333
- }
334
-
335
- default: {
336
- throw new Error("Color() - Invalid number of arguments");//java.lang.IllegalArgumentException(S`Invalid number of arguments`);
337
- }//*/
338
- }
339
- }
340
-
341
- public static makeColor(r:number,g:number,b:number):Color
342
- {
343
- let color:Color = null;
344
- try
345
- {
346
- color = new Color(r,g,b);
347
- }
348
- catch(e)
349
- {
350
- console.log(e.message);
351
- }
352
- return color;
353
- }
354
-
355
- public toRGB():number
356
- {
357
- return (this._R*65536) + (this._G*256) + this._B;
358
- }
359
-
360
- public toARGB(): number {
361
- let returnVal: number = 0;
362
- returnVal = (this._A << 24) + ((this._R & 0xFF) << 16) + ((this._G & 0xFF) << 8) + (this._B & 0xFF);
363
- return returnVal;
364
- }
365
-
366
- private convert(integer:number):string
367
- {
368
- //Simpler
369
- //var str = integer.toString(16);
370
- //return str.length === 1 ? "0" + str : str;
371
-
372
- //Much Faster
373
- var hexAlphabet = "0123456789ABCDEF";
374
- return isNaN(integer) ? "00" : hexAlphabet.charAt((integer - integer % 16)/16) + hexAlphabet.charAt(integer % 16);
375
- }
376
-
377
- /**
378
- * A hex string in the format of AARRGGBB
379
- * @param {Boolean} withAlpha Optional, default is true. If set to false,
380
- * will return a hex string without alpha values.
381
- */
382
- public toHexString(withAlpha:boolean = false):string
383
- {
384
- if(withAlpha === false)
385
- {
386
- return "#" + this.convert(this._R) +
387
- this.convert(this._G) +
388
- this.convert(this._B);
389
- }
390
- else
391
- {
392
- return "#" + this.convert(this._A) +
393
- this.convert(this._R) +
394
- this.convert(this._G) +
395
- this.convert(this._B);
396
- }
397
- }
398
-
399
- public toString(): string {
400
- return "Color{A=" + this._A.toString() + ",R=" + this._R.toString() +
401
- ",G=" + this._G.toString() + ",B=" + this._B.toString() + "}";
402
- }
403
-
404
- public getRed(): number {
405
- return this._R;
406
- }
407
-
408
- public getGreen(): number {
409
- return this._G;
410
- }
411
-
412
- public getBlue(): number {
413
- return this._B;
414
- }
415
-
416
- public getAlpha(): number {
417
- return this._A;
418
- }
419
-
420
- /**
421
- *
422
- * @param alpha 0-255
423
- */
424
- public setAlpha(alpha: number): void {
425
- this._A = alpha;
426
- }
427
-
428
- public toInt(): number {
429
- return this.toARGB();
430
- }
431
-
432
-
433
- /**
434
- * get alpha value from uint
435
- * */
436
- private getAlphaFromColor(color: number): number {
437
- let alpha: number = 255;
438
- if (color > 16777215) {
439
-
440
- alpha = (color >>> 24);
441
- }
442
-
443
- return alpha;
444
- }
445
- /**
446
- * get red value from uint
447
- * */
448
- private getRedFromColor(color: number): number {
449
- let red: number = 255;
450
- red = (color >> 16) & 0xFF;
451
- return red;
452
- }
453
- /**
454
- * get green value from uint
455
- * */
456
- private getGreenFromColor(color: number): number {
457
- let green: number = 255;
458
- green = (color >> 8) & 0xFF;
459
- return green;
460
- }
461
- /**
462
- * get blue value from uint
463
- * */
464
- private getBlueFromColor(color: number): number {
465
- let blue: number = 255;
466
- if (color > 16777215) {
467
-
468
- blue = color & 0x000000FF;
469
- }
470
-
471
- else {
472
-
473
- blue = color & 0x0000FF;
474
- }
475
-
476
- return blue;
477
- }
478
-
479
-
480
-
481
- }
@@ -1,40 +0,0 @@
1
-
2
- import { type double } from "../../graphics2d/BasicTypes";
3
-
4
- /**
5
- * Units of Measure to be used with {@link MilStdAttributes#DistanceUnits}
6
- * Default is meters.
7
- */
8
- export class DistanceUnit {
9
- private static readonly FEET_PER_METER: double = 3.28084;
10
- private static readonly FLIGHT_LEVEL_PER_METER: double = 0.0328084; // hundreds of feet
11
- public readonly conversionFactor: double = 0;
12
- public readonly label: string;
13
-
14
- public constructor(conversionFactor: double, label: string) {
15
- this.conversionFactor = conversionFactor;
16
- this.label = label;
17
- }
18
-
19
- public static parse(distanceUnitText: string): DistanceUnit | null {
20
- if (distanceUnitText == null) {
21
- return null;
22
- }
23
- let parts: string[] = distanceUnitText.split(",");
24
- if (parts.length !== 2) {
25
- return null;
26
- }
27
- let conversionFactor: double = parseFloat(parts[0].trim());
28
- let label: string = parts[1].trim();
29
-
30
- return new DistanceUnit(conversionFactor, label);
31
- }
32
-
33
- public toAttribute(): string {
34
- return this.conversionFactor + "," + this.label;
35
- }
36
-
37
- public static METERS: DistanceUnit = new DistanceUnit(1, "M");
38
- public static FEET: DistanceUnit = new DistanceUnit(DistanceUnit.FEET_PER_METER, "FT");
39
- public static FLIGHT_LEVEL: DistanceUnit = new DistanceUnit(DistanceUnit.FLIGHT_LEVEL_PER_METER, "FL");
40
- }