public class TLspNVGLayerBuilder extends ALspLayerBuilder
TLspNVGStyler
for bodies and labels by default.TLspShapeLayerBuilder
.layer
using
a custom TLspNVGStyler
or a custom ILspStyler
:
TLspNVGStyler nvgStyler = new TLspNVGStyler(); TLspNVGStyler customNVGStyler = new CustomNVGStyler(); ILspStyler customLabelStyler = new MyCustomLabelStyler(); TLspNVGLayerBuilder.newBuilder() .model(model) .bodyStyler(TLspPaintState.REGULAR, nvgStyler) .bodyStyler(TLspPaintState.SELECTED, customNVGStyler) .labelStyler(TLspPaintState.REGULAR, customLabelStyler) .labelStyler(TLspPaintState.SELECTED, customLabelStyler) .build();See
TLspNVGStyler
for more details on customization.
Modifier and Type | Method and Description |
---|---|
TLspNVGLayerBuilder |
bodyEditable(boolean aEditable)
Sets whether the body of the symbols should be editable.
|
TLspNVGLayerBuilder |
bodyScaleRange(ILcdInterval aBodyScaleRange)
Sets the scale range for the body of the symbols.
|
TLspNVGLayerBuilder |
bodyStyler(TLspPaintState aPaintState,
ILspStyler aStyler)
Sets the given body styler for the given paint state.
|
ILspInteractivePaintableLayer |
build()
Creates a new layer instance.
|
TLspNVGLayerBuilder |
culling(boolean aUseCulling)
Sets whether objects outside the visible view portion are culled and not painted.
|
TLspNVGLayerBuilder |
editableSupported(boolean aEditableSupported)
Sets whether the layer should support editing.
|
TLspNVGLayerBuilder |
filter(ILcdDynamicFilter aFilter)
Sets a filter that will be used to filter objects to prevent them from
being painted by the layer.
|
TLspNVGLayerBuilder |
icon(ILcdIcon aIcon)
Sets the icon of the layer.
|
TLspNVGLayerBuilder |
label(String aLabel)
Sets the label of the layer.
|
TLspNVGLayerBuilder |
labelScaleRange(ILcdInterval aLabelScaleRange)
Sets the scale range for the labels of the symbols.
|
TLspNVGLayerBuilder |
labelStyler(TLspPaintState aPaintState,
ILspStyler aLabelStyler)
Sets the given label styler for the given paint state.
|
TLspNVGLayerBuilder |
layerStyle(TLspLayerStyle aLayerStyle)
Set a layer style to be used during the rendering of the layer.
|
TLspNVGLayerBuilder |
layerType(ILspLayer.LayerType aLayerType)
Sets the layer type of the layer.
|
TLspNVGLayerBuilder |
model(ILcdModel aModel)
Sets the model of the layer.
|
static TLspNVGLayerBuilder |
newBuilder() |
TLspNVGLayerBuilder |
selectable(boolean aSelectable)
Sets whether the symbols should be selectable.
|
getIcon, getLabel, getLayerStyle, getLayerType, getModel
public static TLspNVGLayerBuilder newBuilder()
public ILspInteractivePaintableLayer build()
ALspLayerBuilder
Creates a new layer instance.
build
in class ALspLayerBuilder
public TLspNVGLayerBuilder layerType(ILspLayer.LayerType aLayerType)
ALspLayerBuilder
ILspLayer.LayerType.EDITABLE
.layerType
in class ALspLayerBuilder
aLayerType
- the layer typeILspLayer.getLayerType()
public TLspNVGLayerBuilder bodyEditable(boolean aEditable)
aEditable
- whether the body of the symbols should be editablepublic TLspNVGLayerBuilder bodyScaleRange(ILcdInterval aBodyScaleRange)
aBodyScaleRange
- the scale range for the body of the symbolspublic TLspNVGLayerBuilder culling(boolean aUseCulling)
aUseCulling
- whether the layer should use culling or notpublic TLspNVGLayerBuilder filter(ILcdDynamicFilter aFilter)
aFilter
- the filterthis
public TLspNVGLayerBuilder icon(ILcdIcon aIcon)
ALspLayerBuilder
null
.icon
in class ALspLayerBuilder
aIcon
- the iconILcdLayer.getIcon()
public TLspNVGLayerBuilder label(String aLabel)
ALspLayerBuilder
null
.label
in class ALspLayerBuilder
aLabel
- the labelILcdLayer.getLabel()
public TLspNVGLayerBuilder labelScaleRange(ILcdInterval aLabelScaleRange)
aLabelScaleRange
- the scale range for the labels of the symbolspublic TLspNVGLayerBuilder model(ILcdModel aModel)
ALspLayerBuilder
null
.model
in class ALspLayerBuilder
aModel
- a modelILcdLayer.getModel()
public TLspNVGLayerBuilder 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 TLspNVGLayerBuilder selectable(boolean aSelectable)
aSelectable
- whether the symbols should be selectablepublic TLspNVGLayerBuilder bodyStyler(TLspPaintState aPaintState, ILspStyler aStyler)
TLspNVGStyler
is set, with the appropriate TLspPaintState
.
See shape layer builder
for the list of supported styles.aPaintState
- the paint state for which to set the body styleraStyler
- the new body styler for the layerthis
public TLspNVGLayerBuilder labelStyler(TLspPaintState aPaintState, ILspStyler aLabelStyler)
TLspNVGStyler
is set, with the appropriate TLspPaintState
.
See shape layer builder
for the list of supported styles.aPaintState
- the paint state for which to set the label styleraLabelStyler
- the new label styler for the layerthis
public TLspNVGLayerBuilder editableSupported(boolean aEditableSupported)
aEditableSupported
- whether the layer should support edition.TLspShapeLayerBuilder.editableSupported(boolean)