public class TLspMGRSGridLayerBuilder extends ALspLayerBuilder
ILspLayer
instances that visualize MGRS grid data. The
styling of the MGRS grid and its labels can be done using TLspMGRSGridStyle
.
An example of how to use this builder:
TLspMGRSGridStyle gridStyle = TLspMGRSGridStyle.newBuilder().defaultMGRSGridStyle().build();
ILspLayer layer = TLspMGRSGridLayerBuilder.newBuilder()
.label("MGRS grid")
.style(gridStyle)
.build();
Modifier and Type | Method and Description |
---|---|
ILspStyledLayer |
build()
Creates a new layer instance.
|
static ILcdModel |
createModel(String aModelName,
ILcdEllipsoid aEllipsoid)
Creates a model that can be used by this builder.
|
TLspMGRSGridLayerBuilder |
label(String aLabel)
Sets the label of the layer.
|
TLspMGRSGridLayerBuilder |
layerStyle(TLspLayerStyle aLayerStyle)
Set a layer style to be used during the rendering of the layer.
|
TLspMGRSGridLayerBuilder |
layerType(ILspLayer.LayerType aLayerType)
This method is not supported for MGRS grid layers
|
TLspMGRSGridLayerBuilder |
model(ILcdModel aModel)
Sets the model of the layer.
|
static TLspMGRSGridLayerBuilder |
newBuilder()
Returns a new MGRS grid layer builder
|
TLspMGRSGridLayerBuilder |
overlayLabel(TLspMGRSGridOverlayLabelBuilder aOverlayLabelBuilder,
Object aConstraint)
Adds an overlay label to be used.
|
TLspMGRSGridLayerBuilder |
style(TLspMGRSGridStyle aMGRSGridStyle)
Sets the style to be used by this layer.
|
getIcon, getLabel, getLayerStyle, getLayerType, getModel, icon
public static TLspMGRSGridLayerBuilder newBuilder()
public static ILcdModel createModel(String aModelName, ILcdEllipsoid aEllipsoid)
Creates a model that can be used by this builder. When no model is set on the builder, a default model is used instead. When using this method, it is possible to customize the used ellipsoid and the model name. The model name is used as a default display name for the layer created by this builder.
aModelName
- The desired model nameaEllipsoid
- The ellipsoid on which the MGRS grid is defined.public TLspMGRSGridLayerBuilder model(ILcdModel aModel)
Sets the model of the layer. This model should be created using the createModel
method of this class. If not, an IllegalArgumentException
is thrown.
Calling this method is optional. If not called, a default model is used.
model
in class ALspLayerBuilder
aModel
- a modelIllegalArgumentException
- if the given model is not created using the createModel
method.ILcdLayer.getModel()
public TLspMGRSGridLayerBuilder label(String aLabel)
""MGRS Grid""
.label
in class ALspLayerBuilder
aLabel
- the labelILcdLayer.getLabel()
public TLspMGRSGridLayerBuilder layerType(ILspLayer.LayerType aLayerType)
layerType
in class ALspLayerBuilder
aLayerType
- the layer typeUnsupportedOperationException
- this method is not supported for MGRS grid layersILspLayer.getLayerType()
public TLspMGRSGridLayerBuilder 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 TLspMGRSGridLayerBuilder style(TLspMGRSGridStyle aMGRSGridStyle)
aMGRSGridStyle
- the MGRS grid style to use.public TLspMGRSGridLayerBuilder overlayLabel(TLspMGRSGridOverlayLabelBuilder aOverlayLabelBuilder, Object aConstraint)
aOverlayLabelBuilder
- the overlay label builder used to create an overlay component. It
is not needed to call the TLspMGRSGridOverlayLabelBuilder.view()
method before calling this
method.aConstraint
- an object expressing layout constraints for this component, usually
one of these location
constants.public ILspStyledLayer build()
Creates a new layer instance.
This builder returns an ILspStyledLayer
that contains ILspCustomizableStyler
instances.
build
in class ALspLayerBuilder