Class TLspComplexStrokedLineStyle.Builder<B extends TLspComplexStrokedLineStyle.Builder<B>>

java.lang.Object
com.luciad.view.lightspeed.style.ALspStyle.Builder<B>
com.luciad.view.lightspeed.style.TLspComplexStrokedLineStyle.Builder<B>
All Implemented Interfaces:
ILspWorldElevationStyle.Builder
Enclosing class:
TLspComplexStrokedLineStyle

public static class TLspComplexStrokedLineStyle.Builder<B extends TLspComplexStrokedLineStyle.Builder<B>> extends ALspStyle.Builder<B> implements ILspWorldElevationStyle.Builder
Builder that can create TLspComplexStrokedLineStyle instances.
Since:
2013.1
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • zOrder

      public B zOrder(int aZOrder)
      Sets the Z-order of this style. Styles should be painted from lowest to highest Z-order.

      Increasing the number of different Z-orders can negatively impact painting performance. By default, it is set to 0.

      Parameters:
      aZOrder - the z order
      Returns:
      this
    • sharpAngleThreshold

      public B sharpAngleThreshold(double aSharpAngleThreshold)

      Sets the threshold which is used to determine if angles are sharp or not. It is interpreted as an angle in degrees between two line segments. In the context of complex stroking, sharp corners are handled differently than non-sharp corners.

      In general, a non-sharp corner is handled as if there is no corner at all. This means that any stroke can just be painted along the corner. A side effect of this is that strokes may be deformed. This deformation will be small for corners that are close to 180 degrees wide (i.e. for line segments that are almost parallel). The deformation can become quite large for sharper corners though, so care should be taken when adjusting this value.

      On the other hand when a corner is considered sharp, strokes will not be deformed, but may be dropped instead.

      This setting is for example useful when complex strokes use a uniform shape and color. An example of a usage is when painting an airspace border using a rectangular stroke along the length of the line. In that case, the threshold can be set to 0.

      When multiple complex stroked styles are used for the same objects, the largest threshold value is chosen.

      The default is 155.0 degrees.

      Parameters:
      aSharpAngleThreshold - the threshold which is used to determine if angles are sharp or not. Expressed in degrees. This value should lie between 0 and 180 degrees.
      Returns:
      this
    • decoration

      public B decoration(double aRelativeLocation, ALspComplexStroke aStroke)

      Positions the given stroke pattern at the given location on the line. A default alignment is used: for stroke patterns at the start of the line, this is LEFT, for stroke patterns at the end of the line, this is RIGHT. Otherwise, this is CENTER.

      Note that it is possible to add multiple stroke patterns at the same location. In that case, the strokes will be appended.

      If it is required to combine decorations with the underlying regular of fallback stroke, ALspComplexStroke.combineWithRegularStroking or ALspComplexStroke.combineWithFallbackStroking can be used.

      Parameters:
      aRelativeLocation - the location where the given stroke will be positioned. This location is a relative position on the stroked line. It is a value in the [0, 1] interval, where 0 means the start of the line and 1 means the end of the line.
      aStroke - the stroke pattern.
      Returns:
      this
    • decoration

      public B decoration(double aRelativeLocation, ELcdHorizontalAlignment aAlignment, ALspComplexStroke aStroke)

      Positions the given stroke pattern at the given location on the line. The given alignment is used.

      Note that it is possible to add multiple stroke patterns at the same location. In that case, the strokes will be appended.

      If it is required to combine decorations with the underlying regular of fallback stroke, ALspComplexStroke.combineWithRegularStroking or ALspComplexStroke.combineWithFallbackStroking can be used.

      Parameters:
      aRelativeLocation - the location where the given stroke will be positioned. This location is a relative position on the stroked line. It is a value in the [0, 1] interval, where 0 means the start of the line and 1 means the end of the line.
      aAlignment - determines how the stroke pattern is aligned to the location. For example, when using CENTER the middle of the stroke will coincide with the specified location. When using RIGHT, the right of the stroke pattern will coincide with the specified location (i.e. it will appear left of the location). Can be null, in which case a default alignment is used.
      aStroke - the stroke pattern.
      Returns:
      this
    • regular

      public B regular(ALspComplexStroke aStroke)

      Repeats the given stroke pattern along the line. A regular stroke is painted where no other decoration strokes are painted. The pattern is anchored to the start of the line. Note that it is possible to add multiple regular strokes.

      Some strokes have influence over whether the regular stroke is painted or not, or where it is painted. For more information, see the combineWithRegularStroking stroke pattern wrapper.

      Parameters:
      aStroke - the stroke
      Returns:
      this
    • regular

      public B regular(double aAnchor, ALspComplexStroke aStroke)

      Repeats the given stroke pattern along the line. A regular stroke is painted where no other decoration strokes are painted. The pattern is anchored to the given location on the line. Note that it is possible to add multiple regular strokes.

      Some strokes have influence over whether the regular stroke is painted or not, or where it is painted. For more information, see the combineWithRegularStroking stroke pattern wrapper.

      Parameters:
      aAnchor - the location to which to anchor the repeating pattern. This location is a relative position on the stroked line. It is a value in the [0, 1] interval, where 0 means the start of the line and 1 means the end of the line.
      aStroke - the stroke
      Returns:
      this
    • fallback

      public B fallback(ALspComplexStroke aStroke)

      The given stroke is used when it is not possible to place an other stroke pattern (see decoration, regular). This can happen for example when a line segment is too curved, or when other stroke patterns are dropped because they don't have enough space. It is typically a simple line pattern, using the same color or thickness as the other, more complex, pattern.

      The given fallback stroke is repeated along the line. The pattern is anchored to the start of the line. Note that only one fallback stroke can be used at the same time. When calling this method a second time, the fallback stroke will be replaced. Also note that the stroke pattern in a fallback stroke can be cut off, e.g. when reaching the end of the line, instead of being omitted.

      Some strokes have influence over whether the fallback stroke is painted or not, or where it is painted. For more information, see the combineWithFallbackStroking and combineWithRegularStroking stroke pattern wrappers.

      Parameters:
      aStroke - the stroke
      Returns:
      this
    • fallback

      public B fallback(double aAnchor, ALspComplexStroke aStroke)

      The given stroke is used when it is not possible to place an other stroke pattern (see decoration, regular). This can happen for example when a line segment is too curved, or when other stroke patterns are dropped because they don't have enough space. It is typically a simple line pattern, using the same color or thickness as the other, more complex, pattern.

      The given fallback stroke is repeated along the line. The pattern is anchored to the given location on the line. Note that only one fallback stroke can be used at the same time. When calling this method a second time, the fallback stroke will be replaced. Also note that the stroke pattern in a fallback stroke can be cut off, e.g. when reaching the end of the line, instead of being omitted.

      Some strokes have influence over whether the fallback stroke is painted or not, or where it is painted. For more information, see the combineWithFallbackStroking and combineWithRegularStroking stroke pattern wrappers.

      Parameters:
      aAnchor - the location to which to anchor the repeating pattern. This location is a relative position on the stroked line. It is a value in the [0, 1] interval, where 0 means the start of the line and 1 means the end of the line.
      aStroke - the stroke
      Returns:
      this
    • haloThickness

      public B haloThickness(float aThickness)

      Sets the halo thickness in pixels. Set to zero if no halo should be visible.

      By default the halo is disabled.

      Parameters:
      aThickness - the thickness in pixels
      Returns:
      this
      See Also:
    • haloColor

      public B haloColor(Color aColor)

      Sets the halo color. This property is only used if the halo is enabled.

      By default the halo color is set to white.

      Parameters:
      aColor - the halo color
      Returns:
      this
      Throws:
      IllegalArgumentException - if aColor==null
      See Also:
    • modulationColor

      public B modulationColor(Color aColor)
      Sets 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. This is the most efficient way to make your objects transparent with this style.

      Using a white color has no effect.

      Parameters:
      aColor - the modulation color
      Returns:
      this
      Since:
      2016.1
    • elevationMode

      public B elevationMode(ILspWorldElevationStyle.ElevationMode aMode)
      Description copied from interface: ILspWorldElevationStyle.Builder
      Specifies the elevation mode. The default mode depends on the specific implementation.
      Specified by:
      elevationMode in interface ILspWorldElevationStyle.Builder
      Parameters:
      aMode -
      Returns:
      this
    • scale

      public B scale(double aScaleFactor)

      Sets the stroke pattern scale factor. For example, when a scale factor is 2, the size of the stroke patterns is doubled.

      See getScale() for extra information.

      Parameters:
      aScaleFactor - the scale factor.
      Returns:
      this
      See Also:
    • scalingMode

      public B scalingMode(TLspComplexStrokedLineStyle.ScalingMode aScalingMode)

      Sets the scaling mode. The scaling mode defines how lengths, widths and heights of stroke patterns are interpreted. For example when using VIEW_SCALING, a rectangular stroke pattern with a length of 10 will always have a length of 10 pixels. When using WORLD_SCALING, it will have a length of 10 meters, so its size will vary depending on the zoom level.

      See getScale() for extra information.

      Parameters:
      aScalingMode - the scaling mode
      Returns:
      this
      See Also:
    • all

      public B all(ALspStyle aStyle)
      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 class ALspStyle.Builder<B extends TLspComplexStrokedLineStyle.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 class ALspStyle.Builder<B extends TLspComplexStrokedLineStyle.Builder<B>>
      Returns:
      the resulting style