Paint interface defines how color patterns
can be generated for Graphics2D operations. A class
implementing the Paint interface is added to the
Graphics2D context in order to define the color
pattern used by the draw and fill methods.
Instances of classes implementing Paint must be
read-only because the Graphics2D does not clone
these objects when they are set as an attribute with the
setPaint method or when the Graphics2D
object is itself cloned.
PaintContext, Color, GradientPaint, TexturePaint, Graphics2D#setPaint
| Modifier and Type | Method and Description |
|---|---|
| public PaintContext | Returns: thePaintContext for
generating color patterns.the preferred cm, Rectangle ColorModel which represents the most convenient
format for the caller to receive the pixel data, or null
if there is no preference.the device space bounding box
of the graphics primitive being rendered.
Implementations of the deviceBounds, Rectangle2D Paint interface
are allowed to throw NullPointerException
for a null deviceBounds.the user space bounding box
of the graphics primitive being rendered.
Implementations of the userBounds, AffineTransform Paint interface
are allowed to throw NullPointerException
for a null userBounds.the xform, RenderingHints AffineTransform from user
space into device space.
Implementations of the Paint interface
are allowed to throw NullPointerException
for a null xform.the set of hints that the context object can use to
choose between rendering alternatives.
Implementations of the hints)Paint interface
are allowed to throw NullPointerException
for a null hints.Creates and returns a |
| createContext | back to summary |
|---|---|
| public PaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints) Creates and returns a
| |