Class TLspLonLatGridLayerBuilder

java.lang.Object
com.luciad.view.lightspeed.layer.ALspLayerBuilder
com.luciad.view.lightspeed.painter.grid.TLspLonLatGridLayerBuilder

public class TLspLonLatGridLayerBuilder extends ALspLayerBuilder
Builder for creating ILspLayer instances that visualize grid data. This builder is the recommended way of creating a lon-lat grid layer.

Use labelStyler(com.luciad.view.lightspeed.layer.TLspPaintState, com.luciad.view.lightspeed.style.styler.ILspStyler) and bodyStyler(com.luciad.view.lightspeed.layer.TLspPaintState, com.luciad.view.lightspeed.style.styler.ILspStyler) to customize the styling. You have two options:

  1. Use a TLspLonLatGridStyler to easily style grids.
  2. Create your own styler. The domain objects you can expect are ILspLonLatGridLine.

Use spacingRange(double, double) to customize the spacing between the grid lines.

Since:
2012.0
See Also:
  • Field Details

  • Constructor Details

    • TLspLonLatGridLayerBuilder

      protected TLspLonLatGridLayerBuilder()
      Creates a new layer builder. It will be configured automatically with a model and TLspLonLatGridStylers.
  • Method Details

    • newBuilder

      public static TLspLonLatGridLayerBuilder newBuilder()
      Returns:
      a new layer builder configured with a model and TLspLonLatGridStylers
    • createModel

      public static ILcdModel createModel(String aModelName)

      Creates a model that can be used by this builder. When no model is set on the builder, a default model is used instead. When using this method, it is possible to customize the model name which is used as a default display name for the layer created by this builder.

      The lon lat grid based on the created model will be based on the geodetic datum of the world reference from the view in which it is visualized. In order to use a different geodetic datum, the createModel method can be used.

      This model should not be shared between different layers.

      Parameters:
      aModelName - The desired model name
      Returns:
      A model that can be used in this builder.
    • createModel

      public static ILcdModel createModel(String aModelName, ILcdGeodeticDatum aDatum)

      Creates a model that can be used by this builder. When no model is set on the builder, a default model is used instead. When using this method, it is possible to customize the following:

      • the model name which is used as a default display name for the layer created by this builder
      • the geodetic datum that is used by the lon lat grid that is displayed by the layer

      This model should not be shared between different layers.

      Parameters:
      aModelName - The desired model name
      Returns:
      A model that can be used in this builder.
      Since:
      2020.1
    • bodyStyler

      public TLspLonLatGridLayerBuilder bodyStyler(TLspPaintState aPaintState, ILspStyler aBodyStyler)
      Define a styler to be used for body representations.

      You can use a TLspLonLatGridStyler, or a styler that can handle ILspLonLatGridLine objects.

      Parameters:
      aPaintState - the paint state to use the styler for
      aBodyStyler - the styler
      Returns:
      this
    • labelStyler

      public TLspLonLatGridLayerBuilder labelStyler(TLspPaintState aPaintState, ILspStyler aLabelStyler)
      Define a styler to be used for label representations.

      You can use a TLspLonLatGridStyler, or a styler that can handle ILspLonLatGridLine objects.

      Parameters:
      aPaintState - the paint state to use the styler for
      aLabelStyler - the styler
      Returns:
      this
    • spacingRange

      public TLspLonLatGridLayerBuilder spacingRange(double aMinimumScale, double aSpacing)
      Configure the spacing of the grid lines at a certain view scale.

      Use multiple calls to set different thresholds. The layer will use the spacing that corresponds to the configured scale just below the view scale.

      If this call is not used, the default set of scaling ranges is used. The example below shows the default set.

         TLspLonLatGridLayerBuilder.newBuilder()
         .spacingRange(0.048,      1/60.0)   // zoomed in
         .spacingRange(0.024,      1/12.0)
         .spacingRange(0.012,      1/6.0)
         .spacingRange(0.006,      1/2.0)
         .spacingRange(0.0012,     1)
         .spacingRange(0.000336,   5)
         .spacingRange(0.0000672, 10)
         .spacingRange(0,         30)        // zoomed out
         .build()
       

      Parameters:
      aMinimumScale - The scale below which this spacing becomes active
      aSpacing - The spacing between the lines, in degrees
      Returns:
      this
    • build

      public ILspLayer build()
      Description copied from class: ALspLayerBuilder

      Creates a new layer instance.

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

      public TLspLonLatGridLayerBuilder 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:
    • label

      public TLspLonLatGridLayerBuilder 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:
    • layerType

      public TLspLonLatGridLayerBuilder 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:
    • layerStyle

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