Class LonLatGridSetting.Builder

java.lang.Object
com.luciad.layers.grids.lonlat.LonLatGridSetting.Builder
All Implemented Interfaces:
AutoCloseable
Enclosing class:
LonLatGridSetting

public static final class LonLatGridSetting.Builder extends Object implements AutoCloseable
Builder for a LonLat grid setting.
Since:
2023.1
  • Constructor Details

  • Method Details

    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • build

      @NotNull public LonLatGridSetting build() throws IllegalStateException
      Returns the LonLat grid setting.

      Mandatory parameters:

      • scaleRange
      • deltaLon
      • deltaLat

      Other parameters are optional.

      Returns:
      the LonLat grid setting.
      Throws:
      IllegalStateException - when not all mandatory parameters are set.
    • scaleRange

      @NotNull public LonLatGridSetting.Builder scaleRange(@NotNull MapScale minScale, @NotNull MapScale maxScale) throws IllegalArgumentException
      Indicates the scale range for which this setting applies.

      This is mandatory.

      Parameters:
      minScale - the min scale (most zoomed out).
      maxScale - the max scale (most zoomed in).
      Returns:
      this builder.
      Throws:
      IllegalArgumentException - when the min scale is larger than or equal to the max scale.
    • deltaLon

      @NotNull public LonLatGridSetting.Builder deltaLon(double deltaLon) throws IllegalArgumentException
      Indicates the delta angle between longitude grid lines in degrees.

      This is mandatory.

      Parameters:
      deltaLon - the delta angle.
      Returns:
      this builder.
      Throws:
      IllegalArgumentException - when the angle is smaller than or equal to 0.
    • deltaLat

      @NotNull public LonLatGridSetting.Builder deltaLat(double deltaLat) throws IllegalArgumentException
      Indicates the delta angle between latitude grid lines in degrees.

      This is mandatory.

      Parameters:
      deltaLat - the delta angle.
      Returns:
      this builder.
      Throws:
      IllegalArgumentException - when the angle is smaller than or equal to 0.
    • lineStyle

      @NotNull public LonLatGridSetting.Builder lineStyle(@NotNull LineStyle lineStyle)
      Indicates the line style to use for this setting.

      This is optional. Defaults to a white line style with width 0.5 and 60% opacity.

      Parameters:
      lineStyle - the line style.
      Returns:
      this builder.
    • originLineStyle

      @NotNull public LonLatGridSetting.Builder originLineStyle(@NotNull LineStyle lineStyle)
      Indicates the origin line style to use for this setting.

      This is optional. Defaults to a red line style with width 1 and 60% opacity.

      Parameters:
      lineStyle - the line style.
      Returns:
      this builder.
    • labelStyle

      @NotNull public LonLatGridSetting.Builder labelStyle(@NotNull TextStyle labelStyle)
      Indicates the label style to use for this setting.

      This is optional. Defaults to a white text style with font size 12 and a gray halo of size 1.

      Parameters:
      labelStyle - the label style.
      Returns:
      this builder.
    • originLabelStyle

      @NotNull public LonLatGridSetting.Builder originLabelStyle(@NotNull TextStyle labelStyle)
      Indicates the origin label style to use for this setting.

      This is optional. Defaults to a white text style with font size 12, 80% opacity, and a red halo of size 1.

      Parameters:
      labelStyle - the label style.
      Returns:
      this builder.
    • labelEdgeOffset

      @NotNull public LonLatGridSetting.Builder labelEdgeOffset(double labelEdgeOffset) throws IllegalArgumentException
      This specifies the offset of the label, away from the edges of the view, in device independent pixels.

      This is optional. Defaults to 6.

      Parameters:
      labelEdgeOffset - the edge offset value. Must be >= 0.
      Returns:
      this builder.
      Throws:
      IllegalArgumentException - when an invalid value is passed.
    • labelGridOffset

      @NotNull public LonLatGridSetting.Builder labelGridOffset(double labelGridOffset) throws IllegalArgumentException
      This specifies the offset of the label, in device independent pixels, away from the grid line to which it is attached.

      This is optional. Defaults to 3.

      Parameters:
      labelGridOffset - the grid offset value. Must be >= 0.
      Returns:
      this builder.
      Throws:
      IllegalArgumentException - when an invalid value is passed.
    • lineLabelPosition

      @NotNull public LonLatGridSetting.Builder lineLabelPosition(@NotNull GridLineLabelPosition lineLabelPosition)
      This specifies the label position (with respect to the line) to use for the line labels.

      They can for example be placed at the left or at the right of the line.

      This is optional. Defaults to AboveOrLeft.

      Parameters:
      lineLabelPosition - the line label position.
      Returns:
      this builder.
    • labelOrientation

      @NotNull public LonLatGridSetting.Builder labelOrientation(@NotNull GridLabelOrientation labelOrientation)
      This specifies the label orientation with respect to the line.

      This is optional. Defaults to AlongLine.

      Parameters:
      labelOrientation - the label orientation.
      Returns:
      this builder.
    • labelPosition

      @NotNull public LonLatGridSetting.Builder labelPosition(@NotNull LonLatGridLabelPosition labelPosition)
      This specifies the label position with respect to the view.

      They can for example be placed at the left or at the right edge of the view. For example, when a label is placed at the east or south side of a line, it is placed at the left or lower edge of the view when using a rectangular projection like Mercator.

      This is optional. Defaults to AllSides.

      Parameters:
      labelPosition - the label position.
      Returns:
      this builder.
    • labelFormat

      @NotNull public LonLatGridSetting.Builder labelFormat(@NotNull String labelFormat) throws IllegalArgumentException
      This specifies the format pattern to use for the labels of the current LonLat grid.
      Parameters:
      labelFormat - the pattern to use.
      Returns:
      this builder.
      Throws:
      IllegalArgumentException - if format is not a valid format pattern.
      See Also: