Class MilStd2525ModifierRetriever

  • All Implemented Interfaces:
    IconRetriever

    public class MilStd2525ModifierRetriever
    extends AbstractIconRetriever
    Icon retriever to retriever modifiers (for example, the Feint/Dummy indicator) for the symbols in the MIL-STD-2525C symbol set.
    • Field Detail

      • DEFAULT_COLOR

        protected static final java.awt.Color DEFAULT_COLOR
      • variableWidths

        protected static final int[] variableWidths
    • Constructor Detail

      • MilStd2525ModifierRetriever

        public MilStd2525ModifierRetriever​(java.lang.String retrieverPath)
        Create a new retriever that will retrieve icons from the specified location.
        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 symbolId,
                                                       AVList params)
        Create an icon for a symbol modifier.
        Parameters:
        symbolId - Identifier for the modifier. This identifier is fields 11 and 12 of a MIL-STD-2525C SIDC (see MIL-STD-2525C Table A-I, pg. 51).
        params - Parameters that affect icon retrieval. This retriever accepts only one parameter: AVKey.COLOR, which determines the color of the modifier (default is black).
        Returns:
        BufferedImage containing the requested modifier, or null if the modifier cannot be retrieved.
      • composePath

        protected java.lang.String composePath​(java.lang.String symbolModifierCode,
                                               AVList params)
      • isVariableWidth

        protected boolean isVariableWidth​(AVList params)
      • mustApplyColor

        protected boolean mustApplyColor​(java.lang.String symbolId)
        Indicates whether or not color must be applied to the modifier. Color is applied to all modifiers except for alternate Operational Condition modifiers, which have their own color.
        Parameters:
        symbolId - Modifier id.
        Returns:
        True if color must be applied to the modifier.
      • chooseBestFittingWidth

        protected java.lang.Integer chooseBestFittingWidth​(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.