TLspLayer
and its corresponding builder TLspShapeLayerBuilder
can
deal with density styles.
Consult the class javadoc of TLspShapePainter
for more information on how to use density styling with a regular shape layer.@Deprecated public final class TLspDensityLayerBuilder extends ALspLayerBuilder
ILspLayer
instances that visualize density plots of geometric shapes. This builder is the
recommended way of creating new density plots of a model that contains
ILcdShape
elements.
This layer builder uses the following default settings to allow for easy
layer setup, they can all be overridden using the methods available on this
builder:
TLspDensityPointStyle
,
TLspDensityLineStyle
and
TLspDensityFillStyle
.ALspDensityStyle
instances, the painter also accepts
TLspIconStyle
, TLspLineStyle
, TLspWorldSizedLineStyle
,
and TLspFillStyle
. Note that
the style should use gray-scale colors.Modifier and Type | Method and Description |
---|---|
TLspDensityLayerBuilder |
bodyScaleRange(ILcdInterval aBodyScaleRange)
Deprecated.
Sets the scale range for the body of the layer.
|
TLspDensityLayerBuilder |
bodyStyler(ILspStyler aBodyStyler)
Deprecated.
Sets the given body styler for the given paint state.
The following styles are supported:
TLspDensityFillStyle : can be applied to closed shapes such as circles or polygons
TLspDensityLineStyle : can be applied to closed and non-closed shapes such as arcs and polylines
TLspDensityPointStyle : can be applied to point shapes and point lists
|
TLspDensityLayerBuilder |
bodyStyles(ALspStyle... aBodyStyles)
Deprecated.
Sets the given body styles.
|
ILspInteractivePaintableLayer |
build()
Deprecated.
Creates a new layer instance.
|
TLspDensityLayerBuilder |
culling(boolean aUseCulling)
Deprecated.
Sets whether the layer should use culling or not, enabled by default.
|
TLspDensityLayerBuilder |
densityScaleFactor(float aDensityScaleFactor)
Deprecated.
When replacing the deprecated
TLspDensityPainter with a TLspShapePainter ,
you can specify the density scale factor on the TLspIndexColorModelStyle (see TLspIndexColorModelStyle.getScaleFactor() ). |
TLspDensityLayerBuilder |
elevationMode(ILspWorldElevationStyle.ElevationMode aElevationMode)
Deprecated.
When replacing the deprecated
TLspDensityPainter with a TLspShapePainter ,
you can specify the elevation mode in the density styles (see ALspDensityStyle.getElevationMode() ).
Note that you have to specify the same elevation mode in all the density styles.
Mixing different elevation modes was not supported by this TLspDensityPainter class, and
is also not supported by the TLspShapePainter . |
TLspDensityLayerBuilder |
filter(ILcdDynamicFilter aFilter)
Deprecated.
Sets a filter that will be used to filter objects to prevent them from
being painted by the layer.
|
TLspDensityLayerBuilder |
icon(ILcdIcon aIcon)
Deprecated.
Sets the icon of the layer.
|
TLspDensityLayerBuilder |
indexColorModel(TLspIndexColorModelStyle aIndexColorModelStyle)
Deprecated.
When replacing the deprecated
TLspDensityPainter with a TLspShapePainter ,
you can let the styler submit a TLspIndexColorModelStyle in combination with ALspDensityStyle . |
TLspDensityLayerBuilder |
label(String aLabel)
Deprecated.
Sets the label of the layer.
|
TLspDensityLayerBuilder |
labeled()
Deprecated.
Sets whether to show labels with a default style.
|
TLspDensityLayerBuilder |
labelEditable(boolean aEditable)
Deprecated.
Sets whether the labels of the layer should be editable.
|
TLspDensityLayerBuilder |
labelEditor(ILspEditor aEditor)
Deprecated.
Sets a custom label editor for the layer, alternatively you can use
labelEditable(boolean) to enable a default label editor. |
TLspDensityLayerBuilder |
labelPainter(ILspPainter aPainter)
Deprecated.
Allows setting a custom label painter on the layer.
|
TLspDensityLayerBuilder |
labelScaleRange(ILcdInterval aLabelScaleRange)
Deprecated.
Sets the scale range for the labels of the layer
|
TLspDensityLayerBuilder |
labelStyler(TLspPaintState aPaintState,
ILspStyler aLabelStyler)
Deprecated.
Sets the given label styles for the given paint state.
|
TLspDensityLayerBuilder |
labelStyles(TLspPaintState aPaintState,
ALspStyle... aLabelStyles)
Deprecated.
Sets the given label styles for the given paint state.
|
TLspDensityLayerBuilder |
layerStyle(TLspLayerStyle aLayerStyle)
Deprecated.
Set a layer style to be used during the rendering of the layer.
|
TLspDensityLayerBuilder |
layerType(ILspLayer.LayerType aLayerType)
Deprecated.
Sets the layer type of the layer.
|
TLspDensityLayerBuilder |
minimumObjectSizeForPainting(double aMinimumObjectSizeForPainting)
Deprecated.
Sets the minimum size of an object in the view for it to be painted and handled otherwise.
|
TLspDensityLayerBuilder |
model(ILcdModel aModel)
Deprecated.
Sets the model of the layer.
|
static TLspDensityLayerBuilder |
newBuilder()
Deprecated.
|
static TLspDensityLayerBuilder |
newBuilder(ILspLayer.LayerType aLayerType)
Deprecated.
Creates a TLspDensityLayerBuilder.newBuilder with the given layer type.
|
getIcon, getLabel, getLayerStyle, getLayerType, getModel
public static TLspDensityLayerBuilder newBuilder()
public static TLspDensityLayerBuilder newBuilder(ILspLayer.LayerType aLayerType)
ILspLayer.LayerType.REALTIME
layer type, since it
provides various performance enhancements for dynamic data. Failing to do so may result in a
non-negligible performance cost.aLayerType
- the layer type for the layer built by this builderpublic ILspInteractivePaintableLayer build()
ALspLayerBuilder
Creates a new layer instance.
build
in class ALspLayerBuilder
public TLspDensityLayerBuilder labelEditable(boolean aEditable)
aEditable
- whether the labels of the layer should be editablethis
labelEditor(ILspEditor)
public TLspDensityLayerBuilder labeled()
Object.toString()
method will be used to retrieve the label
text.this
public TLspDensityLayerBuilder bodyStyler(ILspStyler aBodyStyler)
TLspDensityFillStyle
: can be applied to closed shapes such as circles or polygonsTLspDensityLineStyle
: can be applied to closed and non-closed shapes such as arcs and polylinesTLspDensityPointStyle
: can be applied to point shapes and point listsaBodyStyler
- the new body styler for the layerthis
public TLspDensityLayerBuilder bodyStyles(ALspStyle... aBodyStyles)
TLspDensityFillStyle
: can be applied to closed shapes such as circles or polygonsTLspDensityLineStyle
: can be applied to closed and non-closed shapes such as arcs and polylinesTLspDensityPointStyle
: can be applied to point shapes and point listsaBodyStyles
- the new body styles for the layerthis
public TLspDensityLayerBuilder 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.aPaintState
- the paint state for which to set the label styleraLabelStyler
- the new label styler for the layerthis
public TLspDensityLayerBuilder labelStyles(TLspPaintState aPaintState, ALspStyle... aLabelStyles)
toString()
). See also TLspDataObjectLabelTextProviderStyle.aPaintState
- the paint state for which to set the label stylesaLabelStyles
- the new label styles for the layerthis
public TLspDensityLayerBuilder labelPainter(ILspPainter aPainter)
labelStyler(TLspPaintState, ILspStyler)
or
labelStyles(TLspPaintState, ALspStyle...)
methods instead.aPainter
- the label painter for the layerthis
TLspLabelPainter
public TLspDensityLayerBuilder labelEditor(ILspEditor aEditor)
labelEditable(boolean)
to enable a default label editor.aEditor
- the label editor for the layerthis
TLspLabelEditor
public TLspDensityLayerBuilder bodyScaleRange(ILcdInterval aBodyScaleRange)
aBodyScaleRange
- the scale range for the body of the layerthis
public TLspDensityLayerBuilder labelScaleRange(ILcdInterval aLabelScaleRange)
aLabelScaleRange
- the scale range for the labels of the layerthis
public TLspDensityLayerBuilder culling(boolean aUseCulling)
aUseCulling
- whether the layer should use culling or notthis
public TLspDensityLayerBuilder filter(ILcdDynamicFilter aFilter)
aFilter
- the filterthis
@Deprecated public TLspDensityLayerBuilder elevationMode(ILspWorldElevationStyle.ElevationMode aElevationMode)
TLspDensityPainter
with a TLspShapePainter
,
you can specify the elevation mode in the density styles (see ALspDensityStyle.getElevationMode()
).
Note that you have to specify the same elevation mode in all the density styles.
Mixing different elevation modes was not supported by this TLspDensityPainter
class, and
is also not supported by the TLspShapePainter
.ILspWorldElevationStyle.ElevationMode.ABOVE_ELLIPSOID
aElevationMode
- the new elevation modethis
@Deprecated public TLspDensityLayerBuilder indexColorModel(TLspIndexColorModelStyle aIndexColorModelStyle)
TLspDensityPainter
with a TLspShapePainter
,
you can let the styler submit a TLspIndexColorModelStyle
in combination with ALspDensityStyle
.aIndexColorModelStyle
- the new index color modelthis
public TLspDensityLayerBuilder minimumObjectSizeForPainting(double aMinimumObjectSizeForPainting)
applyOnInteract
(which is for example used during selection). A value of 0 will
always paint all objects, no matter how small they appear. Larger values can discard more
objects. This typically improves the painting speed, although it might leave undesirable gaps
in models containing many small objects. The default value is 1 pixel.aMinimumObjectSizeForPainting
- The minimal size, expressed in pixels.this
@Deprecated public TLspDensityLayerBuilder densityScaleFactor(float aDensityScaleFactor)
TLspDensityPainter
with a TLspShapePainter
,
you can specify the density scale factor on the TLspIndexColorModelStyle
(see TLspIndexColorModelStyle.getScaleFactor()
).aDensityScaleFactor
- the scale factor for density valuesthis
public TLspDensityLayerBuilder model(ILcdModel aModel)
ALspLayerBuilder
null
.model
in class ALspLayerBuilder
aModel
- a modelILcdLayer.getModel()
public TLspDensityLayerBuilder label(String aLabel)
ALspLayerBuilder
null
.label
in class ALspLayerBuilder
aLabel
- the labelILcdLayer.getLabel()
public TLspDensityLayerBuilder layerType(ILspLayer.LayerType aLayerType)
ALspLayerBuilder
ILspLayer.LayerType.EDITABLE
.layerType
in class ALspLayerBuilder
aLayerType
- the layer typeILspLayer.getLayerType()
public TLspDensityLayerBuilder icon(ILcdIcon aIcon)
ALspLayerBuilder
null
.icon
in class ALspLayerBuilder
aIcon
- the iconILcdLayer.getIcon()
public TLspDensityLayerBuilder 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)