Class TLspComplexStrokedLineStyle
- All Implemented Interfaces:
ILspWorldElevationStyle
,ILspStyler
Style that can be used to apply complex strokes to a shape's outline. A stroked line style is essentially a series of strokes, which are positioned in a pattern along the line to which the style is applied, or which are positioned once at a specific location.
A TLspComplexStrokedLineStyle
consists of ALspComplexStrokes
, along with a few properties that affect the visualization, such as the
elevation mode and halo settings.
A TLspComplexStrokedLineStyle
defines how a line is painted. It combines a number of
stroke patterns,
that are for example repeated along the line, or added as a decoration at the start or end.
It is possible to combine decorations and regular of fallback strokes by using
ALspComplexStroke.combineWithRegularStroking
or ALspComplexStroke.combineWithFallbackStroking
.
Decorations, regular repeated patterns and fallback patterns can be created using ALspComplexStroke
.
These patterns can be composed to form more complex strokes patterns.
Example code:
#import static com.luciad.view.lightspeed.style.complexstroke.ALspComplexStroke.*;
// Create a complex stroked line style
TLspComplexStrokedLineStyle style = TLspComplexStrokedLineStyle.newBuilder()
// Blue arrow consisting of two lines
.decoration( 0.0f, combineWithRegularStroking(
compose( line( 10, 0, 0, 5, 1, Color.blue ),
line( 10, 0, 0, -5, 1, Color.blue ) )
) )
// Dashed line
.regular( append( parallelLine( 6, 0, 1, 0, Color.black ),
gap( 6 ),
parallelLine( 3, 0, 1, 0, Color.red ),
gap( 6 ) ) )
.build();
- Since:
- 2013.1
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder that can createTLspComplexStrokedLineStyle
instances.static enum
The scaling mode defines how lengths, widths and heights of stroke patterns are interpreted.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
Returns the elevation mode of this style.Returns the halo color.int
Returns the halo thickness.Gets the color that is modulated with the stroke.double
getScale()
Returns the stroke pattern scale factor.Returns the scaling mode.double
Returns the sharp angle threshold for complex stroked lines.int
hashCode()
boolean
Determines whether this style is transparent.static TLspComplexStrokedLineStyle.Builder
<?> Creates a new stroked line style builder with the default values.toString()
Methods inherited from class com.luciad.view.lightspeed.style.ALspStyle
addStyleChangeListener, getZOrder, isCompatible, removeStyleChangeListener, style
-
Method Details
-
newBuilder
Creates a new stroked line style builder with the default values.- Returns:
- the new builder.
-
asBuilder
Description copied from class:ALspStyle
Creates a new builder initialized with all the properties of this style. -
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
-
getElevationMode
Description copied from interface:ILspWorldElevationStyle
Returns the elevation mode of this style.- Specified by:
getElevationMode
in interfaceILspWorldElevationStyle
- Returns:
- The elevation mode.
-
getScale
public double getScale()Returns the stroke pattern scale factor. For example, when a scale factor is 2, the size of the stroke patterns is doubled.
This style parameter makes it easier to dynamically switch between view and world scaling. I can for example be needed to use view scaled strokes when zoomed out, and to switch to world scaled strokes when zooming in. When the switch should be made at a scale of 0.01, this means that at that scale level, 1 pixel should correspond to 100 world units. So when switching to world scaling, you can use a scale factor of 100.
TLspComplexStrokedLineStyle style = ...; TLspComplexStrokedLineStyle newStyle = style.asBuilder() .scalingMode( WORLD_SCALING ) .scale( 100.0 ) .build();
- Returns:
- the scale factor.
-
getSharpAngleThreshold
public double getSharpAngleThreshold()Returns the sharp angle threshold for complex stroked lines. SeeTLspComplexStrokedLineStyle.Builder.sharpAngleThreshold(double)
for more information.- Returns:
- the sharp angle threshold for complex stroked lines.
- See Also:
-
getScalingMode
Returns the scaling mode.- Returns:
- the scaling mode.
- See Also:
-
getHaloThickness
public int getHaloThickness()Returns the halo thickness.- Returns:
- the halo thickness.
-
getHaloColor
Returns the halo color.- Returns:
- the halo color.
-
getModulationColor
Gets the color that is modulated with the stroke. For example using a stroke with gray-scale colors and a red modulation color will result in a resulting stroke painted with red hues. The alpha value of the color is also used to determine the opacity of the stroke. The opacity indicates how transparent an object will be rendered.- Returns:
- the modulation color
- Since:
- 2016.1
-
equals
-
hashCode
public int hashCode() -
toString
-