| java.awt.Paint
All known Subclasses: java.awt.TexturePaint, java.awt.Color, java.awt.MultipleGradientPaint, java.awt.GradientPaint,
Paint | public interface Paint extends Transparency(Code) | | This 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.
See Also: PaintContext See Also: Color See Also: GradientPaint See Also: TexturePaint See Also: Graphics2D.setPaint version: 1.36, 06/05/07 |
createContext | public PaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)(Code) | | Creates and returns a
PaintContext used to
generate the color pattern.
Since the ColorModel argument to createContext is only a
hint, implementations of Paint should accept a null argument
for ColorModel. Note that if the application does not
prefer a specific ColorModel, the null ColorModel argument
will give the Paint implementation full leeway in using the
most efficient ColorModel it prefers for its raster processing.
Since the API documentation was not specific about this in
releases before 1.4, there may be implementations of
Paint that do not accept a null
ColorModel argument.
If a developer is writing code which passes a null
ColorModel argument to the
createContext method of Paint
objects from arbitrary sources it would be wise to code defensively
by manufacturing a non-null ColorModel for those
objects which throw a NullPointerException .
Parameters: cm - the ColorModel that receives thePaint data. This is used only as a hint. Parameters: deviceBounds - the device space bounding boxof the graphics primitive being rendered Parameters: userBounds - the user space bounding box of the graphics primitive being rendered Parameters: xform - the AffineTransform from userspace into device space Parameters: hints - the hint that the context object uses tochoose between rendering alternatives the PaintContext forgenerating color patterns See Also: PaintContext |
|
|