Class Overview
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.
Summary
Public Methods |
synchronized
void
|
addConsumer(ImageConsumer ic)
Adds an ImageConsumer to the list of consumers interested in
data for this image.
|
synchronized
boolean
|
isConsumer(ImageConsumer ic)
Determine if an ImageConsumer is on the list of consumers
currently interested in data for this image.
|
synchronized
void
|
removeConsumer(ImageConsumer ic)
Remove an ImageConsumer from the list of consumers interested in
data for this image.
|
void
|
requestTopDownLeftRightResend(ImageConsumer ic)
Requests that a given ImageConsumer have the image data delivered
one more time in top-down, left-right order.
|
void
|
run()
The runnable method for this class.
|
synchronized
void
|
setRenderContext(RenderContext rc)
Sets a new RenderContext to use for the next startProduction() call.
|
synchronized
void
|
startProduction(ImageConsumer ic)
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.
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
From interface
java.awt.image.ImageProducer
abstract
void
|
addConsumer(ImageConsumer ic)
Registers an ImageConsumer with the
ImageProducer for access to the image data
during a later reconstruction of the Image .
|
abstract
boolean
|
isConsumer(ImageConsumer ic)
Determines if a specified ImageConsumer
object is currently registered with this
ImageProducer as one of its consumers.
|
abstract
void
|
removeConsumer(ImageConsumer ic)
Removes the specified ImageConsumer object
from the list of consumers currently registered to
receive image data.
|
abstract
void
|
requestTopDownLeftRightResend(ImageConsumer ic)
Requests, on behalf of the ImageConsumer ,
that the ImageProducer attempt to resend
the image data one more time in TOPDOWNLEFTRIGHT order
so that higher quality conversion algorithms which
depend on receiving pixels in order can be used to
produce a better output version of the image.
|
abstract
void
|
startProduction(ImageConsumer ic)
Registers the specified ImageConsumer object
as a consumer and starts an immediate reconstruction of
the image data which will then be delivered to this
consumer and any other consumer which might have already
been registered with the producer.
|
|
From interface
java.lang.Runnable
abstract
void
|
run()
When an object implementing interface Runnable is used
to create a thread, starting the thread causes the object's
run method to be called in that separately executing
thread.
|
|
Public Constructors
Constructs a new RenderableImageProducer from a RenderableImage
and a RenderContext.
Parameters
rdblImage
| the RenderableImage to be rendered. |
rc
| the RenderContext to use for producing the pixels.
|
Public Methods
public
synchronized
void
addConsumer
(ImageConsumer ic)
Adds an ImageConsumer to the list of consumers interested in
data for this image.
Parameters
ic
| an ImageConsumer to be added to the interest list.
|
public
synchronized
boolean
isConsumer
(ImageConsumer ic)
Determine if an ImageConsumer is on the list of consumers
currently interested in data for this image.
Parameters
ic
| the ImageConsumer to be checked. |
Returns
- true if the ImageConsumer is on the list; false otherwise.
public
synchronized
void
removeConsumer
(ImageConsumer ic)
Remove an ImageConsumer from the list of consumers interested in
data for this image.
Parameters
ic
| the ImageConsumer to be removed.
|
public
void
requestTopDownLeftRightResend
(ImageConsumer ic)
Requests that a given ImageConsumer have the image data delivered
one more time in top-down, left-right order.
Parameters
ic
| the ImageConsumer requesting the resend.
|
public
void
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.
public
synchronized
void
setRenderContext
(RenderContext rc)
Sets a new RenderContext to use for the next startProduction() call.
Parameters
rc
| the new RenderContext.
|
public
synchronized
void
startProduction
(ImageConsumer ic)
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
| the ImageConsumer to be added to the list of consumers.
|