Class TLspMGRSGridLayerBuilder

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

public class TLspMGRSGridLayerBuilder extends ALspLayerBuilder
Builder for creating ILspLayer instances that visualize MGRS grid data. The styling of the MGRS grid and its labels can be done using TLspMGRSGridStyle.

An example of how to use this builder:

    TLspMGRSGridStyle gridStyle = TLspMGRSGridStyle.newBuilder().defaultMGRSGridStyle().build();
    ILspLayer layer = TLspMGRSGridLayerBuilder.newBuilder()
                                              .label("MGRS grid")
                                              .style(gridStyle)
                                              .build();
Since:
2012.1
  • Method Details

    • newBuilder

      public static TLspMGRSGridLayerBuilder newBuilder()
      Returns a new MGRS grid layer builder
      Returns:
      a new MGRS grid layer builder
    • createModel

      public static ILcdModel createModel(String aModelName, ILcdEllipsoid aEllipsoid)

      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 used ellipsoid and the model name. The model name is used as a default display name for the layer created by this builder.

      Parameters:
      aModelName - The desired model name
      aEllipsoid - The ellipsoid on which the MGRS grid is defined.
      Returns:
      A model that can be used in this builder.
    • model

      public TLspMGRSGridLayerBuilder model(ILcdModel aModel)

      Sets the model of the layer. This model should be created using the createModel method of this class. If not, an IllegalArgumentException is thrown.

      Calling this method is optional. If not called, a default model is used.

      Overrides:
      model in class ALspLayerBuilder
      Parameters:
      aModel - a model
      Returns:
      this builder
      Throws:
      IllegalArgumentException - if the given model is not created using the createModel method.
      See Also:
    • label

      public TLspMGRSGridLayerBuilder label(String aLabel)
      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 ""MGRS Grid"".

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

      public TLspMGRSGridLayerBuilder layerType(ILspLayer.LayerType aLayerType)
      This method is not supported for MGRS grid layers
      Overrides:
      layerType in class ALspLayerBuilder
      Parameters:
      aLayerType - the layer type
      Returns:
      this builder
      Throws:
      UnsupportedOperationException - this method is not supported for MGRS grid layers
      See Also:
    • layerStyle

      public TLspMGRSGridLayerBuilder 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:
    • style

      public TLspMGRSGridLayerBuilder style(TLspMGRSGridStyle aMGRSGridStyle)
      Sets the style to be used by this layer.
      Parameters:
      aMGRSGridStyle - the MGRS grid style to use.
      Returns:
      this builder.
    • overlayLabel

      public TLspMGRSGridLayerBuilder overlayLabel(TLspMGRSGridOverlayLabelBuilder aOverlayLabelBuilder, Object aConstraint)
      Adds an overlay label to be used. When the layer (built using this builder) is added to the view, this overlay label builder is used to add an overlay component to a view. The overlay component is also removed when the layer is removed from a view.
      Parameters:
      aOverlayLabelBuilder - the overlay label builder used to create an overlay component. It is not needed to call the TLspMGRSGridOverlayLabelBuilder.view() method before calling this method.
      aConstraint - an object expressing layout constraints for this component, usually one of these location constants.
      Returns:
      this builder.
    • build

      public ILspStyledLayer build()

      Creates a new layer instance.

      This builder returns an ILspStyledLayer that contains ILspCustomizableStyler instances.

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