BrushCoat


public final class BrushCoat


A BrushCoat represents one coat of ink applied by a brush. It includes a BrushTip that describes the structure of that coat, and a non-empty list of possible BrushPaint objects - each one describes how to render the coat structure, and the one BrushPaint that is actually used is the first one in the list that is compatible with the device and renderer. Multiple BrushCoats can be combined within a single brush; when a stroke drawn by a multi-coat brush is rendered, each coat of ink will be drawn entirely atop the previous coat, even if the stroke crosses over itself, as though each coat were painted in its entirety one at a time.

Summary

Nested types

public final class BrushCoat.Builder

Builder for BrushCoat.

Public constructors

Creates a BrushCoat with the given paint and the default BrushTip.

Creates a BrushCoat with the given tip and paint.

BrushCoat(
    @NonNull BrushTip tip,
    @Size(min = 1) @NonNull List<@NonNull BrushPaint> paintPreferences
)

Creates a BrushCoat with the given BrushTip and ordered preferences for BrushPaint.

Public methods

static final @NonNull BrushCoat.Builder

Returns a new BrushCoat.Builder.

final @NonNull BrushCoat
copy(
    @NonNull BrushTip tip,
    @Size(min = 1) @NonNull List<@NonNull BrushPaint> paintPreferences
)

Creates a copy of this and allows named properties to be altered while keeping the rest unchanged.

boolean
equals(Object other)
final @NonNull List<@NonNull BrushPaint>

An immutable list of the BrushPaint instances to try to use for rendering, in preference order.

final @NonNull BrushTip

The tip used to apply the paint.

int
final @NonNull BrushCoat.Builder

Returns a Builder with values set equivalent to this.

@NonNull String

Public constructors

BrushCoat

Added in 1.1.0-alpha03
public BrushCoat(@NonNull BrushPaint paint)

Creates a BrushCoat with the given paint and the default BrushTip.

Parameters
@NonNull BrushPaint paint

The paint to be applied for this coat.

BrushCoat

Added in 1.1.0-alpha03
public BrushCoat(@NonNull BrushTip tip, @NonNull BrushPaint paint)

Creates a BrushCoat with the given tip and paint.

Parameters
@NonNull BrushTip tip

The tip used to apply the paint.

@NonNull BrushPaint paint

The paint to be applied for this coat.

BrushCoat

Added in 1.1.0-alpha03
public BrushCoat(
    @NonNull BrushTip tip,
    @Size(min = 1) @NonNull List<@NonNull BrushPaint> paintPreferences
)

Creates a BrushCoat with the given BrushTip and ordered preferences for BrushPaint.

Parameters
@NonNull BrushTip tip

The tip used to apply the paint.

@Size(min = 1) @NonNull List<@NonNull BrushPaint> paintPreferences

The paint options to try to use for rendering, in preference order. The first one that is compatible with the renderer and the device will be used.

Public methods

builder

Added in 1.1.0-alpha03
public static final @NonNull BrushCoat.Builder builder()

Returns a new BrushCoat.Builder.

copy

Added in 1.1.0-alpha03
public final @NonNull BrushCoat copy(
    @NonNull BrushTip tip,
    @Size(min = 1) @NonNull List<@NonNull BrushPaint> paintPreferences
)

Creates a copy of this and allows named properties to be altered while keeping the rest unchanged.

Java callers should use Builder instead.

equals

public boolean equals(Object other)

getPaintPreferences

Added in 1.1.0-alpha03
public final @NonNull List<@NonNull BrushPaintgetPaintPreferences()

An immutable list of the BrushPaint instances to try to use for rendering, in preference order. The first one that is compatible with the renderer and the device will be used. Compatibility may be determined by various parameters of a BrushPaint and its underlying BrushPaint.TextureLayer objects. Alternative paints add portability to brushes, so that fallback versions of strokes can be rendered on devices or renderers that have more limited functionality. If no paints are compatible, then this BrushCoat will not be rendered.

getTip

Added in 1.1.0-alpha03
public final @NonNull BrushTip getTip()

The tip used to apply the paint.

hashCode

public int hashCode()

toBuilder

Added in 1.1.0-alpha03
public final @NonNull BrushCoat.Builder toBuilder()

Returns a Builder with values set equivalent to this. Java developers, use the returned builder to build a copy of a BrushCoat.

toString

public @NonNull String toString()