public class TLspPlotLayerBuilder extends ALspLayerBuilder
You can configure the following aspects using this builder:
model
: see here
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()
TLspPlotStyle
,
TLcdExpressionFactory
Modifier | Constructor and Description |
---|---|
protected |
TLspPlotLayerBuilder()
Do not subclass TLspPlotLayerBuilder.
|
Modifier and Type | Method and Description |
---|---|
TLspPlotLayerBuilder |
bodyMapScaleRange(TLcdDimensionInterval<TLcdMapScale> aBodyScaleRange)
Sets the scale range for the body of the layer in unitless map scale ratios.
|
TLspPlotLayerBuilder |
bodyScaleRange(ILcdInterval aScaleRange)
Sets a scale range within which the objects are displayed.
|
TLspPlotLayerBuilder |
bodyStyler(TLspPaintState aPaintState,
ILspStyler aStyler)
Sets the styler used for the points in the
BODY paint representation. |
TLspPlotLayerBuilder |
bodyStyles(TLspPaintState aPaintState,
TLspPlotStyle... aStyles)
Sets a (fixed) set of styles to use in this layer for the
BODY paint representation. |
ILspEditableStyledLayer |
build()
Creates a new plot layer using the settings specified on this builder.
|
TLspPlotLayerBuilder |
icon(ILcdIcon aIcon)
Sets the icon of the layer.
|
TLspPlotLayerBuilder |
label(String aLabel)
Sets the label of the layer.
|
TLspPlotLayerBuilder |
labelEditable(boolean aEditable)
Sets whether the labels of the layer should be editable.
|
TLspPlotLayerBuilder |
labelEditor(ILspEditor aEditor)
Sets a custom label editor for the layer, alternatively you can use
labelEditable(boolean) to enable a default label editor. |
TLspPlotLayerBuilder |
labelMapScaleRange(TLcdDimensionInterval<TLcdMapScale> aLabelScaleRange)
Sets the scale range for the labels of the layer in unitless map scale ratios.
|
TLspPlotLayerBuilder |
labelScaleRange(ILcdInterval aScaleRange)
Sets a scale range within which the objects' labels are displayed.
|
TLspPlotLayerBuilder |
labelStyler(TLspPaintState aPaintState,
ILspStyler aLabelStyler)
Sets the given label styler for the given paint state.
|
TLspPlotLayerBuilder |
labelStyles(TLspPaintState aPaintState,
ALspStyle... aLabelStyles)
Sets the given label styles for the given paint state.
|
TLspPlotLayerBuilder |
layerStyle(TLspLayerStyle aLayerStyle)
Set a layer style to be used during the rendering of the layer.
|
TLspPlotLayerBuilder |
layerType(ILspLayer.LayerType aLayerType)
The layer type of plot layers cannot be set.
Sets the layer type of the layer.
|
TLspPlotLayerBuilder |
mandatoryAttributes(ILcdExpression... aMandatoryAttributes)
Set a list of attributes that should always be loaded, regardless of what is necessary for
styling and filtering.
|
TLspPlotLayerBuilder |
mandatoryOrientation(boolean aOrientationMandatory)
Indicates that orientation information should always be loaded, regardless of
styling and filtering.
|
TLspPlotLayerBuilder |
model(ILcdModel aModel)
Sets the model of the layer.
|
static TLspPlotLayerBuilder |
newBuilder()
Creates a new builder.
|
TLspPlotLayerBuilder |
paintingHints(TLspPlotPaintingHints aPaintingHints)
Sets the painting hints to be used by created layers.
|
TLspPlotLayerBuilder |
selectable(boolean aSelectable)
Specifies whether layers should be selectable.
|
getIcon, getLabel, getLayerStyle, getLayerType, getModel
protected TLspPlotLayerBuilder()
public static TLspPlotLayerBuilder newBuilder()
You must set a model on it using model(com.luciad.model.ILcdModel)
.
Default values:
TLspPlotStyle
public TLspPlotLayerBuilder layerType(ILspLayer.LayerType aLayerType)
ILspLayer.LayerType.EDITABLE
.layerType
in class ALspLayerBuilder
aLayerType
- the layer typeILspLayer.getLayerType()
public TLspPlotLayerBuilder model(ILcdModel aModel)
null
.
ILcd2DBoundsIndexedModel
are dynamically/partially loaded and unloaded depending on cache size and visible area.ILcdBounded
.model
in class ALspLayerBuilder
aModel
- a modelILcdLayer.getModel()
public TLspPlotLayerBuilder label(String aLabel)
null
.label
in class ALspLayerBuilder
aLabel
- the labelILcdLayer.getLabel()
public TLspPlotLayerBuilder icon(ILcdIcon aIcon)
null
.icon
in class ALspLayerBuilder
aIcon
- the iconILcdLayer.getIcon()
public TLspPlotLayerBuilder mandatoryAttributes(ILcdExpression... aMandatoryAttributes)
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.
aMandatoryAttributes
- The set of mandatory attributesmandatoryOrientation(boolean)
public TLspPlotLayerBuilder mandatoryOrientation(boolean aOrientationMandatory)
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.
aOrientationMandatory
- Whether the orientation should always be loaded or notmandatoryAttributes(com.luciad.util.expression.ILcdExpression...)
public TLspPlotLayerBuilder bodyStyles(TLspPaintState aPaintState, TLspPlotStyle... aStyles)
BODY
paint representation.
This method delegates to bodyStyler(com.luciad.view.lightspeed.layer.TLspPaintState, com.luciad.view.lightspeed.style.styler.ILspStyler)
. Call bodyStyler(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.
aPaintState
- Paint state for this styleraStyles
- The styles to useTLspPlotStyle
public TLspPlotLayerBuilder bodyStyler(TLspPaintState aPaintState, ILspStyler aStyler)
BODY
paint representation.
Special considerations:
TLspPlotStyle
.ALspStyleTargetProvider
to extract the actual point geometry out of the domain object. It must return ILcdPoint
objects (that optionally also implement ILcdOriented
).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.
aPaintState
- Paint state for this styleraStyler
- The styler to usebodyStyles(com.luciad.view.lightspeed.layer.TLspPaintState, com.luciad.view.lightspeed.style.TLspPlotStyle...)
public TLspPlotLayerBuilder bodyScaleRange(ILcdInterval aScaleRange)
TLspPlotStyle.Builder.automaticScaling(double)
.aScaleRange
- The scale rangepublic TLspPlotLayerBuilder bodyMapScaleRange(TLcdDimensionInterval<TLcdMapScale> aBodyScaleRange)
TLspPlotStyle.Builder.automaticScaling(double)
.aBodyScaleRange
- the scale range for the body of the layerthis
public TLspPlotLayerBuilder labelStyler(TLspPaintState aPaintState, ILspStyler aLabelStyler)
If you need control over other labeling aspects such as positioning or priorities, use an ALspLabelStyler
.
toString()
). See also TLspDataObjectLabelTextProviderStyle.Use either labelStyler(com.luciad.view.lightspeed.layer.TLspPaintState, com.luciad.view.lightspeed.style.styler.ILspStyler)
or labelStyles(com.luciad.view.lightspeed.layer.TLspPaintState, com.luciad.view.lightspeed.style.ALspStyle...)
, not both.
aPaintState
- the paint state for which to set the label styleraLabelStyler
- the new label styler for the layerthis
public TLspPlotLayerBuilder labelStyles(TLspPaintState aPaintState, ALspStyle... aLabelStyles)
toString()
). See also TLspDataObjectLabelTextProviderStyle.Use either labelStyler(com.luciad.view.lightspeed.layer.TLspPaintState, com.luciad.view.lightspeed.style.styler.ILspStyler)
or labelStyles(com.luciad.view.lightspeed.layer.TLspPaintState, com.luciad.view.lightspeed.style.ALspStyle...)
, not both.
aPaintState
- the paint state for which to set the label stylesaLabelStyles
- the new label styles for the layerthis
public TLspPlotLayerBuilder labelScaleRange(ILcdInterval aScaleRange)
aScaleRange
- The scale rangepublic TLspPlotLayerBuilder labelMapScaleRange(TLcdDimensionInterval<TLcdMapScale> aLabelScaleRange)
aLabelScaleRange
- the scale range for the labels of the layerthis
public TLspPlotLayerBuilder paintingHints(TLspPlotPaintingHints aPaintingHints)
TLspPlotPaintingHints.newBuilder().build()
. The hints must not be
null
.aPaintingHints
- the painting hints to be usedthis
public TLspPlotLayerBuilder selectable(boolean aSelectable)
aSelectable
- true if layers should be selectablepublic TLspPlotLayerBuilder labelEditable(boolean aEditable)
aEditable
- whether the labels of the layer should be editablethis
labelEditor(ILspEditor)
public TLspPlotLayerBuilder labelEditor(ILspEditor aEditor)
labelEditable(boolean)
to enable a default label editor.aEditor
- the label editor for the layerthis
TLspLabelEditor
public TLspPlotLayerBuilder 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 ILspEditableStyledLayer build()
build
in class ALspLayerBuilder