Class TLspDAFIFLayerBuilder

java.lang.Object
com.luciad.view.lightspeed.layer.ALspLayerBuilder
com.luciad.format.dafif.lightspeed.TLspDAFIFLayerBuilder

public final class TLspDAFIFLayerBuilder extends ALspLayerBuilder
A layer builder for visualizing DAFIF or DAFIFT data in a Lightspeed view.

This layer builder is for convenience:

  • It uses an AIS styler for bodies and labels, configured for DAFIF(T).
  • It can directly customize TLspAISStyler.
  • It sets appropriate layer icons based on the model contents.
  • It sets appropriate layer labels.
  • It has many of the options available on TLspShapeLayerBuilder.

You can also create a layer using a custom TLspAISStyler or a custom ILspStyler:

 TLspAISStyler aisStyler = new TLspAISStyler(TLspDAFIFLayerBuilder.SYMBOLOGY_ENCODING_FILES_LOCATION);
 TLspAISStyler customAisStyler = new TLspAISStyler(MY_CUSTOM_LOCATION);
 ILspStyler customStyler = new MyCustomStyler();
 TLspShapeLayerBuilder.newBuilder()
                      .model(model)
                      .bodyStyler(TLspPaintState.REGULAR, aisStyler)
                      .bodyStyler(TLspPaintState.SELECTED, customAisStyler)
                      .labelStyler(TLspPaintState.REGULAR, aisStyler)
                      .labelStyler(TLspPaintState.SELECTED, customStyler)
                      .build();
 
See TLspAISStyler for more details on customization.

Since:
2014.0
  • Field Details

    • SYMBOLOGY_ENCODING_FILES_LOCATION

      public static final String SYMBOLOGY_ENCODING_FILES_LOCATION
      Location of the DAFIF(T)-specific .sld files for use in a TLspAISStyler.
      See Also:
  • Method Details

    • newBuilder

      public static TLspDAFIFLayerBuilder newBuilder()
      Creates a new DAFIF layer builder with a TLspAISStyler configured for DAFIF.
      Returns:
      a new DAFIF layer builder.
    • build

      Description copied from class: ALspLayerBuilder

      Creates a new layer instance.

      Specified by:
      build in class ALspLayerBuilder
      Returns:
      the new layer instance
    • selectable

      public TLspDAFIFLayerBuilder selectable(boolean aSelectable)
      Sets whether the layer should be selectable.

      By default, it is selectable.

      Parameters:
      aSelectable - whether the layer should be selectable
      Returns:
      this
    • selectableSupported

      public TLspDAFIFLayerBuilder selectableSupported(boolean aSelectableSupported)
      Sets whether the layer should support selection.

      By default, it support selection.

      Parameters:
      aSelectableSupported - whether the layer should support selection
      Returns:
      this
    • editableSupported

      public TLspDAFIFLayerBuilder editableSupported(boolean aEditableSupported)
      Sets whether the layer should support editing.

      By default, layers support editing.

      Parameters:
      aEditableSupported - whether the layer should support selection
      Returns:
      this
    • bodyEditable

      public TLspDAFIFLayerBuilder bodyEditable(boolean aEditable)
      Sets whether the body of the layer should be editable. A default body editor will be used if no body editor is provided.

      By default, the bodies are not editable.

      Parameters:
      aEditable - whether the body of the layer should be editable
      Returns:
      this
      See Also:
    • labelEditable

      public TLspDAFIFLayerBuilder labelEditable(boolean aEditable)
      Sets whether the labels of the layer should be editable. A default label editor will be used if no label editor is provided.

      By default, the labels are not editable.

      Parameters:
      aEditable - whether the labels of the layer should be editable
      Returns:
      this
      See Also:
    • bodyStyler

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

      By default, a TLspAISStyler is set, configured for DAFIF.

      See shape layer builder for the list of supported styles.

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

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

      By default, a TLspAISStyler is set, configured for DAFIF.

      See shape layer builder for the list of supported styles.

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

      public TLspDAFIFLayerBuilder bodyEditor(ILspEditor aEditor)
      Sets the body editor for the layer, alternatively you can use bodyEditable(boolean) to enable a default editor.
      Parameters:
      aEditor - the body editor for the layer
      Returns:
      this
      See Also:
    • labelEditor

      public TLspDAFIFLayerBuilder labelEditor(ILspEditor aEditor)
      Sets a custom label editor for the layer, alternatively you can use labelEditable(boolean) to enable a default label editor.
      Parameters:
      aEditor - the label editor for the layer
      Returns:
      this
      See Also:
    • bodyScaleRange

      public TLspDAFIFLayerBuilder bodyScaleRange(ILcdInterval aBodyScaleRange)
      Sets the scale range for the body of the layer.

      By default, no scale range is used.

      Parameters:
      aBodyScaleRange - the scale range for the body of the layer
      Returns:
      this
    • labelScaleRange

      public TLspDAFIFLayerBuilder labelScaleRange(ILcdInterval aLabelScaleRange)
      Sets the scale range for the labels of the layer

      By default, no scale range is used.

      Parameters:
      aLabelScaleRange - the scale range for the labels of the layer
      Returns:
      this
    • filter

      public TLspDAFIFLayerBuilder 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
    • model

      public TLspDAFIFLayerBuilder model(ILcdModel aModel)
      Sets the model used by the layer.

      This is mandatory. The model must have a data model with DAFIF(T) data types.

      Overrides:
      model in class ALspLayerBuilder
      Parameters:
      aModel - a DAFIF(T) model, not null
      Returns:
      this
      See Also:
    • label

      public TLspDAFIFLayerBuilder label(String aLabel)
      Sets the textual label for the layer.

      This is optional, by default the model descriptor's display name is used.

      Overrides:
      label in class ALspLayerBuilder
      Parameters:
      aLabel - the label, not null
      Returns:
      this
      See Also:
    • icon

      public TLspDAFIFLayerBuilder icon(ILcdIcon aIcon)
      Sets the legend icon for the layer.

      This is optional, by default an icon is chosen based on the model content.

      Overrides:
      icon in class ALspLayerBuilder
      Parameters:
      aIcon - the icon, not null
      Returns:
      this
      See Also:
    • layerType

      public TLspDAFIFLayerBuilder 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:
    • sldLocations

      public TLspDAFIFLayerBuilder sldLocations(String... aSLDLocations)
      Configure extra locations of .sld files in addition to the default DAFIF configuration. See TLspAISStyler for more details.
      Parameters:
      aSLDLocations - extra locations of .sld files.
      Returns:
      this
    • layerStyle

      public TLspDAFIFLayerBuilder 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: