Customizing visualization

NVG domain object visualization can be classified in the following categories:

Program: Plugging in styling logic for a custom symbology. (from samples/symbology/nvg/lightspeed/MainPanel)
      ILspStyler styler = new DomainSpecificNVGStyler(TLspPaintState.REGULAR);
      ILspStyler selectedStyler = new DomainSpecificNVGStyler(TLspPaintState.SELECTED);
      ILspStyler editedStyler = new DomainSpecificNVGStyler(TLspPaintState.EDITED);
      ILspLayer layer = TLspNVGLayerBuilder.newBuilder()
                                           .bodyStyler(TLspPaintState.REGULAR, styler)
                                           .bodyStyler(TLspPaintState.SELECTED, selectedStyler)
                                           .bodyStyler(TLspPaintState.EDITED, editedStyler)
                                           .model(model)
                                           .build();

private static class DomainSpecificNVGStyler extends TLspNVGStyler {

  private ILcdObjectIconProvider fDomainSpecificIconProvider = new CivilianIconProvider();

  public DomainSpecificNVGStyler(TLspPaintState aPaintState) {
    super(aPaintState);
  }

  @Override
  public void style(Collection<?> aObjects, ALspStyleCollector aCollector, TLspContext aContext) {
    List<Object> classicNVGObjects = new ArrayList<>();
    for (Object object : aObjects) {
      if (isDomainSpecificObject(object)) {
        aCollector.object(object).style(retrieveStyle(object)).submit();
      } else {
        classicNVGObjects.add(object);
      }
    }
    super.style(classicNVGObjects, aCollector, aContext);
  }

  private boolean isDomainSpecificObject(Object object) {
    boolean result = false;
    if (object instanceof TLcdNVG20SymbolizedContent) {
      TLcdNVG20SymbolizedContent symbolizedContent = (TLcdNVG20SymbolizedContent) object;
      TLcdNVGSymbol symbol = symbolizedContent.getSymbol();
      if (CUSTOM_CIVILIAN_DOMAIN_NAME.equals(symbol.getStandardName())) {
        result = true;
      }
    }
    return result;
  }

  private ALspStyle retrieveStyle(Object aObject) {
    return TLspIconStyle.newBuilder()
                        .icon(fDomainSpecificIconProvider.getIcon(aObject))
                        .build();
  }

}