All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Interface java.awt.Paint

public interface Paint
extends Transparency
This interface defines how color patterns can be generated for Graphics2D operations. Paint is set in the Graphics2D and thereafter the stroke and fill methods will use the color pattern generated by the implementing Paint class.

Instances of classes implementing Paint must be immutable (i.e. 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. This is to avoid undefined behavior of Graphics2D rendering which would result if the Paint object were modified after being set in the Graphics2D state.

See Also:
PaintContext, Color, GradientPaint, TexturePaint, setPaint

Method Index

 o createContext(ColorModel, Rectangle, Rectangle2D, AffineTransform)
Create and return a context used to generate the color pattern.

Methods

 o createContext
public abstract PaintContext createContext(ColorModel cm,
                                           Rectangle deviceBounds,
                                           Rectangle2D userBounds,
                                           AffineTransform xform)
Create and return a context used to generate the color pattern.

Parameters:
cm - ColorModel in which the caller wishes to receive the paint data. This is used only as a hint.
deviceBounds - The Rectangle describing the bounding box in device space of the graphics primitive being rendered.
userBounds - The Rectangle2D describing the bounding box in user space of the graphics primitive being rendered.
xform - The Transform from user space into device space.
Returns:
The PaintContext for generating color patterns.
See Also:
PaintContext

All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Submit a bug or feature