public static final class LonLatGridSetting.Builder extends Object implements AutoCloseable
Constructor and Description |
---|
Builder(LonLatGridSetting.Builder other) |
Modifier and Type | Method and Description |
---|---|
LonLatGridSetting |
build()
Returns the LonLat grid setting.
|
void |
close() |
LonLatGridSetting.Builder |
deltaLat(double deltaLat)
Indicates the delta angle between latitude grid lines in degrees.
|
LonLatGridSetting.Builder |
deltaLon(double deltaLon)
Indicates the delta angle between longitude grid lines in degrees.
|
protected void |
finalize() |
LonLatGridSetting.Builder |
labelEdgeOffset(double labelEdgeOffset)
This specifies the offset of the label, away from the edges of the view, in device independent pixels.
|
LonLatGridSetting.Builder |
labelFormat(String labelFormat)
This specifies the format pattern to use for the labels of the current LonLat grid.
|
LonLatGridSetting.Builder |
labelGridOffset(double labelGridOffset)
This specifies the offset of the label, in device independent pixels, away from the grid line to which it is attached.
|
LonLatGridSetting.Builder |
labelOrientation(GridLabelOrientation labelOrientation)
This specifies the label orientation with respect to the line.
|
LonLatGridSetting.Builder |
labelPosition(LonLatGridLabelPosition labelPosition)
This specifies the label position with respect to the view.
|
LonLatGridSetting.Builder |
labelStyle(TextStyle labelStyle)
Indicates the label style to use for this setting.
|
LonLatGridSetting.Builder |
lineLabelPosition(GridLineLabelPosition lineLabelPosition)
This specifies the label position (with respect to the line) to use for the line labels.
|
LonLatGridSetting.Builder |
lineStyle(LineStyle lineStyle)
Indicates the line style to use for this setting.
|
LonLatGridSetting.Builder |
originLabelStyle(TextStyle labelStyle)
Indicates the origin label style to use for this setting.
|
LonLatGridSetting.Builder |
originLineStyle(LineStyle lineStyle)
Indicates the origin line style to use for this setting.
|
LonLatGridSetting.Builder |
scaleRange(MapScale minScale,
MapScale maxScale)
Indicates the scale range for which this setting applies.
|
public Builder(@NotNull LonLatGridSetting.Builder other)
public void close()
close
in interface AutoCloseable
@NotNull public LonLatGridSetting build() throws IllegalStateException
Mandatory parameters:
Other parameters are optional.
IllegalStateException
- when not all mandatory parameters are set.@NotNull public LonLatGridSetting.Builder scaleRange(@NotNull MapScale minScale, @NotNull MapScale maxScale) throws IllegalArgumentException
This is mandatory.
minScale
- the min scale (most zoomed out).maxScale
- the max scale (most zoomed in).IllegalArgumentException
- when the min scale is larger than or equal to the max scale.@NotNull public LonLatGridSetting.Builder deltaLon(double deltaLon) throws IllegalArgumentException
This is mandatory.
deltaLon
- the delta angle.IllegalArgumentException
- when the angle is smaller than or equal to 0.@NotNull public LonLatGridSetting.Builder deltaLat(double deltaLat) throws IllegalArgumentException
This is mandatory.
deltaLat
- the delta angle.IllegalArgumentException
- when the angle is smaller than or equal to 0.@NotNull public LonLatGridSetting.Builder lineStyle(@NotNull LineStyle lineStyle)
This is optional. Defaults to a white line style with width 0.5 and 60% opacity.
lineStyle
- the line style.@NotNull public LonLatGridSetting.Builder originLineStyle(@NotNull LineStyle lineStyle)
This is optional. Defaults to a red line style with width 1 and 60% opacity.
lineStyle
- the line style.@NotNull public LonLatGridSetting.Builder labelStyle(@NotNull TextStyle labelStyle)
This is optional. Defaults to a white text style with font size 12 and a gray halo of size 1.
labelStyle
- the label style.@NotNull public LonLatGridSetting.Builder originLabelStyle(@NotNull TextStyle labelStyle)
This is optional. Defaults to a white text style with font size 12, 80% opacity, and a red halo of size 1.
labelStyle
- the label style.@NotNull public LonLatGridSetting.Builder labelEdgeOffset(double labelEdgeOffset) throws IllegalArgumentException
This is optional. Defaults to 6
.
labelEdgeOffset
- the edge offset value. Must be >= 0.IllegalArgumentException
- when an invalid value is passed.@NotNull public LonLatGridSetting.Builder labelGridOffset(double labelGridOffset) throws IllegalArgumentException
This is optional. Defaults to 3
.
labelGridOffset
- the grid offset value. Must be >= 0.IllegalArgumentException
- when an invalid value is passed.@NotNull public LonLatGridSetting.Builder lineLabelPosition(@NotNull GridLineLabelPosition lineLabelPosition)
They can for example be placed at the left or at the right of the line.
This is optional. Defaults to AboveOrLeft
.
lineLabelPosition
- the line label position.@NotNull public LonLatGridSetting.Builder labelOrientation(@NotNull GridLabelOrientation labelOrientation)
This is optional. Defaults to AlongLine
.
labelOrientation
- the label orientation.@NotNull public LonLatGridSetting.Builder labelPosition(@NotNull LonLatGridLabelPosition labelPosition)
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
.
labelPosition
- the label position.@NotNull public LonLatGridSetting.Builder labelFormat(@NotNull String labelFormat) throws IllegalArgumentException
labelFormat
- the pattern to use.IllegalArgumentException
- if format is not a valid format pattern.LonLatFormat