Class TLspPlotStyle.Builder<B extends TLspPlotStyle.Builder<B>>
- All Implemented Interfaces:
ILspWorldElevationStyle.Builder
- Direct Known Subclasses:
TLspPlotStyle.Builder
- Enclosing class:
TLspPlotStyle
Default values:
visibility(com.luciad.util.expression.ILcdExpression<java.lang.Boolean>)
: true (all objects visible)scale(com.luciad.util.expression.ILcdExpression<java.lang.Float>)
: 1 (original icon size)modulationColor(com.luciad.util.expression.ILcdExpression<java.awt.Color>)
: white (original icon is not modified)opacity(com.luciad.util.expression.ILcdExpression<java.lang.Float>)
: 1 (original icon is not modified)icon(com.luciad.util.expression.ILcdExpression<? extends com.luciad.gui.ILcdIcon>)
: null (white dots are displayed)useOrientation(boolean)
: false (icons are aligned to the screen, not using usingILcdOriented
)automaticScaling(double)
: off (icons are not rescaled depending on zoom level)density(boolean)
: off (no density plot is derived from the icons)eyeDomeLighting(com.luciad.view.lightspeed.style.TLspEyeDomeLightingSettings)
: off (eye-dome lighting is disabled)
- Since:
- 2014.0
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSets all parameters on the builder based on the given style.automaticScaling
(double aTargetWorldSize) Enables automatic scaling of icons based on the zoom level / distance to the camera.build()
Builds the style with the set parameters.density
(boolean aDensity) Sets whether or not density should be painted.density
(IndexColorModel aIndexColorModel, double aHardness) Sets the density parameters for the density painting.Specifies the elevation mode.eyeDomeLighting
(TLspEyeDomeLightingSettings aEyeDomeLightingSettings) Sets the eye-dome lighting (EDL) settings.Sets an icon to use for all objects.icon
(ILcdExpression<? extends ILcdIcon> aIconExpression) Sets the expression that determines the icon to use.modulationColor
(ILcdExpression<Color> aColorExpression) Sets the expression that determines the modulation color to apply to the icons.modulationColor
(Color aFixedColor) Sets a fixed modulation color to apply to all icons.opacity
(float aFixedOpacity) Sets a fixed opacity to apply to all icons.opacity
(ILcdExpression<Float> aOpacityExpression) Sets the expression that determines the transparency to apply to the icons.scale
(float aFixedScale) Sets a fixed scale factor to apply to all icons.scale
(ILcdExpression<Float> aScaleExpression) Sets the expression that determines the scale factor to apply to the icons.useOrientation
(boolean aOrientationEnabled) Sets whether the icon should respect its orientation.visibility
(ILcdExpression<Boolean> aVisibilityExpression) Sets the expression that determines whether objects should be displayed or not.Methods inherited from class com.luciad.view.lightspeed.style.ALspStyle.Builder
equals, hashCode
-
Constructor Details
-
Builder
protected Builder()
-
-
Method Details
-
all
Description copied from class:ALspStyle.Builder
Sets all parameters on the builder based on the given style. This is useful for example to create a new style that has almost all properties equal to another style.- Specified by:
all
in classALspStyle.Builder<B extends TLspPlotStyle.Builder<B>>
- Parameters:
aStyle
- the style to copy- Returns:
this
-
build
Description copied from class:ALspStyle.Builder
Builds the style with the set parameters.- Specified by:
build
in classALspStyle.Builder<B extends TLspPlotStyle.Builder<B>>
- Returns:
- the resulting style
-
elevationMode
Specifies the elevation mode. The default mode depends on the specific implementation. Only 'ON_TERRAIN' and 'ABOVE_ELLIPSOID' are supported for this style.- Specified by:
elevationMode
in interfaceILspWorldElevationStyle.Builder
- Parameters:
aMode
-- Returns:
this
-
visibility
Sets the expression that determines whether objects should be displayed or not.If not set, all objects in view are always displayed.
- Parameters:
aVisibilityExpression
- An expression of type Boolean- Returns:
- this
-
scale
Sets the expression that determines the scale factor to apply to the icons.- Scale
1
corresponds to the original size of the icon. - Scale
<1
will shrink the icon. - Scale
>1
will enlarge the icon.
If not set, icons are never re-scaled.
Note that you can apply
automaticScaling(double)
based on zoom level.- Parameters:
aScaleExpression
- An expression of type Float- Returns:
- this
- Scale
-
scale
Sets a fixed scale factor to apply to all icons. Seescale(ILcdExpression)
for more details.- Parameters:
aFixedScale
- The scale factor to apply- Returns:
- this
-
density
Sets whether or not density should be painted. The default is false. Alternatively, usedensity(IndexColorModel, double)
to enable and configure the density plot. Turning density on is incompatible with enablingeyeDomeLighting(com.luciad.view.lightspeed.style.TLspEyeDomeLightingSettings)
(EDL). Trying to combine both will result in an IllegalStateException to be thrown.- Parameters:
aDensity
- True if density should be painted, false if density should not be painted.- Returns:
- this
-
density
Sets the density parameters for the density painting. Using this method will also turn density on. Turning density on is incompatible with enablingeyeDomeLighting(com.luciad.view.lightspeed.style.TLspEyeDomeLightingSettings)
(EDL). Trying to combine both will result in an IllegalStateException to be thrown.- Parameters:
aIndexColorModel
- a color model to use to visualize density (maps occurrence counts to color)aHardness
- A value between 0 and 1 to determine how "hard" the density visualization should be. 0 is the softest value, and will result in a smooth transition from one point to the other. 1 is the hardest value, and will result in a sharp transition from one point to the other.- Returns:
- this
- See Also:
-
automaticScaling
Enables automatic scaling of icons based on the zoom level / distance to the camera.Icons will be rendered with a given size in world coordinates (typically meters), but will be clamped to their native size in view coordinates (pixels). The effect of this is that icons will get smaller if you zoom out, but will not get magnified if you zoom in. In 3D views, the icons will also be subject to perspective (i.e. icons will get smaller towards the horizon). This is equivalent to TLspIconStyle.ScalingMode.WORLD_SCALING_CLAMPED.
Enabling this option is strongly recommended:
- It reduces cluttering when zoomed out (2D), or of far away data (3D)
- It improves performance
If not set, icons are not rescaled based on zoom level.
This setting can be combined with a custom
scale(com.luciad.util.expression.ILcdExpression<java.lang.Float>)
expression.- Parameters:
aTargetWorldSize
- the maximum world size icons should be drawn at- Returns:
- this
-
modulationColor
Sets the expression that determines the modulation color to apply to the icons.Color
Color.white
corresponds to the original icon.If not set, icons keep their original color.
- Parameters:
aColorExpression
- An expression of typeColor
- Returns:
- this
-
modulationColor
Sets a fixed modulation color to apply to all icons. SeemodulationColor(com.luciad.util.expression.ILcdExpression<java.awt.Color>)
for more details.- Parameters:
aFixedColor
- The modulation color to apply to all icons- Returns:
- this
-
opacity
Sets the expression that determines the transparency to apply to the icons. This value is multiplied with the alpha value of the modulation color to determine the transparency of the icon.- Opacity
1
corresponds to the original transparency icon. - Opacity
<1
will make the icons more transparent. - Opacity
0
or<0
will make the icons completely transparent. - Opacity
>1
has no effect.
If not set, icons keep their original opacity determined by the alpha value of the modulation color.
- Parameters:
aOpacityExpression
- An expression of type Float- Returns:
- this
- Opacity
-
opacity
Sets a fixed opacity to apply to all icons. Seeopacity(ILcdExpression)
for more details.- Parameters:
aFixedOpacity
- The opacity to apply- Returns:
- this
-
icon
Sets the expression that determines the icon to use.Use
null
to display dots instead of icons.If not set, dots are used (equivalent of
null
).- Parameters:
aIconExpression
- An expression of typeILcdIcon
- Returns:
- this
-
icon
Sets an icon to use for all objects. Seeicon(ILcdExpression)
for more details.- Parameters:
aIcon
- The icon to use- Returns:
- this
-
useOrientation
Sets whether the icon should respect its orientation. By default, this is set to false. The actual orientation that is applied to the icon will be retrieved from theILcdOriented
interface. Either the geometry returned by theALspStyleTargetProvider
or the model object should implement this interface. The geometry takes precedence if both objects implement this interface. The orientation is interpreted as an azimuth. If the geometry or domain object do not implementILcdOriented
, this option has no effect.- Parameters:
aOrientationEnabled
- a flag indicating whether or not the icon should respect its orientation- Returns:
this
-
eyeDomeLighting
Sets the eye-dome lighting (EDL) settings. By default, EDL is disabled. SeeTLspEyeDomeLightingSettings
for more details. Enabling EDL is incompatible with adensity plot
. Trying to combine both will result in an IllegalStateException to be thrown.- Parameters:
aEyeDomeLightingSettings
- The settings to use- Returns:
- this
- Since:
- 2019.1
-