home *** CD-ROM | disk | FTP | other *** search
/ Java Programmer's Toolkit / Java Programmer's Toolkit.iso / solaris2 / jdk / src / java / awt / image / imageobs.jav < prev    next >
Encoding:
Text File  |  1995-10-30  |  4.3 KB  |  115 lines

  1. /*
  2.  * @(#)ImageObserver.java    1.14 95/09/08 Jim Graham
  3.  *
  4.  * Copyright (c) 1994 Sun Microsystems, Inc. All Rights Reserved.
  5.  *
  6.  * Permission to use, copy, modify, and distribute this software
  7.  * and its documentation for NON-COMMERCIAL purposes and without
  8.  * fee is hereby granted provided that this copyright notice
  9.  * appears in all copies. Please refer to the file "copyright.html"
  10.  * for further important copyright and licensing information.
  11.  *
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
  13.  * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  14.  * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  15.  * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
  16.  * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
  17.  * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
  18.  */
  19.  
  20. package java.awt.image;
  21.  
  22. import java.awt.Image;
  23.  
  24. /**
  25.  * An asynchronous update interface for receiving notifications about
  26.  * Image information as the Image is constructed.
  27.  *
  28.  * @version     1.14 09/08/95
  29.  * @author     Jim Graham
  30.  */
  31. public interface ImageObserver {
  32.     /**
  33.      * This method is called when information about an image which was
  34.      * previously requested using an asynchronous interface becomes
  35.      * available.  Asynchronous interfaces are method calls such as
  36.      * getWidth(ImageObserver) and drawImage(img, x, y, ImageObserver)
  37.      * which take an ImageObserver object as an argument.  Those methods
  38.      * register the caller as interested either in information about
  39.      * the overall image itself (in the case of getWidth(ImageObserver))
  40.      * or about an output version of an image (in the case of the
  41.      * drawImage(img, x, y, [w, h,] ImageObserver) call).  This method
  42.      * should return true if further updates are needed or false if the
  43.      * required information has been acquired.  The image which was being
  44.      * tracked is passed in using the img argument.  Various constants
  45.      * are combined to form the infoflags argument which indicates what
  46.      * information about the image is now available.  The interpretation
  47.      * of the x, y, width, and height arguments depends on the contents
  48.      * of the infoflags argument.
  49.      * @see Image#getWidth
  50.      * @see Image#getHeight
  51.      * @see java.awt.Graphics#drawImage
  52.      */
  53.     public boolean imageUpdate(Image img, int infoflags,
  54.                    int x, int y, int width, int height);
  55.  
  56.     /**
  57.      * The width of the base image is now available and can be taken
  58.      * from the width argument to the imageUpdate callback method.
  59.      * @see Image#getWidth
  60.      * @see #imageUpdate
  61.      */
  62.     public static final int WIDTH = 1;
  63.  
  64.     /**
  65.      * The height of the base image is now available and can be taken
  66.      * from the height argument to the imageUpdate callback method.
  67.      * @see Image#getHeight
  68.      * @see #imageUpdate
  69.      */
  70.     public static final int HEIGHT = 2;
  71.  
  72.     /**
  73.      * The properties of the image are now available.
  74.      * @see Image#getProperty
  75.      * @see #imageUpdate
  76.      */
  77.     public static final int PROPERTIES = 4;
  78.  
  79.     /**
  80.      * More pixels needed for drawing a scaled variation of the image
  81.      * are available.  The bounding box of the new pixels can be taken
  82.      * from the x, y, width, and height arguments to the imageUpdate
  83.      * callback method.
  84.      * @see java.awt.Graphics#drawImage
  85.      * @see #imageUpdate
  86.      */
  87.     public static final int SOMEBITS = 8;
  88.  
  89.     /**
  90.      * Another complete frame of a multi-frame image which was previously
  91.      * drawn is now available to be drawn again.  The x, y, width, and height
  92.      * arguments to the imageUpdate callback method should be ignored.
  93.      * @see java.awt.Graphics#drawImage
  94.      * @see #imageUpdate
  95.      */
  96.     public static final int FRAMEBITS = 16;
  97.  
  98.     /**
  99.      * A static image which was previously drawn is now complete and can
  100.      * be drawn again in its final form.  The x, y, width, and height
  101.      * arguments to the imageUpdate callback method should be ignored.
  102.      * @see java.awt.Graphics#drawImage
  103.      * @see #imageUpdate
  104.      */
  105.     public static final int ALLBITS = 32;
  106.  
  107.     /**
  108.      * An image which was being tracked asynchronously has encountered
  109.      * an error.  No further information will become available and
  110.      * drawing the image will fail.
  111.      * @see #imageUpdate
  112.      */
  113.     public static final int ERROR = 64;
  114. }
  115.