Package java.awt.image Previous
Previous
Java API
Java API
Index
Index
Next
Next

Interface ImageProducer

Methods

public  interface  java.awt.image.ImageProducer
{
        // Methods
    public abstract void addConsumer(ImageConsumer  ic);	
    public abstract boolean isConsumer(ImageConsumer  ic);	
    public abstract void removeConsumer(ImageConsumer  ic);	
    public abstract void	
        requestTopDownLeftRightResend(ImageConsumer  ic);
    public abstract void startProduction(ImageConsumer  ic);	
}

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 .


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 .

ParameterDescription
ic an image consumer


isConsumer

public abstract boolean isConsumer(ImageConsumer  ic) 

Return Value:

Returns true if the specified image consumer argument is currently registered with this image producer as one of its consumers; false otherwise.

ParameterDescription
ic an image consumer


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.

ParameterDescription
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.

ParameterDescription
ic an image consumer

See Also: setHints in class ImageConsumer .


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

ParameterDescription
ic an image consumer



Top© 1996 Sun Microsystems, Inc. All rights reserved.