Class ArtPaint
java.lang.Object
com.codename1.art.ArtPaint
- Direct Known Subclasses:
GradientPaint, ImagePaint, SolidPaint
What fills a shape, a stroke or text: a color, a gradient or an image.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract intcolorAt(double x, double y, double[] bbox) The color at a point of paint space.abstract ArtPaintcopy()A deep copy.protected ArtPaintCopies the shared properties intopand returns it.How this paint combines with the paints listed before it on the same shape.floatThe paint's own opacity, 0 to 1.booleanFalse when the paint is kept but not drawn.voidsetBlendMode(BlendMode blendMode) Sets the blend mode.voidsetEnabled(boolean enabled) Turns the paint on or off.voidsetOpacity(float opacity) Sets the paint's opacity.
-
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: 0 to 1
-
getBlendMode
How this paint combines with the paints listed before it on the same shape. -
setBlendMode
Sets the blend mode.
Parameters
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: true to draw it
-
copy
A deep copy. -
copyBase
-
colorAt
public abstract int colorAt(double x, double y, double[] bbox) The color at a point of paint space.
Parameters
x: x in the space of the shape that is paintedy: y in that spacebbox: the shape's bounding box asx, y, w, h, for paints relative to it
-