001    /* ImageObserver.java -- Java interface for asynchronous updates to an image
002       Copyright (C) 1999 Free Software Foundation, Inc.
003    
004    This file is part of GNU Classpath.
005    
006    GNU Classpath is free software; you can redistribute it and/or modify
007    it under the terms of the GNU General Public License as published by
008    the Free Software Foundation; either version 2, or (at your option)
009    any later version.
010    
011    GNU Classpath is distributed in the hope that it will be useful, but
012    WITHOUT ANY WARRANTY; without even the implied warranty of
013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014    General Public License for more details.
015    
016    You should have received a copy of the GNU General Public License
017    along with GNU Classpath; see the file COPYING.  If not, write to the
018    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
019    02110-1301 USA.
020    
021    Linking this library statically or dynamically with other modules is
022    making a combined work based on this library.  Thus, the terms and
023    conditions of the GNU General Public License cover the whole
024    combination.
025    
026    As a special exception, the copyright holders of this library give you
027    permission to link this library with independent modules to produce an
028    executable, regardless of the license terms of these independent
029    modules, and to copy and distribute the resulting executable under
030    terms of your choice, provided that you also meet, for each linked
031    independent module, the terms and conditions of the license of that
032    module.  An independent module is a module which is not derived from
033    or based on this library.  If you modify this library, you may extend
034    this exception to your version of the library, but you are not
035    obligated to do so.  If you do not wish to do so, delete this
036    exception statement from your version. */
037    
038    
039    package java.awt.image;
040    
041    import java.awt.Image;
042    
043    /**
044     * An object implementing the <code>ImageObserver</code> interface can
045     * receive updates on image construction from an
046     * <code>ImageProducer</code> asynchronously.
047     *
048     * @see ImageProducer
049     * @author C. Brian Jones (cbj@gnu.org)
050     */
051    public interface ImageObserver
052    {
053        /**
054         * The width of the image has been provided as the
055         * <code>width</code> argument to <code>imageUpdate</code>.
056         *
057         * @see #imageUpdate
058         */
059        int WIDTH = 1;
060    
061        /**
062         * The height of the image has been provided as the
063         * <code>height</code> argument to <code>imageUpdate</code>.
064         *
065         * @see #imageUpdate
066         */
067        int HEIGHT = 2;
068    
069        /**
070         * The properties of the image have been provided.
071         *
072         * @see #imageUpdate
073         * @see java.awt.Image#getProperty (java.lang.String, java.awt.image.ImageObserver)
074         */
075        int PROPERTIES = 4;
076    
077        /**
078         * More pixels are now available for drawing a scaled variation of
079         * the image.
080         *
081         * @see #imageUpdate
082         */
083        int SOMEBITS = 8;
084    
085        /**
086         * All the pixels needed to draw a complete frame of a multi-frame
087         * image are available.
088         *
089         * @see #imageUpdate
090         */
091        int FRAMEBITS = 16;
092    
093        /**
094         * An image with a single frame, a static image, is complete.
095         *
096         * @see #imageUpdate
097         */
098        int ALLBITS = 32;
099    
100        /**
101         * An error was encountered while producing the image.
102         *
103         * @see #imageUpdate
104         */
105        int ERROR = 64;
106    
107        /**
108         * Production of the image was aborted.
109         *
110         * @see #imageUpdate
111         */
112        int ABORT = 128;
113    
114        /**
115         * This is a callback method for an asynchronous image producer to
116         * provide updates on the production of the image as it happens.
117         *
118         * @param image the image the update refers to
119         * @param flags a bit mask indicating what is provided with this update
120         * @param x the x coordinate of the image
121         * @param y the y coordinate of the image
122         * @param width the width of the image
123         * @param height the height of the image
124         *
125         * @see java.awt.Image
126         */
127        boolean imageUpdate(Image image, int flags, int x,
128                                            int y, int width, int height);
129    }