Making Use of MilStdSymbol - missioncommand/mil-sym-java GitHub Wiki
MilStdSymbol is the object type returned from WebRenderer.RenderMultiPointAsMilStdSymbol().
Within MilStdSymbol there are 3 relevant methods to access data for plotting the symbol to a map.
Get ArrayList of ShapeInfo containing polylines
Get ArrayList of ShapeInfo containing text and image modifiers
Get Color for all text in symbol
These methods are not necessary to plot the symbol but might contain useful information.
20-30 digit code corresponding to a symbol
User defined from input
True if the rendered symbol fit inside the bounding box
All polylines in a shape have the same properties/style.
For each polyline move to the first point then draw a line to every following point
Stroke size for all polylines in shape.
Result is BasicStroke.CAP_BUTT , BasicStroke.CAP_ROUND or BasicStroke.CAP_SQUARE
Result is BasicStroke.JOIN_MITER , BasicStroke.JOIN_ROUND or BasicStroke.JOIN_BEVEL
Only relevant if ShapeInfo.getStroke().getLineJoin() is BasicStroke.JOIN_MITER
If attribute MilStdAttributes.UseDashArray was set to "true" (can check with MilStdSymbol.getUseDashArray()) and getDashArray() is not null then apply the dash array to all polylines in shape.
Stroke color of all polylines in shape.
Fill all polylines in shape with color returned
Use the shader to fill all polylines in shape. Always returns null in Java and TypeScript
Use the texture paint to fill all polylines in shape. Always returns null in Android and TypeScript.
2.1.11 ShapeInfo.getPatternFillImage() : Bitmap (Android), BufferedImage (Java), or string (TypeScript)
Use the image to fill all polylines in shape for TypeScript. Optionally can use to get an image object instead of using result of getShader()(Android) or getTexturePaint() (Java).
For modifier shapes either getModifierString() or getModifierImage()will return a nonnull value indicating if the shape is a text or image modifier.
Get text modifier as a string
Get text or image position
Get the color for the text
2.2.1.4 RendererSettings.getInstance().getMPLabelFont() : Paint (Android) or Font (Java and TypeScript)
Returned object includes font name, style and size. Alternatively can use the RendererSettings methods getMPModifierFontName(), getMPModifierFontType() and getMPModifierFontSize() to get font attributes.
Result is ShapeInfo.justify_left , ShapeInfo.justify_center or ShapeInfo.justify_right
Rotate the text or image by result in degrees
Center justify all image modifiers
2.2.2.1 ShapeInfo.getModifierImage(): Bitmap (Android), BufferedImage (Java), or string (TypeScript)
Get the image
Get text or image position
Rotate the text or image by result in degrees