public class TLspLonLatGridLayerBuilder extends ALspLayerBuilder
ILspLayer
instances that visualize grid data.
This builder is the recommended way of creating a lon-lat grid layer.
Use labelStyler(com.luciad.view.lightspeed.layer.TLspPaintState, com.luciad.view.lightspeed.style.styler.ILspStyler) and bodyStyler(com.luciad.view.lightspeed.layer.TLspPaintState, com.luciad.view.lightspeed.style.styler.ILspStyler) to customize the styling. You have two options:
Use spacingRange(double, double) to customize the spacing between the grid lines.
TLspLonLatGridStyler
,
ILspLonLatGridLine
Modifier and Type | Field and Description |
---|---|
static String |
GRID_TYPE_NAME
An identifying type for grid layers.
|
Modifier | Constructor and Description |
---|---|
protected |
TLspLonLatGridLayerBuilder()
Creates a new layer builder.
|
Modifier and Type | Method and Description |
---|---|
TLspLonLatGridLayerBuilder |
bodyStyler(TLspPaintState aPaintState,
ILspStyler aBodyStyler)
Define a styler to be used for body representations.
|
ILspLayer |
build()
Creates a new layer instance.
|
static ILcdModel |
createModel(String aModelName)
Creates a model that can be used by this builder.
|
static ILcdModel |
createModel(String aModelName,
ILcdGeodeticDatum aDatum)
Creates a model that can be used by this builder.
|
TLspLonLatGridLayerBuilder |
label(String aLabel)
Sets the label of the layer.
|
TLspLonLatGridLayerBuilder |
labelStyler(TLspPaintState aPaintState,
ILspStyler aLabelStyler)
Define a styler to be used for label representations.
|
TLspLonLatGridLayerBuilder |
layerStyle(TLspLayerStyle aLayerStyle)
Set a layer style to be used during the rendering of the layer.
|
TLspLonLatGridLayerBuilder |
layerType(ILspLayer.LayerType aLayerType)
Sets the layer type of the layer.
|
TLspLonLatGridLayerBuilder |
model(ILcdModel aModel)
Sets the model of the layer.
|
static TLspLonLatGridLayerBuilder |
newBuilder() |
TLspLonLatGridLayerBuilder |
spacingRange(double aMinimumScale,
double aSpacing)
Configure the spacing of the grid lines at a certain view scale.
|
getIcon, getLabel, getLayerStyle, getLayerType, getModel, icon
public static final String GRID_TYPE_NAME
protected TLspLonLatGridLayerBuilder()
TLspLonLatGridStyler
s.public static TLspLonLatGridLayerBuilder newBuilder()
TLspLonLatGridStyler
spublic static ILcdModel createModel(String aModelName)
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 model name which is used as a default display name for the layer created by this builder.
The lon lat grid based on the created model will be based on the geodetic datum of the world reference from the
view in which it is visualized. In order to use a different geodetic datum, the
createModel
method can be used.
This model should not be shared between different layers.
aModelName
- The desired model namepublic static ILcdModel createModel(String aModelName, ILcdGeodeticDatum aDatum)
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 following:
This model should not be shared between different layers.
aModelName
- The desired model namepublic TLspLonLatGridLayerBuilder bodyStyler(TLspPaintState aPaintState, ILspStyler aBodyStyler)
You can use a TLspLonLatGridStyler
, or a styler that can handle ILspLonLatGridLine
objects.
aPaintState
- the paint state to use the styler foraBodyStyler
- the stylerpublic TLspLonLatGridLayerBuilder labelStyler(TLspPaintState aPaintState, ILspStyler aLabelStyler)
You can use a TLspLonLatGridStyler
, or a styler that can handle ILspLonLatGridLine
objects.
aPaintState
- the paint state to use the styler foraLabelStyler
- the stylerpublic TLspLonLatGridLayerBuilder spacingRange(double aMinimumScale, double aSpacing)
Use multiple calls to set different thresholds. The layer will use the spacing that corresponds to the configured scale just below the view scale.
If this call is not used, the default set of scaling ranges is used. The example below shows the default set.
TLspLonLatGridLayerBuilder.newBuilder() .spacingRange(0.048, 1/60.0) // zoomed in .spacingRange(0.024, 1/12.0) .spacingRange(0.012, 1/6.0) .spacingRange(0.006, 1/2.0) .spacingRange(0.0012, 1) .spacingRange(0.000336, 5) .spacingRange(0.0000672, 10) .spacingRange(0, 30) // zoomed out .build()
aMinimumScale
- The scale below which this spacing becomes activeaSpacing
- The spacing between the lines, in degreespublic ILspLayer build()
ALspLayerBuilder
Creates a new layer instance.
build
in class ALspLayerBuilder
public TLspLonLatGridLayerBuilder model(ILcdModel aModel)
ALspLayerBuilder
null
.model
in class ALspLayerBuilder
aModel
- a modelILcdLayer.getModel()
public TLspLonLatGridLayerBuilder label(String aLabel)
ALspLayerBuilder
null
.label
in class ALspLayerBuilder
aLabel
- the labelILcdLayer.getLabel()
public TLspLonLatGridLayerBuilder layerType(ILspLayer.LayerType aLayerType)
ALspLayerBuilder
ILspLayer.LayerType.EDITABLE
.layerType
in class ALspLayerBuilder
aLayerType
- the layer typeILspLayer.getLayerType()
public TLspLonLatGridLayerBuilder 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)