public class TLspAPP6ALayerBuilder extends ALspLayerBuilder
APP6 shapes
.
The layer will contain two paint representations that can be controlled separately:
TLspPaintRepresentation.BODY
: the main bodyTLspPaintRepresentation.LABEL
: the labels
For non-line symbols, the body visualisation consists of an icon.
For line
symbols, the
body visualisation depends on the symbol. It typically consists of a line or area.
Basic customization of the visualization is possible using an ILcdAPP6AStyle.
If the domain object implements ILcdAPP6AStyled, then the style will be retrieved from it.
Otherwise, a default style
is used.
Other customization of the visualization is possible by setting a custom body
or label
styler. This layer builder installs a TLspAPP6ASymbolStyler by default. This styler
recognizes domain objects which implement ILcdAPP6ACoded and
ILcdAPP6AStyled. Replacing the default
styler with a custom one allows APP6 symbology to be used on domain objects which do not
implement these interfaces, as well as making all sorts of other customizations possible
(e.g. additional decorations or labels on symbols).
ILcdAPP6AShape
Modifier and Type | Method and Description |
---|---|
TLspAPP6ALayerBuilder |
bodyEditable(boolean aEditable)
Sets whether the body of the symbols should be editable.
|
TLspAPP6ALayerBuilder |
bodyMapScaleRange(TLcdDimensionInterval<TLcdMapScale> aBodyScaleRange)
Sets the scale range for the body of the layer in unitless map scale ratios.
|
TLspAPP6ALayerBuilder |
bodyScaleRange(ILcdInterval aBodyScaleRange)
Sets the scale range for the body of the symbols.
|
TLspAPP6ALayerBuilder |
bodyStyler(TLspPaintState aPaintState,
ILspStyler aStyler)
Sets the given body styler for the given paint state.
The styler can specify a
TLspAPP6ASymbolStyle to paint the object as an APP6
symbol. |
ILspInteractivePaintableLayer |
build()
Creates and returns a new APP-6A layer based on the current parameters of this builder.
|
TLspAPP6ALayerBuilder |
culling(boolean aUseCulling)
Sets whether objects outside the visible view portion are culled and not painted.
|
TLspAPP6ALayerBuilder |
defaultStyle(ILcdAPP6AStyle aDefaultStyle)
Sets the default symbology style that will be used if a domain object does not itself contain
any styling.
|
TLspAPP6ALayerBuilder |
filter(ILcdDynamicFilter aFilter)
Sets a filter that will be used to filter objects to prevent them from
being painted by the layer.
|
TLspAPP6ALayerBuilder |
icon(ILcdIcon aIcon)
Sets the icon of the layer.
|
TLspAPP6ALayerBuilder |
iconProvider(TLcdAPP6AObjectIconProvider aIconProvider)
Override the default icon provider.
|
TLspAPP6ALayerBuilder |
label(String aLabel)
Sets the label of the layer.
|
TLspAPP6ALayerBuilder |
labelMapScaleRange(TLcdDimensionInterval<TLcdMapScale> aLabelScaleRange)
Sets the scale range for the labels of the layer in unitless map scale ratios.
|
TLspAPP6ALayerBuilder |
labelScaleRange(ILcdInterval aLabelScaleRange)
Sets the scale range for the labels of the symbols.
|
TLspAPP6ALayerBuilder |
labelStyler(TLspPaintState aPaintState,
ILspStyler aStyler)
Sets the given label styler for the given paint state.
The styler can specify a
TLspAPP6ASymbolStyle to paint the standard APP6 symbol
labels. |
TLspAPP6ALayerBuilder |
layerStyle(TLspLayerStyle aLayerStyle)
Set a layer style to be used during the rendering of the layer.
|
TLspAPP6ALayerBuilder |
layerType(ILspLayer.LayerType aLayerType)
Sets the layer type of the layer.
|
TLspAPP6ALayerBuilder |
model(ILcdModel aModel)
Sets the model of the layer.
|
static TLspAPP6ALayerBuilder |
newBuilder() |
TLspAPP6ALayerBuilder |
objectViewMargin(double aObjectViewMargin)
Sets the largest possible difference (in pixels) between an object's model bounds and its
painted representation's bounds that should be taken into account.
|
TLspAPP6ALayerBuilder |
objectWorldMargin(double aObjectWorldMargin)
Sets the largest possible difference (in meters) between an object's model bounds and its
painted representation's bounds that should be taken into account.
|
TLspAPP6ALayerBuilder |
selectable(boolean aSelectable)
Sets whether the symbols should be selectable.
|
getIcon, getLabel, getLayerStyle, getLayerType, getModel
public static TLspAPP6ALayerBuilder newBuilder()
public ILspInteractivePaintableLayer build()
build
in class ALspLayerBuilder
public TLspAPP6ALayerBuilder bodyStyler(TLspPaintState aPaintState, ILspStyler aStyler)
TLspAPP6ASymbolStyle
to paint the object as an APP6
symbol.
You can also specify the following styles to paint custom geometry or decorations:
TLspFillStyle
: can be applied to closed shapes such as circles or polygonsTLspLineStyle
: can be applied to closed and non-closed shapes such as arcs and polylinesTLspComplexStrokedLineStyle
: can be applied to closed and non-closed shapes such as arcs and polylinesTLspWorldSizedLineStyle
: can be applied to closed and non-closed shapes such as arcs and polylinesTLspIconStyle
: can be applied to point shapes and point listsTLsp3DIconStyle
: can be applied to point shapes and point listsTLspVerticalLineStyle
: can be applied to point shapes and point listsILcdAPP6AShape
as
geometry to get the visualization as specified by the standard. Other ILcdShape
's are
also supported as geometry for most symbols.
Note that the created layer will not have the specified styler directly as its body styler.aPaintState
- the paint state for which to set the body styleraStyler
- the new body styler for the layerthis
public TLspAPP6ALayerBuilder labelStyler(TLspPaintState aPaintState, ILspStyler aStyler)
TLspAPP6ASymbolStyle
to paint the standard APP6 symbol
labels.
You can also specify the following styles to paint custom labels:
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 framesTLspLabelOpacityStyle
to specify the opacity and modulation color.TLspPinLineStyle
to draw pins for the labels (see
TLspLabelPainter
)ILcdAPP6AShape
as
geometry to get the visualization as specified by the standard. Other ILcdShape
's are
also supported as geometry for most symbols.
Note that the created layer will not have the specified styler directly as its label styler.aPaintState
- the paint state for which to set the label styleraStyler
- the new label styler for the layerthis
public TLspAPP6ALayerBuilder defaultStyle(ILcdAPP6AStyle aDefaultStyle)
aDefaultStyle
- The default stylepublic TLspAPP6ALayerBuilder iconProvider(TLcdAPP6AObjectIconProvider aIconProvider)
aIconProvider
- The new icon providerpublic TLspAPP6ALayerBuilder layerType(ILspLayer.LayerType aLayerType)
ALspLayerBuilder
ILspLayer.LayerType.EDITABLE
.layerType
in class ALspLayerBuilder
aLayerType
- the layer typeILspLayer.getLayerType()
public TLspAPP6ALayerBuilder bodyEditable(boolean aEditable)
aEditable
- whether the body of the symbols should be editablepublic TLspAPP6ALayerBuilder bodyScaleRange(ILcdInterval aBodyScaleRange)
aBodyScaleRange
- the scale range for the body of the symbolspublic TLspAPP6ALayerBuilder bodyMapScaleRange(TLcdDimensionInterval<TLcdMapScale> aBodyScaleRange)
aBodyScaleRange
- the scale range for the body of the layerthis
public TLspAPP6ALayerBuilder culling(boolean aUseCulling)
aUseCulling
- whether the layer should use culling or notpublic TLspAPP6ALayerBuilder filter(ILcdDynamicFilter aFilter)
aFilter
- the filterthis
public TLspAPP6ALayerBuilder icon(ILcdIcon aIcon)
ALspLayerBuilder
null
.icon
in class ALspLayerBuilder
aIcon
- the iconILcdLayer.getIcon()
public TLspAPP6ALayerBuilder 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 TLspAPP6ALayerBuilder label(String aLabel)
ALspLayerBuilder
null
.label
in class ALspLayerBuilder
aLabel
- the labelILcdLayer.getLabel()
public TLspAPP6ALayerBuilder labelScaleRange(ILcdInterval aLabelScaleRange)
aLabelScaleRange
- the scale range for the labels of the symbols. If aLabelScaleRange is null, labels will always be displayed.public TLspAPP6ALayerBuilder labelMapScaleRange(TLcdDimensionInterval<TLcdMapScale> aLabelScaleRange)
aLabelScaleRange
- the scale range for the labels of the layerthis
public TLspAPP6ALayerBuilder model(ILcdModel aModel)
ALspLayerBuilder
null
.model
in class ALspLayerBuilder
aModel
- a modelILcdLayer.getModel()
public TLspAPP6ALayerBuilder selectable(boolean aSelectable)
aSelectable
- whether the symbols should be selectablepublic TLspAPP6ALayerBuilder objectViewMargin(double aObjectViewMargin)
culling
is enabled). It ensures, for example, that a model element is still painted if its visual
representation falls inside the view, but its model bounds do not.
If for example view-sized icons are used to represent points on the map, the icon could be 16
by 16 pixels, whereas the object itself is a point, having a zero size. Depending on where the
point is located in the icon, the required margin for this example can be up to 16 pixels.
The drawback of setting a too large value is a performance loss. The drawback of setting a too
small value is that objects (e.g. icons) disappear when they are located partly outside the
view.
You can also configure a maximum distance in meters
.
The default value is 32
.aObjectViewMargin
- the maximum difference (in pixels)this
public TLspAPP6ALayerBuilder objectWorldMargin(double aObjectWorldMargin)
culling
is enabled). It ensures, for example, that a model element is still painted if its visual
representation falls inside the view, but its model bounds do not.
If for example circles are used to represent points on the map, the circle could have a radius
of 1km, whereas the object itself is a point, having a zero size. The required margin for this
example is 1000 meters.
The drawback of setting a too large value is a performance loss. The drawback of setting a too
small value is that objects (e.g. icons) disappear when they are located partly outside the
view.
You can also configure a maximum distance in pixels
.
The default value is 0
.aObjectWorldMargin
- the maximum difference in metersthis