Class TLspComplexStrokedLineStyle

java.lang.Object
com.luciad.view.lightspeed.style.ALspStyle
com.luciad.view.lightspeed.style.TLspComplexStrokedLineStyle
All Implemented Interfaces:
ILspWorldElevationStyle, ILspStyler

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();
 

Since:
2013.1
See Also:
  • Method Details

    • newBuilder

      public static TLspComplexStrokedLineStyle.Builder<?> newBuilder()
      Creates a new stroked line style builder with the default values.
      Returns:
      the new builder.
    • asBuilder

      public TLspComplexStrokedLineStyle.Builder<?> asBuilder()
      Description copied from class: ALspStyle
      Creates a new builder initialized with all the properties of this style.
      Specified by:
      asBuilder in class ALspStyle
      Returns:
      the new builder.
    • 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 class ALspStyle
      Returns:
      whether or not this style is transparent
    • getElevationMode

      public ILspWorldElevationStyle.ElevationMode getElevationMode()
      Description copied from interface: ILspWorldElevationStyle
      Returns the elevation mode of this style.
      Specified by:
      getElevationMode in interface ILspWorldElevationStyle
      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. See TLspComplexStrokedLineStyle.Builder.sharpAngleThreshold(double) for more information.
      Returns:
      the sharp angle threshold for complex stroked lines.
      See Also:
    • getScalingMode

      public TLspComplexStrokedLineStyle.ScalingMode getScalingMode()
      Returns the scaling mode.
      Returns:
      the scaling mode.
      See Also:
    • getHaloThickness

      public int getHaloThickness()
      Returns the halo thickness.
      Returns:
      the halo thickness.
    • getHaloColor

      public Color getHaloColor()
      Returns the halo color.
      Returns:
      the halo color.
    • getModulationColor

      public 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

      public boolean equals(Object o)
      Overrides:
      equals in class ALspStyle
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class ALspStyle
    • toString

      public String toString()
      Overrides:
      toString in class Object