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
ConstructorsModifierConstructorDescriptionprotected
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
-
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 is
ILspLayer.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 is
null
.- 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 is
null
.- Overrides:
label
in classALspLayerBuilder
- Parameters:
aLabel
- the label- Returns:
- this builder
- See Also:
-
icon
Sets the icon of the layer.The default value is
null
.- 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 use
TLspPlotStyle.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 use
TLspPlotStyle.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
ALspLabelStyler
.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. -