Class MilStd2525IconRetriever
- java.lang.Object
-
- gov.nasa.worldwind.symbology.AbstractIconRetriever
-
- gov.nasa.worldwind.symbology.milstd2525.MilStd2525IconRetriever
-
- All Implemented Interfaces:
IconRetriever
public class MilStd2525IconRetriever extends AbstractIconRetriever
Retriever to retrieve icons for symbols in the MIL-STD-2525 symbol set. The retriever can retrieve icons from either a local or remote symbol store. See the Symbology Usage Guide for details on how to configure a local symbol repository. For more information on how to use this class see the IconRetriever Usage Guide and theIconRetrieverUsage
example.Retrieval parameters
Table IX (pg. 35) of MIL-STD-2525C defines a hierarchy for simplifying tactical symbols. This hierarchy is implemented using retrieval parameters SHOW_FILL, SHOW_FRAME, and SHOW_ICON. By default, all three elements are displayed, and they can be turned off by setting the appropriate parameter. If frame and icon are turned off the retriever will return an image that contains a circle, either black or filled with the icon fill color (depending on the state of SHOW_FILL).
createIcon
accepts the following parameters:createIcon Parameters Key Type Description SymbologyConstants.SHOW_ICON Boolean Determines if the symbol will be created with an icon. SymbologyConstants.SHOW_FRAME Boolean Determines if the symbol will be created with a frame. SymbologyConstants.SHOW_FILL Boolean Determines if the symbol will be created with a fill color. AVKey.COLOR java.awt.Color Fill color applied to the symbol. If the symbol is drawn with a frame, then this color will be used to fill the frame. If the symbol is not drawn with a frame, then the fill will be applied to the icon itself. The fill color has no effect if Show Fill is False.
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
CIRCLE_LINE_WIDTH
Line width used to stroke circle when fill is turned off.protected static int
CIRCLE_RADIUS
Radius (in pixels) of circle that is drawn to the represent the symbol when both frame and icon are off.protected static java.awt.Color
DEFAULT_FRAME_COLOR
protected static java.awt.Color
DEFAULT_ICON_COLOR
protected static java.lang.String
DEFAULT_IMAGE_FORMAT
protected static java.util.Set<java.lang.String>
emsEquipment
protected static java.awt.Color
FILL_COLOR_LIGHT_BLUE
protected static java.awt.Color
FILL_COLOR_LIGHT_GREEN
protected static java.awt.Color
FILL_COLOR_LIGHT_PURPLE
protected static java.awt.Color
FILL_COLOR_LIGHT_RED
protected static java.awt.Color
FILL_COLOR_LIGHT_YELLOW
protected static java.util.Map<java.lang.String,java.awt.Color>
fillColorMap
protected static java.lang.String
FILLS_PATH
protected static java.awt.Color
FRAME_COLOR_BLUE
protected static java.awt.Color
FRAME_COLOR_GREEN
protected static java.awt.Color
FRAME_COLOR_PURPLE
protected static java.awt.Color
FRAME_COLOR_RED
protected static java.awt.Color
FRAME_COLOR_YELLOW
protected static java.util.Map<java.lang.String,java.awt.Color>
frameColorMap
protected static java.lang.String
FRAMES_PATH
protected static java.awt.Color
ICON_COLOR_DARK_GREEN
protected static java.awt.Color
ICON_COLOR_GREEN
protected static java.awt.Color
ICON_COLOR_ORANGE
protected static java.awt.Color
ICON_COLOR_RED
protected static java.awt.Color
ICON_COLOR_YELLOW
protected static java.util.Map<java.lang.String,java.awt.Color>
iconColorMap
protected static java.lang.String
ICONS_PATH
protected static java.util.Map<java.lang.String,java.lang.String>
schemePathMap
protected static java.lang.String
TACTICAL_SYMBOLS_PATH
protected static java.util.Set<java.lang.String>
unfilledIconMap
protected static java.util.Set<java.lang.String>
unframedIconMap
protected static java.lang.String
UNKNOWN_PATH
-
Fields inherited from class gov.nasa.worldwind.symbology.AbstractIconRetriever
retrieverPath
-
-
Constructor Summary
Constructors Constructor Description MilStd2525IconRetriever(java.lang.String retrieverPath)
Create a new retriever that will retrieve icons from the specified location.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
composeFillPath(SymbolCode symbolCode)
protected java.lang.String
composeFramePath(SymbolCode symbolCode)
protected java.lang.String
composeIconPath(SymbolCode symbolCode, AVList params)
java.awt.image.BufferedImage
createIcon(java.lang.String sidc, AVList params)
Create an icon for a MIL-STD-2525C symbol.protected java.awt.image.BufferedImage
drawCircle(SymbolCode symbolCode, AVList params, java.awt.image.BufferedImage dest)
protected java.awt.image.BufferedImage
drawFill(SymbolCode symbolCode, AVList params, java.awt.image.BufferedImage dest)
protected java.awt.image.BufferedImage
drawFrame(SymbolCode symbolCode, AVList params, java.awt.image.BufferedImage dest)
protected java.awt.image.BufferedImage
drawIcon(SymbolCode symbolCode, AVList params, java.awt.image.BufferedImage dest)
protected java.awt.image.BufferedImage
drawIconComponent(java.lang.String path, java.awt.Color color, java.awt.image.BufferedImage dest)
protected java.awt.Color
getColorFromParams(AVList params)
Retrieves the value of the AVKey.COLOR parameter.protected java.awt.Color
getFillColor(SymbolCode symbolCode, AVList params)
protected java.awt.Color
getFrameColor(SymbolCode symbolCode, AVList params)
protected java.lang.String
getGroundFunctionId(SymbolCode symbolCode)
protected java.awt.Color
getIconColor(SymbolCode symbolCode, AVList params)
protected java.lang.String
getMaskedFillCode(SymbolCode symbolCode)
protected java.lang.String
getMaskedFrameCode(SymbolCode symbolCode)
protected java.lang.String
getMaskedIconCode(SymbolCode symbolCode, AVList params)
protected java.lang.String
getMaskedUnknownIconCode(SymbolCode symbolCode, AVList params)
protected java.lang.String
getSimpleStandardIdentity(SymbolCode symbolCode)
protected java.lang.String
getSimpleStatus(SymbolCode symbolCode)
protected boolean
isDashedFrame(SymbolCode symbolCode)
protected boolean
mustDrawFill(SymbolCode symbolCode, AVList params)
protected boolean
mustDrawFrame(SymbolCode symbolCode, AVList params)
protected boolean
mustDrawIcon(SymbolCode symbolCode, AVList params)
protected SymbolCode
transformToWarfightingScheme(SymbolCode symbolCode)
-
Methods inherited from class gov.nasa.worldwind.symbology.AbstractIconRetriever
drawImage, equals, getRetrieverPath, hashCode, multiply, readImage, replaceColor
-
-
-
-
Field Detail
-
FILLS_PATH
protected static final java.lang.String FILLS_PATH
- See Also:
- Constant Field Values
-
FRAMES_PATH
protected static final java.lang.String FRAMES_PATH
- See Also:
- Constant Field Values
-
ICONS_PATH
protected static final java.lang.String ICONS_PATH
- See Also:
- Constant Field Values
-
TACTICAL_SYMBOLS_PATH
protected static final java.lang.String TACTICAL_SYMBOLS_PATH
- See Also:
- Constant Field Values
-
UNKNOWN_PATH
protected static final java.lang.String UNKNOWN_PATH
- See Also:
- Constant Field Values
-
FILL_COLOR_LIGHT_RED
protected static final java.awt.Color FILL_COLOR_LIGHT_RED
-
FILL_COLOR_LIGHT_BLUE
protected static final java.awt.Color FILL_COLOR_LIGHT_BLUE
-
FILL_COLOR_LIGHT_GREEN
protected static final java.awt.Color FILL_COLOR_LIGHT_GREEN
-
FILL_COLOR_LIGHT_YELLOW
protected static final java.awt.Color FILL_COLOR_LIGHT_YELLOW
-
FILL_COLOR_LIGHT_PURPLE
protected static final java.awt.Color FILL_COLOR_LIGHT_PURPLE
-
FRAME_COLOR_RED
protected static final java.awt.Color FRAME_COLOR_RED
-
FRAME_COLOR_BLUE
protected static final java.awt.Color FRAME_COLOR_BLUE
-
FRAME_COLOR_GREEN
protected static final java.awt.Color FRAME_COLOR_GREEN
-
FRAME_COLOR_YELLOW
protected static final java.awt.Color FRAME_COLOR_YELLOW
-
FRAME_COLOR_PURPLE
protected static final java.awt.Color FRAME_COLOR_PURPLE
-
ICON_COLOR_RED
protected static final java.awt.Color ICON_COLOR_RED
-
ICON_COLOR_ORANGE
protected static final java.awt.Color ICON_COLOR_ORANGE
-
ICON_COLOR_GREEN
protected static final java.awt.Color ICON_COLOR_GREEN
-
ICON_COLOR_DARK_GREEN
protected static final java.awt.Color ICON_COLOR_DARK_GREEN
-
ICON_COLOR_YELLOW
protected static final java.awt.Color ICON_COLOR_YELLOW
-
DEFAULT_FRAME_COLOR
protected static final java.awt.Color DEFAULT_FRAME_COLOR
-
DEFAULT_ICON_COLOR
protected static final java.awt.Color DEFAULT_ICON_COLOR
-
DEFAULT_IMAGE_FORMAT
protected static final java.lang.String DEFAULT_IMAGE_FORMAT
- See Also:
- Constant Field Values
-
CIRCLE_RADIUS
protected static final int CIRCLE_RADIUS
Radius (in pixels) of circle that is drawn to the represent the symbol when both frame and icon are off.- See Also:
- Constant Field Values
-
CIRCLE_LINE_WIDTH
protected static final int CIRCLE_LINE_WIDTH
Line width used to stroke circle when fill is turned off.- See Also:
- Constant Field Values
-
schemePathMap
protected static final java.util.Map<java.lang.String,java.lang.String> schemePathMap
-
fillColorMap
protected static final java.util.Map<java.lang.String,java.awt.Color> fillColorMap
-
frameColorMap
protected static final java.util.Map<java.lang.String,java.awt.Color> frameColorMap
-
iconColorMap
protected static final java.util.Map<java.lang.String,java.awt.Color> iconColorMap
-
unfilledIconMap
protected static final java.util.Set<java.lang.String> unfilledIconMap
-
unframedIconMap
protected static final java.util.Set<java.lang.String> unframedIconMap
-
emsEquipment
protected static final java.util.Set<java.lang.String> emsEquipment
-
-
Constructor Detail
-
MilStd2525IconRetriever
public MilStd2525IconRetriever(java.lang.String retrieverPath)
Create a new retriever that will retrieve icons from the specified location. The retrieval path may be a file URL to a directory on the local file system (for example, file:///symbols/mil-std-2525). A URL to a network resource (http://myserver.com/milstd2525/), or a URL to a JAR or ZIP file (jar:file:milstd2525-symbols.zip!).- Parameters:
retrieverPath
- File path or URL to the symbol directory, for example "http://myserver.com/milstd2525/".
-
-
Method Detail
-
createIcon
public java.awt.image.BufferedImage createIcon(java.lang.String sidc, AVList params)
Create an icon for a MIL-STD-2525C symbol. By default the symbol will include a filled frame and an icon. The fill, frame, and icon can be turned off by setting retrieval parameters. If both frame and icon are turned off then this method will return an image containing a circle.- Parameters:
sidc
- SIDC identifier for the symbol.params
- Parameters that affect icon retrieval. See Parameters in class documentation.- Returns:
- An BufferedImage containing the icon for the requested symbol, or null if the icon cannot be retrieved.
-
mustDrawFill
protected boolean mustDrawFill(SymbolCode symbolCode, AVList params)
-
mustDrawFrame
protected boolean mustDrawFrame(SymbolCode symbolCode, AVList params)
-
mustDrawIcon
protected boolean mustDrawIcon(SymbolCode symbolCode, AVList params)
-
drawFill
protected java.awt.image.BufferedImage drawFill(SymbolCode symbolCode, AVList params, java.awt.image.BufferedImage dest)
-
drawFrame
protected java.awt.image.BufferedImage drawFrame(SymbolCode symbolCode, AVList params, java.awt.image.BufferedImage dest)
-
drawIcon
protected java.awt.image.BufferedImage drawIcon(SymbolCode symbolCode, AVList params, java.awt.image.BufferedImage dest)
-
drawCircle
protected java.awt.image.BufferedImage drawCircle(SymbolCode symbolCode, AVList params, java.awt.image.BufferedImage dest)
-
drawIconComponent
protected java.awt.image.BufferedImage drawIconComponent(java.lang.String path, java.awt.Color color, java.awt.image.BufferedImage dest)
-
composeFillPath
protected java.lang.String composeFillPath(SymbolCode symbolCode)
-
composeFramePath
protected java.lang.String composeFramePath(SymbolCode symbolCode)
-
composeIconPath
protected java.lang.String composeIconPath(SymbolCode symbolCode, AVList params)
-
getFillColor
protected java.awt.Color getFillColor(SymbolCode symbolCode, AVList params)
-
getFrameColor
protected java.awt.Color getFrameColor(SymbolCode symbolCode, AVList params)
-
getIconColor
protected java.awt.Color getIconColor(SymbolCode symbolCode, AVList params)
-
getColorFromParams
protected java.awt.Color getColorFromParams(AVList params)
Retrieves the value of the AVKey.COLOR parameter.- Parameters:
params
- Parameter list.- Returns:
- The value of the AVKey.COLOR parameter, if such a parameter exists and is of type java.awt.Color. Returns null if the parameter list is null, if there is no value for key AVKey.COLOR, or if the value is not a Color.
-
getMaskedFillCode
protected java.lang.String getMaskedFillCode(SymbolCode symbolCode)
-
getMaskedFrameCode
protected java.lang.String getMaskedFrameCode(SymbolCode symbolCode)
-
transformToWarfightingScheme
protected SymbolCode transformToWarfightingScheme(SymbolCode symbolCode)
-
getMaskedIconCode
protected java.lang.String getMaskedIconCode(SymbolCode symbolCode, AVList params)
-
getMaskedUnknownIconCode
protected java.lang.String getMaskedUnknownIconCode(SymbolCode symbolCode, AVList params)
-
isDashedFrame
protected boolean isDashedFrame(SymbolCode symbolCode)
-
getSimpleStandardIdentity
protected java.lang.String getSimpleStandardIdentity(SymbolCode symbolCode)
-
getSimpleStatus
protected java.lang.String getSimpleStatus(SymbolCode symbolCode)
-
getGroundFunctionId
protected java.lang.String getGroundFunctionId(SymbolCode symbolCode)
-
-