Packages  This Package  Prev  Next  Index  

§2.11 Interface ImageObserver

public  interface  java.awt.image.ImageObserver
{
        // flags for the infoflags argument to imageUpdate
    public final static int ABORT;	§2.11.1
    public final static int ALLBITS;	§2.11.2
    public final static int ERROR;	§2.11.3
    public final static int FRAMEBITS;	§2.11.4
    public final static int HEIGHT;	§2.11.5
    public final static int PROPERTIES;	§2.11.6
    public final static int SOMEBITS;	§2.11.7
    public final static int WIDTH;	§2.11.8

        // Methods
    public abstract boolean	§2.11.9
            imageUpdate(Image  img, int  infoflags,
            int  x, int  y, int  width, int  height);
}
The image observer interface specifies the methods that all image observers must implement.

An image observer is interested in receiving asynchronous notifications about the image as the image is being constructed.


Fields

ABORT

public final static int ABORT = 128
This flag in the infoflags argument to imageUpdate (II-§2.11.9) indicates that the image was aborted before production was complete.


No more information will become available without further action to trigger another image production sequence.
If the ERROR flag was not also set in this image update, then accessing any of the data in the image restarts the production again, possibly from the beginning.

ALLBITS

public final static int ALLBITS = 32
This flag in the infoflags argument to imageUpdate (II-§2.11.9) indicates that a static image is now complete and can be drawn in its final form.


The x, y, width, and height arguments to the imageUpdate method should be ignored when this flag is set in the status.
See Also:
drawImage in class Graphics (II-§1.20.12).

ERROR

public final static int ERROR = 64
This flag in the infoflags argument to imageUpdate (II-§2.11.9) indicates that an image which was being tracked asynchronously has encountered an error. No further information will become available, and drawing the image will fail.


Whenever this flag is set, the ABORT flag must also be set.

FRAMEBITS

public final static int FRAMEBITS = 16
This flag in the infoflags argument to imageUpdate (II-§2.11.9) indicates that another complete frame of a multi-frame image can now be drawn.


The x, y, width, and height arguments to the imageUpdate method should be ignored when this flag is set in the status.
See Also:
drawImage in class Graphics (II-§1.20.12).

HEIGHT

public final static int HEIGHT = 2
This flag in the infoflags argument to imageUpdate (II-§2.11.9) indicates that the height of the base image is now available and can be taken from the height argument to the imageUpdate method.

See Also:
getHeight in class Image (II-§1.24.5).

PROPERTIES

public final static int PROPERTIES = 4
This flag in the infoflags argument to imageUpdate (II-§2.11.9) indicates that the properties of the image are now available.

See Also:
getProperty in class Image (II-§1.24.6).

SOMEBITS

public final static int SOMEBITS = 8
This flag in the infoflags argument to imageUpdate (II-§2.11.9) indicates that the pixels needed for drawing a scaled variation of the image are now available.


The bounding box of the new pixels can be taken from the x, y, width, and height arguments to the imageUpdate method.
See Also:
drawImage in class Graphics (II-§1.20.12).

WIDTH

public final static int WIDTH
This flag in the infoflags argument to imageUpdate (II-§2.11.9) indicates that the width of the base image is now available and can be taken from the width argument to the imageUpdate method.

See Also:
getWidth in class Image (II-§1.24.8).

Methods

imageUpdate

public abstract boolean
imageUpdate(Image img, int infoflags, int x, int y,
int width, int height)
This image observer method is called when previously requested information about an image becomes available.
Asynchronous interfaces are method calls such as getWidth (II-§1.24.8), getHeight (II-§1.24.5),and drawImage (II-§1.20.12) which take an image observer as an argument. These methods register the caller as being interested either in information about the image or about an output version of the image.


This method should return true if further calls to imageUpdate are needed by this image observer; false if it needs no more information.
The infoflags argument should be the OR of the following flags:
WIDTH (II-§2.11.8) HEIGHT (II-§2.11.5)
PROPERTIES (II-§2.11.6) SOMEBITS (II-§2.11.7)
FRAMEBITS (II-§2.11.4) ALLBITS (II-§2.11.2)
ERROR (II-§2.11.3) ABORT (II-§2.11.1)

The interpretation of the x, y, width, and height arguments depends on the infoflags argument.
Parameters:
img - The image being observed
infoflags - the OR of the above flags
x - an x coordinate
y - a y coordinate
width - the width
height - the height
Returns:
true if further calls to imageUpdate are needed by this image observer; false otherwise.

Packages  This Package  Prev  Next  Index
Java API Document (HTML generated by dkramer on April 22, 1996)
Copyright © 1996 Sun Microsystems, Inc. All rights reserved
Please send any comments or corrections to doug.kramer@sun.com