java.awt

Interface Paint

public interface Paint extends Transparency

Defines how color patterns are generated for Graphics2D operations. This is used to perform the draw and fill methods of the graphics object. Instances must be immutable, because the graphics object does not clone them.

Since: 1.1

See Also: PaintContext Color GradientPaint TexturePaint setPaint

UNKNOWN: updated to 1.4

Method Summary
PaintContextcreateContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)
Create the context necessary for performing the color pattern generation.

Method Detail

createContext

public PaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)
Create the context necessary for performing the color pattern generation. The color model is a hint, and may be null for Classpath implementations; however some legacy code may throw a NullPointerException when passed a null. Leaving the color model null provides the most efficiency and leeway in the generation of the color pattern.

Parameters: cm the color model, used as a hint deviceBounds the device space bounding box of the painted area userBounds the user space bounding box of the painted area xform the transformation from user space to device space hints any hints for choosing between rendering alternatives

Returns: the context for performing the paint