Class StrokeSymbolLayer

  • Direct Known Subclasses:
    SolidStrokeSymbolLayer

    public abstract class StrokeSymbolLayer
    extends SymbolLayer
    Represents a symbol layer intended for use with line geometries. When applied to a polyline geometry, it draws a stroke along that geometry. The StrokeSymbolLayer can also control drawing the outline of a polygon geometry. This symbol layer controls many common operations vital for working with strokes. Width, cap style, and line style 3D are controllable on a StrokeSymbolLayer. These properties provide the ability to pick between various options for rendering strokes. Line style 3D applies only in 3D, but cap style and width have effects in both 2D and 3D.
    Since:
    100.5.0
    • Method Detail

      • getWidth

        public double getWidth()
        Gets the width of the stroke. The default is 0.
        Returns:
        the width of the stroke. Width is defined in dp (density-independent pixels) except StrokeSymbolLayer.LineStyle3D.TUBE, which is defined in meters.
        Since:
        100.5.0
        See Also:
        setWidth(double)
      • setWidth

        public void setWidth​(double width)
        Sets the width of the stroke. The default is 0.

        When getting the width from a multilayer polyline symbol, the value reported is the largest width of all the symbol layers it contains. The symbol width is updated when its symbol layer widths change (if there is a new largest layer width). When setting a new width at the polyline symbol level, the width of the largest symbol layer is given the provided value, and all the smaller layers are sized proportionately. An individual symbol layer can be given a specific width without affecting the other layers.

        Parameters:
        width - Desired width of the stroke; cannot be negative. Width is defined in dp (density-independent pixels) except StrokeSymbolLayer.LineStyle3D.TUBE, which is defined in meters.
        Throws:
        ArcGISRuntimeException - if width is negative
        Since:
        100.5.0
      • getCapStyle

        public StrokeSymbolLayer.CapStyle getCapStyle()
        Gets the cap style for this layer. The default cap style is StrokeSymbolLayer.CapStyle.ROUND. Cap styles affect strokes in MapViews and SceneViews, as well as the 'strip' and 'tube' line styles in SceneViews.
        Returns:
        the cap style
        Since:
        100.5.0