StrokeStyle

  • StrokeStyle defines the visual appearance of lines and borders on one-dimensional map elements like polylines.

  • It offers options to create solid color strokes or gradient strokes using the colorBuilder and gradientBuilder methods respectively.

  • You can customize the stroke with a repeating pattern using the getStamp method, allowing for textured or image-based effects.

  • The class provides a nested Builder class to facilitate the creation and configuration of different stroke styles.

public final class StrokeStyle extends Object

Describes the drawing style for one-dimensional entities such as polylines.

Nested Class Summary

class StrokeStyle.Builder Builder for StrokeStyle

Public Method Summary

static StrokeStyle.Builder
colorBuilder(int color)
Creates a solid color stroke style builder.
StampStyle
getStamp()
Gets stamp style of a stroke.
static StrokeStyle.Builder
gradientBuilder(int fromColor, int toColor)
Creates a gradient stroke style interpolating from fromColor to toColor builder.

Inherited Method Summary

Public Methods

public static StrokeStyle.Builder colorBuilder (int color)

Creates a solid color stroke style builder.

Parameters
color the color of the stroke.
Returns
  • a builder of solid color stroke style.

public StampStyle getStamp ()

Gets stamp style of a stroke.

The stamp style's image is repeated over the stroke. If the image has transparent or semi-transparent portions, the underlying stroke color will show through in those places. Otherwise, the stamped texture/image will completely cover the base stroke.

Returns
  • the stamp style of a stroke.

public static StrokeStyle.Builder gradientBuilder (int fromColor, int toColor)

Creates a gradient stroke style interpolating from fromColor to toColor builder.

Parameters
fromColor color at the beginning of the stroke.
toColor color at the end of the stroke.
Returns
  • a builder of a gradient stroke style.