Package com.luciad.view.lightspeed.style
Class TLspParameterizedLineStyle
java.lang.Object
com.luciad.view.lightspeed.style.ALspStyle
com.luciad.view.lightspeed.style.TLspParameterizedLineStyle
- All Implemented Interfaces:
ILspEffectsHintStyle
,ILspWorldElevationStyle
,ILspStyler
public final class TLspParameterizedLineStyle
extends ALspStyle
implements ILspWorldElevationStyle, ILspEffectsHintStyle
Style used to style
ILcdPolyline
. Most properties of this style
can be controlled through expressions
.
Construction of this style is done through its TLspParameterizedLineStyle.Builder
.
The following properties of this style are calculated by an expression:
- Visibility: determines whether the object is displayed or not
- Color: the color of the line
- Opacity: transparency of the line
- Width: determines the width of the line in pixels
For defaults, see TLspParameterizedLineStyle.Builder
.
ILcdExpressionIn this example, the even vertices will be assigned a green color, while uneven will be blue. Between vertices the color will be interpolated between green and blue. Note: -When usingcolor = attribute("ColorAttribute", Color.class, new TLcdExpressionFactory.AttributeValueProvider () { @Override public Color getValue(Object aDomainObject, Object aGeometry) { throw new RuntimeException("Not used for lines"); } @Override public Color getValue(Object aDomainObject, Object aGeometry, int aIndex) { return aIndex % 2 == 0 ? Color.green : Color.blue; } }); TLspParameterizedLineStyle style = TLspParameterizedLineStyle.newBuilder() .color(color) .width(5) .build();
TLcdExpressionFactory.viewPositionAttribute()
, the view position is calculated for each vertex
of the line.
- TLcdExpressionFactory.viewPositionAttribute()
must not be used when the elevation mode is set to
ILspWorldElevationStyle.ElevationMode.ON_TERRAIN
or when the elevation mode is ILspWorldElevationStyle.ElevationMode.OBJECT_DEPENDENT
and all
z-values of the geometry are 0.- Since:
- 2018.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builder for parametrized line styles.Nested classes/interfaces inherited from interface com.luciad.view.lightspeed.style.ILspEffectsHintStyle
ILspEffectsHintStyle.EffectsHint
Nested classes/interfaces inherited from interface com.luciad.view.lightspeed.style.ILspWorldElevationStyle
ILspWorldElevationStyle.ElevationMode
-
Method Summary
Modifier and TypeMethodDescriptionCreates a new builder initialized with all the properties of this style.boolean
getColor()
Gets the color expression.Gets the dash pattern.Returns the effects hints specified for this style.Returns the elevation mode of this style.Returns the expression that determines transparency of the line.Returns the expression that determines whether the object should be displayed or not.double
getWidth()
Gets the line width (pixels).int
hashCode()
boolean
isCompatible
(TLspPaintPass aPaintPass) Utility method to determine whether the style is compatible with the given paint pass.boolean
Determines whether this style is transparent.static TLspParameterizedLineStyle.Builder
<?> Creates a new builder with the default values.toString()
Methods inherited from class com.luciad.view.lightspeed.style.ALspStyle
addStyleChangeListener, getZOrder, removeStyleChangeListener, style
-
Method Details
-
newBuilder
Creates a new builder with the default values.- Returns:
- the new builder.
-
asBuilder
Creates a new builder initialized with all the properties of this style. -
getColor
Gets the color expression.- Returns:
- the color
-
getOpacity
Returns the expression that determines transparency of the line.- Returns:
- The expression
-
getVisibility
Returns the expression that determines whether the object should be displayed or not.- Returns:
- The expression
-
isTransparent
public boolean isTransparent()Description copied from class:ALspStyle
Determines whether this style is transparent. Shapes that are transparent can be painted in a different paint phase than shapes that are not transparent.- Specified by:
isTransparent
in classALspStyle
- Returns:
- whether or not this style is transparent
-
getWidth
public double getWidth()Gets the line width (pixels). The returned value is always strictly positive.- Returns:
- the line width
-
getDashPattern
Gets the dash pattern.- Returns:
- the dash pattern
- Since:
- 2018.1
-
getElevationMode
Description copied from interface:ILspWorldElevationStyle
Returns the elevation mode of this style.- Specified by:
getElevationMode
in interfaceILspWorldElevationStyle
- Returns:
- The elevation mode.
-
getEffectsHints
Description copied from interface:ILspEffectsHintStyle
Returns the effects hints specified for this style.- Specified by:
getEffectsHints
in interfaceILspEffectsHintStyle
- Returns:
- the effects hints specified for this style
-
isCompatible
Description copied from class:ALspStyle
Utility method to determine whether the style is compatible with the given paint pass. A style and paint pass are compatible if they use or request the same terrain and transparency properties.- Overrides:
isCompatible
in classALspStyle
- Parameters:
aPaintPass
- the paint pass- Returns:
true
if the style can be used in the given paint pass,false otherwise
.
-
equals
-
hashCode
public int hashCode() -
toString
-