public final class TLspBUFRLayerBuilder extends ALspLayerBuilder
Layer builder for BUFR models. It implements standard BUFR/SIGWX visualization of a BUFR data model.
An example of how to use this builder:
ILspLayer layer = TLspBUFRLayerBuilder.newBuilder()
.model(model)
.label("My BUFR layer")
.build();
An example of how to add styling to a layer using this builder:
TLcdBUFRStyleSettings styleSettings = TLcdBUFRStyleSettings
.newBuilder()
.sigwxStyleSettings(
TLcdSIGWXStyleSettings
.newBuilder()
.cloudBorderColor(new Color(205, 0, 0))
.cloudBorderLineWidth(1)
.jetStreamLineColor(new Color(0, 139, 0))
.jetStreamLineWidth(3)
.jetStreamWindSymbolColor(new Color(0, 139, 0))
.jetStreamLabelForegroundColor(new Color(0, 139, 0))
.clearAirTurbulenceBorderColor(new Color(255, 255, 0))
.clearAirTurbulenceBorderLineWidth(2)
.volcanoLabelForegroundColor(Color.white)
.volcanoIconColor(Color.red)
.radiationIconColor(Color.red)
.radiationLabelForegroundColor(Color.white)
.stormIconColor(Color.red)
.stormLabelForegroundColor(Color.white)
.build())
.build();
ILspLayer styledLayer = TLspBUFRLayerBuilder.newBuilder()
.model(model)
.styleSettings(styleSettings)
.label("My styled BUFR layer")
.build();
Note that this layer builder cannot handle model tree nodes. In order to visualize a model tree node with multiple BUFR leaf models, one can create a layer tree node for the model tree node, and use this layer builder for the leaf BUFR models. See the Visualize BUFR data on a Lightspeed map tutorial for an example.
Modifier and Type | Method and Description |
---|---|
ILspLayer |
build()
Creates a new layer instance.
|
TLspBUFRLayerBuilder |
icon(ILcdIcon aIcon)
Sets the icon of the layer.
|
TLspBUFRLayerBuilder |
label(String aLabel)
Sets the label of the layer.
|
TLspBUFRLayerBuilder |
layerStyle(TLspLayerStyle aLayerStyle)
Set a layer style to be used during the rendering of the layer.
|
TLspBUFRLayerBuilder |
layerType(ILspLayer.LayerType aLayerType)
Sets the layer type of the layer.
|
TLspBUFRLayerBuilder |
model(ILcdModel aModel)
Sets the model of the layer.
|
static TLspBUFRLayerBuilder |
newBuilder()
Returns a new layer builder with the default settings
|
TLspBUFRLayerBuilder |
selectable(boolean aSelectable)
Sets whether the layer should be selectable
|
TLspBUFRLayerBuilder |
styleSettings(TLcdBUFRStyleSettings aBUFRStyleSettings)
Sets the style settings to use when creating layers
|
getIcon, getLabel, getLayerStyle, getLayerType, getModel
public static TLspBUFRLayerBuilder newBuilder()
public TLspBUFRLayerBuilder selectable(boolean aSelectable)
aSelectable
- whether the layer should be selectablethis
public TLspBUFRLayerBuilder styleSettings(TLcdBUFRStyleSettings aBUFRStyleSettings)
aBUFRStyleSettings
- The style settingsthis
public TLspBUFRLayerBuilder model(ILcdModel aModel)
null
.model
in class ALspLayerBuilder
aModel
- a modelIllegalArgumentException
- if the given model is not a BUFR modelILcdLayer.getModel()
public ILspLayer build()
ALspLayerBuilder
Creates a new layer instance.
build
in class ALspLayerBuilder
public TLspBUFRLayerBuilder label(String aLabel)
ALspLayerBuilder
null
.label
in class ALspLayerBuilder
aLabel
- the labelILcdLayer.getLabel()
public TLspBUFRLayerBuilder layerType(ILspLayer.LayerType aLayerType)
ALspLayerBuilder
ILspLayer.LayerType.EDITABLE
.layerType
in class ALspLayerBuilder
aLayerType
- the layer typeILspLayer.getLayerType()
public TLspBUFRLayerBuilder 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 TLspBUFRLayerBuilder icon(ILcdIcon aIcon)
ALspLayerBuilder
null
.icon
in class ALspLayerBuilder
aIcon
- the iconILcdLayer.getIcon()