Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public abstract class ArtPaint
- Object
- 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
opacityfloat- 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
blendModeBlendMode- 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
enabledboolean- 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
xdouble- x in the space of the shape that is painted
ydouble- y in that space
bboxdouble[]- the shape’s bounding box as
x, y, w, h, for paints relative to it