This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


java.awt
interface Paint

All Superinterfaces:
Transparency
All Known Implementing Classes:
Color, ColorUIResource, SystemColor, GradientPaint, MultipleGradientPaint, LinearGradientPaint, RadialGradientPaint, TexturePaint

public interface Paint
extends Transparency

This Paint interface defines how color patterns can be generated for {@link 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.


Field Summary
 
Fields inherited from class java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
 
Method Summary
 PaintContext
createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)

          Creates and returns a java.awt.PaintContext used to generate the color pattern.
 
Methods inherited from class java.awt.Transparency
getTransparency
 

Method Detail

createContext

public PaintContext createContext(ColorModel cm,
                                  Rectangle deviceBounds,
                                  Rectangle2D userBounds,
                                  AffineTransform xform,
                                  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.

Parameters:
cm - the {@link ColorModel} that receives the Paint data. This is used only as a hint.
deviceBounds - the device space bounding box of the graphics primitive being rendered
userBounds - the user space bounding box of the graphics primitive being rendered
xform - the {@link AffineTransform} from user space into device space
hints - the hint that the context object uses to choose between rendering alternatives
Returns:
the PaintContext for generating color patterns


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.