StrokeStyle

  • StrokeStyle describes the drawing style for one-dimensional entities such as polylines.

  • It includes a nested class, StrokeStyle.Builder, for building StrokeStyle instances.

  • Public methods allow creating solid color, gradient, or transparent stroke styles, getting the stamp style, and checking visibility.

  • StrokeStyle implements the Parcelable interface.

public final class StrokeStyle extends Object
implements Parcelable

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

Nested Class Summary

class StrokeStyle.Builder Builder for StrokeStyle

Inherited Constant Summary

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.
boolean
isVisible()
Gets visibility of this StrokeStyle.
static StrokeStyle.Builder
transparentColorBuilder()
Creates a transparent stroke style 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.

public boolean isVisible ()

Gets visibility of this StrokeStyle.

public static StrokeStyle.Builder transparentColorBuilder ()

Creates a transparent stroke style builder.

Returns
  • a builder of transparent color stroke style.