home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-20 | 2.2 KB | 63 lines |
- /*
- * @(#)Paint.java 1.16 98/03/18
- *
- * Copyright 1997 by Sun Microsystems, Inc.,
- * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
- * All rights reserved.
- *
- * This software is the confidential and proprietary information
- * of Sun Microsystems, Inc. ("Confidential Information"). You
- * shall not disclose such Confidential Information and shall use
- * it only in accordance with the terms of the license agreement
- * you entered into with Sun.
- */
-
- package java.awt;
-
- import java.awt.image.ColorModel;
- import java.awt.geom.AffineTransform;
- import java.awt.geom.Point2D;
- import java.awt.geom.Rectangle2D;
-
- /**
- * 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.
- * <p>
- * 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 PaintContext
- * @see Color
- * @see GradientPaint
- * @see TexturePaint
- * @see Graphics2D#setPaint
- * @version 10 Feb 1997
- */
-
- public interface Paint extends Transparency {
- /**
- * Create and return a context used to generate the color pattern.
- * @param cm ColorModel in which the caller wishes to receive the
- * paint data. This is used only as a hint.
- * @param deviceBounds The Rectangle describing the bounding box
- * in device space of the graphics primitive being rendered.
- * @param userBounds The Rectangle2D describing the bounding box in
- * user space of the graphics primitive being rendered.
- * @param xform The Transform from user space into device space.
- * @return The PaintContext for generating color patterns.
- * @see PaintContext
- */
- public PaintContext createContext(ColorModel cm,
- Rectangle deviceBounds,
- Rectangle2D userBounds,
- AffineTransform xform);
-
- }
-