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 / PaintContext.java < prev    next >
Encoding:
Java Source  |  1999-05-28  |  2.4 KB  |  71 lines  |  [TEXT/CWIE]

  1. /*
  2.  * @(#)PaintContext.java    1.19 98/10/01
  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.color.ColorSpace;
  18. import java.awt.image.Raster;
  19. import java.awt.image.ColorModel;
  20.  
  21. /**
  22.  * The <code>PaintContext</code> interface defines the encapsulated 
  23.  * and optimized environment to generate color patterns in device 
  24.  * space for fill or stroke operations on a 
  25.  * {@link Graphics2D}.  The <code>PaintContext</code> provides
  26.  * the necessary colors for <code>Graphics2D</code> operations in the 
  27.  * form of a {@link Raster} associated with a {@link ColorModel}.  
  28.  * The <code>PaintContext</code> maintains state for a particular paint 
  29.  * operation.  In a multi-threaded environment, several
  30.  * contexts can exist simultaneously for a single {@link Paint} object.
  31.  * @see Paint
  32.  * @version 10 Feb 1997
  33.  */
  34.  
  35. public interface PaintContext {
  36.     /**
  37.      * Releases the resources allocated for the operation.
  38.      */
  39.     public void dispose();
  40.  
  41.     /**
  42.      * Returns the <code>ColorModel</code> of the output.  Note that
  43.      * this <code>ColorModel</code> might be different from the hint
  44.      * specified in the 
  45.      * {@link Paint#createContext(ColorModel, Rectangle, Rectangle2D,
  46. AffineTransform, RenderingHints) createContext} method of
  47.      * <code>Paint</code>.  Not all <code>PaintContext</code> objects are
  48.      * capable of generating color patterns in an arbitrary
  49.      * <code>ColorModel</code>.
  50.      * @return the <code>ColorModel</code> of the output.
  51.      */
  52.     ColorModel getColorModel();
  53.  
  54.     /**
  55.      * Returns a <code>Raster</code> containing the colors generated for 
  56.      * the graphics operation.
  57.      * @param x, y the coordinates of the area in device space
  58.      * for which colors are generated.
  59.      * @param w the width of the area in device space 
  60.      * @param h the height of the area in device space
  61.      * @return a <code>Raster</code> representing the specified 
  62.      * rectangular area and containing the colors generated for
  63.      * the graphics operation.
  64.      */
  65.     Raster getRaster(int x,
  66.              int y,
  67.              int w,
  68.              int h);
  69.  
  70. }
  71.