public final class TLspNetCDFLayerBuilder extends ALspLayerBuilder
Layer builder for NetCDF models. It tries to provide sensible coloring defaults.
An example of how to use this builder:
ILspLayer layer = TLspNetCDFLayerBuilder.newBuilder()
.model(myNetCDFModel)
.build();
Note that this layer builder cannot handle model tree nodes. In order to visualize a model tree node with multiple NetCDF leaf models, one can create a layer tree node for the model tree node, and use this layer builder for the leaf NetCDF models.
NetCDF images can also be visualized as an icon grid. This happens automatically when the ALcdImage
to be painted contains 2 bands. Icon grid visualization can also be enable/customized by setting a
TLspParameterizedRasterIconStyle
as the styler
. In other cases, the image is visualized
as a raster.
Modifier and Type | Method and Description |
---|---|
ILspEditableStyledLayer |
build()
Creates a new layer instance.
|
static TLcdColorMap |
createDefaultColorMap(Object aNetCDFObject)
Creates a default color map for the given NetCDF object or
ALcdImage . |
TLspNetCDFLayerBuilder |
filter(ILcdDynamicFilter aFilter)
Sets a filter that will be used to filter objects to prevent them from
being painted by the layer.
|
TLspNetCDFLayerBuilder |
icon(ILcdIcon aIcon)
Sets the icon of the layer.
|
TLspNetCDFLayerBuilder |
label(String aLabel)
Sets the label of the layer.
|
TLspNetCDFLayerBuilder |
layerStyle(TLspLayerStyle aLayerStyle)
Set a layer style to be used during the rendering of the layer.
|
TLspNetCDFLayerBuilder |
layerType(ILspLayer.LayerType aLayerType)
This method is not supported for NetCDF layers.
|
TLspNetCDFLayerBuilder |
model(ILcdModel aModel)
Sets the model of the layer.
|
static TLspNetCDFLayerBuilder |
newBuilder()
Returns a new layer builder with the default settings
|
TLspNetCDFLayerBuilder |
styler(TLspPaintRepresentationState aPaintRepresentationState,
ILspStyler aStyler)
Sets the styler used to visualize the image.
|
getIcon, getLabel, getLayerStyle, getLayerType, getModel
public static TLspNetCDFLayerBuilder newBuilder()
public static TLcdColorMap createDefaultColorMap(Object aNetCDFObject)
ALcdImage
. It takes into account the type of data and the min and
max values of the data, if available. This layer builder uses the color map retrieved from this method as default
color map.aNetCDFObject
- the NetCDF object or ALcdImage
for which to create a color map.IllegalArgumentException
- if the given NetCDF object is not created by the
NetCDF model decoder.public ILspEditableStyledLayer build()
Creates a new layer instance.
When styler
is not called, the created layer exposes an ILspCustomizableStyler
with the default styles.
build
in class ALspLayerBuilder
public TLspNetCDFLayerBuilder styler(TLspPaintRepresentationState aPaintRepresentationState, ILspStyler aStyler)
TLspPaintRepresentation#BODY
affects the style of the raster.
Refer to the TLspRasterLayerBuilder class javadoc for an overview of the supported styles.
The default styler drapes the raster data on top of the view's terrain and paints a red hatched rectangle when zoom
out too far. It also configures a default color map.aPaintRepresentationState
- the paint representation.aStyler
- the stylerpublic TLspNetCDFLayerBuilder filter(ILcdDynamicFilter aFilter)
Sets a filter that will be used to filter objects to prevent them from being painted by the layer. No filter is set by default.
The objects passed to the layer filter are domain objects of a TLcdNetCDFFilteredModel
. See
TLcdNetCDFFilteredModel
javadoc for more information
about these domain objects. Note that NetCDF models typically contain exactly one domain object.
aFilter
- the filterpublic TLspNetCDFLayerBuilder model(ILcdModel aModel)
model
in class ALspLayerBuilder
aModel
- a modelIllegalArgumentException
- if the given model is not a NetCDF modelILcdLayer.getModel()
public TLspNetCDFLayerBuilder 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 null
. In that case, the display name of the model descriptor is used as label.
label
in class ALspLayerBuilder
aLabel
- the labelILcdLayer.getLabel()
public TLspNetCDFLayerBuilder layerType(ILspLayer.LayerType aLayerType)
This method is not supported for NetCDF layers. The default of LayerType#EDITABLE
is used.
layerType
in class ALspLayerBuilder
aLayerType
- the layer typeUnsupportedOperationException
- this method is not supported for NetCDF layersILspLayer.getLayerType()
public TLspNetCDFLayerBuilder layerStyle(TLspLayerStyle aLayerStyle)
ALspLayerBuilder
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)
.layerStyle
in class ALspLayerBuilder
aLayerStyle
- the layer style. Must not be null
. If you want to set the default layer style, set TLspLayerStyle.newBuilder().build()
ILspLayer.getLayerStyle()
,
ILspLayer.setLayerStyle(TLspLayerStyle)
public TLspNetCDFLayerBuilder icon(ILcdIcon aIcon)
ALspLayerBuilder
null
.icon
in class ALspLayerBuilder
aIcon
- the iconILcdLayer.getIcon()