Class LonLatGridSetting.Builder
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
LonLatGridSetting
- Since:
- 2023.1
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns the LonLat grid setting.void
close()
deltaLat
(double deltaLat) Indicates the delta angle between latitude grid lines in degrees.deltaLon
(double deltaLon) Indicates the delta angle between longitude grid lines in degrees.protected void
finalize()
labelEdgeOffset
(double labelEdgeOffset) This specifies the offset of the label, away from the edges of the view, in device independent pixels.labelFormat
(String labelFormat) This specifies the format pattern to use for the labels of the current LonLat grid.labelGridOffset
(double labelGridOffset) This specifies the offset of the label, in device independent pixels, away from the grid line to which it is attached.labelOrientation
(GridLabelOrientation labelOrientation) This specifies the label orientation with respect to the line.labelPosition
(LonLatGridLabelPosition labelPosition) This specifies the label position with respect to the view.labelStyle
(TextStyle labelStyle) Indicates the label style to use for this setting.lineLabelPosition
(GridLineLabelPosition lineLabelPosition) This specifies the label position (with respect to the line) to use for the line labels.Indicates the line style to use for this setting.originLabelStyle
(TextStyle labelStyle) Indicates the origin label style to use for this setting.originLineStyle
(LineStyle lineStyle) Indicates the origin line style to use for this setting.scaleRange
(MapScale minScale, MapScale maxScale) Indicates the scale range for which this setting applies.
-
Constructor Details
-
Builder
-
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
build
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
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
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
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
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
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
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:
-