Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public abstract class ArtPaint

  1. Object
  2. ArtPaint

Known subtypesGradientPaint, ImagePaint, SolidPaint

What fills a shape, a stroke or text: a color, a gradient or an image.

Constructors

public ArtPaint()

Methods

public float getOpacity()The paint’s own opacity, 0 to 1.
public void setOpacity(float opacity)Sets the paint’s opacity.
public BlendMode getBlendMode()How this paint combines with the paints listed before it on the same shape.
public void setBlendMode(BlendMode blendMode)Sets the blend mode.
public boolean isEnabled()False when the paint is kept but not drawn.
public void setEnabled(boolean enabled)Turns the paint on or off.
public abstract ArtPaint copy()A deep copy.
protected ArtPaint copyBase(ArtPaint p)Copies the shared properties into p and returns it.
public abstract int colorAt(double x, double y, double[] bbox)The color at a point of paint space.

Inherited methods

Constructor details

ArtPaint

public ArtPaint()

Method details

getOpacity

public float getOpacity()
The paint’s own opacity, 0 to 1.

setOpacity

public void setOpacity(float opacity)
Sets the paint’s opacity.

Parameters

opacity float
0 to 1

getBlendMode

public BlendMode getBlendMode()
How this paint combines with the paints listed before it on the same shape.

setBlendMode

public void setBlendMode(BlendMode blendMode)
Sets the blend mode.

Parameters

blendMode BlendMode
the mode

isEnabled

public boolean isEnabled()
False when the paint is kept but not drawn.

setEnabled

public void setEnabled(boolean enabled)
Turns the paint on or off.

Parameters

enabled boolean
true to draw it

copy

public abstract ArtPaint copy()
A deep copy.

copyBase

protected ArtPaint copyBase(ArtPaint p)
Copies the shared properties into p and returns it.

colorAt

public abstract int colorAt(double x, double y, double[] bbox)
The color at a point of paint space.

Parameters

x double
x in the space of the shape that is painted
y double
y in that space
bbox double[]
the shape’s bounding box as x, y, w, h, for paints relative to it