This guide uses the APP-6A symbology to describe the military symbology functionality. The functionality available for MIL-STD 2525b is exactly the same.

You just need to substitute APP6A with MS2525b in all class names and method names, and app6a with milstd2525b in all package names.

In addition, the LuciadLightspeed support for APP-6B, APP-6C, APP-6D, MIL-STD 2525c and MIL-STD 2525d standards relies on the same APIs as its support for the APP-6A and MIL-STD 2525b standards. This means that you can use the APP-6A API in the same way for APP-6B, APP-6C and APP-6D symbology, and that you can use the MIL-STD 2525b API for MIL-STD 2525c and MIL-STD 2525d symbology.

This guide focuses on using military symbols in a GXY view. To visualize an ILcdModel containing MIL-STD 2525b or APP-6A objects in a view, you must create a layer. Visualizing military symbols in a GXY view explains how to create such a layer for a GXY view. Styling military symbols in a GXY view explains how to configure a default rendering style for a GXY layer. Creating and editing symbols in a GXY view further describes how to interact with the layer once it is ready, and create and edit symbols in a GXY view.

Visualizing military symbols in a GXY view

To visualize an ILcdModel in a GXY view, create a layer of type ILcdGXYLayer for your model. As described in the LuciadLightspeed Developer’s Guide, an ILcdGXYLayer needs to have an ILcdGXYPainterProvider to be able to render the objects, and optionally an ILcdGXYLabelPainterProvider to render the labels. The API provides the necessary implementations for these interfaces. For APP-6A, these implementations are:

See the package com.luciad.symbology.app6a.view.gxy.painter to find the implementations.

Styling military symbols in a GXY view

As explained in Configuring the style, you can define a style object and use it to configure the rendering of military symbols on the map. If you are using APP-6A symbols, you can associate the style object directly with one or more military symbols by defining an implementation of ILcdStyledMilitarySymbol in the domain object. Additionally, you can configure it as the default style on the painter and label painter provider classes mentioned in Visualizing military symbols in a GXY view. Use the method setDefaultMilitarySymbolStyle(TLcdMilitarySymbolStyle), available in both classes, for this. The default style will be used for all symbols that do not have an associated style.

Configuring a style on a military symbol or painter is optional. The implementation uses default style settings based upon the military symbology standards if no explicit styles have been defined.

Creating and editing symbols in a GXY view

To allow application users to modify domain object properties by interacting with the GUI, an ILcdGXYLayer must have an ILcdGXYEditorProvider that provides an ILcdGXYEditor instance for that object. The LuciadLightspeed MIL-STD 2525b and APP-6A APIs provide an implementation of this interface. For APP-6A, this is the class TLcdAPP6AGXYEditorProvider. For each type of symbol in APP-6A, it returns a specific ILcdGXYEditor that can be used to:

  • Translate the entire symbol or one of its points

  • Add and remove points, if allowed by the geometry of a symbol

  • Change the buffer size in the case of a buffer symbol

  • Set an offset in the case of a point symbol

To support the creation of new symbols by application users, connect a TLcdGXYNewController2 to an implementation of ALcdAPP6AGXYNewControllerModel. The controller model only needs to provide the relevant layer and an uninitialized military symbol. The samples provide a convenience controller model that adds the given symbol to the topmost compatible layer, and an action that sets up and enables a TLcdGXYNewController2. The action could be connected to a toolbar button or search field. Program: Connecting a search widget to an action that creates a new military symbol shows an example of the latter: a search widget is configured to create and trigger the action whenever the user selects a symbol.

Program: Connecting a search widget to an action that creates a new military symbol (from samples/symbology/gxy/GXYSymbologyCreationBar)
/**
 * Lets the user create and insert a military symbol by typing in a search field or
 * by clicking on a button that opens a symbol hierarchy tree.
 */
public class GXYSymbologyCreationBar extends SymbolSelectionBar {

  /**
   * Called when the user selects a symbol from the symbol hierarchy.
   * @param aSIDC the hierarchy code of the symbol
   */
  @Override
  protected void symbolSelected(final String aSIDC) {
    new GXYCreateAction(
        GXYMilitarySymbolNewControllerModel.newInstanceForHierarchy(aSIDC),
        fView,
        fUndoManager,
        fSnappables
    ).actionPerformed(null);
  }