Class TLspNVGStyler

java.lang.Object
com.luciad.view.lightspeed.style.styler.ALspStyler
com.luciad.format.nvg.lightspeed.TLspNVGStyler
All Implemented Interfaces:
ILspStyler

public class TLspNVGStyler extends ALspStyler
Styler to visualize NVG objects as specified by the NVG standard.

TLspNVGStyler uses the TLcdNVGStyle and the TLcdNVGSymbol of an nvg element for its visualization. If the standard defined in TLcdNVGSymbol specifies how an object should be rendered, the symbol has precedence over the style. If an element has a symbol with an unsupported standard, only the style is used for visualization. For the visualization of domain specific symbols, implement a custom styler as described in the NVG Developer's guide.

If an element doesn't have a style set, a style with default values according to NVG specifications will be used. Style customization of military symbols is possible by setting an ILcdAPP6AStyle and an ILcdMS2525bStyle.

This styler can only style NVG objects and should only be used with layers made by TLspNVGLayerBuilder.

Since:
2015.0
  • Constructor Details

  • Method Details

    • style

      public void style(Collection<?> aObjects, ALspStyleCollector aStyleCollector, TLspContext aContext)
      Description copied from interface: ILspStyler

      Styles the objects or labels contained in aObjects using the methods provided by ALspStyleCollector.

      Example usages for object styling:

      
       // Same style for all objects:
       aStyleCollector.objects(aObjects).style(myStyle).submit();
      
       // Object specific styling:
       aStyleCollector.object(myObject1).style(myStyle1).submit();
       aStyleCollector.object(myObject2).style(myStyle2).submit();
       

      Example usages for label styling:

      
       if (aStyleCollector instanceof ALspLabelStyleCollector) {
         ALspLabelStyleCollector labelStyleCollector = (ALspLabelStyleCollector)aStyleCollector;
      
         // Specify a priority for all labels of all objects:
         labelStyleCollector.objects(aDomainObjects).allLabels().priority(3).styles(...).submit();
      
         // Specify an algorithm for a specific label:
         labelStyleCollector.object(myObject1).label(123).algorithm(...).styles(...).submit();
       }
       

      The objects that are provided to aStyleCollector must be objects that are contained in aObjects. Note that not all objects have to be styled. Objects that are not submitted in aStyleCollector will not be painted.

      This method can be called very frequently, depending on the (amount of) data. If this method is not implemented efficiently, painting performance may be affected.

      Parameters:
      aObjects - The objects to be styled.
      aStyleCollector - A style collector to which all styling information should be passed, this collector is only valid within this method call, and can no longer be used afterwards.
      aContext - Provides context information that may affect styling, such as view specific properties.
    • getDefaultMS2525bStyle

      @Deprecated public ILcdMS2525bStyle getDefaultMS2525bStyle()
      Deprecated.
      Returns the default symbology style for MIL-STD 2525 domain objects that do not contain any styling.
      Returns:
      a ILcdMS2525bStyle instance.
      See Also:
    • setDefaultMS2525bStyle

      @Deprecated public void setDefaultMS2525bStyle(ILcdMS2525bStyle aDefaultMS2525bStyle)
      Sets the default symbology style for MIL-STD 2525 domain objects that do not contain any styling.
      Parameters:
      aDefaultMS2525bStyle - the default MS2525 Style for the painter provider
      See Also:
    • getDefaultAPP6AStyle

      @Deprecated public ILcdAPP6AStyle getDefaultAPP6AStyle()
      Deprecated.
      Returns the default symbology style for APP-6 domain objects that do not contain any styling.
      Returns:
      a ILcdAPP6AStyle instance.
      See Also:
    • setDefaultAPP6AStyle

      @Deprecated public void setDefaultAPP6AStyle(ILcdAPP6AStyle aDefaultAPP6AStyle)
      Sets the default symbology style for APP-6 domain objects that do not contain any styling.
      Parameters:
      aDefaultAPP6AStyle - the default APP6A Style for the painter provider
      See Also:
    • getDefaultMilitarySymbolStyle

      public TLcdMilitarySymbolStyle getDefaultMilitarySymbolStyle()
      Returns the default symbology style for APP-6 and MIL-STD 2525 domain objects that do not contain any styling.
      Returns:
      a TLcdMilitarySymbolStyle instance.
      Since:
      2024.0
    • setDefaultMilitarySymbolStyle

      public void setDefaultMilitarySymbolStyle(TLcdMilitarySymbolStyle aDefaultStyle)
      Sets the default symbology style for APP-6 and MIL-STD 2525 domain objects that do not contain any styling.
      Parameters:
      aDefaultStyle - the default APP-6 and MIL-STD 2525 Style for the painter provider.
      Since:
      2024.0
    • getDefaultNVGStyle

      public TLcdNVGStyle getDefaultNVGStyle()
      Returns the default TLcdNVGStyle of this styler.
      Returns:
      the default nvg style.
      See Also:
    • setDefaultNVGStyle

      public void setDefaultNVGStyle(TLcdNVGStyle aDefaultNVGStyle)
      Set the default TLcdNVGStyle of this styler.

      This NVG Style allows to override the default values of the style attributes from NVG specifications. These values will be used to visualize an object if neither its style neither a style of its ancestors explicitly set these attributes. If some values aren't set on this style, the styler will use the ones from the specifications.

      For example, a new default font can be set and every elements will use it except the element with a font set.

      Note that this default nvg style is not used for elements with a military symbols.

      Parameters:
      aDefaultNVGStyle - a default nvg style