Class SolidStrokeSymbolLayer


  • public final class SolidStrokeSymbolLayer
    extends StrokeSymbolLayer
    Represents a polyline geometry symbolized with a solid color.

    This symbol layer, if it is the sole symbol layer in a MultilayerSymbol, colors the geometry of the line with the specified solid color. The class also allows setting a collection of GeometricEffect which modify the stroke in various ways.

    It is also used to represent the Web Scene specification's LineSymbol3DLayer and PathSymbol3DLayer. LineSymbol3DLayer is represented by StrokeSymbolLayer.LineStyle3D.STRIP, and PathSymbol3DLayer is represented by StrokeSymbolLayer.LineStyle3D.TUBE.

    The SolidStrokeSymbolLayer provides a similar user experience to the SimpleLineSymbolHandle, but, since it is a symbol layer, can be used in a MultilayerSymbol. The simple line styles of the SimpleLineSymbol are represented here by DashGeometricEffect, but all dash patterns are custom.

    A SolidStrokeSymbolLayer in a MultilayerPolygonSymbol will act as the outline of the fill.

    Since:
    100.5.0
    • Constructor Detail

      • SolidStrokeSymbolLayer

        public SolidStrokeSymbolLayer​(double width,
                                      int color,
                                      java.lang.Iterable<GeometricEffect> geometricEffects)
        Creates a solid stroke symbol layer with the given width, color, and geometric effects. The other properties are defaulted as follows: cap style is StrokeSymbolLayer.CapStyle.ROUND, and the 3D line style is StrokeSymbolLayer.LineStyle3D.STRIP.
        Parameters:
        width - the width of the stroke in dp (density-independent pixels) for all line styles except StrokeSymbolLayer.LineStyle3D.TUBE, which is defined in meters.
        color - the color of the stroke in the format 0xAARRGGBB
        geometricEffects - the geometric effects of the stroke
        Throws:
        java.lang.IllegalArgumentException - if geometricEffects is null
        Since:
        100.5.0
      • SolidStrokeSymbolLayer

        public SolidStrokeSymbolLayer​(double width,
                                      int color,
                                      java.lang.Iterable<GeometricEffect> geometricEffects,
                                      StrokeSymbolLayer.LineStyle3D lineStyle3D)
        Creates a solid stroke symbol layer with the given width, color, geometric effects and 3D line style. Cap style is defaulted to StrokeSymbolLayer.CapStyle.ROUND.
        Parameters:
        width - the width of the stroke in dp (density-independent pixels) for all line styles except StrokeSymbolLayer.LineStyle3D.TUBE, which is defined in meters.
        color - the color of the stroke in the format 0xAARRGGBB
        geometricEffects - the geometric effects of the stroke
        lineStyle3D - the 3D line style of the stroke
        Throws:
        java.lang.IllegalArgumentException - if geometricEffects or lineStyle3D are null
        Since:
        100.5.0
    • Method Detail

      • getColor

        public int getColor()
        Gets the color of a solid stroke symbol layer. The default color is opaque black, 0xff000000.

        The solid color of the SolidStrokeSymbolLayer. The stroke will render with the specified color. When getting the color from a symbol, the consensus value (for all layers) is reported. If there is no consensus (one or more layers have different colors), a null value is reported for the color. Likewise, setting a value for color on a symbol will apply that color to all layers the symbol contains.

        If you don't want changes to the symbol color to propagate to some of the symbol layers it contains, you can lock the color for those layers. If a symbol layer is color-locked, changes to the parent symbol will not affect the symbol layer. This also means that the layer will not be considered when determining a consensus color for the symbol as a whole.

        Returns:
        the color of the stroke in the format 0xAARRGGBB
        Since:
        100.5.0
      • setColor

        public void setColor​(int color)
        Sets the color of a solid stroke symbol layer. The default color is opaque black, 0xff000000.

        The solid color of the SolidStrokeSymbolLayer. The stroke will render with the specified color. When getting the color from a symbol, the consensus value (for all layers) is reported. If there is no consensus (one or more layers have different colors), a null value is reported for the color. Likewise, setting a value for color on a symbol will apply that color to all layers the symbol contains.

        If you don't want changes to the symbol color to propagate to some of the symbol layers it contains, you can lock the color for those layers. If a symbol layer is color-locked, changes to the parent symbol will not affect the symbol layer. This also means that the layer will not be considered when determining a consensus color for the symbol as a whole.

        Parameters:
        color - the color of the stroke in the format 0xAARRGGBB
        Since:
        100.5.0
      • getGeometricEffects

        public java.util.List<GeometricEffect> getGeometricEffects()
        Gets a list of the geometric effects. The list is modifiable and effects can be added or removed.
        Returns:
        the collection of geometric effects
        Since:
        100.5.0