public class TLspComplexStrokedLineStyle extends ALspStyle implements ILspWorldElevationStyle
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();
ALspComplexStroke
Modifier and Type | Class and Description |
---|---|
static class |
TLspComplexStrokedLineStyle.Builder<B extends TLspComplexStrokedLineStyle.Builder<B>>
Builder that can create
TLspComplexStrokedLineStyle
instances. |
static class |
TLspComplexStrokedLineStyle.ScalingMode
The scaling mode defines how lengths, widths and heights of stroke patterns are interpreted.
|
ILspWorldElevationStyle.ElevationMode
Modifier and Type | Method and Description |
---|---|
TLspComplexStrokedLineStyle.Builder<?> |
asBuilder()
Creates a new builder initialized with all the properties of this style.
|
boolean |
equals(Object o) |
ILspWorldElevationStyle.ElevationMode |
getElevationMode()
Returns the elevation mode of this style.
|
Color |
getHaloColor()
Returns the halo color.
|
int |
getHaloThickness()
Returns the halo thickness.
|
Color |
getModulationColor()
Gets the color that is modulated with the stroke.
|
double |
getScale()
Returns the stroke pattern scale factor.
|
TLspComplexStrokedLineStyle.ScalingMode |
getScalingMode()
Returns the scaling mode.
|
double |
getSharpAngleThreshold()
Returns the sharp angle threshold for complex stroked lines.
|
int |
hashCode() |
boolean |
isTransparent()
Determines whether this style is transparent.
|
static TLspComplexStrokedLineStyle.Builder<?> |
newBuilder()
Creates a new stroked line style builder with the default values.
|
String |
toString() |
addStyleChangeListener, getZOrder, isCompatible, removeStyleChangeListener, style
public static TLspComplexStrokedLineStyle.Builder<?> newBuilder()
public TLspComplexStrokedLineStyle.Builder<?> asBuilder()
ALspStyle
public boolean isTransparent()
ALspStyle
isTransparent
in class ALspStyle
public ILspWorldElevationStyle.ElevationMode getElevationMode()
ILspWorldElevationStyle
getElevationMode
in interface ILspWorldElevationStyle
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();
public double getSharpAngleThreshold()
TLspComplexStrokedLineStyle.Builder.sharpAngleThreshold(double)
for
more information.TLspComplexStrokedLineStyle.Builder.sharpAngleThreshold(double)
public TLspComplexStrokedLineStyle.ScalingMode getScalingMode()
TLspComplexStrokedLineStyle.ScalingMode
public int getHaloThickness()
public Color getHaloColor()
public Color getModulationColor()