public static final class RasterLayer.Builder extends Object implements AutoCloseable
Builder
for creating a RasterLayer
for a IRasterModel
.
The raster values are only painted if the pixel density of the raster is not too high. Otherwise the bounds of the raster is painted instead. The style for painting the bounds of the raster data can be customized. You can find an example within this related article on basic raster styling.
Constructor and Description |
---|
Builder(RasterLayer.Builder other) |
Modifier and Type | Method and Description |
---|---|
RasterLayer |
build()
Returns a new layer, based on the properties set on this builder.
|
void |
close() |
RasterLayer.Builder |
detailFactor(double factor)
Sets the detail factor to use.
|
RasterLayer.Builder |
fillStyle(FillStyle fillStyle)
Sets the fill style used when the raster data extent is shown when zoomed out far.
|
protected void |
finalize() |
RasterLayer.Builder |
lineStyle(ComplexStrokeLineStyle lineStyle)
Sets the line style used when the raster data extent is shown when zoomed out far.
|
RasterLayer.Builder |
lineStyle(LineStyle lineStyle)
Sets the line style used when the raster data extent is shown when zoomed out far.
|
RasterLayer.Builder |
model(IRasterModel model)
Sets the raster model of the layer.
|
RasterLayer.Builder |
rasterStyle(RasterStyle rasterStyle)
Sets the style for this raster.
|
RasterLayer.Builder |
title(String title)
Sets the title to use for the layer.
|
RasterLayer.Builder |
visible(boolean visible)
Sets whether the layer should be visible initially.
|
public Builder(@NotNull RasterLayer.Builder other)
public void close()
close
in interface AutoCloseable
@NotNull public RasterLayer build() throws IllegalArgumentException, IllegalStateException
IllegalArgumentException
- when the raster tile set structure is not supported.IllegalStateException
- If not all mandatory parameters are set.@NotNull public RasterLayer.Builder title(@NotNull String title)
If not set, the title from the ModelMetadata
is used.
title
- the title for the layer.@NotNull public RasterLayer.Builder visible(boolean visible)
Default is true
.
visible
- the visibility.@NotNull public RasterLayer.Builder model(@NotNull IRasterModel model) throws NullPointerException
Calling this function is mandatory.
model
- the raster model of the layer.NullPointerException
- if model is null
.@NotNull public RasterLayer.Builder fillStyle(@NotNull FillStyle fillStyle)
fillStyle
- a fill style created with FillStyle#newBuilder
.@NotNull public RasterLayer.Builder lineStyle(@NotNull LineStyle lineStyle)
Only one line style can be set, if this function is called when a ComplexStrokeLineStyle
has already been set, it will be overwritten.
lineStyle
- a line style created with LineStyle#newBuilder
.@NotNull public RasterLayer.Builder lineStyle(@NotNull ComplexStrokeLineStyle lineStyle)
Only one line style can be set, if this function is called when a LineStyle
has already been set, it will be overwritten.
lineStyle
- a complex stroke line style created with ComplexStrokeLineStyle#newBuilder
.@NotNull public RasterLayer.Builder rasterStyle(@NotNull RasterStyle rasterStyle)
rasterStyle
- the raster style to apply.@NotNull public RasterLayer.Builder detailFactor(double factor) throws IllegalArgumentException
The detail factor modifies the quality/detail of the loaded data.
factor
- The factor to apply. IllegalArgumentException
- if the factor is not strictly positive.