Class DictionarySymbolStyle

  • All Implemented Interfaces:
    Loadable

    public class DictionarySymbolStyle
    extends SymbolStyle
    Defines a mechanism to obtain unique multi-layer symbol style from a given specification, such as mil2525d. A DictionarySymbolStyle is made up of a *.stylx file (a sqlite database from ArcGIS Pro), which contains the symbol primitives for a given symbology specification (such as mil2525d), as well as a rule engine that parses input fields. The DictionarySymbolStyle assembles new symbols from the input attributes, and can also apply geometry manipulations to the symbols in the case of multipoint geometries.

    A DictionarySymbolStyle can be used in conjunction with a DictionaryRenderer applied to a FeatureLayer or GraphicsOverlay.

    When used by itself, the DictionarySymbolStyle supports two key workflows. The first is to find a symbol with provided attributes values. This is done by creating a map of field names and attribute values (as determined by the associated specification), and passing those into getSymbolAsync(Map) ), which returns a new Symbol. In this case, the key is the name of the specification field (e.g. "symbolset" in the case of mil2525d), and the value is the value you want associated with that field (e.g "Atmospheric"). You might use this symbol to create a new Graphic.

    You can also use a standalone DictionarySymbolStyle to search for symbol primitives. Symbol primitives are the individual symbols that make up more complex and advanced multilayer military symbols. This is achieved using SymbolStyle.searchSymbolsAsync(SymbolStyleSearchParameters). You could create a symbol picker app that searches for all symbols that have the tag "maritime" in it. The search results contain symbols which you could then either use as they are or extract from them different individual symbols to create a new symbol.

    Visit the Esri ArcGIS for Defense web site for details about military symbology styles.

    Since:
    100.2.0
    • Constructor Detail

      • DictionarySymbolStyle

        public DictionarySymbolStyle​(String specificationType,
                                     String dictionaryPath)
        Creates a dictionary symbol style. If the specification type is null or empty, an attempt will be made during loading to infer the type from the meta table, if it exists, inside the *.stylx file. If the load is successful, the type can be retrieved with getSpecificationType(). If the type is known before creating the DictionarySymbolStyle, it is best to provide the type.
        Parameters:
        specificationType - specification type e.g., "mil2525d", can be null or empty
        dictionaryPath - absolute path to dictionary file. It is a file with .stylx extension. The dictionary will fail to load if the file does not exist.
        Since:
        100.2.0
    • Method Detail

      • getSpecificationType

        public String getSpecificationType()
        Gets the specification type.
        Returns:
        the specification type
        Since:
        100.2.0
      • getConfigurationProperties

        public Map<String,String> getConfigurationProperties()
        Gets the configuration properties.

        Each symbology rule engine may have additional properties that can be configured. To modify these properties, obtain the defaults using this method, and modify them to the desired values.

        Returns:
        the configuration properties
        Since:
        100.2.0
      • getTextFieldNames

        public List<String> getTextFieldNames()
        Gets the text field names.

        For example, mil2525d would include "combateffectiveness", "credibility", "reliability", and "staffcomment", among many others.

        Returns:
        the text field names
        Since:
        100.2.0
      • getSymbolAsync

        public ListenableFuture<Symbol> getSymbolAsync​(Map<String,Object> attributes)
        Finds a Symbol, as defined by the input attributes.

        This function is useful for obtaining a single, multi-layer symbol from supplied attributes. This is commonly used to create symbols and graphics on-the-fly. For example, with mil2525d, you may want to obtain a symbol where "symbolset" is 40, "modifier1" is "Incident Qualifier : Accident", "echelon" is "Army", and so on. All of these key/value pairs can be used to obtain the specific symbol that you need. Once you have that symbol, you can apply it to a Graphic or Renderer, obtain its swatch image, or serialize to JSON.

        If the SymbolDictionary is not loaded then starting executing this method will load it.

        Parameters:
        attributes - attributes to generate the CIM symbol
        Returns:
        a Future that represents the symbol found based on attributes
        Throws:
        IllegalArgumentException - if attributes is null
        Since:
        100.2.0
      • getSymbologyFieldNames

        public List<String> getSymbologyFieldNames()
        Gets the symbology field names.

        For example, mil2525d would include "identity", "symbolset", "symbolentity", and "modifier1", among many others.

        Returns:
        the symbology field names
        Since:
        100.2.0