params);
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/renderer/RendererPluginInterface/src/main/java/ArmyC2/C2SD/RendererPluginInterface/SinglePointInfo.java:
--------------------------------------------------------------------------------
1 | package ArmyC2.C2SD.RendererPluginInterface;
2 |
3 | import java.awt.geom.Point2D;
4 | import java.awt.geom.Rectangle2D;
5 | import java.awt.image.BufferedImage;
6 |
7 | /**
8 | *
9 | * @author michael.spinelli
10 | */
11 | public class SinglePointInfo implements ISinglePointInfo {
12 |
13 | private BufferedImage _Image = null;
14 | private Point2D _centerPoint = null;
15 | Rectangle2D _symbolBounds = null;
16 |
17 | public SinglePointInfo(BufferedImage bi) {
18 | _Image = bi;
19 | _centerPoint = new Point2D.Double(bi.getWidth() / 2, bi.getHeight() / 2);
20 | _symbolBounds = new Rectangle2D.Double(0, 0, bi.getWidth(), bi.getHeight());
21 | }
22 |
23 | public SinglePointInfo(BufferedImage bi, Point2D centerPoint, Rectangle2D symbolBounds) {
24 | _Image = bi;
25 | _centerPoint = centerPoint;
26 | _symbolBounds = symbolBounds;
27 | }
28 |
29 | @Override
30 | public BufferedImage getImage() {
31 | return _Image;
32 | }
33 |
34 | @Override
35 | public Rectangle2D getSymbolBounds() {
36 | return _symbolBounds;
37 | }
38 |
39 | @Override
40 | public Point2D getSymbolCenterPoint() {
41 | return _centerPoint;
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/org/gavaghan/geodesy/Angle.java:
--------------------------------------------------------------------------------
1 | /* Geodesy by Mike Gavaghan
2 | *
3 | * http://www.gavaghan.org/blog/free-source-code/geodesy-library-vincentys-formula/
4 | *
5 | * This code may be freely used and modified on any personal or professional
6 | * project. It comes with no warranty.
7 | */
8 | package org.gavaghan.geodesy;
9 |
10 | /**
11 | * Utility methods for dealing with angles.
12 | *
13 | * @author Mike Gavaghan
14 | */
15 | public class Angle
16 | {
17 | /** Degrees/Radians conversion constant. */
18 | static private final double PiOver180 = Math.PI / 180.0;
19 |
20 | /**
21 | * Disallow instantiation.
22 | */
23 | private Angle()
24 | {
25 | }
26 |
27 | /**
28 | * Convert degrees to radians.
29 | * @param degrees
30 | * @return
31 | */
32 | static public double toRadians( double degrees )
33 | {
34 | return degrees * PiOver180;
35 | }
36 |
37 | /**
38 | * Convert radians to degrees.
39 | * @param radians
40 | * @return
41 | */
42 | static public double toDegrees( double radians )
43 | {
44 | return radians / PiOver180;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/org/gavaghan/geodesy/Ellipsoid.java:
--------------------------------------------------------------------------------
1 | /* Geodesy by Mike Gavaghan
2 | *
3 | * http://www.gavaghan.org/blog/free-source-code/geodesy-library-vincentys-formula/
4 | *
5 | * This code may be freely used and modified on any personal or professional
6 | * project. It comes with no warranty.
7 | */
8 | package org.gavaghan.geodesy;
9 |
10 | import java.io.Serializable;
11 |
12 | /**
13 | * Encapsulation of an ellipsoid, and declaration of common reference
14 | * ellipsoids.
15 | *
16 | * @author Mike Gavaghan
17 | */
18 | public class Ellipsoid implements Serializable {
19 | private static final long serialVersionUID = -2694307956656400089L;
20 |
21 | /** Semi major axis (meters). */
22 | private final double mSemiMajorAxis;
23 |
24 | /** Semi minor axis (meters). */
25 | private final double mSemiMinorAxis;
26 |
27 | /** Flattening. */
28 | private final double mFlattening;
29 |
30 | /** Inverse flattening. */
31 | private final double mInverseFlattening;
32 |
33 | /**
34 | * Construct a new Ellipsoid. This is private to ensure the values are
35 | * consistent (flattening = 1.0 / inverseFlattening). Use the methods
36 | * fromAAndInverseF() and fromAAndF() to create new instances.
37 | *
38 | * @param semiMajor
39 | * @param semiMinor
40 | * @param flattening
41 | * @param inverseFlattening
42 | */
43 | private Ellipsoid(double semiMajor, double semiMinor, double flattening, double inverseFlattening) {
44 | mSemiMajorAxis = semiMajor;
45 | mSemiMinorAxis = semiMinor;
46 | mFlattening = flattening;
47 | mInverseFlattening = inverseFlattening;
48 | }
49 |
50 | /** The WGS84 ellipsoid. */
51 | static public final Ellipsoid WGS84 = fromAAndInverseF(6378137.0, 298.257223563);
52 |
53 | /** The GRS80 ellipsoid. */
54 | static public final Ellipsoid GRS80 = fromAAndInverseF(6378137.0, 298.257222101);
55 |
56 | /** The GRS67 ellipsoid. */
57 | static public final Ellipsoid GRS67 = fromAAndInverseF(6378160.0, 298.25);
58 |
59 | /** The ANS ellipsoid. */
60 | static public final Ellipsoid ANS = fromAAndInverseF(6378160.0, 298.25);
61 |
62 | /** The WGS72 ellipsoid. */
63 | static public final Ellipsoid WGS72 = fromAAndInverseF(6378135.0, 298.26);
64 |
65 | /** The Clarke1858 ellipsoid. */
66 | static public final Ellipsoid Clarke1858 = fromAAndInverseF(6378293.645, 294.26);
67 |
68 | /** The Clarke1880 ellipsoid. */
69 | static public final Ellipsoid Clarke1880 = fromAAndInverseF(6378249.145, 293.465);
70 |
71 | /** A spherical "ellipsoid". */
72 | static public final Ellipsoid Sphere = fromAAndF(6371000, 0.0);
73 |
74 | /**
75 | * Build an Ellipsoid from the semi major axis measurement and the inverse
76 | * flattening.
77 | *
78 | * @param semiMajor
79 | * semi major axis (meters)
80 | * @param inverseFlattening
81 | * @return
82 | */
83 | static public Ellipsoid fromAAndInverseF(double semiMajor, double inverseFlattening) {
84 | double f = 1.0 / inverseFlattening;
85 | double b = (1.0 - f) * semiMajor;
86 |
87 | return new Ellipsoid(semiMajor, b, f, inverseFlattening);
88 | }
89 |
90 | /**
91 | * Build an Ellipsoid from the semi major axis measurement and the
92 | * flattening.
93 | *
94 | * @param semiMajor
95 | * semi major axis (meters)
96 | * @param flattening
97 | * @return
98 | */
99 | static public Ellipsoid fromAAndF(double semiMajor, double flattening) {
100 | double inverseF = 1.0 / flattening;
101 | double b = (1.0 - flattening) * semiMajor;
102 |
103 | return new Ellipsoid(semiMajor, b, flattening, inverseF);
104 | }
105 |
106 | /**
107 | * Get semi-major axis.
108 | *
109 | * @return semi-major axis (in meters).
110 | */
111 | public double getSemiMajorAxis() {
112 | return mSemiMajorAxis;
113 | }
114 |
115 | /**
116 | * Get semi-minor axis.
117 | *
118 | * @return semi-minor axis (in meters).
119 | */
120 | public double getSemiMinorAxis() {
121 | return mSemiMinorAxis;
122 | }
123 |
124 | /**
125 | * Get flattening
126 | *
127 | * @return
128 | */
129 | public double getFlattening() {
130 | return mFlattening;
131 | }
132 |
133 | /**
134 | * Get inverse flattening.
135 | *
136 | * @return
137 | */
138 | public double getInverseFlattening() {
139 | return mInverseFlattening;
140 | }
141 | }
142 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/org/gavaghan/geodesy/GeodeticCurve.java:
--------------------------------------------------------------------------------
1 | /* Geodesy by Mike Gavaghan
2 | *
3 | * http://www.gavaghan.org/blog/free-source-code/geodesy-library-vincentys-formula/
4 | *
5 | * This code may be freely used and modified on any personal or professional
6 | * project. It comes with no warranty.
7 | */
8 | package org.gavaghan.geodesy;
9 |
10 | import java.io.Serializable;
11 |
12 | /**
13 | * This is the outcome of a geodetic calculation. It represents the path and
14 | * ellipsoidal distance between two GlobalCoordinates for a specified reference
15 | * ellipsoid.
16 | *
17 | * @author Mike Gavaghan
18 | */
19 | public class GeodeticCurve implements Serializable
20 | {
21 | /** Ellipsoidal distance (in meters). */
22 | private final double mEllipsoidalDistance;
23 |
24 | /** Azimuth (degrees from north). */
25 | private final double mAzimuth;
26 |
27 | /** Reverse azimuth (degrees from north). */
28 | private final double mReverseAzimuth;
29 |
30 | /**
31 | * Create a new GeodeticCurve.
32 | * @param ellipsoidalDistance ellipsoidal distance in meters
33 | * @param azimuth azimuth in degrees
34 | * @param reverseAzimuth reverse azimuth in degrees
35 | */
36 | public GeodeticCurve(double ellipsoidalDistance, double azimuth, double reverseAzimuth)
37 | {
38 | mEllipsoidalDistance = ellipsoidalDistance;
39 | mAzimuth = azimuth;
40 | mReverseAzimuth = reverseAzimuth;
41 | }
42 |
43 | /**
44 | * Get the ellipsoidal distance.
45 | * @return ellipsoidal distance in meters
46 | */
47 | public double getEllipsoidalDistance()
48 | {
49 | return mEllipsoidalDistance;
50 | }
51 |
52 | /**
53 | * Get the azimuth.
54 | * @return azimuth in degrees
55 | */
56 | public double getAzimuth()
57 | {
58 | return mAzimuth;
59 | }
60 |
61 | /**
62 | * Get the reverse azimuth.
63 | * @return reverse azimuth in degrees
64 | */
65 | public double getReverseAzimuth()
66 | {
67 | return mReverseAzimuth;
68 | }
69 |
70 | /**
71 | * Get curve as a string.
72 | * @return
73 | */
74 | @Override
75 | public String toString()
76 | {
77 | StringBuffer buffer = new StringBuffer();
78 |
79 | buffer.append("s=");
80 | buffer.append(mEllipsoidalDistance);
81 | buffer.append(";a12=");
82 | buffer.append(mAzimuth);
83 | buffer.append(";a21=");
84 | buffer.append(mReverseAzimuth);
85 | buffer.append(";");
86 |
87 | return buffer.toString();
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/org/gavaghan/geodesy/GeodeticMeasurement.java:
--------------------------------------------------------------------------------
1 | /* Geodesy by Mike Gavaghan
2 | *
3 | * http://www.gavaghan.org/blog/free-source-code/geodesy-library-vincentys-formula/
4 | *
5 | * This code may be freely used and modified on any personal or professional
6 | * project. It comes with no warranty.
7 | */
8 | package org.gavaghan.geodesy;
9 |
10 | /**
11 | * This is the outcome of a three dimensional geodetic calculation. It
12 | * represents the path a between two GlobalPositions for a specified reference
13 | * ellipsoid.
14 | *
15 | * @author Mike Gavaghan
16 | */
17 | public class GeodeticMeasurement extends GeodeticCurve
18 | {
19 | /**
20 | * The elevation change, in meters, going from the starting to the ending
21 | * point.
22 | */
23 | private final double mElevationChange;
24 |
25 | /** The distance travelled, in meters, going from one point to the next. */
26 | private final double mP2P;
27 |
28 | /**
29 | * Creates a new instance of GeodeticMeasurement.
30 | *
31 | * @param ellipsoidalDistance ellipsoidal distance in meters
32 | * @param azimuth azimuth in degrees
33 | * @param reverseAzimuth reverse azimuth in degrees
34 | * @param elevationChange the change in elevation, in meters, going from the
35 | * starting point to the ending point
36 | */
37 | public GeodeticMeasurement(double ellipsoidalDistance, double azimuth, double reverseAzimuth, double elevationChange)
38 | {
39 | super(ellipsoidalDistance, azimuth, reverseAzimuth);
40 | mElevationChange = elevationChange;
41 | mP2P = Math.sqrt(ellipsoidalDistance * ellipsoidalDistance + mElevationChange * mElevationChange);
42 | }
43 |
44 | /**
45 | * Creates a new instance of GeodeticMeasurement.
46 | *
47 | * @param averageCurve average geodetic curve
48 | * @param elevationChange the change in elevation, in meters, going from the
49 | * starting point to the ending point
50 | */
51 | public GeodeticMeasurement(GeodeticCurve averageCurve, double elevationChange)
52 | {
53 | this(averageCurve.getEllipsoidalDistance(), averageCurve.getAzimuth(), averageCurve.getReverseAzimuth(), elevationChange);
54 | }
55 |
56 | /**
57 | * Get the elevation change.
58 | *
59 | * @return elevation change, in meters, going from the starting to the ending
60 | * point
61 | */
62 | public double getElevationChange()
63 | {
64 | return mElevationChange;
65 | }
66 |
67 | /**
68 | * Get the point-to-point distance.
69 | *
70 | * @return the distance travelled, in meters, going from one point to the
71 | * next
72 | */
73 | public double getPointToPointDistance()
74 | {
75 | return mP2P;
76 | }
77 |
78 | /**
79 | * Get the GeodeticMeasurement as a string.
80 | */
81 | @Override
82 | public String toString()
83 | {
84 | StringBuffer buffer = new StringBuffer();
85 |
86 | buffer.append(super.toString());
87 | buffer.append("elev12=");
88 | buffer.append(mElevationChange);
89 | buffer.append(";p2p=");
90 | buffer.append(mP2P);
91 |
92 | return buffer.toString();
93 | }
94 |
95 | }
96 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/org/gavaghan/geodesy/GlobalPosition.java:
--------------------------------------------------------------------------------
1 | /* Geodesy by Mike Gavaghan
2 | *
3 | * http://www.gavaghan.org/blog/free-source-code/geodesy-library-vincentys-formula/
4 | *
5 | * This code may be freely used and modified on any personal or professional
6 | * project. It comes with no warranty.
7 | */
8 | package org.gavaghan.geodesy;
9 |
10 | /**
11 | *
12 | * Encapsulates a three dimensional location on a globe (GlobalCoordinates
13 | * combined with an elevation in meters above a reference ellipsoid).
14 | *
15 | *
16 | * See documentation for GlobalCoordinates for details on how latitude and
17 | * longitude measurements are canonicalized.
18 | *
19 | *
20 | * @author Mike Gavaghan
21 | */
22 | public class GlobalPosition extends GlobalCoordinates
23 | {
24 | /** Elevation, in meters, above the surface of the ellipsoid. */
25 | private double mElevation;
26 |
27 | /**
28 | * Creates a new instance of GlobalPosition.
29 | *
30 | * @param latitude latitude in degrees
31 | * @param longitude longitude in degrees
32 | * @param elevation elevation, in meters, above the reference ellipsoid
33 | */
34 | public GlobalPosition(double latitude, double longitude, double elevation)
35 | {
36 | super(latitude, longitude);
37 | mElevation = elevation;
38 | }
39 |
40 | /**
41 | * Creates a new instance of GlobalPosition.
42 | *
43 | * @param coords coordinates of the position
44 | * @param elevation elevation, in meters, above the reference ellipsoid
45 | */
46 | public GlobalPosition(GlobalCoordinates coords, double elevation)
47 | {
48 | this(coords.getLatitude(), coords.getLongitude(), elevation);
49 | }
50 |
51 | /**
52 | * Get elevation.
53 | *
54 | * @return elevation about the ellipsoid in meters.
55 | */
56 | public double getElevation()
57 | {
58 | return mElevation;
59 | }
60 |
61 | /**
62 | * Set the elevation.
63 | *
64 | * @param elevation elevation about the ellipsoid in meters.
65 | */
66 | public void setElevation(double elevation)
67 | {
68 | mElevation = elevation;
69 | }
70 |
71 | /**
72 | * Compare this position to another. Western longitudes are less than eastern
73 | * logitudes. If longitudes are equal, then southern latitudes are less than
74 | * northern latitudes. If coordinates are equal, lower elevations are less
75 | * than higher elevations
76 | *
77 | * @param other instance to compare to
78 | * @return -1, 0, or +1 as per Comparable contract
79 | */
80 | public int compareTo(GlobalPosition other)
81 | {
82 | int retval = super.compareTo(other);
83 |
84 | if (retval == 0)
85 | {
86 | if (mElevation < other.mElevation) retval = -1;
87 | else if (mElevation > other.mElevation) retval = +1;
88 | }
89 |
90 | return retval;
91 | }
92 |
93 | /**
94 | * Get a hash code for this position.
95 | *
96 | * @return
97 | */
98 | @Override
99 | public int hashCode()
100 | {
101 | int hash = super.hashCode();
102 |
103 | if (mElevation != 0) hash *= (int) mElevation;
104 |
105 | return hash;
106 | }
107 |
108 | /**
109 | * Compare this position to another object for equality.
110 | *
111 | * @param other
112 | * @return
113 | */
114 | @Override
115 | public boolean equals(Object obj)
116 | {
117 | if (!(obj instanceof GlobalPosition)) return false;
118 |
119 | GlobalPosition other = (GlobalPosition) obj;
120 |
121 | return (mElevation == other.mElevation) && (super.equals(other));
122 | }
123 |
124 | /**
125 | * Get position as a string.
126 | */
127 | @Override
128 | public String toString()
129 | {
130 | StringBuffer buffer = new StringBuffer();
131 |
132 | buffer.append(super.toString());
133 | buffer.append("elevation=");
134 | buffer.append(Double.toString(mElevation));
135 | buffer.append("m");
136 |
137 | return buffer.toString();
138 | }
139 | }
140 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/GeoArc.java:
--------------------------------------------------------------------------------
1 | package sec.geo;
2 |
3 | public class GeoArc extends GeoPath {
4 | public GeoArc(GeoPoint pivot, double widthMeters, double heightMeters, double leftAzimuth, double rightAzimuth,
5 | double maxDistanceMeters, double flatnessDistanceMeters, int limit) {
6 | super(maxDistanceMeters, flatnessDistanceMeters, limit);
7 |
8 | moveTo(pivot);
9 | arcTo(pivot, widthMeters, heightMeters, leftAzimuth, rightAzimuth);
10 | closePath();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/GeoBlock.java:
--------------------------------------------------------------------------------
1 | package sec.geo;
2 |
3 | import org.gavaghan.geodesy.GeodeticCurve;
4 | import org.gavaghan.geodesy.GlobalCoordinates;
5 |
6 | public class GeoBlock extends GeoPath {
7 | public GeoBlock(GeoPoint p1, GeoPoint p2, double widthMeters, double maxDistanceMeters,
8 | double flatnessDistanceMeters, int limit) {
9 | super(maxDistanceMeters, flatnessDistanceMeters, limit);
10 |
11 | GlobalCoordinates c1 = toGlobalCoord(p1);
12 | GlobalCoordinates c2 = toGlobalCoord(p2);
13 | GeodeticCurve curve = geoCalc.calculateGeodeticCurve(REFERENCE_ELLIPSOID, c1, c2);
14 | double a1 = curve.getAzimuth();
15 | double a2 = curve.getReverseAzimuth();
16 | double radius = widthMeters / 2;
17 |
18 | GlobalCoordinates c = geoCalc.calculateEndingGlobalCoordinates(REFERENCE_ELLIPSOID, c1, a1 - 90, radius);
19 | moveTo(c.getLongitude(), c.getLatitude());
20 | c = geoCalc.calculateEndingGlobalCoordinates(REFERENCE_ELLIPSOID, c2, a2 + 90, radius);
21 | lineTo(c.getLongitude(), c.getLatitude());
22 | c = geoCalc.calculateEndingGlobalCoordinates(REFERENCE_ELLIPSOID, c2, a2 - 90, radius);
23 | lineTo(c.getLongitude(), c.getLatitude());
24 | c = geoCalc.calculateEndingGlobalCoordinates(REFERENCE_ELLIPSOID, c1, a1 + 90, radius);
25 | lineTo(c.getLongitude(), c.getLatitude());
26 | closePath();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/GeoBlock2.java:
--------------------------------------------------------------------------------
1 | package sec.geo;
2 |
3 | import org.gavaghan.geodesy.GeodeticCurve;
4 | import org.gavaghan.geodesy.GlobalCoordinates;
5 | import static sec.geo.GeoPath.REFERENCE_ELLIPSOID;
6 |
7 | public class GeoBlock2 extends GeoPath {
8 | public GeoBlock2(GeoPoint p1, GeoPoint p2, double leftWidthMeters, double rightWidthMeters, double maxDistanceMeters,
9 | double flatnessDistanceMeters, int limit) {
10 | super(maxDistanceMeters, flatnessDistanceMeters, limit);
11 |
12 | GlobalCoordinates c1 = toGlobalCoord(p1);
13 | GlobalCoordinates c2 = toGlobalCoord(p2);
14 | GeodeticCurve curve = geoCalc.calculateGeodeticCurve(REFERENCE_ELLIPSOID, c1, c2);
15 | double a1 = curve.getAzimuth();
16 | double a2 = curve.getReverseAzimuth();
17 | double leftRadius = leftWidthMeters;
18 | double rightRadius = rightWidthMeters;
19 |
20 | GlobalCoordinates c = geoCalc.calculateEndingGlobalCoordinates(REFERENCE_ELLIPSOID, c1, a1 - 90, leftRadius);
21 | moveTo(c.getLongitude(), c.getLatitude());
22 | c = geoCalc.calculateEndingGlobalCoordinates(REFERENCE_ELLIPSOID, c2, a2 + 90, leftRadius);
23 | lineTo(c.getLongitude(), c.getLatitude());
24 | c = geoCalc.calculateEndingGlobalCoordinates(REFERENCE_ELLIPSOID, c2, a2 - 90, rightRadius);
25 | lineTo(c.getLongitude(), c.getLatitude());
26 | c = geoCalc.calculateEndingGlobalCoordinates(REFERENCE_ELLIPSOID, c1, a1 + 90, rightRadius);
27 | lineTo(c.getLongitude(), c.getLatitude());
28 | closePath();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/GeoEllipse.java:
--------------------------------------------------------------------------------
1 | package sec.geo;
2 |
3 | public class GeoEllipse extends GeoPath {
4 | public GeoEllipse(GeoPoint pivot, double widthMeters, double heightMeters, double maxDistanceMeters,
5 | double flatnessDistanceMeters, int limit) {
6 | super(maxDistanceMeters, flatnessDistanceMeters, limit);
7 | arcTo(pivot, widthMeters, heightMeters, 0, 180);
8 | arcTo(pivot, widthMeters, heightMeters, 180, 0);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/GeoPoint.java:
--------------------------------------------------------------------------------
1 | package sec.geo;
2 |
3 | import java.awt.geom.Point2D;
4 |
5 | public class GeoPoint extends Point2D.Double {
6 | private static final long serialVersionUID = -1693809094948881246L;
7 |
8 | public GeoPoint() {
9 | super();
10 | }
11 |
12 | public GeoPoint(double longitudeDegrees, double latitudeDegrees) {
13 | super(longitudeDegrees, latitudeDegrees);
14 | }
15 |
16 | public double getLatitude() {
17 | return y;
18 | }
19 |
20 | public void setLatitude(double latitudeDegrees) {
21 | y = latitudeDegrees;
22 | }
23 |
24 | public double getLongitude() {
25 | return x;
26 | }
27 |
28 | public void setLongitude(double longitudeDegrees) {
29 | x = longitudeDegrees;
30 | }
31 |
32 | @Override
33 | public String toString() {
34 | return x + "," + y;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/kml/KmlOptions.java:
--------------------------------------------------------------------------------
1 | package sec.geo.kml;
2 |
3 | public class KmlOptions {
4 |
5 |
6 | public enum AltitudeMode {
7 | ABSOLUTE ("absolute"),
8 | RELATIVE_TO_GROUND ("relativeToGround"),
9 | RELATIVE_TO_SEA_FLOOR ("relativeToSeaFloor"),
10 | CLAMP_TO_GROUND ("clampToGround"),
11 | CLAMP_TO_SEA_FLOOR("clampToSeaFloor");
12 |
13 | private String mode = "absolute";
14 |
15 | private AltitudeMode(String mode) {
16 | this.mode = mode;
17 | }
18 |
19 | public static AltitudeMode fromString(String mode) {
20 | if(mode != null) {
21 | for(AltitudeMode am : AltitudeMode.values()) {
22 | if(am.getMode().equals(mode)) {
23 | return am;
24 | }
25 | }
26 | }
27 | throw new IllegalArgumentException("No AltitudeMode with mode \""+mode+"\" found");
28 | }
29 |
30 | public String toString(){
31 | return this.mode;
32 | }
33 |
34 | public String getMode() {
35 | return mode;
36 | }
37 | }
38 |
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/kml/KmlPolygon.java:
--------------------------------------------------------------------------------
1 | package sec.geo.kml;
2 |
3 | import java.util.ArrayList;
4 | import java.util.Collections;
5 | import java.util.List;
6 |
7 | import org.gavaghan.geodesy.Ellipsoid;
8 | import org.gavaghan.geodesy.GeodeticCalculator;
9 | import org.gavaghan.geodesy.GlobalCoordinates;
10 | import org.gavaghan.geodesy.GlobalPosition;
11 |
12 | import sec.geo.GeoPoint;
13 | import sec.geo.kml.KmlOptions.AltitudeMode;
14 | import sec.geo.shape.Point;
15 |
16 | public class KmlPolygon {
17 | //private static final String PREFIX = "relativeToGround";
18 | //private static final String SUFFIX = "";
19 | private final List points;
20 |
21 | private AltitudeMode altitudeMode = AltitudeMode.ABSOLUTE;
22 |
23 |
24 | //protected final GeodeticCalculator geoCalc;
25 | protected static final Ellipsoid REFERENCE_ELLIPSOID = Ellipsoid.WGS84;
26 | private String altitudeModeField = "#ALTITUDEMODE#";
27 |
28 | private String PREFIX = "" +
29 | " \n" +
30 | " 1\n" +
31 | " "+altitudeModeField+"\n" +
32 | " ";
33 | private String SUFFIX = "" +
34 | " \n" +
35 | " \n";
36 |
37 |
38 |
39 | public KmlPolygon() {
40 | points = new ArrayList();
41 | }
42 |
43 | public KmlPolygon(List points, AltitudeMode altitudeMode) {
44 | this();
45 | this.points.addAll(points);
46 | this.altitudeMode = altitudeMode;
47 | }
48 |
49 |
50 | public void addPoint(Point point) {
51 | points.add(point);
52 | }
53 |
54 | public void addPoints(List points) {
55 | this.points.addAll(points);
56 | }
57 |
58 | @Override
59 | public String toString() {
60 | StringBuilder sb = new StringBuilder();
61 |
62 |
63 |
64 | sb.append(PREFIX);
65 | sb.append(toCoordString());
66 | sb.append(SUFFIX);
67 |
68 | int altitudeModeIndex = sb.indexOf(altitudeModeField);
69 | int altitudeModeLength = altitudeModeField.length();
70 | if(altitudeMode != null)
71 | sb.replace(altitudeModeIndex, altitudeModeIndex + altitudeModeLength, altitudeMode.toString());
72 |
73 | return sb.toString();
74 | }
75 |
76 | public String toCoordString() {
77 | StringBuilder sb = new StringBuilder();
78 |
79 | List orderedPoints = getPointsCounterClockwise();
80 | if(orderedPoints == null)
81 | return "";
82 |
83 | for (Point point : orderedPoints) {
84 | sb.append(point.getLongitude());
85 | sb.append(",");
86 | sb.append(point.getLatitude());
87 | sb.append(",");
88 | sb.append(point.getAltitude());
89 | sb.append(" ");
90 | }
91 |
92 | // Close off the list of coordinates if necessary
93 | Point point = orderedPoints.get(0);
94 | if (!point.equals(orderedPoints.get(orderedPoints.size() - 1))) {
95 | sb.append(point.getLongitude());
96 | sb.append(",");
97 | sb.append(point.getLatitude());
98 | sb.append(",");
99 | sb.append(point.getAltitude());
100 | sb.append(" ");
101 | }
102 |
103 | return sb.toString();
104 | }
105 |
106 |
107 | public AltitudeMode getAltitudeMode() {
108 | return altitudeMode;
109 | }
110 |
111 | public void setAltitudeMode(AltitudeMode altitudeMode) {
112 | this.altitudeMode = altitudeMode;
113 | }
114 |
115 | public List getPointsClockwise() {
116 | if(points == null || points.size() < 3)
117 | return null;
118 |
119 | List result = points.subList(0, points.size()-1);
120 | int order = getPointOrder();
121 | if(order < 0) {
122 | Collections.reverse(result);
123 | return result;
124 | }
125 | else return result;
126 | }
127 |
128 | public List getPointsCounterClockwise() {
129 | if(points == null || points.size() < 3)
130 | return null;
131 |
132 | List result = points.subList(0, points.size()-1);
133 | int order = getPointOrder();
134 | if(order > 0) {
135 | Collections.reverse(result);
136 | return result;
137 | }
138 | else return result;
139 | }
140 |
141 | public int getPointOrder() {
142 | if(points==null || points.size()<3)
143 | return 0;
144 |
145 | int n = points.size();
146 | int j, k, count = 0;
147 | double z;
148 | for(int i=0; i 0)
156 | count++;
157 | }
158 | if(count > 0)
159 | return -1; //counterclockwise
160 | else if(count < 0)
161 | return 1; //clockwise
162 | else return 0; //invalid
163 | }
164 | }
165 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/kml/KmlStyle.java:
--------------------------------------------------------------------------------
1 | package sec.geo.kml;
2 |
3 | public class KmlStyle {
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/shape/AArc.java:
--------------------------------------------------------------------------------
1 | package sec.geo.shape;
2 |
3 | public abstract class AArc extends APivot {
4 | protected double leftAzimuthDegrees, rightAzimuthDegrees;
5 |
6 | public void setRightAzimuthDegrees(double rightAzimuthDegrees) {
7 | this.rightAzimuthDegrees = rightAzimuthDegrees;
8 | shapeChanged();
9 | }
10 |
11 | public void setLeftAzimuthDegrees(double leftAzimuthDegrees) {
12 | this.leftAzimuthDegrees = leftAzimuthDegrees;
13 | shapeChanged();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/shape/AComposite.java:
--------------------------------------------------------------------------------
1 | package sec.geo.shape;
2 |
3 | import java.util.HashSet;
4 | import java.util.Set;
5 |
6 | public class AComposite {
7 | protected Set elements;
8 |
9 | public AComposite() {
10 | elements = new HashSet();
11 | }
12 |
13 | public Set getElements() {
14 | return elements;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/shape/AExtrusion.java:
--------------------------------------------------------------------------------
1 | package sec.geo.shape;
2 |
3 | import java.awt.Shape;
4 |
5 | import sec.geo.kml.KmlOptions.AltitudeMode;
6 |
7 | public abstract class AExtrusion {
8 | private double minAltitudeMeters;
9 | private double maxAltitudeMeters;
10 | private Shape shape;
11 | protected double maxDistanceMeters;
12 | protected double flatnessDistanceMeters;
13 |
14 | protected AltitudeMode altitudeMode;
15 | protected int limit;
16 |
17 | public AExtrusion() {
18 | maxDistanceMeters = 100000;
19 | flatnessDistanceMeters = 1;
20 | limit = 4;
21 | }
22 |
23 | public Shape getShape() {
24 | if (shape == null) {
25 | shape = createShape();
26 | }
27 | return shape;
28 | }
29 |
30 | protected void shapeChanged() {
31 | shape = null;
32 | }
33 |
34 | protected abstract Shape createShape();
35 |
36 | public double getMinAltitude() {
37 | return minAltitudeMeters;
38 | }
39 |
40 | public void setMinAltitude(double minAltitudeMeters) {
41 | this.minAltitudeMeters = minAltitudeMeters;
42 | shapeChanged();
43 | }
44 |
45 | public double getMaxAltitude() {
46 | return maxAltitudeMeters;
47 | }
48 |
49 | public void setMaxAltitude(double maxAltitudeMeters) {
50 | this.maxAltitudeMeters = maxAltitudeMeters;
51 | shapeChanged();
52 | }
53 |
54 | public void setMaxDistance(double maxDistanceMeters) {
55 | this.maxDistanceMeters = maxDistanceMeters;
56 | shapeChanged();
57 | }
58 |
59 | public void setFlatness(double flatnessDistanceMeters) {
60 | this.flatnessDistanceMeters = flatnessDistanceMeters;
61 | shapeChanged();
62 | }
63 |
64 | public void setLimit(int limit) {
65 | this.limit = limit;
66 | shapeChanged();
67 | }
68 |
69 | public AltitudeMode getAltitudeMode() {
70 | return altitudeMode;
71 | }
72 |
73 | public void setAltitudeMode(AltitudeMode altitudeMode) {
74 | this.altitudeMode = altitudeMode;
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/shape/APath.java:
--------------------------------------------------------------------------------
1 | package sec.geo.shape;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import sec.geo.GeoPoint;
7 |
8 | public abstract class APath extends AExtrusion {
9 | protected final List points;
10 |
11 | public APath() {
12 | points = new ArrayList();
13 | }
14 |
15 | public void addPoint(GeoPoint point) {
16 | points.add(point);
17 | shapeChanged();
18 | }
19 |
20 | public void addPoints(List points) {
21 | this.points.addAll(points);
22 | shapeChanged();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/shape/APivot.java:
--------------------------------------------------------------------------------
1 | package sec.geo.shape;
2 |
3 | import sec.geo.GeoPoint;
4 |
5 | public abstract class APivot extends AExtrusion implements ICircle {
6 | protected GeoPoint pivot;
7 | protected double radiusMeters;
8 |
9 | public APivot() {
10 | pivot = new GeoPoint();
11 | }
12 |
13 | @Override
14 | public void setRadius(double radiusMeters) {
15 | this.radiusMeters = radiusMeters;
16 | shapeChanged();
17 | }
18 |
19 | @Override
20 | public void setPivot(GeoPoint pivot) {
21 | this.pivot = pivot;
22 | shapeChanged();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/shape/Cake.java:
--------------------------------------------------------------------------------
1 | package sec.geo.shape;
2 |
3 | import sec.geo.GeoPoint;
4 |
5 | public class Cake extends AComposite implements IPivot {
6 | private GeoPoint pivot;
7 |
8 | public Cake() {
9 | super();
10 | pivot = new GeoPoint();
11 | }
12 |
13 | public void addLayer(AExtrusion layer) {
14 | if (layer instanceof IPivot) {
15 | ((IPivot) layer).setPivot(pivot);
16 | elements.add(layer);
17 | } else {
18 | throw new IllegalArgumentException();
19 | }
20 | }
21 |
22 | @Override
23 | public void setPivot(GeoPoint pivot) {
24 | this.pivot = pivot;
25 | for (AExtrusion layer : elements) {
26 | ((IPivot) layer).setPivot(pivot);
27 | layer.shapeChanged();
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/shape/Circle.java:
--------------------------------------------------------------------------------
1 | package sec.geo.shape;
2 |
3 | import java.awt.Shape;
4 |
5 | import sec.geo.GeoEllipse;
6 |
7 | public class Circle extends APivot {
8 | @Override
9 | protected Shape createShape() {
10 | GeoEllipse e = new GeoEllipse(pivot, radiusMeters * 2, radiusMeters * 2, maxDistanceMeters,
11 | flatnessDistanceMeters, limit);
12 | return e;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/shape/IArc.java:
--------------------------------------------------------------------------------
1 | package sec.geo.shape;
2 |
3 | public interface IArc extends ICircle {
4 | public void setRightAzimuthDegrees(double rightAzimuthDegrees);
5 |
6 | public void setLeftAzimuthDegrees(double leftAzimuthDegrees);
7 | }
8 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/shape/ICircle.java:
--------------------------------------------------------------------------------
1 | package sec.geo.shape;
2 |
3 | public interface ICircle extends IPivot {
4 | void setRadius(double radiusMeters);
5 | }
6 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/shape/IPivot.java:
--------------------------------------------------------------------------------
1 | package sec.geo.shape;
2 |
3 | import sec.geo.GeoPoint;
4 |
5 | public interface IPivot {
6 | void setPivot(GeoPoint pivot);
7 | }
8 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/shape/Line.java:
--------------------------------------------------------------------------------
1 | package sec.geo.shape;
2 |
3 | import java.awt.Shape;
4 |
5 | import sec.geo.GeoPath;
6 |
7 | public class Line extends APath {
8 | @Override
9 | protected Shape createShape() {
10 | GeoPath path = new GeoPath(maxDistanceMeters, flatnessDistanceMeters, limit);
11 | for (int i = 0; i < points.size(); i++) {
12 | if (i > 0) {
13 | path.lineTo(points.get(i));
14 | } else {
15 | path.moveTo(points.get(i));
16 | }
17 | }
18 | return path;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/shape/Orbit.java:
--------------------------------------------------------------------------------
1 | package sec.geo.shape;
2 |
3 | import java.awt.Shape;
4 | import java.awt.geom.Area;
5 |
6 | import sec.geo.GeoBlock;
7 | import sec.geo.GeoEllipse;
8 | import sec.geo.GeoPoint;
9 |
10 | public class Orbit extends APath {
11 | private double widthMeters;
12 |
13 | public void setWidth(double widthMeters) {
14 | this.widthMeters = widthMeters;
15 | shapeChanged();
16 | }
17 |
18 | @Override
19 | protected Shape createShape() {
20 | Area orbit = new Area();
21 | GeoPoint previousPoint = null;
22 | for (GeoPoint point : points) {
23 | GeoEllipse ellipse = new GeoEllipse(point, widthMeters, widthMeters, maxDistanceMeters,
24 | flatnessDistanceMeters, limit);
25 | orbit.add(new Area(ellipse));
26 | if (previousPoint != null) {
27 | // Draw rectangle connection
28 | GeoBlock block = new GeoBlock(previousPoint, point, widthMeters, maxDistanceMeters,
29 | flatnessDistanceMeters, limit);
30 | orbit.add(new Area(block));
31 | }
32 | previousPoint = point;
33 | }
34 | return orbit;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/shape/Point.java:
--------------------------------------------------------------------------------
1 | package sec.geo.shape;
2 |
3 | import org.gavaghan.geodesy.GlobalPosition;
4 |
5 | public class Point {
6 | private final double longitudeDegrees;
7 | private final double latitudeDegrees;
8 | private final double altitudeMeters;
9 |
10 | public Point(double longitudeDegrees, double latitudeDegrees) {
11 | this(longitudeDegrees, latitudeDegrees, 0);
12 | }
13 |
14 | public Point(double longitudeDegrees, double latitudeDegrees, double altitudeMeters) {
15 | this.longitudeDegrees = longitudeDegrees;
16 | this.latitudeDegrees = latitudeDegrees;
17 | this.altitudeMeters = altitudeMeters;
18 | }
19 |
20 | public double getLongitude() {
21 | return longitudeDegrees;
22 | }
23 |
24 | public double getLatitude() {
25 | return latitudeDegrees;
26 | }
27 |
28 | public double getAltitude() {
29 | return altitudeMeters;
30 | }
31 |
32 | public GlobalPosition toGlobalPos() {
33 | return new GlobalPosition(getLatitude(), getLongitude(), getAltitude());
34 | }
35 |
36 |
37 | @Override
38 | public boolean equals(Object o) {
39 | if (!(o instanceof Point)) {
40 | return false;
41 | }
42 | Point other = (Point) o;
43 | return (longitudeDegrees == other.longitudeDegrees) && (latitudeDegrees == other.latitudeDegrees)
44 | && (altitudeMeters == other.altitudeMeters);
45 | }
46 |
47 | @Override
48 | public String toString() {
49 | return "[" + longitudeDegrees + "," + latitudeDegrees + "," + altitudeMeters + "]";
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/shape/Polyarc.java:
--------------------------------------------------------------------------------
1 | package sec.geo.shape;
2 |
3 | import java.awt.Shape;
4 |
5 | import sec.geo.GeoPath;
6 | import sec.geo.GeoPoint;
7 |
8 | public class Polyarc extends APath implements IArc {
9 | private GeoPoint pivot;
10 | private double radiusMeters;
11 | private double leftAzimuthDegrees, rightAzimuthDegrees;
12 |
13 | @Override
14 | public void setRadius(double radiusMeters) {
15 | this.radiusMeters = radiusMeters;
16 | shapeChanged();
17 | }
18 |
19 | @Override
20 | public void setPivot(GeoPoint pivot) {
21 | this.pivot = pivot;
22 | shapeChanged();
23 | }
24 |
25 | public void setRightAzimuthDegrees(double rightAzimuthDegrees) {
26 | this.rightAzimuthDegrees = rightAzimuthDegrees;
27 | shapeChanged();
28 | }
29 |
30 | public void setLeftAzimuthDegrees(double leftAzimuthDegrees) {
31 | this.leftAzimuthDegrees = leftAzimuthDegrees;
32 | shapeChanged();
33 | }
34 |
35 | @Override
36 | protected Shape createShape() {
37 | GeoPath shape = new GeoPath(maxDistanceMeters, flatnessDistanceMeters, limit);
38 | for (int i = 0; i < points.size(); i++) {
39 | GeoPoint point = points.get(i);
40 | if (i == 0) {
41 | shape.moveTo(point);
42 | } else {
43 | shape.lineTo(point);
44 | }
45 | }
46 | shape.arcTo(pivot, radiusMeters * 2, radiusMeters * 2, leftAzimuthDegrees, rightAzimuthDegrees);
47 | shape.closePath();
48 | return shape;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/shape/Polygon.java:
--------------------------------------------------------------------------------
1 | package sec.geo.shape;
2 |
3 | import java.awt.Shape;
4 |
5 | import sec.geo.GeoPath;
6 |
7 | public class Polygon extends APath {
8 | @Override
9 | protected Shape createShape() {
10 | GeoPath path = new GeoPath(maxDistanceMeters, flatnessDistanceMeters, limit);
11 | for (int i = 0; i < points.size(); i++) {
12 | if (i > 0) {
13 | path.lineTo(points.get(i));
14 | } else {
15 | path.moveTo(points.get(i));
16 | }
17 | }
18 | path.closePath();
19 | return path;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/shape/Radarc.java:
--------------------------------------------------------------------------------
1 | package sec.geo.shape;
2 |
3 | import java.awt.Shape;
4 | import java.awt.geom.Area;
5 |
6 | import sec.geo.GeoArc;
7 | import sec.geo.GeoEllipse;
8 |
9 | public class Radarc extends AArc {
10 | private double minRadiusMeters;
11 |
12 | public void setMinRadius(double minRadiusMeters) {
13 | this.minRadiusMeters = minRadiusMeters;
14 | shapeChanged();
15 | }
16 |
17 | @Override
18 | protected Shape createShape() {
19 | GeoArc arc = new GeoArc(pivot, radiusMeters * 2, radiusMeters * 2, leftAzimuthDegrees, rightAzimuthDegrees,
20 | maxDistanceMeters, flatnessDistanceMeters, limit);
21 | Area shape = new Area(arc);
22 | GeoEllipse ellipse = new GeoEllipse(pivot, minRadiusMeters * 2, minRadiusMeters * 2, maxDistanceMeters,
23 | flatnessDistanceMeters, limit);
24 | shape.subtract(new Area(ellipse));
25 | return shape;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/shape/Route.java:
--------------------------------------------------------------------------------
1 | package sec.geo.shape;
2 |
3 | import java.awt.Shape;
4 | import java.awt.geom.Area;
5 | import java.awt.geom.PathIterator;
6 |
7 | import sec.geo.GeoBlock;
8 | import sec.geo.GeoBlock2;
9 | import sec.geo.GeoEllipse;
10 | import sec.geo.GeoPoint;
11 |
12 | public class Route extends APath {
13 | private double leftWidthMeters;
14 | private double rightWidthMeters;
15 |
16 |
17 | public void setLeftWidth(double widthMeters) {
18 | this.leftWidthMeters = widthMeters;
19 | shapeChanged();
20 | }
21 |
22 | public void setRightWidth(double widthMeters) {
23 | this.rightWidthMeters = widthMeters;
24 | shapeChanged();
25 | }
26 |
27 | @Override
28 | protected Shape createShape() {
29 | Area route = new Area();
30 | GeoPoint previousPoint = null;
31 | for (int i = 0; i < points.size(); i++) {
32 |
33 | GeoPoint point = points.get(i);
34 |
35 | /*
36 | if (i > 0 && i < points.size() - 1) {
37 | GeoEllipse ellipse = new GeoEllipse(point, widthMeters, widthMeters, maxDistanceMeters,
38 | flatnessDistanceMeters, limit);
39 | route.add(new Area(ellipse));
40 | }
41 | * */
42 | if (previousPoint != null) {
43 |
44 | // Skip if points are the same -- doesn't take into account height difference
45 | if(previousPoint.equals(point))
46 | continue;
47 |
48 | // Draw rectangle connection
49 | GeoBlock2 block = new GeoBlock2(previousPoint, point, this.leftWidthMeters, this.rightWidthMeters, maxDistanceMeters,
50 | flatnessDistanceMeters, limit);
51 | Area area = new Area(block);
52 | route.add(area);
53 |
54 | }
55 | previousPoint = point;
56 | }
57 | return route;
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/geo/shape/Track.java:
--------------------------------------------------------------------------------
1 | package sec.geo.shape;
2 |
3 | public class Track extends AComposite {
4 | public void addRoute(Route route) {
5 | elements.add(route);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/web/exceptions/InvalidNumberOfPointsException.java:
--------------------------------------------------------------------------------
1 | package sec.web.exceptions;
2 |
3 | /**
4 | *
5 | * @author stephen.pinizzotto
6 | */
7 | public class InvalidNumberOfPointsException extends Exception {
8 | private static final long serialVersionUID = 2791008774716307095L;
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/web/json/utilities/HTTPTokener.java:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright (c) 2002 JSON.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | The Software shall be used for Good, not Evil.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 | SOFTWARE.
25 | */
26 |
27 | package sec.web.json.utilities;
28 |
29 | /**
30 | * The HTTPTokener extends the JSONTokener to provide additional methods
31 | * for the parsing of HTTP headers.
32 | * @author JSON.org
33 | * @version 2010-12-24
34 | */
35 | public class HTTPTokener extends JSONTokener {
36 |
37 | /**
38 | * Construct an HTTPTokener from a string.
39 | * @param string A source string.
40 | */
41 | public HTTPTokener(String string) {
42 | super(string);
43 | }
44 |
45 |
46 | /**
47 | * Get the next token or string. This is used in parsing HTTP headers.
48 | * @throws JSONException
49 | * @return A String.
50 | */
51 | public String nextToken() throws JSONException {
52 | char c;
53 | char q;
54 | StringBuffer sb = new StringBuffer();
55 | do {
56 | c = next();
57 | } while (Character.isWhitespace(c));
58 | if (c == '"' || c == '\'') {
59 | q = c;
60 | for (;;) {
61 | c = next();
62 | if (c < ' ') {
63 | throw syntaxError("Unterminated string.");
64 | }
65 | if (c == q) {
66 | return sb.toString();
67 | }
68 | sb.append(c);
69 | }
70 | }
71 | for (;;) {
72 | if (c == 0 || Character.isWhitespace(c)) {
73 | return sb.toString();
74 | }
75 | sb.append(c);
76 | c = next();
77 | }
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/web/json/utilities/JSONException.java:
--------------------------------------------------------------------------------
1 | package sec.web.json.utilities;
2 |
3 | /**
4 | * The JSONException is thrown by the JSON.org classes when things are amiss.
5 | * @author JSON.org
6 | * @version 2010-12-24
7 | */
8 | public class JSONException extends Exception {
9 | private static final long serialVersionUID = 0;
10 | private Throwable cause;
11 |
12 | /**
13 | * Constructs a JSONException with an explanatory message.
14 | * @param message Detail about the reason for the exception.
15 | */
16 | public JSONException(String message) {
17 | super(message);
18 | }
19 |
20 | public JSONException(Throwable cause) {
21 | super(cause.getMessage());
22 | this.cause = cause;
23 | }
24 |
25 | public Throwable getCause() {
26 | return this.cause;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/web/json/utilities/JSONString.java:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * The JSONString
interface allows a toJSONString()
4 | * method so that a class can change the behavior of
5 | * JSONObject.toString()
, JSONArray.toString()
,
6 | * and JSONWriter.value(
Object)
. The
7 | * toJSONString
method will be used instead of the default behavior
8 | * of using the Object's toString()
method and quoting the result.
9 | */
10 | package sec.web.json.utilities;
11 |
12 | public interface JSONString {
13 | /**
14 | * The toJSONString
method allows a class to produce its own JSON
15 | * serialization.
16 | *
17 | * @return A strictly syntactically correct JSON text.
18 | */
19 | public String toJSONString();
20 | }
21 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/web/renderer/GeoPixelConversion.java:
--------------------------------------------------------------------------------
1 | package sec.web.renderer;
2 |
3 | public class GeoPixelConversion {
4 |
5 | private static double inchPerMeter = 39.3700787;
6 | private static double pixelsPerInch = 96.0;
7 | private static double METERS_PER_DEG = 111319.49079327357264771338267056;
8 |
9 | public static double metersPerPixel(double scale) {
10 | double step1 = scale / pixelsPerInch;
11 | return step1 / inchPerMeter;
12 | }
13 |
14 | public static double lat2y(double latitude, double scale, double latOrigin, double metPerPix) {
15 |
16 | double latRem = -(latitude - latOrigin);
17 | double pixDis = (latRem * METERS_PER_DEG) / metPerPix;
18 | return pixDis;
19 | }
20 |
21 | public static double y2lat(double yPosition, double scale, double latOrigin, double metPerPix) {
22 |
23 | double latitude = latOrigin - ((yPosition * metPerPix) / METERS_PER_DEG);
24 | return latitude;
25 | }
26 |
27 | public static double long2x(double longitude, double scale, double longOrigin, double latitude, double metPerPix,boolean normalize) {
28 |
29 | double longRem = longitude-longOrigin;
30 | if(normalize)
31 | {
32 | if (longRem > 180) {
33 | longRem -= 360;
34 | }
35 | if (longRem < -180) {
36 | longRem += 360;
37 | }
38 | }
39 | double metersPerDeg = GetMetersPerDegAtLat(latitude);
40 | double pixDis = (longRem * metersPerDeg) / metPerPix;
41 | return pixDis;
42 | }
43 |
44 | public static double x2long(double xPosition, double scale, double longOrigin, double latitude, double metPerPix) {
45 |
46 | double metersPerDeg = GetMetersPerDegAtLat(latitude);
47 | double longitude = longOrigin + ((xPosition * metPerPix) / metersPerDeg);
48 |
49 | if (longitude < -180) {
50 | longitude += 360;
51 | } else if (longitude > 180) {
52 | longitude -= 360;
53 | }
54 |
55 | return longitude;
56 | }
57 |
58 | public static double Deg2Rad(double deg) {
59 | double conv_factor = (2.0 * Math.PI) / 360.0;
60 | return (deg * conv_factor);
61 | }
62 |
63 | public static double GetMetersPerDegAtLat(double lat) {
64 | // Convert latitude to radians
65 | lat = Deg2Rad(lat);
66 | // Set up "Constants"
67 | double p1 = 111412.84; // longitude calculation term 1
68 |
69 | double p2 = -93.5; // longitude calculation term 2
70 |
71 | double p3 = 0.118; // longitude calculation term 3
72 |
73 | // Calculate the length of a degree of longitude in meters at given
74 | // latitude
75 | double longlen = (p1 * Math.cos(lat)) + (p2 * Math.cos(3 * lat)) + (p3 * Math.cos(5 * lat));
76 |
77 | return longlen;
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/web/renderer/PointConverter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this template, choose Tools | Templates
3 | * and open the template in the editor.
4 | */
5 |
6 | package sec.web.renderer;
7 | import ArmyC2.C2SD.Utilities.IPointConversion;
8 | //import sec.web.renderer.GeoPixelConversion;
9 | import java.awt.geom.Point2D;
10 | import java.awt.Point;
11 | /**
12 | *
13 | * @author Michael Deutch
14 | */
15 | public class PointConverter implements IPointConversion
16 | {
17 | private double _controlLat=0;
18 | private double _controlLong=0;
19 | private double _scale=0;
20 | private double _metersPerPixel=0;
21 | private boolean _normalize=true;
22 | public void set_normalize(boolean value)
23 | {
24 | _normalize=value;
25 | }
26 | public PointConverter(double controlLong, double controlLat, double scale)
27 | {
28 | try
29 | {
30 | this._controlLat=controlLat;
31 | this._controlLong=controlLong;
32 | this._scale=scale;
33 | _metersPerPixel=GeoPixelConversion.metersPerPixel(scale);
34 | }
35 | catch(Error e)
36 | {
37 | throw e;
38 | }
39 | }
40 | /**
41 | * add constructor to handle when earth is flipped about it's X axis (South is on top)
42 | * @param left
43 | * @param right
44 | * @param top
45 | * @param bottom
46 | * @param scale
47 | */
48 | public PointConverter(double left, double top, double right, double bottom, double scale)
49 | {
50 | try
51 | {
52 | this._controlLat=top;
53 | this._controlLong=left;
54 | this._scale=scale;
55 | _metersPerPixel=GeoPixelConversion.metersPerPixel(scale);
56 | if(top X_ALTITUDE_DEPTH = new ArrayList();
29 | public String Y_LOCATION = "";
30 | public ArrayList AM_DISTANCE = new ArrayList();
31 | public ArrayList AN_AZIMUTH = new ArrayList();
32 | public String FillColor = "";
33 | public String LineColor = "";
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/web/renderer/utilities/LineInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this template, choose Tools | Templates
3 | * and open the template in the editor.
4 | */
5 | package sec.web.renderer.utilities;
6 |
7 | import java.awt.Color;
8 | import java.awt.Stroke;
9 | import java.awt.geom.Point2D;
10 | import java.util.ArrayList;
11 |
12 | /**
13 | *
14 | * @author michael.spinelli
15 | */
16 | public class LineInfo {
17 |
18 | private Color lineColor = null;
19 | private Color fillColor = null;
20 | private int lineWidth = 2;
21 | private Stroke stroke = null;
22 |
23 | private ArrayList> _Polylines = null;
24 |
25 | public LineInfo()
26 | {
27 |
28 |
29 | }
30 |
31 | public void setLineColor(Color value)
32 | {
33 | lineColor=value;
34 | }
35 | public Color getLineColor()
36 | {
37 | return lineColor;
38 | }
39 |
40 | public void setFillColor(Color value)
41 | {
42 | fillColor=value;
43 | }
44 | public Color getFillColor()
45 | {
46 | return fillColor;
47 | }
48 |
49 | public Stroke getStroke()
50 | {
51 | return stroke;
52 | }
53 | //client will use this to do fills (if it is not null)
54 | /*
55 | public TexturePaint getTexturePaint()
56 | {
57 | return texturePaint;
58 | }
59 | public void setTexturePaint(TexturePaint value)
60 | {
61 | texturePaint=value;
62 | }*/
63 |
64 | public void setStroke(Stroke s)
65 | {
66 | stroke=s;
67 | }
68 |
69 | public ArrayList> getPolylines()
70 | {
71 | return _Polylines;
72 | }
73 |
74 | public void setPolylines(ArrayList> value)
75 | {
76 | _Polylines = value;
77 | }
78 |
79 | }
80 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/web/renderer/utilities/SymbolInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this template, choose Tools | Templates
3 | * and open the template in the editor.
4 | */
5 | package sec.web.renderer.utilities;
6 |
7 | import java.util.ArrayList;
8 |
9 | /**
10 | *
11 | * @author michael.spinelli
12 | */
13 | public class SymbolInfo {
14 |
15 | private ArrayList _LineInfo = null;
16 | private ArrayList _TextInfo = null;
17 |
18 | public SymbolInfo()
19 | {
20 |
21 | }
22 | public SymbolInfo(ArrayList ti, ArrayList li)
23 | {
24 | _LineInfo = li;
25 | _TextInfo = ti;
26 | }
27 |
28 | public ArrayList getTextInfoList()
29 | {
30 | return _TextInfo;
31 | }
32 |
33 | public ArrayList getLineInfoList()
34 | {
35 | return _LineInfo;
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/java/sec/web/renderer/utilities/TextInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this template, choose Tools | Templates
3 | * and open the template in the editor.
4 | */
5 | package sec.web.renderer.utilities;
6 |
7 | import java.awt.geom.Point2D;
8 |
9 | /**
10 | *
11 | * @author michael.spinelli
12 | */
13 | public class TextInfo {
14 | private String _ModifierString = null;
15 | private Point2D _ModifierStringPosition = null;
16 | private double _ModifierStringAngle = 0;
17 |
18 | public TextInfo()
19 | {
20 |
21 | }
22 | //set this when returning text string.
23 | public void setModifierString(String value)
24 | {
25 | _ModifierString = value;
26 | }
27 |
28 | public String getModifierString()
29 | {
30 | return _ModifierString;
31 | }
32 |
33 | //location to draw ModifierString.
34 | public void setModifierStringPosition(Point2D value)
35 | {
36 | _ModifierStringPosition = value;
37 | }
38 |
39 | public Point2D getModifierStringPosition()
40 | {
41 | return _ModifierStringPosition;
42 | }
43 |
44 | //angle to draw ModifierString.
45 | public void setModifierStringAngle(double value)
46 | {
47 | _ModifierStringAngle = value;
48 | }
49 |
50 | public double getModifierStringAngle()
51 | {
52 | return _ModifierStringAngle;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/jnlp/TEMPresources/mil-sym-renderer.jnlp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | mil-sym-renderer
6 | SEC
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/jnlp/template.vm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SECRenderer
6 | SEC
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | $dependencies
21 |
22 |
23 |
24 |
25 |
26 |
27 | -spport:6789
28 |
29 | -spbacklog:0
30 |
31 |
32 |
33 | -mpport:6790
34 |
35 | -mpbacklog:0
36 |
37 |
38 |
39 |
40 |
47 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/resources/META-INF/services/ArmyC2.C2SD.RendererPluginInterface.ISinglePointRenderer:
--------------------------------------------------------------------------------
1 | sec.web.renderer.SinglePoint2525Renderer
2 | sec.web.renderer.AreaSymbolFill
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/resources/assembly/zipAssembly.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 | PORTABLE
6 | /
7 |
8 |
9 | zip
10 |
11 |
12 |
13 | /target
14 | /target
15 |
16 |
17 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/resources/images/globe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/missioncommand/old-mil-sym-java/98382d0a471c50b18a46fe04669a747f7925f075/renderer/mil-sym-renderer/src/main/resources/images/globe.png
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/resources/properties/secrenderer.properties:
--------------------------------------------------------------------------------
1 | secrenderer.jnlp.jar.version:${project.version}
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 | Archetype Created Web Application
7 |
8 |
--------------------------------------------------------------------------------
/renderer/mil-sym-renderer/src/main/webapp/index.jsp:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World!
4 |
5 |
6 |
--------------------------------------------------------------------------------
/renderer/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 |
4 |
5 | io.github.missioncommand
6 | mil-sym-java
7 | 0.1.43
8 | ..
9 |
10 |
11 | mil-sym-renderer-parent
12 | pom
13 | mil-sym-java :: Renderer
14 | mil-sym-java Renderer
15 |
16 |
17 | RendererPluginInterface
18 | mil-sym-renderer
19 |
20 |
21 |
--------------------------------------------------------------------------------
/samples/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 |
4 |
5 | io.github.missioncommand
6 | mil-sym-java
7 | 0.1.43
8 | ..
9 |
10 |
11 | mil-sym-java-samples-parent
12 | pom
13 | mil-sym-java :: Samples
14 | mil-sym-java Samples
15 |
16 |
17 | rendering-sample-1
18 |
19 |
20 |
--------------------------------------------------------------------------------
/samples/rendering-sample-1/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 |
4 |
5 | io.github.missioncommand
6 | mil-sym-java
7 | 0.1.43
8 | ../..
9 |
10 |
11 | rendering-sample-1
12 | jar
13 | mil-sym-java :: Samples :: rendering-sample-1
14 |
15 |
16 | sec.web.renderer.samples.Gui
17 |
18 |
19 |
20 |
21 | io.github.missioncommand
22 | mil-sym-renderer
23 |
24 |
25 |
26 | junit
27 | junit
28 | test
29 |
30 |
31 |
32 |
33 |
34 |
35 | org.apache.maven.plugins
36 | maven-assembly-plugin
37 |
38 |
39 | package
40 |
41 | attached
42 |
43 |
44 |
45 |
46 |
47 |
48 | ${mainClass}
49 |
50 |
51 | ${project.artifactId}
52 | .
53 |
54 |
55 |
56 | jar-with-dependencies
57 |
58 | false
59 | ${project.artifactId}-executable
60 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/samples/rendering-sample-1/readme.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # Renderer sample project 1
4 |
5 | ## About
6 |
7 | This is a basic sample of how to use the renderer.
8 |
9 | It will draw one of two single point icons on the form and it will output kml for multipoint rendering via "System.out.println()".
10 |
11 | ## Deployment
12 |
13 | This sample project gets packaged as a tradition jar file as well as an executable jar file and can be run in your jvm by using the command: `java -jar rendering-sample-1-executable.jar`
14 |
15 | ## Requirements
16 |
17 | This sample jar project was developed against the following web server:
18 |
19 | Apache Tomcat 7
20 |
21 | The JVM used to run this jar requires:
22 |
23 | Orcale Java >= 1.7
24 |
25 | ## Build Commands
26 |
27 | This is typical maven project that can be built using the following maven command: `mvn clean install`
28 |
29 | ## Libraries
30 |
31 | Libraries Used include:
32 |
33 |
34 |
35 | Dependency Name |
36 |
37 |
38 | mil.army.missioncommand.mil-sym-renderer |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/java/sec/web/renderer/model/CommonURL.java:
--------------------------------------------------------------------------------
1 | package sec.web.renderer.model;
2 |
3 | public class CommonURL {
4 |
5 | private String protocol;
6 | private String host;
7 | private String port;
8 | private String contextPath;
9 |
10 | public CommonURL() { }
11 |
12 | public CommonURL(String protocol, String host, String port, String contextPath) {
13 | this.protocol = protocol;
14 | this.host = host;
15 | this.port = port;
16 | this.contextPath = contextPath;
17 | }
18 |
19 | public String getProtocol() {
20 | return protocol;
21 | }
22 |
23 | public void setProtocol(String protocol) {
24 | this.protocol = protocol;
25 | }
26 |
27 | public String getHost() {
28 | return host;
29 | }
30 |
31 | public void setHost(String host) {
32 | this.host = host;
33 | }
34 |
35 | public String getPort() {
36 | return port;
37 | }
38 |
39 | public void setPort(String port) {
40 | this.port = port;
41 | }
42 |
43 | public String getContextPath() {
44 | return contextPath;
45 | }
46 |
47 | public void setContextPath(String contextPath) {
48 | this.contextPath = contextPath;
49 | }
50 |
51 | @Override
52 | public String toString() {
53 | StringBuilder sb = new StringBuilder();
54 |
55 | if (this.protocol != null && this.protocol != "") {
56 | sb.append(this.protocol);
57 | sb.append("://");
58 | }
59 |
60 | if (this.host != null && this.host != "") {
61 | sb.append(this.host);
62 | }
63 |
64 | if (this.port != null && this.port != "") {
65 | sb.append(":");
66 | sb.append(this.port);
67 | sb.append("/");
68 | }
69 |
70 | if (this.contextPath != null && this.contextPath != "") {
71 | sb.append(this.contextPath);
72 | }
73 |
74 | return sb.toString();
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/java/sec/web/renderer/model/Plugin.java:
--------------------------------------------------------------------------------
1 | package sec.web.renderer.model;
2 |
3 | import java.io.File;
4 |
5 | public class Plugin extends CommonURL {
6 | private String pluginName;
7 | private String pluginPath;
8 |
9 |
10 | public Plugin() {
11 | super();
12 | }
13 |
14 | public Plugin(String name, String path) {
15 | this.pluginName = name;
16 | this.pluginPath = path;
17 | }
18 |
19 | public String getName() {
20 | return pluginName;
21 | }
22 |
23 | public void setName(String name) {
24 | this.pluginName = name;
25 | }
26 |
27 | public String getPath() {
28 | return pluginPath;
29 | }
30 |
31 | public void setPath(String path) {
32 | this.pluginPath = path;
33 | }
34 |
35 | @Override
36 | public String toString() {
37 | StringBuilder sb = new StringBuilder();
38 | sb.append(super.toString());
39 | sb.append(this.pluginName);
40 | if (this.pluginPath != "" && this.pluginPath != null) {
41 | sb.append(File.separator);
42 | sb.append(this.pluginPath);
43 | }
44 |
45 |
46 | return sb.toString();
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/java/sec/web/renderer/model/PluginData.java:
--------------------------------------------------------------------------------
1 | package sec.web.renderer.model;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | public class PluginData {
7 |
8 | private long id = 0;
9 |
10 | private List plugins = new ArrayList();
11 |
12 | public long getId() {
13 | return id;
14 | }
15 |
16 | public void setId(long id) {
17 | this.id = id;
18 | }
19 |
20 | public List getPlugins() {
21 | return plugins;
22 | }
23 |
24 | public void setPlugins(List plugins) {
25 | this.plugins = plugins;
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/java/sec/web/renderer/model/RenderingDataEnums.java:
--------------------------------------------------------------------------------
1 | package sec.web.renderer.model;
2 |
3 | public enum RenderingDataEnums {
4 | IMAGE("image"), KML("kml"), MP3D("mp3d"), MP2D("mp2d"), SPBI("spbi"), SVG("svg"), SVGZ("svgz");
5 |
6 | private String type;
7 |
8 | private RenderingDataEnums(String type) {
9 | this.type = type;
10 | }
11 |
12 | public String getRequestType() {
13 | return this.type;
14 | }
15 |
16 |
17 | /**
18 | * @param text
19 | * @throws This method is the same as the valueOf(String) method but gaurds against case sensitivity that could result in an
20 | * Exception in thread main java.lang.IllegalArgumentexcetiopn: No enum const class
21 | * if text does not match any enum type in this class
22 | * */
23 | public static RenderingDataEnums fromString(String text) {
24 | RenderingDataEnums rde = null;
25 | if (text != null && text.length() > 2) {
26 | for (RenderingDataEnums enums : RenderingDataEnums.values()) {
27 | if (text.equalsIgnoreCase(enums.type)) {
28 | rde = enums;
29 | }
30 | }
31 | }
32 | return rde;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/java/sec/web/renderer/services/directory/DirectoryReaderController.java:
--------------------------------------------------------------------------------
1 | package sec.web.renderer.services.directory;
2 |
3 | import java.util.ArrayList;
4 |
5 | import javax.servlet.http.HttpServletRequest;
6 | import javax.servlet.http.HttpServletResponse;
7 | import javax.ws.rs.core.Context;
8 |
9 | import org.springframework.stereotype.Controller;
10 | import org.springframework.web.bind.annotation.PathVariable;
11 | import org.springframework.web.bind.annotation.RequestMapping;
12 | import org.springframework.web.bind.annotation.RequestMethod;
13 | import org.springframework.web.bind.annotation.RequestParam;
14 | import org.springframework.web.bind.annotation.ResponseBody;
15 |
16 | import sec.web.renderer.services.directory.listeners.DirectoryWatcherVJ6;
17 | import sec.web.renderer.utils.IoUtilities;
18 |
19 | @Controller
20 | /**
21 | * @deprecated
22 | *
23 | */
24 | public class DirectoryReaderController {
25 |
26 | public DirectoryReaderController() { }
27 |
28 | @RequestMapping(value="/pluginList", method = RequestMethod.GET)
29 | @ResponseBody
30 | public String getContent(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestParam(value="type", defaultValue="delimited") String type) {
31 | String result = "";
32 | String baseUrl = request.getRequestURL().toString().replace(request.getRequestURI().substring(1), request.getContextPath());
33 |
34 | try {
35 | /* Comma delimited String */
36 | String dirContents = ""; //= utils.getContentAsString(',');
37 |
38 | ArrayList fileList = DirectoryWatcherVJ6.scheduler.getFileNames();
39 |
40 | if (type.equalsIgnoreCase("delimited")) {
41 | dirContents = IoUtilities.buildUrlDelimitedList(fileList, ',', baseUrl);
42 | } else {
43 | dirContents = IoUtilities.buildJsonUrlList(fileList, baseUrl);
44 | }
45 |
46 | if (!"".equals(dirContents) || dirContents != null) {
47 | result = dirContents;
48 | }
49 | } catch (Exception ioe) {
50 | ioe.printStackTrace();
51 | }
52 |
53 | return result;
54 | }
55 |
56 | @RequestMapping(value="/message/{msg}", method = RequestMethod.GET)
57 | @ResponseBody
58 | public String getMessage(@PathVariable String msg) {
59 |
60 | return msg;
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/java/sec/web/renderer/services/directory/DirectoryReaderServlet.java:
--------------------------------------------------------------------------------
1 | package sec.web.renderer.services.directory;
2 |
3 | import java.io.File;
4 | import java.io.IOException;
5 | import java.io.PrintWriter;
6 | import java.util.List;
7 | import java.util.Properties;
8 | import java.util.logging.Level;
9 | import java.util.logging.Logger;
10 |
11 | import javax.servlet.ServletException;
12 | import javax.servlet.annotation.WebServlet;
13 | import javax.servlet.http.HttpServlet;
14 | import javax.servlet.http.HttpServletRequest;
15 | import javax.servlet.http.HttpServletResponse;
16 |
17 | import sec.web.renderer.utils.DirectoryReaderUtils;
18 |
19 | /**
20 | * Servlet implementation class DirectoryReader
21 | * @deprecated
22 | *
23 | */
24 | @WebServlet(name = "sec-directory-reader", urlPatterns = { "/directoryReader" })
25 | public class DirectoryReaderServlet extends HttpServlet {
26 | private static final long serialVersionUID = 534810784725663803L;
27 | private static final Logger LOGGER = Logger.getLogger(DirectoryReaderServlet.class.getName());
28 | private Properties props;
29 |
30 | /**
31 | * @see HttpServlet#HttpServlet()
32 | */
33 | public DirectoryReaderServlet() {
34 | super();
35 |
36 | props = DirectoryReaderUtils.loadProperties("properties/prop.properties", this.getClass().getClassLoader());
37 | }
38 |
39 | /**
40 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
41 | */
42 | @SuppressWarnings("unused")
43 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
44 | try {
45 | response.setContentType("application/json");
46 | PrintWriter writer = response.getWriter();
47 | String urlStr = buildURL(request.getServerName(), String.valueOf(request.getServerPort()));
48 |
49 | StringBuilder filePath = new StringBuilder();
50 | filePath.append(props.getProperty("directoryPath"));
51 | filePath.append(File.separator);
52 | filePath.append(props.getProperty("directoryName"));
53 | filePath.append(File.separator);
54 |
55 | /* Comma delimited String */
56 | String contents = DirectoryReaderUtils.getDirectoryContent(new File(filePath.toString()));
57 |
58 | writer.println(contents);
59 |
60 | } catch (Exception e) {
61 | LOGGER.log(Level.WARNING, e.getMessage());
62 | }
63 | }
64 |
65 | private String buildURL(String serverName, String port) {
66 | String urlStr = props.getProperty("protocol") + "://" +
67 | serverName + ":" +
68 | port + "/" +
69 | props.getProperty("directoryName");
70 | return urlStr;
71 | }
72 |
73 |
74 | protected String makeHtmlResponse(List contents) {
75 | StringBuilder sb = new StringBuilder();
76 | sb.append("Content of Resources folder
");
77 | sb.append("");
86 |
87 | return sb.toString();
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/java/sec/web/renderer/services/directory/listeners/DirectoryReaderTaskScheduler.java:
--------------------------------------------------------------------------------
1 | package sec.web.renderer.services.directory.listeners;
2 |
3 | import java.util.ArrayList;
4 | import java.util.concurrent.Executors;
5 | import java.util.concurrent.ScheduledExecutorService;
6 | import java.util.concurrent.TimeUnit;
7 | import java.util.logging.Level;
8 | import java.util.logging.Logger;
9 |
10 | /**
11 | *
12 | * @author User
13 | * @deprecated
14 | */
15 | public class DirectoryReaderTaskScheduler {
16 | private final static Logger LOGGER = Logger.getLogger(DirectoryReaderTaskScheduler.class.getName());
17 |
18 | private ReadDirectoryTimerTask timeTask;
19 | private final int NO_DELAY = 0;
20 | public ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor();
21 |
22 | public void startTimer(String path, int interval) {
23 | timeTask = new ReadDirectoryTimerTask(path);
24 | service.scheduleAtFixedRate(timeTask, NO_DELAY, interval, TimeUnit.MILLISECONDS);
25 | System.out.println("timer has been scheduled to watch " + path + " for every " + interval + " milliseconds");
26 | }
27 |
28 | public void stopTimer() {
29 | LOGGER.log(Level.INFO, "Timer shutdown initiated");
30 | service.shutdown();
31 | }
32 |
33 | public synchronized ArrayList getFileNames() {
34 | ArrayList temp = new ArrayList();
35 | if (this.timeTask != null) {
36 | temp = timeTask.getFileNames();
37 | }
38 | return temp;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/java/sec/web/renderer/services/directory/listeners/DirectoryWatcherVJ6.java:
--------------------------------------------------------------------------------
1 | package sec.web.renderer.services.directory.listeners;
2 |
3 | import java.util.Calendar;
4 | import java.util.Properties;
5 | import java.util.logging.Level;
6 | import java.util.logging.Logger;
7 |
8 | import javax.servlet.ServletContextEvent;
9 | import javax.servlet.ServletContextListener;
10 |
11 | import sec.web.renderer.utils.IoUtilities;
12 |
13 | /**
14 | * @deprecated
15 | * @author User
16 | */
17 | public class DirectoryWatcherVJ6 implements ServletContextListener {
18 | public static final Logger LOGGER = Logger.getLogger(DirectoryWatcherVJ6.class.getName());
19 | public static DirectoryReaderTaskScheduler scheduler = new DirectoryReaderTaskScheduler();
20 | public final int INTERVAL = 60 * 1000;
21 |
22 | @Override
23 | public void contextDestroyed(ServletContextEvent sce) {
24 | scheduler.stopTimer();
25 | }
26 |
27 | @Override
28 | public void contextInitialized(ServletContextEvent sce) {
29 | //TODO: generate default properties file
30 |
31 | Properties props = IoUtilities.getProperties();
32 | StringBuilder filePath = new StringBuilder();
33 | filePath.append(props.getProperty("directoryPath"));
34 |
35 | scheduler.startTimer(filePath.toString(), INTERVAL);
36 |
37 | LOGGER.log(Level.INFO, "Timer Initialized");
38 | LOGGER.log(Level.INFO, "\n\n\n" + new String("starting folder timer ").toUpperCase()
39 | + Calendar.getInstance().getTime().toString()
40 | + "\n\n\n");
41 |
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/java/sec/web/renderer/services/directory/listeners/ReadDirectoryTimerTask.java:
--------------------------------------------------------------------------------
1 | package sec.web.renderer.services.directory.listeners;
2 |
3 | import java.io.File;
4 | import java.util.ArrayList;
5 | import java.util.TimerTask;
6 |
7 | import sec.web.renderer.utils.ImagingUtils;
8 |
9 | /**
10 | * @deprecated
11 | * @author User
12 | */
13 | public class ReadDirectoryTimerTask extends TimerTask {
14 | private String directoryPath;
15 | private ArrayList fileNames = new ArrayList();
16 |
17 | public ReadDirectoryTimerTask(String dirPath) {
18 | directoryPath = dirPath;
19 | }
20 |
21 | @Override
22 | public void run() {
23 | try {
24 | // retain old list of plugins
25 | ArrayList oldList = new ArrayList();
26 | oldList.addAll(fileNames);
27 |
28 | // clear current list and rebuild
29 | clear();
30 | File dirToRead = new File(this.directoryPath);
31 | File[] files = dirToRead.listFiles();
32 |
33 | if (files != null) {
34 | for (File f : files) {
35 | fileNames.add(f.getName());
36 | // System.out.printf("adding:\t%s\n", f.getAbsolutePath());
37 | }
38 | }
39 |
40 | // compare original and updated list to see if there are differences. If so, reload the plugins.
41 | int oldSize = oldList.size();
42 |
43 | oldList.retainAll(fileNames);
44 | if (oldSize != fileNames.size()) {
45 | // System.out.println("reloading plugins!");
46 | ImagingUtils.reloadPlugins();
47 | }
48 |
49 | } catch (Exception exception) {
50 | exception.printStackTrace();
51 | }
52 | }
53 |
54 |
55 | private void clear() {
56 | if (!this.fileNames.isEmpty()) {
57 | this.fileNames.clear();
58 | }
59 | }
60 |
61 | public ArrayList getFileNames() {
62 | return this.fileNames;
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/java/sec/web/renderer/services/imaging/ImageGeneratorServlet.java:
--------------------------------------------------------------------------------
1 | package sec.web.renderer.services.imaging;
2 |
3 | import java.io.IOException;
4 | import java.io.OutputStream;
5 | import java.io.PrintWriter;
6 | import java.util.logging.Level;
7 | import java.util.logging.Logger;
8 |
9 | import javax.servlet.ServletException;
10 | import javax.servlet.annotation.WebServlet;
11 | import javax.servlet.http.HttpServlet;
12 | import javax.servlet.http.HttpServletRequest;
13 | import javax.servlet.http.HttpServletResponse;
14 |
15 | import sec.web.renderer.utils.ImagingUtils;
16 |
17 | /**
18 | * Servlet implementation class DirectoryReader
19 | */
20 | @WebServlet(name = "sec-image-generator-servlet", urlPatterns = { "/kml/symbolID" })
21 | public class ImageGeneratorServlet extends HttpServlet {
22 | private static final long serialVersionUID = 851369047318854091L;
23 | private static final Logger LOGGER = Logger.getLogger(ImageGeneratorServlet.class.getName());
24 |
25 | /**
26 | * @see HttpServlet#HttpServlet()
27 | */
28 | public ImageGeneratorServlet() {
29 | super();
30 | }
31 |
32 | /**
33 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
34 | * response)
35 | */
36 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
37 | OutputStream os = response.getOutputStream();
38 |
39 | try {
40 | response.setContentType("image/png");
41 |
42 | byte[] pngResponse = ImagingUtils.getMilStd2525Png(request.getRequestURI(), request.getQueryString());
43 |
44 | if (pngResponse == null) {
45 | response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
46 | throw new Exception();
47 | }
48 |
49 | os.write(pngResponse);
50 | os.close();
51 |
52 | } catch (Exception exc) {
53 | LOGGER.log(Level.SEVERE, this.getClass().getName() + exc.getMessage());
54 | response.setContentType("text/plain");
55 | PrintWriter out = response.getWriter();
56 | out.println(genHtmlErrorPage(request.getContextPath()));
57 | out.close();
58 | }
59 | }
60 |
61 | private String genHtmlErrorPage(String ctxPath) {
62 | StringBuilder sb = new StringBuilder();
63 |
64 | sb.append("");
65 | sb.append("");
66 | sb.append("503");
67 | sb.append("");
68 |
69 | sb.append("");
70 | sb.append("Servlet SinglePoint at " + ctxPath + "
");
71 | sb.append("
url: " + "test" + "
");
72 | sb.append("");
73 | sb.append("");
74 |
75 |
76 | return sb.toString();
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/java/sec/web/renderer/services/imaging/SECRendererImpl.java:
--------------------------------------------------------------------------------
1 | package sec.web.renderer.services.imaging;
2 |
3 | import sec.web.renderer.SECRenderer;
4 | import sec.web.renderer.utilities.PNGInfo;
5 |
6 | public class SECRendererImpl {
7 | protected static SECRenderer sr;
8 |
9 | public SECRendererImpl() {
10 | sr = SECRenderer.getInstance();
11 | //sr.matchSECWebRendererAppletDefaultRendererSettings();
12 | }
13 |
14 |
15 | public static byte[] getMilStd2525Png(String symbolId, String queryString) {
16 | String path = symbolId;
17 |
18 | if (queryString != null || "".equals(queryString)) {
19 | path += "?" + queryString;
20 | }
21 |
22 | PNGInfo pngInfo = sr.getMilStdSymbolImageFromURL(path);
23 | byte[] pngResponse = (pngInfo == null) ? null : pngInfo.getImageAsByteArray();
24 |
25 | return pngResponse;
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/java/sec/web/renderer/services/ping/PingServiceController.java:
--------------------------------------------------------------------------------
1 | package sec.web.renderer.services.ping;
2 |
3 | import java.io.IOException;
4 |
5 | import javax.servlet.http.HttpServletResponse;
6 | import javax.ws.rs.core.Context;
7 |
8 | import org.springframework.stereotype.Controller;
9 | import org.springframework.web.bind.annotation.RequestMapping;
10 | import org.springframework.web.bind.annotation.RequestMethod;
11 | import org.springframework.web.bind.annotation.ResponseBody;
12 |
13 | @Controller
14 | public class PingServiceController {
15 |
16 | public PingServiceController() {
17 | }
18 |
19 | @RequestMapping(value = "/ping", method = RequestMethod.GET)
20 | @ResponseBody
21 | public void ping(@Context HttpServletResponse response) {
22 |
23 | try {
24 | response.setContentType("text/html");
25 | response.setStatus(HttpServletResponse.SC_OK);
26 | response.getOutputStream().println(response.getStatus());
27 |
28 | // response.getOutputStream().close();
29 | } catch (IOException e) {
30 | e.printStackTrace();
31 | }
32 |
33 | // return response.getStatus();
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/java/sec/web/renderer/services/ping/PingServiceServlet.java:
--------------------------------------------------------------------------------
1 | package sec.web.renderer.services.ping;
2 |
3 | import java.io.IOException;
4 | import java.util.Calendar;
5 | import java.util.logging.Level;
6 | import java.util.logging.Logger;
7 |
8 | import javax.servlet.ServletException;
9 | import javax.servlet.ServletOutputStream;
10 | import javax.servlet.annotation.WebServlet;
11 | import javax.servlet.http.HttpServlet;
12 | import javax.servlet.http.HttpServletRequest;
13 | import javax.servlet.http.HttpServletResponse;
14 |
15 | /**
16 | * Servlet implementation class DirectoryReader
17 | */
18 | @WebServlet(name = "sec-ping-service-servlet", urlPatterns = { "/ping" })
19 | public class PingServiceServlet extends HttpServlet {
20 | private static final long serialVersionUID = 1798608294319568590L;
21 | private static final Logger LOGGER = Logger.getLogger(PingServiceServlet.class.getName());
22 |
23 | /**
24 | * @see HttpServlet#HttpServlet()
25 | */
26 | public PingServiceServlet() {
27 | super();
28 | }
29 |
30 | /**
31 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
32 | * response)
33 | */
34 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
35 | ServletOutputStream os = response.getOutputStream();
36 | LOGGER.log(Level.INFO, "ping:\t" + Calendar.getInstance().getTime());
37 |
38 | response.setContentType("text/html");
39 | response.setStatus(HttpServletResponse.SC_OK);
40 |
41 | String pageResult = genHtmlPage(response.getStatus());
42 |
43 | os.println(pageResult);
44 | os.close();
45 | }
46 |
47 | private String genHtmlPage(int statusCode) {
48 | StringBuilder sb = new StringBuilder();
49 |
50 | sb.append("");
51 | sb.append("");
52 | sb.append("Mil-Symbology-Renderer Availability Page");
53 | sb.append("");
63 | sb.append("");
64 |
65 | sb.append("");
66 | sb.append("Service is up and running:\t" + statusCode + "
");
67 | sb.append("");
68 | sb.append("");
69 |
70 |
71 | return sb.toString();
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/java/sec/web/renderer/utils/DirectoryReaderUtils.java:
--------------------------------------------------------------------------------
1 | package sec.web.renderer.utils;
2 |
3 | import java.io.File;
4 | import java.io.IOException;
5 | import java.io.InputStream;
6 | import java.util.Properties;
7 | import java.util.logging.Level;
8 | import java.util.logging.Logger;
9 |
10 | public class DirectoryReaderUtils {
11 | private final static Logger LOGGER = Logger.getLogger(DirectoryReaderUtils.class.getName());
12 |
13 | public DirectoryReaderUtils() {
14 |
15 | }
16 |
17 | public static String getDirectoryContent(File dir) throws IOException {
18 | StringBuilder sb = new StringBuilder();
19 | System.out.println(dir.getAbsolutePath());
20 |
21 | if (!dir.exists()) {
22 | dir.mkdirs();
23 | System.out.println("location does not exists ... Creating " + dir.getAbsolutePath());
24 | }
25 |
26 | if (dir.isDirectory()) {
27 | File[] files = dir.listFiles();
28 | for (File f : files) {
29 | sb.append(f.getName());
30 | sb.append(",");
31 | }
32 | }
33 |
34 | if (sb.toString().length() <= 0) {
35 | throw new IOException("NO plugins were found at:\t" + dir.getAbsolutePath());
36 | }
37 |
38 | return sb.substring(0, sb.toString().lastIndexOf(','));
39 | }
40 |
41 |
42 | public static Properties loadProperties(String fileName, ClassLoader loader) {
43 | Properties props = new Properties();
44 | if (fileName == null || fileName.equals("")) {
45 | throw new IllegalArgumentException("null reference: " + fileName);
46 | }
47 | if (fileName.startsWith("/")) {
48 | fileName = fileName.substring(1);
49 | }
50 |
51 | InputStream inStream = null;
52 | try {
53 | if (loader == null) {
54 | loader = ClassLoader.getSystemClassLoader();
55 | }
56 |
57 | inStream = loader.getResourceAsStream(fileName);
58 | props.load(inStream);
59 |
60 | } catch (IOException ioe) {
61 | LOGGER.log(Level.WARNING, ioe.getMessage());
62 | ioe.printStackTrace();
63 | }
64 | return props;
65 | }
66 |
67 | /**
68 | * @param dir
69 | */
70 | public static void emptyDirectory(File dir) {
71 | if (dir.exists() && dir.isDirectory()) {
72 | File[] tmpFiles = dir.listFiles();
73 |
74 | if (tmpFiles.length > 0) {
75 | for (File f : tmpFiles) {
76 | f.delete();
77 | }
78 | }
79 | }
80 | }
81 |
82 | /**
83 | * @param dir
84 | * @throws IOException
85 | */
86 | public static boolean isEmpty(File dir) throws IOException {
87 | boolean isEmpty = false;
88 |
89 | if (!dir.exists()) {
90 | LOGGER.log(Level.SEVERE, "Directory does NOT exist at " + dir.getAbsolutePath());
91 | throw new IOException("Directory does NOT exist at " + dir.getAbsolutePath());
92 | } else if ( !dir.isDirectory() ) {
93 | LOGGER.log(Level.SEVERE, dir.getAbsolutePath() + " is not a directory");
94 | throw new IOException(dir.getAbsolutePath() + " is not a directory");
95 | }
96 |
97 | isEmpty = (dir.listFiles().length <= 0) ? isEmpty = true : isEmpty;
98 |
99 | return isEmpty;
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/java/sec/web/renderer/utils/MultiPointUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this template, choose Tools | Templates
3 | * and open the template in the editor.
4 | */
5 | package sec.web.renderer.utils;
6 |
7 | import ArmyC2.C2SD.Utilities.ErrorLogger;
8 |
9 | import java.util.Map;
10 |
11 | import sec.web.renderer.SECRenderer;
12 |
13 | /**
14 | *
15 | * @author michael.spinelli
16 | */
17 | public class MultiPointUtils {
18 |
19 | public static String RenderSymbol(String symbolID, Map params) {
20 | String returnVal = "";
21 | String id = "ID";
22 | String name = "NAME";
23 | String description = "DESCRIPTION";
24 | // String symbolID
25 | String controlPoints = "0,0";
26 | String altitudeMode = "clampToGround";
27 | double scale = 50000;
28 | String bbox = "";
29 | String modifiers = "";
30 | int format = 0;
31 | int symStd = 0;
32 | boolean debug = false;
33 | try {
34 | if (params.containsKey("ID"))
35 | id = params.get("ID");
36 | if (params.containsKey("NAME"))
37 | name = params.get("NAME");
38 | if (params.containsKey("DESCRIPTION"))
39 | description = params.get("DESCRIPTION");
40 | if (params.containsKey("CONTROLPOINTS"))
41 | controlPoints = params.get("CONTROLPOINTS");
42 | if (params.containsKey("ALTITUDEMODE"))
43 | altitudeMode = params.get("ALTITUDEMODE");
44 | if (params.containsKey("SCALE"))
45 | scale = Double.parseDouble(params.get("SCALE"));
46 | if (params.containsKey("BBOX"))
47 | bbox = params.get("BBOX");
48 | if (params.containsKey("MODIFIERS"))
49 | modifiers = params.get("MODIFIERS");
50 | if (params.containsKey("FORMAT"))
51 | format = Integer.parseInt(params.get("FORMAT"));
52 | if (params.containsKey("SYMSTD"))
53 | symStd = Integer.parseInt(params.get("SYMSTD"));
54 |
55 | if (debug) {
56 | System.out.println("SymbolID: " + symbolID);
57 | System.out.println("Param values:");
58 | System.out.println(ErrorLogger.PrintStringMap(params));
59 | }
60 |
61 | returnVal = SECRenderer.getInstance().RenderMultiPointSymbol(id, name, description, symbolID, controlPoints,
62 | altitudeMode, scale, bbox, modifiers, format, symStd);
63 | } catch (Exception exc) {
64 | System.err.println(exc.getMessage());
65 | exc.printStackTrace();
66 | }
67 | if (debug) {
68 | // System.out.println("MultiPointUtils.RenderSymbol() return: ");
69 | // System.out.println(returnVal);
70 | }
71 | return returnVal;
72 | }
73 |
74 | @SuppressWarnings("unused")
75 | public static String RenderSymbol2D(String symbolID, Map params) {
76 | String returnVal = "";
77 | String id = "ID";
78 | String name = "NAME";
79 | String description = "DESCRIPTION";
80 | // String symbolID
81 | String controlPoints = "0,0";
82 | String altitudeMode = "clampToGround";
83 | double scale = 50000;
84 | String bbox = "";
85 | String modifiers = "";
86 | int pixelWidth = 1280;
87 | int pixelHeight = 1024;
88 | int format = 0;
89 | int symStd = 0;
90 | boolean debug = false;
91 | try {
92 | if (params.containsKey("ID"))
93 | id = params.get("ID");
94 | if (params.containsKey("NAME"))
95 | name = params.get("NAME");
96 | if (params.containsKey("DESCRIPTION"))
97 | description = params.get("DESCRIPTION");
98 | if (params.containsKey("CONTROLPOINTS"))
99 | controlPoints = params.get("CONTROLPOINTS");
100 | if (params.containsKey("PIXELWIDTH"))
101 | scale = Integer.parseInt(params.get("PIXELWIDTH"));
102 | if (params.containsKey("PIXELHEIGHT"))
103 | scale = Integer.parseInt(params.get("PIXELHEIGHT"));
104 | if (params.containsKey("BBOX"))
105 | bbox = params.get("BBOX");
106 | if (params.containsKey("MODIFIERS"))
107 | modifiers = params.get("MODIFIERS");
108 | if (params.containsKey("FORMAT"))
109 | format = Integer.parseInt(params.get("FORMAT"));
110 | if (params.containsKey("SYMSTD"))
111 | symStd = Integer.parseInt(params.get("SYMSTD"));
112 |
113 | if (debug) {
114 | System.out.println("SymbolID: " + symbolID);
115 | System.out.println("Param values:");
116 | System.out.println(ErrorLogger.PrintStringMap(params));
117 | }
118 |
119 | returnVal = SECRenderer.getInstance().RenderMultiPointSymbol2D(id, name, description, symbolID, controlPoints,
120 | pixelWidth, pixelHeight, bbox, modifiers, format, symStd);
121 | } catch (Exception exc) {
122 | System.err.println(exc.getMessage());
123 | exc.printStackTrace();
124 | }
125 | if (debug) {
126 | // System.out.println("MultiPointUtils.RenderSymbol() return: ");
127 | // System.out.println(returnVal);
128 | }
129 | return returnVal;
130 | }
131 | }
132 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/java/sec/web/renderer/utils/ResourceUtils.java:
--------------------------------------------------------------------------------
1 | package sec.web.renderer.utils;
2 |
3 | import java.io.IOException;
4 | import java.io.InputStream;
5 | import java.util.Properties;
6 | import java.util.logging.Level;
7 | import java.util.logging.Logger;
8 |
9 |
10 | public class ResourceUtils {
11 | public static final Logger LOGGER = Logger.getLogger(ResourceUtils.class.getName());
12 |
13 | public static Properties loadResource(String fileName) {
14 | return loadResource(fileName, null);
15 | }
16 |
17 | public static Properties loadResource(String fileName, ClassLoader loader) {
18 | Properties props = new Properties();
19 | if (fileName == null || fileName.equals("")) {
20 | throw new IllegalArgumentException("null reference: " + fileName);
21 | }
22 | if (fileName.startsWith("/")) {
23 | fileName = fileName.substring(1);
24 | }
25 |
26 | InputStream inStream = null;
27 | try {
28 | if (loader == null) {
29 | loader = ClassLoader.getSystemClassLoader();
30 | }
31 |
32 | inStream = loader.getResourceAsStream(fileName);
33 | props.load(inStream);
34 |
35 | } catch (IOException ioe) {
36 | LOGGER.log(Level.WARNING, ioe.getMessage());
37 | ioe.printStackTrace();
38 | }
39 | return props;
40 | }
41 |
42 | public static boolean isPluginsEnabled() {
43 | Properties props = loadResource("properties/prop.properties", null);
44 | Boolean enabled = Boolean.valueOf((String)props.get("enablePlugins"));
45 | boolean enablePlugins = (enabled == null) ? true : enabled;
46 |
47 | return enablePlugins;
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/resources/assembly/zip.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 | jsDocs
6 |
7 | zip
8 |
9 |
10 |
11 |
12 | ${project.build.directory}/site/jsdoc
13 | jsdocs
14 |
15 |
16 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/resources/properties/prop.properties:
--------------------------------------------------------------------------------
1 | #enablePlugins
2 | #if true, "mil-sym-service/plugins" folder will be created at the same level as
3 | #webapps if it doesn't already exist.
4 | #if false, no folder will be created and there will be no attempt to
5 | #load plugins.
6 | enablePlugins=false
7 | #0=2525B,1=2525C,2=2525D(in the future; highest level of support is C currently)
8 | #This is just a default setting. It can be overridden by adding the symstd
9 | #parameter to the url like "?symstd=2525C".
10 | symStd=0
11 | #textBackgroundMethod
12 | #0=NONE, 1=Color Filled Rectangle behind the text, 2=Outline, 3 = Quick Outline
13 | textBackgroundMethod=3
14 | #autoCollapseModifiers
15 | #true, fire support areas will only show identifying label and labels that fit
16 | #the area. false, all labels are shown all the time.
17 | autoCollapseModifiers=false
18 | #operationalConditionModifierType
19 | #0=Slash, 1=Bars
20 | operationalConditionModifierType=1
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/WEB-INF/dispatch-servlet.xml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 | Spring Web MVC Application
9 |
10 |
11 | index.jsp
12 |
13 |
14 |
15 | dispatch
16 | org.springframework.web.servlet.DispatcherServlet
17 | 1
18 |
19 |
20 |
21 | dispatch
22 | /renderer/*
23 |
24 |
25 |
26 | contextConfigLocation
27 | /WEB-INF/dispatch-servlet.xml
28 |
29 |
30 |
31 | org.springframework.web.context.ContextLoaderListener
32 |
33 |
34 | sec.web.renderer.services.directory.listeners.DirectoryWatcherVJ6
35 |
36 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/WEB-INF/wro/wro.properties:
--------------------------------------------------------------------------------
1 | #List of preProcessors
2 | preProcessors=jsMin,cssImport,semicolonAppender
3 | #List of postProcessors
4 | postProcessors=cssMin,jsMin
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/WEB-INF/wro/wro.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | /js/*.js
7 |
8 |
9 |
10 | /js/*.debug.js
11 |
12 |
13 |
14 | /js/mil-symbology-renderer.debug.js
15 | /js/cpce3d-js-utils.debug.js
16 | /js/cpce3d-geo-library.debug.js
17 | /js/cpce3d-geo-json-parser.debug.js
18 | /js/cpce3d-data-explorer.debug.js
19 | /js/cpce3d-data-manager.debug.js
20 | /js/cpce3d-wms-manager.debug.js
21 | /js/cpce3d-map-tools.debug.js
22 | /js/jc2cui-map-api-manager.debug.js
23 | /js/core-map-api-manager.debug.js
24 | /js/cpce3d-context-menu.debug.js
25 | /js/cpce3d-page-utils.debug.js
26 |
27 |
28 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/WebServiceSinglePoints.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/css/images/ui-bg_flat_0_aaaaaa_40x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/missioncommand/old-mil-sym-java/98382d0a471c50b18a46fe04669a747f7925f075/service/mil-sym-service/src/main/webapp/css/images/ui-bg_flat_0_aaaaaa_40x100.png
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/css/images/ui-bg_flat_100_262b30_40x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/missioncommand/old-mil-sym-java/98382d0a471c50b18a46fe04669a747f7925f075/service/mil-sym-service/src/main/webapp/css/images/ui-bg_flat_100_262b30_40x100.png
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/css/images/ui-bg_flat_100_646c76_40x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/missioncommand/old-mil-sym-java/98382d0a471c50b18a46fe04669a747f7925f075/service/mil-sym-service/src/main/webapp/css/images/ui-bg_flat_100_646c76_40x100.png
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/css/images/ui-bg_flat_100_747c88_40x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/missioncommand/old-mil-sym-java/98382d0a471c50b18a46fe04669a747f7925f075/service/mil-sym-service/src/main/webapp/css/images/ui-bg_flat_100_747c88_40x100.png
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/css/images/ui-bg_flat_100_8892a1_40x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/missioncommand/old-mil-sym-java/98382d0a471c50b18a46fe04669a747f7925f075/service/mil-sym-service/src/main/webapp/css/images/ui-bg_flat_100_8892a1_40x100.png
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/css/images/ui-bg_flat_75_646c76_40x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/missioncommand/old-mil-sym-java/98382d0a471c50b18a46fe04669a747f7925f075/service/mil-sym-service/src/main/webapp/css/images/ui-bg_flat_75_646c76_40x100.png
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/css/images/ui-bg_glass_55_fbf9ee_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/missioncommand/old-mil-sym-java/98382d0a471c50b18a46fe04669a747f7925f075/service/mil-sym-service/src/main/webapp/css/images/ui-bg_glass_55_fbf9ee_1x400.png
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/css/images/ui-bg_inset-soft_95_fef1ec_1x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/missioncommand/old-mil-sym-java/98382d0a471c50b18a46fe04669a747f7925f075/service/mil-sym-service/src/main/webapp/css/images/ui-bg_inset-soft_95_fef1ec_1x100.png
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/css/images/ui-icons_2e83ff_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/missioncommand/old-mil-sym-java/98382d0a471c50b18a46fe04669a747f7925f075/service/mil-sym-service/src/main/webapp/css/images/ui-icons_2e83ff_256x240.png
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/css/images/ui-icons_cd0a0a_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/missioncommand/old-mil-sym-java/98382d0a471c50b18a46fe04669a747f7925f075/service/mil-sym-service/src/main/webapp/css/images/ui-icons_cd0a0a_256x240.png
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/css/images/ui-icons_ffffff_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/missioncommand/old-mil-sym-java/98382d0a471c50b18a46fe04669a747f7925f075/service/mil-sym-service/src/main/webapp/css/images/ui-icons_ffffff_256x240.png
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/css/min/mil-symbology-renderer-all.css:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/css/test/imageTbl.css:
--------------------------------------------------------------------------------
1 | /* ------------------
2 | styling for the tables
3 | ------------------ */
4 |
5 | #background-image {
6 | font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
7 | font-size: 12px;
8 | margin: 15px;
9 | /*width: auto;*/
10 | text-align: middle;
11 | border-collapse: collapse;
12 | background: url('images/armyRanks.jpg') 765px 80px no-repeat;
13 | }
14 |
15 | #background-image th {
16 | padding: 12px;
17 | font-weight: normal;
18 | font-size: 14px;
19 | color: #339;
20 | white-space: nowrap;
21 | }
22 |
23 | #background-image td {
24 | padding: 9px 12px;
25 | color: #669;
26 | border-top: 1px solid #fff;
27 | }
28 |
29 | .urlField {
30 | padding: 9px 12px;
31 | color: #669;
32 | /*white-space: nowrap;*/
33 | border-top: 1px solid #fff;
34 | }
35 |
36 | #background-image tfoot td {
37 | font-size: 11px;
38 | }
39 | #background-image tbody td {
40 | background: url('images/back.png');
41 | }
42 |
43 | * html #background-image tbody td {
44 | /*
45 | ----------------------------
46 | PUT THIS ON IE6 ONLY STYLE
47 | AS THE RULE INVALIDATES
48 | YOUR STYLESHEET
49 | ----------------------------
50 | */
51 | filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='css/test/images/back.png',sizingMethod='crop');
52 | background: none;
53 | }
54 |
55 | #background-image tbody tr:hover td {
56 | color: #339;
57 | background: none;
58 | }
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/css/test/images/armyRanks.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/missioncommand/old-mil-sym-java/98382d0a471c50b18a46fe04669a747f7925f075/service/mil-sym-service/src/main/webapp/css/test/images/armyRanks.jpg
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/css/test/images/armyStar.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/missioncommand/old-mil-sym-java/98382d0a471c50b18a46fe04669a747f7925f075/service/mil-sym-service/src/main/webapp/css/test/images/armyStar.jpg
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/css/test/images/back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/missioncommand/old-mil-sym-java/98382d0a471c50b18a46fe04669a747f7925f075/service/mil-sym-service/src/main/webapp/css/test/images/back.png
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/css/test/images/bullet_green.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/missioncommand/old-mil-sym-java/98382d0a471c50b18a46fe04669a747f7925f075/service/mil-sym-service/src/main/webapp/css/test/images/bullet_green.png
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/css/test/images/bullet_red.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/missioncommand/old-mil-sym-java/98382d0a471c50b18a46fe04669a747f7925f075/service/mil-sym-service/src/main/webapp/css/test/images/bullet_red.png
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/css/test/images/button_bg.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/missioncommand/old-mil-sym-java/98382d0a471c50b18a46fe04669a747f7925f075/service/mil-sym-service/src/main/webapp/css/test/images/button_bg.gif
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/css/test/images/cecom-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/missioncommand/old-mil-sym-java/98382d0a471c50b18a46fe04669a747f7925f075/service/mil-sym-service/src/main/webapp/css/test/images/cecom-logo.png
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/css/test/images/input_bg.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/missioncommand/old-mil-sym-java/98382d0a471c50b18a46fe04669a747f7925f075/service/mil-sym-service/src/main/webapp/css/test/images/input_bg.gif
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/css/test/main.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: #FFFFFF;
3 | font-family: "Lucinda Grande", "lucinda Sans Unicode", Lucinda, Arial,Hlevetica, sans-serif;
4 | font-size: 16px;
5 | margin: 0;
6 | }
7 |
8 | h1.title {
9 | background-color: #3665BB;
10 | color: #FFFFFF;
11 | padding-left: 15px;
12 | padding-right: 15px;
13 | }
14 |
15 | h2 {
16 | color: #021C4D;
17 | margin-bottom: 5px;
18 | margin-top: 10px;
19 | }
20 |
21 | .h2_content {
22 | margin-left: 10px;
23 | }
24 |
25 | h3 {
26 | color: #1A3059;
27 | margin-bottom: 5px;
28 | }
29 |
30 | .h3_content {
31 | margin-left: 10px;
32 | }
33 |
34 | a.external {
35 | color: #D0345E;
36 | }
37 |
38 | canvas {
39 | border: 1px dotted gray;
40 | }
41 |
42 | #container {
43 | margin-left: auto;
44 | margin-right: auto;
45 | margin-top: 0px;
46 | position: relative;
47 | width: 1100px;
48 | }
49 |
50 | #header {
51 | background-color: #3665BB;
52 | border-top-left-radius: 10px;
53 | border-top-right-radius: 10px;
54 | margin-bottom: 0;
55 | padding-bottom: 0;
56 | padding-top: 5px;
57 | }
58 |
59 | .todo {
60 | background-color: yellow;
61 | }
62 |
63 | .nav {
64 | background-color: #597CBB;
65 | color: white;
66 | height: 30px;
67 | padding-left: 15px;
68 | padding-top: 7px;
69 | }
70 |
71 | .nav>a {
72 | color: white;
73 | padding: 2px 4px;
74 | text-decoration: none;
75 | }
76 |
77 | .nav a.selected {
78 | background-color: #1A3059;
79 | color: white;
80 | padding: 2px 4px;
81 | text-decoration: none;
82 | }
83 |
84 | .nav a:hover {
85 | background-color: #A1002B;
86 | color: white;
87 | padding: 2px 4px;
88 | text-decoration: none;
89 | }
90 |
91 | #content {
92 | background-color: white;
93 | border-bottom-left-radius: 10px;
94 | border-bottom-right-radius: 10px;
95 | border: 2px solid;
96 | border-color: #597CBB;
97 | margin-bottom: 10px;
98 | margin-top: 0;
99 | min-height: 200px;
100 | padding: 20px 15px;
101 | }
102 |
103 | #footer {
104 | color: #021C4D;
105 | font-size: 10px;
106 | margin-bottom: 20px;
107 | margin-top: 50px;
108 | text-align: center;
109 | }
110 |
111 | #footer a {
112 | color: gray;
113 | text-decoration: none;
114 | }
115 |
116 | /*Form*/
117 | form {
118 | width: 400px;
119 | border: none;
120 | padding: 10px;
121 | margin-left: 16px;
122 | }
123 |
124 |
125 |
126 | .blue {
127 | color: #0099CC;
128 | font-weight: bold;
129 | }
130 |
131 | /*General styles - NOT really related to the forms*/
132 | img {
133 | border: 0;
134 | }
135 |
136 | /* Forms defaults - change as needed */
137 | label {
138 | color: #999;
139 | cursor: pointer;
140 | padding-left: 2px;
141 | line-height: 26px;
142 | }
143 |
144 | label.chosen {
145 | color: #333;
146 | }
147 |
148 |
149 |
150 | Transparent items
151 | .outtaHere {
152 | position: absolute;
153 | left: -3000px;
154 | }
155 |
156 | table.t1 {
157 | margin: 0px;
158 | }
159 |
160 | /* Text inputs */
161 | .textinput,.textinputHovered {
162 | height: 30px;
163 | /*background: url(images/input_bg.gif) repeat-x left top;*/
164 | border: solid 2px #DAE4E8;
165 | padding: 4px 0;
166 | vertical-align: middle;
167 | text-indent: 5px;
168 | width: 500px;
169 | }
170 |
171 | .textInputSelected {
172 | border: solid 2px #0099CC;
173 | }
174 |
175 | .textinputHovered {
176 | background-position: left bottom;
177 | color: #0099CC;
178 | border-width: 2px;
179 | height: 30px;
180 | }
181 |
182 | input[type="text"]:hover {
183 | border: solid 2px #0099CC;
184 | }
185 |
186 | .inputCorner {
187 | padding-bottom: 0;
188 | vertical-align: middle;
189 | }
190 |
191 | h1.section {
192 | color: #0099CC;
193 | font-size: 1.6em;
194 | }
195 |
196 | /* Button */
197 | .buttonSubmit, .buttonSubmitHovered {
198 | width: auto;
199 | height: 45px;
200 | color: #FFF;
201 | font-weight: bold;
202 | }
203 |
204 | .buttonSubmitHovered {
205 | background-position: left bottom;
206 | }
207 |
208 | .buttonImg {
209 | vertical-align: bottom;
210 | }
211 |
212 | input[type="submit"].buttonSubmit {
213 | margin: 10px;
214 | margin-left: 0px;
215 | }
216 |
217 | input[type="submit"]:hover {
218 | background-position: left bottom;
219 | cursor: pointer;
220 | border: solid 2px #0099CC;
221 | }
222 |
223 | #symbolCheckerDiv {
224 | height: 350px;
225 | }
226 |
227 | .divLeft {
228 | float: left;
229 | width: 40%;
230 | }
231 | .divRight {
232 | float: right;
233 | padding-top: 100px;
234 | width: 60%;
235 | text-align: center;
236 | }
237 |
238 | input.watermark {
239 | color: #999;
240 | font-weight: bold;
241 | }
242 |
243 | .space {
244 | height: 20px;
245 | }
246 |
247 | .pingResult {
248 | float:right;
249 | margin: 25px 650px auto auto;
250 | text-shadow: 0px 2px 3px #555;
251 | }
252 |
253 | .success {
254 | color: #00CD00;
255 | }
256 | .failure {
257 | color: #CD2626;
258 | }
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/js/skin-vista/icons.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/missioncommand/old-mil-sym-java/98382d0a471c50b18a46fe04669a747f7925f075/service/mil-sym-service/src/main/webapp/js/skin-vista/icons.gif
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/js/skin-vista/loading.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/missioncommand/old-mil-sym-java/98382d0a471c50b18a46fe04669a747f7925f075/service/mil-sym-service/src/main/webapp/js/skin-vista/loading.gif
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/js/skin/icons.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/missioncommand/old-mil-sym-java/98382d0a471c50b18a46fe04669a747f7925f075/service/mil-sym-service/src/main/webapp/js/skin/icons.gif
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/js/skin/loading.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/missioncommand/old-mil-sym-java/98382d0a471c50b18a46fe04669a747f7925f075/service/mil-sym-service/src/main/webapp/js/skin/loading.gif
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/js/skin/vline.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/missioncommand/old-mil-sym-java/98382d0a471c50b18a46fe04669a747f7925f075/service/mil-sym-service/src/main/webapp/js/skin/vline.gif
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/rpc_relay.uncompressed.html:
--------------------------------------------------------------------------------
1 |
17 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/main/webapp/symbology-renderer-widget.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Extensible Symbology Renderer Widget
5 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | Mil Symbology Renderer Widget
24 |
25 | This widget renders MIL-STD-2525 Symbology for maps. Please minimize, but do not close.
26 |
27 |
34 |
35 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/test/java/test/sec/web/renderer/imaging/SpringImagingTests.java:
--------------------------------------------------------------------------------
1 | package test.sec.web.renderer.imaging;
2 |
3 | import static org.junit.Assert.*;
4 |
5 | import java.io.IOException;
6 | import java.net.MalformedURLException;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 | //import org.springframework.test.context.ContextConfiguration;
11 | //import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
12 | import org.springframework.web.client.RestTemplate;
13 | import org.xml.sax.SAXException;
14 |
15 | import sec.web.renderer.services.imaging.ImageGeneratorController;
16 |
17 | import com.meterware.httpunit.GetMethodWebRequest;
18 | import com.meterware.httpunit.WebRequest;
19 | import com.meterware.httpunit.WebResponse;
20 | import com.meterware.servletunit.ServletRunner;
21 | import com.meterware.servletunit.ServletUnitClient;
22 |
23 |
24 | //@RunWith(SpringJUnit4ClassRunner.class)
25 | //@ContextConfiguration( locations = { "test-dispatch-servlet.xml" })
26 | @SuppressWarnings("unused")
27 | public class SpringImagingTests {
28 |
29 | private String BASE_URL = "http://localhost:8080/rendering-sdk/renderer";
30 | private String KML_URL = "/kml/SFGP-----------"; // ?name=testKML&description=globeView&lat=-39&lon=-78&alt=25000&id=test1
31 | private String IMG_URL = "/image/SFGP-----------"; // ?T=uniquedesignation&n=ENY&h=USA"
32 |
33 |
34 | // @Test
35 | // public void testMe() {
36 | // RestTemplate rest = new RestTemplate();
37 | //
38 | // rest.getForObject(BASE_URL, new Object[]{});
39 | // }
40 |
41 | // @Test
42 | // public void getImagingKMLTest() throws MalformedURLException, IOException, SAXException {
43 | // ServletRunner sr = new ServletRunner();
44 | // sr.registerServlet("ImageGeneratorController", ImageGeneratorController.class.getName());
45 | //
46 | // ServletUnitClient client = sr.newClient();
47 | // WebRequest request = new GetMethodWebRequest(BASE_URL+KML_URL);
48 | // request.setParameter("name", "unique designation");
49 | // request.setParameter("description", "additional info");
50 | // request.setParameter("lat", "-39");
51 | // request.setParameter("lon", "-78");
52 | // request.setParameter("alt", "25000");
53 | //
54 | // WebResponse response = sr.getResponse(request);
55 | // WebResponse resp = client.getResponse(request);
56 | //
57 | // assertNotNull("no response received", response);
58 | // assertNotNull("no response received", resp);
59 | //
60 | // String content = response.getText();
61 | // System.out.println(content);
62 | //
63 | // assertTrue(content, content.contains("name"));
64 | // }
65 |
66 |
67 | //
68 | // @Test
69 | // public void getImagingImageTest() throws MalformedURLException, IOException, SAXException {
70 | // ServletRunner sr = new ServletRunner();
71 | // sr.registerServlet("ImageGeneratorController", ImageGeneratorController.class.getName());
72 | //
73 | // ServletUnitClient client = sr.newClient();
74 | // WebRequest request = new GetMethodWebRequest(BASE_URL+IMG_URL);
75 | // request.setParameter("name", "unique designation");
76 | // request.setParameter("description", "additional info");
77 | // request.setParameter("lat", "-39");
78 | // request.setParameter("lon", "-78");
79 | // request.setParameter("alt", "25000");
80 | //
81 | // WebResponse response = sr.getResponse(request);
82 | // WebResponse resp = client.getResponse(request);
83 | //
84 | // assertNotNull("no response received", response);
85 | // assertNotNull("no response received", resp);
86 | //
87 | // String content = response.getText();
88 | // System.out.println(content);
89 | //
90 | // assertTrue(content, content.contains("name"));
91 | // }
92 |
93 | // @Test
94 | // public void testUtilsPNG() {
95 | // String url = "/ImageGeneratorController/image/123456789012345";
96 | // String queryStr = "t=unique+designation&h=additional+info&n=ENY";
97 | // byte[] pngResp = ImagingUtils.getMilStd2525Png(url, queryStr);
98 | // }
99 |
100 | }
101 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/test/java/test/sec/web/renderer/imaging/TestImagingUtils.java:
--------------------------------------------------------------------------------
1 | package test.sec.web.renderer.imaging;
2 |
3 | import static org.junit.Assert.*;
4 | import java.io.IOException;
5 | import java.net.MalformedURLException;
6 |
7 | import org.junit.AfterClass;
8 | import org.junit.BeforeClass;
9 | import org.junit.Test;
10 | import org.xml.sax.SAXException;
11 |
12 | import sec.web.renderer.services.imaging.ImageGeneratorServlet;
13 | import sec.web.renderer.utils.ImagingUtils;
14 |
15 | import com.meterware.httpunit.GetMethodWebRequest;
16 | import com.meterware.httpunit.WebRequest;
17 | import com.meterware.httpunit.WebResponse;
18 | import com.meterware.servletunit.ServletRunner;
19 | import com.meterware.servletunit.ServletUnitClient;
20 |
21 | @SuppressWarnings("unused")
22 | public class TestImagingUtils {
23 |
24 | protected static ImagingUtils utils = null;
25 | protected String servletURL = "http://test.meterware.com/ImageGeneratorServlet";
26 |
27 | @BeforeClass
28 | public static void init() {
29 | utils = new ImagingUtils();
30 | }
31 |
32 | @AfterClass
33 | public static void destroy() throws IOException {
34 |
35 | }
36 |
37 | // @Test
38 | // public void getAllQueryParamsTest() throws MalformedURLException, IOException, SAXException {
39 | // ServletRunner sr = new ServletRunner();
40 | // sr.registerServlet("ImageGeneratorServlet", ImageGeneratorServlet.class.getName());
41 | //
42 | // ServletUnitClient client = sr.newClient();
43 | // WebRequest request = new GetMethodWebRequest(servletURL);
44 | // request.setParameter("t", "unique designation");
45 | // request.setParameter("h", "additional info");
46 | // request.setParameter("n", "ENY");
47 | //
48 | // WebResponse response = sr.getResponse(request);
49 | //
50 | // assertNotNull("no response received", response);
51 | //
52 | // String content = response.getText();
53 | // System.out.println(content);
54 | //
55 | // assertTrue(content, content.contains("param2"));
56 | // }
57 |
58 |
59 | // @Test
60 | // public void testUtilsPNG() {
61 | // String url = "/ImageGeneratorServlet/image/123456789012345";
62 | // String queryStr = "t=unique+designation&h=additional+info&n=ENY";
63 | // byte[] pngResp = ImagingUtils.getMilStd2525Png(url, queryStr);
64 | // }
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/test/java/test/sec/web/renderer/imaging/test-dispatch-servlet.xml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/service/mil-sym-service/src/test/resources/test-dispatch-servlet.xml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/service/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 |
4 |
5 | io.github.missioncommand
6 | mil-sym-java
7 | 0.1.43
8 | ..
9 |
10 |
11 | mil-sym-service-parent
12 | pom
13 | mil-sym-java :: Service
14 | mil-sym-java Service
15 |
16 |
17 | mil-sym-service
18 |
19 |
20 |
21 |
22 |
23 | org.apache.maven.plugins
24 | maven-source-plugin
25 |
26 |
27 | attach-sources
28 |
29 | jar
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/travis/release.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set +x
4 | set -e
5 |
6 | echo '[release] TRAVIS_TAG='$TRAVIS_TAG
7 | echo '[release] TRAVIS_PULL_REQUEST='$TRAVIS_PULL_REQUEST
8 |
9 | # we only publish if a tag, but not NOT PRs
10 | if [[ -n $TRAVIS_TAG ]] && [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then
11 | mvn -Pinclude-sources -Pinclude-javadocs deploy --settings travis/settings.xml -DskipTests=true -e
12 | exit $?
13 | fi
14 |
--------------------------------------------------------------------------------
/travis/settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | bintray-missioncommand-maven
5 | ${env.BINTRAY_USER}
6 | ${env.BINTRAY_KEY}
7 |
8 |
9 |
--------------------------------------------------------------------------------