home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / unsupported / JDK1.2beta3 / SOURCE / SRC.ZIP / java / awt / Paint.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  2.2 KB  |  63 lines

  1. /*
  2.  * @(#)Paint.java    1.16 98/03/18
  3.  *
  4.  * Copyright 1997 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 interface defines how color patterns
  24.  * can be generated for Graphics2D operations.
  25.  * Paint is set in the Graphics2D and
  26.  * thereafter the stroke and fill methods will use the color
  27.  * pattern generated by the implementing Paint class.
  28.  * <p>
  29.  * Instances of classes implementing Paint must be immutable
  30.  * (i.e. read-only) because the Graphics2D does not clone
  31.  * these objects when they are set as an attribute with the setPaint
  32.  * method or when the Graphics2D object is itself cloned.
  33.  * This is to avoid undefined behavior of Graphics2D rendering
  34.  * which would result if the Paint object were modified after
  35.  * being set in the Graphics2D state.
  36.  * @see PaintContext
  37.  * @see Color
  38.  * @see GradientPaint
  39.  * @see TexturePaint
  40.  * @see Graphics2D#setPaint
  41.  * @version 10 Feb 1997
  42.  */
  43.  
  44. public interface Paint extends Transparency {
  45.     /**
  46.      * Create and return a context used to generate the color pattern.
  47.      * @param cm ColorModel in which the caller wishes to receive the
  48.      * paint data. This is used only as a hint.
  49.      * @param deviceBounds The Rectangle describing the bounding box
  50.      * in device space of the graphics primitive being rendered.
  51.      * @param userBounds The Rectangle2D describing the bounding box in
  52.      * user space of the graphics primitive being rendered.
  53.      * @param xform The Transform from user space into device space.
  54.      * @return The PaintContext for generating color patterns.
  55.      * @see PaintContext
  56.      */
  57.     public PaintContext createContext(ColorModel cm,
  58.                       Rectangle deviceBounds,
  59.                       Rectangle2D userBounds,
  60.                       AffineTransform xform);
  61.  
  62. }
  63.