public java.awt.PaintContext | createContext(java.awt.image.ColorModel cm, java.awt.Rectangle deviceBounds, java.awt.geom.Rectangle2D userBounds, java.awt.geom.AffineTransform xform, java.awt.RenderingHints hints)Creates and returns a {@link 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 .
|