home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / Java2 / src / java / awt / Paint.java < prev    next >
Encoding:
Java Source  |  1999-05-28  |  2.4 KB  |  68 lines  |  [TEXT/CWIE]

  1. /*
  2.  * @(#)Paint.java       1.19 98/06/29
  3.  *
  4.  * Copyright 1997, 1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.awt;
  16.  
  17. import java.awt.image.ColorModel;
  18. import java.awt.geom.AffineTransform;
  19. import java.awt.geom.Point2D;
  20. import java.awt.geom.Rectangle2D;
  21.  
  22. /**
  23.  * This <code>Paint</code> interface defines how color patterns
  24.  * can be generated for {@link Graphics2D} operations.  A class
  25.  * implementing the <code>Paint</code> interface is added to the
  26.  * <code>Graphics2D</code> context in order to define the color 
  27.  * pattern used by the <code>draw</code> and <code>fill</code> methods.
  28.  * <p>
  29.  * Instances of classes implementing <code>Paint</code> must be 
  30.  * read-only because the <code>Graphics2D</code> does not clone
  31.  * these objects when they are set as an attribute with the 
  32.  * <code>setPaint</code> method or when the <code>Graphics2D</code>
  33.  * object is itself cloned.
  34.  * @see PaintContext
  35.  * @see Color
  36.  * @see GradientPaint
  37.  * @see TexturePaint
  38.  * @see Graphics2D#setPaint
  39.  * @version 10 Feb 1997
  40.  */
  41.  
  42. public interface Paint extends Transparency {
  43.     /**
  44.      * Creates and returns a {@link PaintContext} used to 
  45.      * generate the color pattern.
  46.      * @param cm the {@link ColorModel} that receives the
  47.      * <code>Paint</code> data. This is used only as a hint.
  48.      * @param deviceBounds the device space bounding box
  49.      *                     of the graphics primitive being rendered
  50.      * @param userBounds the user space bounding box 
  51.      *                     of the graphics primitive being rendered
  52.      * @param xform the {@link AffineTransform} from user
  53.      *      space into device space
  54.      * @param hints the hint that the context object uses to
  55.      *              choose between rendering alternatives
  56.      * @return the <code>PaintContext</code> for
  57.      *              generating color patterns
  58.      * @see PaintContext
  59.      */
  60.     public PaintContext createContext(ColorModel cm,
  61.                       Rectangle deviceBounds,
  62.                       Rectangle2D userBounds,
  63.                       AffineTransform xform,
  64.                                       RenderingHints hints);
  65.  
  66. }
  67.  
  68.