Packages  This Package  Prev  Next  Index  

§2.12 Interface ImageProducer

public  interface  java.awt.image.ImageProducer
{
        // Methods
    public abstract void addConsumer(ImageConsumer  ic);	§2.12.1
    public abstract boolean isConsumer(ImageConsumer  ic);	§2.12.2
    public abstract void removeConsumer(ImageConsumer  ic);	§2.12.3
    public abstract void	§2.12.4
        requestTopDownLeftRightResend(ImageConsumer  ic);
    public abstract void startProduction(ImageConsumer  ic);	§2.12.5
}
The image producer interface specifies the methods that all image producers must implement. Every image contains an image producer which can reconstruct the image whenever it is needed by an image consumer (II-§2.10).


Methods

addConsumer

public abstract void addConsumer(ImageConsumer ic)
Registers the image consumer argument as wanting information about this image.
The image producer may, at its discretion, start delivering the image data immediately, or it may wait until the next image reconstruction is forced by a call to the startProduction method (II-§2.12.5).

Parameters:
ic - an image consumer

isConsumer

public abstract boolean isConsumer(ImageConsumer ic)
Parameters:
ic - an image consumer
Returns:
true if the specified image consumer argument is currently registered with this image producer as one of its consumers; false otherwise.

removeConsumer

public abstract void removeConsumer(ImageConsumer ic)
Removes the specified image consumer object from the list of consumers registered to receive the image data. It is not an error to remove a consumer that is not registered.
The image producer should stop sending data to this consumer as soon as it is feasible.
Parameters:
ic - an image consumer

requestTopDownLeftRightResend

public abstract void
requestTopDownLeftRightResend(ImageConsumer ic)
An image consumer inokes this method to request that the image producer attempt to resend the image data one more time in top-down, left-to-right order.
If the data cannot be resent in that order, the image producer ignores this call.
If the data can be resent in that order, the image producer should respond by executing the following minimum set of image consumer method calls.
ic.setHints(TOPDOWNLEFTRIGHT | otherhints );
ic.setPixels(...); // As many times as needed
ic.imageComplete();
An image consumer might call this method so that it can use a higher quality conversion algorithm which depends on receiving the pixels in order.
Parameters:
ic - an image consumer
See Also:
setHints in class ImageConsumer (II-§2.10.13).

startProduction

public abstract void startProduction(ImageConsumer ic)
Registers the image consumer argument as wanting information about this image.
In addition, this method forces the image producer to start an immediate reconstruction of the image data. Then data will be delivered both to this image consumer and to any other image consumers which may have already been registered with the producer using the addConsumer method (II-§2.12.1)

Parameters:
ic - an image consumer


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