Class RenderableImageProducer
java.lang.Object
java.awt.image.renderable.RenderableImageProducer
- All Implemented Interfaces:
ImageProducer, Runnable
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.
-
Constructor Summary
ConstructorsConstructorDescriptionRenderableImageProducer(RenderableImage rdblImage, RenderContext rc) Constructs a new RenderableImageProducer from a RenderableImage and a RenderContext. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an ImageConsumer to the list of consumers interested in data for this image.booleanDetermine if an ImageConsumer is on the list of consumers currently interested in data for this image.voidRemove an ImageConsumer from the list of consumers interested in data for this image.voidRequests that a given ImageConsumer have the image data delivered one more time in top-down, left-right order.voidrun()The runnable method for this class.voidSets a new RenderContext to use for the next startProduction() call.voidAdds 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.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.booleanCompares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.inthashCode()Answers an integer hash code for the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.toString()Answers a string containing a concise, human-readable description of the receiver.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
Constructor Details
-
RenderableImageProducer
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.
-
-
Method Details
-
setRenderContext
Sets a new RenderContext to use for the next startProduction() call.- Parameters:
rc- the new RenderContext.
-
addConsumer
Adds an ImageConsumer to the list of consumers interested in data for this image.- Specified by:
addConsumerin interfaceImageProducer- Parameters:
ic- an ImageConsumer to be added to the interest list.- See Also:
-
isConsumer
Determine if an ImageConsumer is on the list of consumers currently interested in data for this image.- Specified by:
isConsumerin interfaceImageProducer- Parameters:
ic- the ImageConsumer to be checked.- Returns:
- true if the ImageConsumer is on the list; false otherwise.
-
removeConsumer
Remove an ImageConsumer from the list of consumers interested in data for this image.- Specified by:
removeConsumerin interfaceImageProducer- Parameters:
ic- the ImageConsumer to be removed.
-
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.- Specified by:
startProductionin interfaceImageProducer- Parameters:
ic- the ImageConsumer to be added to the list of consumers.- See Also:
-
requestTopDownLeftRightResend
Requests that a given ImageConsumer have the image data delivered one more time in top-down, left-right order.- Specified by:
requestTopDownLeftRightResendin interfaceImageProducer- Parameters:
ic- the ImageConsumer requesting the resend.- See Also:
-
run
-