APIdia Launch Partner
Top Description Fields Constructors Methods
java.awt.image.renderable

public Class RenderableImageProducer

extends Object
implements ImageProducer, Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable, java.awt.image.ImageProducer
Imports
java.awt.image.ColorModel, .DataBuffer, .ImageConsumer, .ImageProducer, .Raster, .RenderedImage, .SampleModel, java.util.Enumeration, .Vector

An adapter class that implements ImageProducer to allow the asynchronous production of a RenderableImage. The size of the ImageConsumer is determined by the scale factor of the usr2dev transform in the RenderContext. If the RenderContext is null, the default rendering of the RenderableImage is used. This class implements an asynchronous production that produces the image in one thread at one resolution. This class may be subclassed to implement versions that will render the image using several threads. These threads could render either the same image at progressively better quality, or different sections of the image at a single resolution.

Field Summary

Modifier and TypeField and Description
pack-priv Vector<ImageConsumer>
ics

A Vector of image consumers.

pack-priv RenderContext
rc

The RenderContext to use for producing the image.

pack-priv RenderableImage
rdblImage

The RenderableImage source for the producer.

Constructor Summary

AccessConstructor and Description
public
RenderableImageProducer(RenderableImage
the RenderableImage to be rendered.
rdblImage
,
RenderContext
the RenderContext to use for producing the pixels.
rc
)

Constructs a new RenderableImageProducer from a RenderableImage and a RenderContext.

Method Summary

Modifier and TypeMethod and Description
public synchronized void
addConsumer(ImageConsumer
an ImageConsumer to be added to the interest list.
ic
)

Implements java.awt.image.ImageProducer.addConsumer.

Adds an ImageConsumer to the list of consumers interested in data for this image.

public synchronized boolean

Returns:

true if the ImageConsumer is on the list; false otherwise.
isConsumer
(ImageConsumer
the ImageConsumer to be checked.
ic
)

Implements java.awt.image.ImageProducer.isConsumer.

Determine if an ImageConsumer is on the list of consumers currently interested in data for this image.

public synchronized void
removeConsumer(ImageConsumer
the ImageConsumer to be removed.
ic
)

Implements java.awt.image.ImageProducer.removeConsumer.

Remove an ImageConsumer from the list of consumers interested in data for this image.

public void
requestTopDownLeftRightResend(ImageConsumer
the ImageConsumer requesting the resend.
ic
)

Implements java.awt.image.ImageProducer.requestTopDownLeftRightResend.

Requests that a given ImageConsumer have the image data delivered one more time in top-down, left-right order.

public void
run()

Implements java.lang.Runnable.run.

The runnable method for this class.

public synchronized void
setRenderContext(RenderContext
the new RenderContext.
rc
)

Sets a new RenderContext to use for the next startProduction() call.

public synchronized void
startProduction(ImageConsumer
the ImageConsumer to be added to the list of consumers.
ic
)

Implements java.awt.image.ImageProducer.startProduction.

Adds an ImageConsumer to the list of consumers interested in data for this image, and immediately starts delivery of the image data through the ImageConsumer interface.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

icsback to summary
pack-priv Vector<ImageConsumer> ics

A Vector of image consumers.

rcback to summary
pack-priv RenderContext rc

The RenderContext to use for producing the image.

rdblImageback to summary
pack-priv RenderableImage rdblImage

The RenderableImage source for the producer.

Constructor Detail

RenderableImageProducerback to summary
public RenderableImageProducer(RenderableImage rdblImage, RenderContext rc)

Constructs a new RenderableImageProducer from a RenderableImage and a RenderContext.

Parameters
rdblImage:RenderableImage

the RenderableImage to be rendered.

rc:RenderContext

the RenderContext to use for producing the pixels.

Method Detail

addConsumerback to summary
public synchronized void addConsumer(ImageConsumer ic)

Implements java.awt.image.ImageProducer.addConsumer.

Adds an ImageConsumer to the list of consumers interested in data for this image.

Parameters
ic:ImageConsumer

an ImageConsumer to be added to the interest list.

isConsumerback to summary
public synchronized boolean isConsumer(ImageConsumer ic)

Implements java.awt.image.ImageProducer.isConsumer.

Determine if an ImageConsumer is on the list of consumers currently interested in data for this image.

Parameters
ic:ImageConsumer

the ImageConsumer to be checked.

Returns:boolean

true if the ImageConsumer is on the list; false otherwise.

removeConsumerback to summary
public synchronized void removeConsumer(ImageConsumer ic)

Implements java.awt.image.ImageProducer.removeConsumer.

Remove an ImageConsumer from the list of consumers interested in data for this image.

Parameters
ic:ImageConsumer

the ImageConsumer to be removed.

requestTopDownLeftRightResendback to summary
public void requestTopDownLeftRightResend(ImageConsumer ic)

Implements java.awt.image.ImageProducer.requestTopDownLeftRightResend.

Requests that a given ImageConsumer have the image data delivered one more time in top-down, left-right order.

Parameters
ic:ImageConsumer

the ImageConsumer requesting the resend.

runback to summary
public void run()

Implements java.lang.Runnable.run.

The runnable method for this class. This will produce an image using the current RenderableImage and RenderContext and send it to all the ImageConsumer currently registered with this class.

setRenderContextback to summary
public synchronized void setRenderContext(RenderContext rc)

Sets a new RenderContext to use for the next startProduction() call.

Parameters
rc:RenderContext

the new RenderContext.

startProductionback to summary
public synchronized void startProduction(ImageConsumer ic)

Implements java.awt.image.ImageProducer.startProduction.

Adds an ImageConsumer to the list of consumers interested in data for this image, and immediately starts delivery of the image data through the ImageConsumer interface.

Parameters
ic:ImageConsumer

the ImageConsumer to be added to the list of consumers.