public class TLspS52LayerBuilder extends ALspLayerBuilder
Supports models
for an individual cell, or for whole catalogues.
Example:
String source = ...; ILcdModelDecoder decoder = new TLcdS57UnifiedModelDecoder(); ILcdModel s57Model = decoder.decode( source ); ILspLayer layer = TLspS52LayerBuilder.newBuilder().model(s57Model).build();
Note: it is not allowed to wrap the output of the S57 model decoder in an ordered model.
TLcdS52GXYLayerFactory to create layers in GXY view.
Modifier and Type | Method and Description |
---|---|
ILspInteractivePaintableLayer |
build()
Creates the layer.
|
TLspS52LayerBuilder |
filter(ILcdDynamicFilter aFilter)
Specify a filter on the objects on this layer.
|
TLspS52LayerBuilder |
icon(ILcdIcon aIcon)
Sets the icon of the layer.
|
TLspS52LayerBuilder |
label(String aLabel)
Sets the label of the layer.
|
TLspS52LayerBuilder |
layerStyle(TLspLayerStyle aLayerStyle)
Set a layer style to be used during the rendering of the layer.
|
TLspS52LayerBuilder |
layerType(ILspLayer.LayerType aLayerType)
Sets the layer type of the layer.
|
TLspS52LayerBuilder |
model(ILcdModel aModel)
Sets the model the layer should be created for.
|
static TLspS52LayerBuilder |
newBuilder()
Creates a new builder with default settings.
|
TLspS52LayerBuilder |
opacity(float aOpacity)
Sets the overall transparency of the layer with a
TLspLayerStyle . |
TLspS52LayerBuilder |
s52DisplaySettings(TLcdS52DisplaySettings aDisplaySettings)
Specify the
S52 display settings to use in this layer. |
TLspS52LayerBuilder |
s52ProductConfiguration(TLcdS52ProductConfiguration aProductConfiguration)
Specify the
S52 product configuration to use in this layer. |
TLspS52LayerBuilder |
s52Symbology(ILcdS52Symbology aSymbology)
Specify the
S52 symbology to use in this layer. |
TLspS52LayerBuilder |
s57ProductConfiguration(TLcdS57ProductConfiguration aProductConfiguration)
Specify the
S57 product configuration to use in this layer. |
TLspS52LayerBuilder |
selectable(boolean aSelectable)
Sets whether the elements in the layer should be selectable.
|
getIcon, getLabel, getLayerStyle, getLayerType, getModel
public ILspInteractivePaintableLayer build()
Before building the layer, you must have set a model
.
build
in class ALspLayerBuilder
IllegalStateException
- if no model has been specifiedpublic TLspS52LayerBuilder model(ILcdModel aModel)
Sets the model the layer should be created for.
Setting a model is mandatory.
The model must be an S57 model: it must have aTLcdS57CatalogueModelDescriptor
or TLcdS57ModelDescriptor
and contain S57 objects
.
Note: it is not allowed to wrap the output of the S57 model decoder in an ordered model.
model
in class ALspLayerBuilder
aModel
- a model, not null
IllegalArgumentException
- if the model is not a proper S57 model or when the model is
an
ordered model.ILcdLayer.getModel()
public TLspS52LayerBuilder label(String aLabel)
ALspLayerBuilder
null
.label
in class ALspLayerBuilder
aLabel
- the labelILcdLayer.getLabel()
public TLspS52LayerBuilder icon(ILcdIcon aIcon)
ALspLayerBuilder
null
.icon
in class ALspLayerBuilder
aIcon
- the iconILcdLayer.getIcon()
public TLspS52LayerBuilder s52DisplaySettings(TLcdS52DisplaySettings aDisplaySettings)
S52 display settings
to use in this layer.
This call is optional. If not specified, the default TLcdS52DisplaySettings
will be
used.
aDisplaySettings
- S52 display settings to use.public TLspS52LayerBuilder s57ProductConfiguration(TLcdS57ProductConfiguration aProductConfiguration)
S57 product configuration
to use in this layer.
This call is optional. It is only necessary when you have customized S-57 attributes.
If not specified, the default
will be used.
This product configuration should preferable be the one used when decoding the S-57 model.
aProductConfiguration
- S57 product configuration to use.public TLspS52LayerBuilder s52ProductConfiguration(TLcdS52ProductConfiguration aProductConfiguration)
S52 product configuration
to use in this layer.
This call is optional. If not specified, the default
will be used.
The S52 product configuration is only used to create the ILcdS52Symbology
,
but you can also call s52Symbology(com.luciad.format.s52.ILcdS52Symbology)
to specify a custom ILcdS52Symbology
directly.
aProductConfiguration
- S52 product configuration to use.public TLspS52LayerBuilder s52Symbology(ILcdS52Symbology aSymbology)
S52 symbology
to use in this layer.
This call is optional.
If not specified, the default symbology
from the S-52 product configuration
will be used, based on the display settings
.
aSymbology
- S52 symbology to use.public TLspS52LayerBuilder filter(ILcdDynamicFilter aFilter)
Operations on this layer will only be applied to objects of the model that pass the filter. This includes painting, labeling, selection, editing, ...
This call is optional. If not specified, no filter is applied.
See ALcdDynamicFilter
for a convenience class that handles change listeners and
events.
aFilter
- The filter to setpublic TLspS52LayerBuilder selectable(boolean aSelectable)
By default, this is on (true).
aSelectable
- whether the layer should be selectablepublic TLspS52LayerBuilder layerType(ILspLayer.LayerType aLayerType)
ALspLayerBuilder
ILspLayer.LayerType.EDITABLE
.layerType
in class ALspLayerBuilder
aLayerType
- the layer typeILspLayer.getLayerType()
public TLspS52LayerBuilder opacity(float aOpacity)
TLspLayerStyle
.
By default, this is 1 (fully opaque).
aOpacity
- Transparency of the new layer, between 0 (fully transparent) and 1 (fully
opaque).public TLspS52LayerBuilder 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 static TLspS52LayerBuilder newBuilder()
Before using build()
to create the layer, you must specify a model
.