Class TLspAPP6ALayerBuilder

java.lang.Object
com.luciad.view.lightspeed.layer.ALspLayerBuilder
com.luciad.symbology.app6a.view.lightspeed.TLspAPP6ALayerBuilder

public class TLspAPP6ALayerBuilder extends ALspLayerBuilder
Builder for layers capable of visualizing APP6 shapes.

The layer will contain two paint representations that can be controlled separately:

For non-line symbols, the body visualisation consists of an icon. For line symbols, the body visualisation depends on the symbol. It typically consists of a line or area.

Basic customization of the visualization is possible using an military symbol style. If the domain object implements ILcdStyledMilitarySymbol, then the style will be retrieved from it. Otherwise, a default style is used.

Other customization of the visualization is possible by setting a custom body or label styler. This layer builder installs a TLspAPP6ASymbolStyler by default. This styler recognizes domain objects which implement ILcdAPP6ACoded and ILcdStyledMilitarySymbol. Replacing the default styler with a custom one allows APP6 symbology to be used on domain objects which do not implement these interfaces, as well as making all sorts of other customizations possible (e.g. additional decorations or labels on symbols).

Since:
2012.0
See Also:
  • Method Details

    • newBuilder

      public static TLspAPP6ALayerBuilder newBuilder()
      Returns:
      a new APP-6A layer builder with selection and editing of symbols enabled and with no editing and decluttering for labels
    • build

      Creates and returns a new APP-6A layer based on the current parameters of this builder.
      Specified by:
      build in class ALspLayerBuilder
      Returns:
      a new APP-6A layer
    • bodyStyler

      public TLspAPP6ALayerBuilder bodyStyler(TLspPaintState aPaintState, ILspStyler aStyler)
      Sets the given body styler for the given paint state.

      The styler can specify a TLspAPP6ASymbolStyle to paint the object as an APP6 symbol.

      You can also specify the following styles to paint custom geometry or decorations:

      The styler should specify an ILcdAPP6AShape as geometry to get the visualization as specified by the standard. Other ILcdShape's are also supported as geometry for most symbols.

      Note that the created layer will not have the specified styler directly as its body styler.

      Parameters:
      aPaintState - the paint state for which to set the body styler
      aStyler - the new body styler for the layer
      Returns:
      this
    • labelStyler

      public TLspAPP6ALayerBuilder labelStyler(TLspPaintState aPaintState, ILspStyler aStyler)
      Sets the given label styler for the given paint state.

      The styler can specify a TLspAPP6ASymbolStyle to paint the standard APP6 symbol labels.

      You can also specify the following styles to paint custom labels:

      The styler should specify an ILcdAPP6AShape as geometry to get the visualization as specified by the standard. Other ILcdShape's are also supported as geometry for most symbols.

      Note that the created layer will not have the specified styler directly as its label styler.

      Parameters:
      aPaintState - the paint state for which to set the label styler
      aStyler - the new label styler for the layer
      Returns:
      this
    • defaultStyle

      @Deprecated public TLspAPP6ALayerBuilder defaultStyle(ILcdAPP6AStyle aDefaultStyle)
      Deprecated.
      Sets the default symbology style that will be used if a domain object does not implement ILcdStyledMilitarySymbol.
      Parameters:
      aDefaultStyle - The default style
      Returns:
      this builder
    • defaultStyle

      public TLspAPP6ALayerBuilder defaultStyle(TLcdMilitarySymbolStyle aDefaultStyle)
      Sets the default symbology style that will be used if a domain object does not implement ILcdStyledMilitarySymbol.
      Parameters:
      aDefaultStyle - The default style
      Returns:
      this builder
      Since:
      2024.0
    • iconProvider

      public TLspAPP6ALayerBuilder iconProvider(TLcdAPP6AObjectIconProvider aIconProvider)
      Override the default icon provider.

      The icon provider is only use for non-line symbols.

      Parameters:
      aIconProvider - The new icon provider
      Returns:
      this builder
    • layerType

      public TLspAPP6ALayerBuilder layerType(ILspLayer.LayerType aLayerType)
      Description copied from class: ALspLayerBuilder
      Sets the layer type of the layer.

      The default value is ILspLayer.LayerType.EDITABLE.

      Overrides:
      layerType in class ALspLayerBuilder
      Parameters:
      aLayerType - the layer type
      Returns:
      this builder
      See Also:
    • bodyEditable

      public TLspAPP6ALayerBuilder bodyEditable(boolean aEditable)
      Sets whether the body of the symbols should be editable.
      Parameters:
      aEditable - whether the body of the symbols should be editable
      Returns:
      this builder
    • bodyScaleRange

      public TLspAPP6ALayerBuilder bodyScaleRange(ILcdInterval aBodyScaleRange)
      Sets the scale range for the body of the symbols.
      Parameters:
      aBodyScaleRange - the scale range for the body of the symbols
      Returns:
      this builder
    • bodyMapScaleRange

      public TLspAPP6ALayerBuilder bodyMapScaleRange(TLcdDimensionInterval<TLcdMapScale> aBodyScaleRange)
      Sets the scale range for the body of the layer in unitless map scale ratios. This property defines a range of scales in which the bodies of the layer are visible. By default, no scale range is used, meaning that all bodies are visible.
      Parameters:
      aBodyScaleRange - the scale range for the body of the layer
      Returns:
      this
      Since:
      2021.0
    • culling

      public TLspAPP6ALayerBuilder culling(boolean aUseCulling)
      Sets whether objects outside the visible view portion are culled and not painted.

      Enabling culling restricts the objects that are painted to those that (approximately) overlap with the view. This typically reduces the memory usage and increases the frame rate. However because culling also introduces an additional overhead, you may get better performance by disabling it for either very dynamic layers or layers with only a small amount of objects.

      Parameters:
      aUseCulling - whether the layer should use culling or not
      Returns:
      this builder
    • filter

      public TLspAPP6ALayerBuilder filter(ILcdDynamicFilter aFilter)
      Sets a filter that will be used to filter objects to prevent them from being painted by the layer. No filter is set by default.
      Parameters:
      aFilter - the filter
      Returns:
      this
    • icon

      public TLspAPP6ALayerBuilder icon(ILcdIcon aIcon)
      Description copied from class: ALspLayerBuilder
      Sets the icon of the layer.

      The default value is null.

      Overrides:
      icon in class ALspLayerBuilder
      Parameters:
      aIcon - the icon
      Returns:
      this builder
      See Also:
    • layerStyle

      public TLspAPP6ALayerBuilder layerStyle(TLspLayerStyle aLayerStyle)
      Description copied from class: ALspLayerBuilder
      Set a layer style to be used during the rendering of the layer. TLspLayerStyle is used to style the layer as a whole. Layer style can for example modify the transparency of a layer. Also, layer style can be modified after building the layer by calling ILspLayer.setLayerStyle(TLspLayerStyle).
      Overrides:
      layerStyle in class ALspLayerBuilder
      Parameters:
      aLayerStyle - the layer style. Must not be null. If you want to set the default layer style, set TLspLayerStyle.newBuilder().build()
      Returns:
      this
      See Also:
    • label

      public TLspAPP6ALayerBuilder label(String aLabel)
      Description copied from class: ALspLayerBuilder
      Sets the label of the layer. This is a short textual representation for it, often used to represent the layer to end-users.

      The default value is null.

      Overrides:
      label in class ALspLayerBuilder
      Parameters:
      aLabel - the label
      Returns:
      this builder
      See Also:
    • labelScaleRange

      public TLspAPP6ALayerBuilder labelScaleRange(ILcdInterval aLabelScaleRange)
      Sets the scale range for the labels of the symbols.
      Parameters:
      aLabelScaleRange - the scale range for the labels of the symbols. If aLabelScaleRange is null, labels will always be displayed.
      Returns:
      this builder
    • labelMapScaleRange

      public TLspAPP6ALayerBuilder labelMapScaleRange(TLcdDimensionInterval<TLcdMapScale> aLabelScaleRange)
      Sets the scale range for the labels of the layer in unitless map scale ratios. This property defines a range of scales in which the labels of the layer are visible. By default, no scale range is used, meaning that all labels are visible.
      Parameters:
      aLabelScaleRange - the scale range for the labels of the layer
      Returns:
      this
      Since:
      2021.0
    • model

      public TLspAPP6ALayerBuilder model(ILcdModel aModel)
      Description copied from class: ALspLayerBuilder
      Sets the model of the layer.

      The default value is null.

      Overrides:
      model in class ALspLayerBuilder
      Parameters:
      aModel - a model
      Returns:
      this builder
      See Also:
    • selectable

      public TLspAPP6ALayerBuilder selectable(boolean aSelectable)
      Sets whether the symbols should be selectable.
      Parameters:
      aSelectable - whether the symbols should be selectable
      Returns:
      this builder
    • objectViewMargin

      public TLspAPP6ALayerBuilder objectViewMargin(double aObjectViewMargin)
      Sets the largest possible difference (in pixels) between an object's model bounds and its painted representation's bounds that should be taken into account.

      This value is used when determining what objects are visible (if culling is enabled). It ensures, for example, that a model element is still painted if its visual representation falls inside the view, but its model bounds do not.

      If for example view-sized icons are used to represent points on the map, the icon could be 16 by 16 pixels, whereas the object itself is a point, having a zero size. Depending on where the point is located in the icon, the required margin for this example can be up to 16 pixels.

      The drawback of setting a too large value is a performance loss. The drawback of setting a too small value is that objects (e.g. icons) disappear when they are located partly outside the view.

      You can also configure a maximum distance in meters.

      The default value is 32.

      Parameters:
      aObjectViewMargin - the maximum difference (in pixels)
      Returns:
      this
    • objectWorldMargin

      public TLspAPP6ALayerBuilder objectWorldMargin(double aObjectWorldMargin)
      Sets the largest possible difference (in meters) between an object's model bounds and its painted representation's bounds that should be taken into account.

      This value is used when determining what objects are visible (if culling is enabled). It ensures, for example, that a model element is still painted if its visual representation falls inside the view, but its model bounds do not.

      If for example circles are used to represent points on the map, the circle could have a radius of 1km, whereas the object itself is a point, having a zero size. The required margin for this example is 1000 meters.

      The drawback of setting a too large value is a performance loss. The drawback of setting a too small value is that objects (e.g. icons) disappear when they are located partly outside the view.

      You can also configure a maximum distance in pixels.

      The default value is 0.

      Parameters:
      aObjectWorldMargin - the maximum difference in meters
      Returns:
      this