home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 November / Chip_1998-11_cd.bin / tema / Cafe / main.bin / ImageObserver.java < prev    next >
Text File  |  1997-05-20  |  5KB  |  133 lines

  1. /*
  2.  * @(#)ImageObserver.java    1.17 96/11/23
  3.  * 
  4.  * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion 1.1_beta
  20.  * 
  21.  */
  22.  
  23. package java.awt.image;
  24.  
  25. import java.awt.Image;
  26.  
  27. /**
  28.  * An asynchronous update interface for receiving notifications about
  29.  * Image information as the Image is constructed.
  30.  *
  31.  * @version     1.17 11/23/96
  32.  * @author     Jim Graham
  33.  */
  34. public interface ImageObserver {
  35.     /**
  36.      * This method is called when information about an image which was
  37.      * previously requested using an asynchronous interface becomes
  38.      * available.  Asynchronous interfaces are method calls such as
  39.      * getWidth(ImageObserver) and drawImage(img, x, y, ImageObserver)
  40.      * which take an ImageObserver object as an argument.  Those methods
  41.      * register the caller as interested either in information about
  42.      * the overall image itself (in the case of getWidth(ImageObserver))
  43.      * or about an output version of an image (in the case of the
  44.      * drawImage(img, x, y, [w, h,] ImageObserver) call).  
  45.  
  46.      * <p>This method
  47.      * should return true if further updates are needed or false if the
  48.      * required information has been acquired.  The image which was being
  49.      * tracked is passed in using the img argument.  Various constants
  50.      * are combined to form the infoflags argument which indicates what
  51.      * information about the image is now available.  The interpretation
  52.      * of the x, y, width, and height arguments depends on the contents
  53.      * of the infoflags argument.
  54.      * @see Image#getWidth
  55.      * @see Image#getHeight
  56.      * @see java.awt.Graphics#drawImage
  57.      */
  58.     public boolean imageUpdate(Image img, int infoflags,
  59.                    int x, int y, int width, int height);
  60.  
  61.     /**
  62.      * The width of the base image is now available and can be taken
  63.      * from the width argument to the imageUpdate callback method.
  64.      * @see Image#getWidth
  65.      * @see #imageUpdate
  66.      */
  67.     public static final int WIDTH = 1;
  68.  
  69.     /**
  70.      * The height of the base image is now available and can be taken
  71.      * from the height argument to the imageUpdate callback method.
  72.      * @see Image#getHeight
  73.      * @see #imageUpdate
  74.      */
  75.     public static final int HEIGHT = 2;
  76.  
  77.     /**
  78.      * The properties of the image are now available.
  79.      * @see Image#getProperty
  80.      * @see #imageUpdate
  81.      */
  82.     public static final int PROPERTIES = 4;
  83.  
  84.     /**
  85.      * More pixels needed for drawing a scaled variation of the image
  86.      * are available.  The bounding box of the new pixels can be taken
  87.      * from the x, y, width, and height arguments to the imageUpdate
  88.      * callback method.
  89.      * @see java.awt.Graphics#drawImage
  90.      * @see #imageUpdate
  91.      */
  92.     public static final int SOMEBITS = 8;
  93.  
  94.     /**
  95.      * Another complete frame of a multi-frame image which was previously
  96.      * drawn is now available to be drawn again.  The x, y, width, and height
  97.      * arguments to the imageUpdate callback method should be ignored.
  98.      * @see java.awt.Graphics#drawImage
  99.      * @see #imageUpdate
  100.      */
  101.     public static final int FRAMEBITS = 16;
  102.  
  103.     /**
  104.      * A static image which was previously drawn is now complete and can
  105.      * be drawn again in its final form.  The x, y, width, and height
  106.      * arguments to the imageUpdate callback method should be ignored.
  107.      * @see java.awt.Graphics#drawImage
  108.      * @see #imageUpdate
  109.      */
  110.     public static final int ALLBITS = 32;
  111.  
  112.     /**
  113.      * An image which was being tracked asynchronously has encountered
  114.      * an error.  No further information will become available and
  115.      * drawing the image will fail.
  116.      * As a convenience, the ABORT flag will be indicated at the same
  117.      * time to indicate that the image production was aborted.
  118.      * @see #imageUpdate
  119.      */
  120.     public static final int ERROR = 64;
  121.  
  122.     /**
  123.      * An image which was being tracked asynchronously was aborted before
  124.      * production was complete.  No more information will become available
  125.      * without further action to trigger another image production sequence.
  126.      * If the ERROR flag was not also set in this image update, then
  127.      * accessing any of the data in the image will restart the production
  128.      * again, probably from the beginning.
  129.      * @see #imageUpdate
  130.      */
  131.     public static final int ABORT = 128;
  132. }
  133.