Class TLspPlotLayerBuilder
- Direct Known Subclasses:
TLspPlotLayerBuilder
You can configure the following aspects using this builder:
model
: seehere
for restrictionsplot styles
label styles
mandatory attributes and orientation
scale range
See newBuilder()
for default values.
To customize the styling, you need to use a TLspPlotStyle
, or a styler that submits TLspPlotStyle
s.
Example:
ILspLayer layer = TLspPLotLayerBuilder.newBuilder() .model(myModel) .label("Plots") .bodyStyles(REGULAR, TLspPlotStyle.newBuilder()....build() .build()
- Since:
- 2014.0
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
Do not subclass TLspPlotLayerBuilder. -
Method Summary
Modifier and TypeMethodDescriptionbodyMapScaleRange
(TLcdDimensionInterval<TLcdMapScale> aBodyScaleRange) Sets the scale range for the body of the layer in unitless map scale ratios.bodyScaleRange
(ILcdInterval aScaleRange) Sets a scale range within which the objects are displayed.bodyStyler
(TLspPaintState aPaintState, ILspStyler aStyler) Sets the styler used for the points in theBODY
paint representation.bodyStyles
(TLspPaintState aPaintState, TLspPlotStyle... aStyles) Sets a (fixed) set of styles to use in this layer for theBODY
paint representation.build()
Creates a new plot layer using the settings specified on this builder.Sets the icon of the layer.Sets the label of the layer.labelEditable
(boolean aEditable) Sets whether the labels of the layer should be editable.labelEditor
(ILspEditor aEditor) Sets a custom label editor for the layer, alternatively you can uselabelEditable(boolean)
to enable a default label editor.labelMapScaleRange
(TLcdDimensionInterval<TLcdMapScale> aLabelScaleRange) Sets the scale range for the labels of the layer in unitless map scale ratios.labelScaleRange
(ILcdInterval aScaleRange) Sets a scale range within which the objects' labels are displayed.labelStyler
(TLspPaintState aPaintState, ILspStyler aLabelStyler) Sets the given label styler for the given paint state.labelStyles
(TLspPaintState aPaintState, ALspStyle... aLabelStyles) Sets the given label styles for the given paint state.layerStyle
(TLspLayerStyle aLayerStyle) Set a layer style to be used during the rendering of the layer.layerType
(ILspLayer.LayerType aLayerType) The layer type of plot layers cannot be set. Sets the layer type of the layer.mandatoryAttributes
(ILcdExpression... aMandatoryAttributes) Set a list of attributes that should always be loaded, regardless of what is necessary for styling and filtering.mandatoryOrientation
(boolean aOrientationMandatory) Indicates that orientation information should always be loaded, regardless of styling and filtering.Sets the model of the layer.static TLspPlotLayerBuilder
Creates a new builder.paintingHints
(TLspPlotPaintingHints aPaintingHints) Sets the painting hints to be used by created layers.selectable
(boolean aSelectable) Specifies whether layers should be selectable.Methods inherited from class com.luciad.view.lightspeed.layer.ALspLayerBuilder
getIcon, getLabel, getLayerStyle, getLayerType, getModel
-
Constructor Details
-
TLspPlotLayerBuilder
protected TLspPlotLayerBuilder()Do not subclass TLspPlotLayerBuilder. Attempting to do so will throw IllegalStateExceptions.- Since:
- 2014.0
-
-
Method Details
-
newBuilder
Creates a new builder.You must set a model on it using
model(com.luciad.model.ILcdModel)
.Default values:
- attributes: not set (no mandatory attributes)
- style(r): default
TLspPlotStyle
- scale range: not set (always visible)
- Returns:
- A builder
-
layerType
The layer type of plot layers cannot be set. Sets the layer type of the layer. The default value isILspLayer.LayerType.EDITABLE
.- Overrides:
layerType
in classALspLayerBuilder
- Parameters:
aLayerType
- the layer type- Returns:
- this builder
- See Also:
-
model
Sets the model of the layer. The default value isnull
.- Models that are
ILcd2DBoundsIndexedModel
are dynamically/partially loaded and unloaded depending on cache size and visible area. - Other models are processed entirely. The domain objects must be
ILcdBounded
.
- Overrides:
model
in classALspLayerBuilder
- Parameters:
aModel
- a model- Returns:
- this builder
- See Also:
- Models that are
-
label
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 isnull
.- Overrides:
label
in classALspLayerBuilder
- Parameters:
aLabel
- the label- Returns:
- this builder
- See Also:
-
icon
Sets the icon of the layer. The default value isnull
.- Overrides:
icon
in classALspLayerBuilder
- Parameters:
aIcon
- the icon- Returns:
- this builder
- See Also:
-
mandatoryAttributes
Set a list of attributes that should always be loaded, regardless of what is necessary for styling and filtering.
This call is optional. The layer will automatically determine the necessary attributes based on the expressions inside
TLspPlotStyle
.However, if at runtime a new style is set with other attributes, the layer will have to process the new attributes. To avoid this processing, you can set the super-set of all attributes you may need up front.
- Parameters:
aMandatoryAttributes
- The set of mandatory attributes- Returns:
- this
- See Also:
-
mandatoryOrientation
Indicates that orientation information should always be loaded, regardless of styling and filtering.
This call is optional. The layer will automatically determine if orientation is necessary based on the
TLspPlotStyle
.However, if at runtime a new style is set with different orientation settings, the layer will have to process the data again. To avoid this processing, you can set the super-set of all attributes you may need up front.
- Parameters:
aOrientationMandatory
- Whether the orientation should always be loaded or not- Returns:
- this
- See Also:
-
bodyStyles
Sets a (fixed) set of styles to use in this layer for theBODY
paint representation.This method delegates to
bodyStyler(com.luciad.view.lightspeed.layer.TLspPaintState, com.luciad.view.lightspeed.style.styler.ILspStyler)
. CallbodyStyler(com.luciad.view.lightspeed.layer.TLspPaintState, com.luciad.view.lightspeed.style.styler.ILspStyler)
with a custom styler if you need to change styles at runtime after creation.If not set, a default
TLspPlotStyle
is used.- Parameters:
aPaintState
- Paint state for this styleraStyles
- The styles to use- Returns:
- this
- See Also:
-
bodyStyler
Sets the styler used for the points in theBODY
paint representation.Special considerations:
- It must submit
TLspPlotStyle
. - It must submit the whole, original collection of domain objects. You cannot split styles per object. Instead, you can use expressions to style objects based on rules.
- It is strongly advised (although not mandatory) to re-use the same style instance if it is unchanged.
- You can use a
ALspStyleTargetProvider
to extract the actual point geometry out of the domain object. It must returnILcdPoint
objects (that optionally also implementILcdOriented
).
public void style(Collection<?> aObjects, ALspStyleCollector aStyleCollector, TLspContext aContext) { aStyleCollector.objects(aObjects).geometry(fPointExtractor).style(fStyle).submit(); }
If not set, a default
TLspPlotStyle
is used.- Parameters:
aPaintState
- Paint state for this styleraStyler
- The styler to use- Returns:
- this
- See Also:
- It must submit
-
bodyScaleRange
Sets a scale range within which the objects are displayed. The layer will not paint anything if the view's current scale is outside the given range. If not set, no scale range is used and the layer will always paint itself. Note that to improve performance you can additionally useTLspPlotStyle.Builder.automaticScaling(double)
.- Parameters:
aScaleRange
- The scale range- Returns:
- this
-
bodyMapScaleRange
Sets the scale range for the body of the layer in unitless map scale ratios. This property defines a range of scales in which the bodies of the layer are visible. By default, no scale range is used, meaning that all bodies are visible. Note that to improve performance you can additionally useTLspPlotStyle.Builder.automaticScaling(double)
.- Parameters:
aBodyScaleRange
- the scale range for the body of the layer- Returns:
this
- Since:
- 2021.0
-
labelStyler
Sets the given label styler for the given paint state.If you need control over other labeling aspects such as positioning or priorities, use an
The following styles are supported:ALspLabelStyler
.- TLspTextStyle to get text with a specific font, font color, size, halo etc.
- TLspIconStyle to get custom images.
- ALspLabelTextProviderStyle to specify which text to use (default is
toString()
). See also TLspDataObjectLabelTextProviderStyle.- TLspLabelBoxStyle to specify fill color or frames
- TLspLabelOpacityStyle to specify the opacity and modulation color.
- TLspPinLineStyle to draw pins for the labels.
Use either
labelStyler(com.luciad.view.lightspeed.layer.TLspPaintState, com.luciad.view.lightspeed.style.styler.ILspStyler)
orlabelStyles(com.luciad.view.lightspeed.layer.TLspPaintState, com.luciad.view.lightspeed.style.ALspStyle...)
, not both.- Parameters:
aPaintState
- the paint state for which to set the label styleraLabelStyler
- the new label styler for the layer- Returns:
this
-
labelStyles
Sets the given label styles for the given paint state. The following styles are supported:- TLspTextStyle to get text with a specific font, font color, size, halo etc.
- TLspIconStyle to get custom images.
- ALspLabelTextProviderStyle to specify which text to use (default is
toString()
). See also TLspDataObjectLabelTextProviderStyle.- TLspLabelBoxStyle to specify fill color or frames
- TLspLabelOpacityStyle to specify the opacity and modulation color.
- TLspPinLineStyle to draw pins for the labels.
Use either
labelStyler(com.luciad.view.lightspeed.layer.TLspPaintState, com.luciad.view.lightspeed.style.styler.ILspStyler)
orlabelStyles(com.luciad.view.lightspeed.layer.TLspPaintState, com.luciad.view.lightspeed.style.ALspStyle...)
, not both.- Parameters:
aPaintState
- the paint state for which to set the label stylesaLabelStyles
- the new label styles for the layer- Returns:
this
-
labelScaleRange
Sets a scale range within which the objects' labels are displayed. The layer will not paint any labels if the view's current scale is outside the given range. If not set, no scale range is used and the layer will always paint labels. This can lead to performance problems.- Parameters:
aScaleRange
- The scale range- Returns:
- this
-
labelMapScaleRange
public TLspPlotLayerBuilder labelMapScaleRange(TLcdDimensionInterval<TLcdMapScale> aLabelScaleRange) Sets the scale range for the labels of the layer in unitless map scale ratios. This property defines a range of scales in which the labels of the layer are visible. If not set, no scale range is used and the layer will always paint labels. This can lead to performance problems.- Parameters:
aLabelScaleRange
- the scale range for the labels of the layer- Returns:
this
- Since:
- 2021.0
-
paintingHints
Sets the painting hints to be used by created layers. The default value isTLspPlotPaintingHints.newBuilder().build()
. The hints must not benull
.- Parameters:
aPaintingHints
- the painting hints to be used- Returns:
this
-
selectable
Specifies whether layers should be selectable.- Parameters:
aSelectable
- true if layers should be selectable- Returns:
- this
-
labelEditable
Sets whether the labels of the layer should be editable. A default label editor will be used if no label editor is provided.- Parameters:
aEditable
- whether the labels of the layer should be editable- Returns:
this
- See Also:
-
labelEditor
Sets a custom label editor for the layer, alternatively you can uselabelEditable(boolean)
to enable a default label editor.- Parameters:
aEditor
- the label editor for the layer- Returns:
this
- See Also:
-
layerStyle
Description copied from class:ALspLayerBuilder
Set a layer style to be used during the rendering of the layer.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 callingILspLayer.setLayerStyle(TLspLayerStyle)
.- Overrides:
layerStyle
in classALspLayerBuilder
- Parameters:
aLayerStyle
- the layer style. Must not benull
. If you want to set the default layer style, setTLspLayerStyle.newBuilder().build()
- Returns:
- this
- See Also:
-
build
Creates a new plot layer using the settings specified on this builder.- Specified by:
build
in classALspLayerBuilder
- Returns:
- the new layer instance
-