Class RenderContext
java.lang.Object
java.awt.image.renderable.RenderContext
- All Implemented Interfaces:
Cloneable
A RenderContext encapsulates the information needed to produce a
specific rendering from a RenderableImage. It contains the area to
be rendered specified in rendering-independent terms, the
resolution at which the rendering is to be performed, and hints
used to control the rendering process.
Users create RenderContexts and pass them to the RenderableImage via the createRendering method. Most of the methods of RenderContexts are not meant to be used directly by applications, but by the RenderableImage and operator classes to which it is passed.
The AffineTransform parameter passed into and out of this class are cloned. The RenderingHints and Shape parameters are not necessarily cloneable and are therefore only reference copied. Altering RenderingHints or Shape instances that are in use by instances of RenderContext may have undesired side effects.
-
Constructor Summary
ConstructorsConstructorDescriptionRenderContext(AffineTransform usr2dev) Constructs a RenderContext with a given transform.RenderContext(AffineTransform usr2dev, RenderingHints hints) Constructs a RenderContext with a given transform and rendering hints.RenderContext(AffineTransform usr2dev, Shape aoi) Constructs a RenderContext with a given transform and area of interest.RenderContext(AffineTransform usr2dev, Shape aoi, RenderingHints hints) Constructs a RenderContext with a given transform. -
Method Summary
Modifier and TypeMethodDescriptionclone()Makes a copy of a RenderContext.voidconcatenateTransform(AffineTransform modTransform) Modifies the current user-to-device transform by appending another transform.voidconcetenateTransform(AffineTransform modTransform) Deprecated.Gets the ares of interest currently contained in the RenderContext.Gets the rendering hints of thisRenderContext.Gets the current user-to-device AffineTransform.voidpreConcatenateTransform(AffineTransform modTransform) Modifies the current user-to-device transform by prepending another transform.voidpreConcetenateTransform(AffineTransform modTransform) Deprecated.replaced bypreConcatenateTransform(AffineTransform).voidsetAreaOfInterest(Shape newAoi) Sets the current area of interest.voidsetRenderingHints(RenderingHints hints) Sets the rendering hints of thisRenderContext.voidsetTransform(AffineTransform newTransform) Sets the current user-to-device AffineTransform contained in the RenderContext to a given transform.Methods declared in class Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionbooleanCompares 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
-
RenderContext
Constructs a RenderContext with a given transform. The area of interest is supplied as a Shape, and the rendering hints are supplied as a RenderingHints object.- Parameters:
usr2dev- an AffineTransform.aoi- a Shape representing the area of interest.hints- a RenderingHints object containing rendering hints.
-
RenderContext
Constructs a RenderContext with a given transform. The area of interest is taken to be the entire renderable area. No rendering hints are used.- Parameters:
usr2dev- an AffineTransform.
-
RenderContext
Constructs a RenderContext with a given transform and rendering hints. The area of interest is taken to be the entire renderable area.- Parameters:
usr2dev- an AffineTransform.hints- a RenderingHints object containing rendering hints.
-
RenderContext
Constructs a RenderContext with a given transform and area of interest. The area of interest is supplied as a Shape. No rendering hints are used.- Parameters:
usr2dev- an AffineTransform.aoi- a Shape representing the area of interest.
-
-
Method Details
-
getRenderingHints
Gets the rendering hints of thisRenderContext.- Returns:
- a
RenderingHintsobject that represents the rendering hints of thisRenderContext. - See Also:
-
setRenderingHints
Sets the rendering hints of thisRenderContext.- Parameters:
hints- aRenderingHintsobject that represents the rendering hints to assign to thisRenderContext.- See Also:
-
setTransform
Sets the current user-to-device AffineTransform contained in the RenderContext to a given transform.- Parameters:
newTransform- the new AffineTransform.- See Also:
-
preConcatenateTransform
Modifies the current user-to-device transform by prepending another transform. In matrix notation the operation is:[this] = [modTransform] x [this]
- Parameters:
modTransform- the AffineTransform to prepend to the current usr2dev transform.- Since:
- 1.3
-
preConcetenateTransform
Deprecated.replaced bypreConcatenateTransform(AffineTransform).Modifies the current user-to-device transform by prepending another transform. In matrix notation the operation is:[this] = [modTransform] x [this]
This method does the same thing as the preConcatenateTransform method. It is here for backward compatibility with previous releases which misspelled the method name.- Parameters:
modTransform- the AffineTransform to prepend to the current usr2dev transform.
-
concatenateTransform
Modifies the current user-to-device transform by appending another transform. In matrix notation the operation is:[this] = [this] x [modTransform]
- Parameters:
modTransform- the AffineTransform to append to the current usr2dev transform.- Since:
- 1.3
-
concetenateTransform
Deprecated.replaced byconcatenateTransform(AffineTransform).Modifies the current user-to-device transform by appending another transform. In matrix notation the operation is:[this] = [this] x [modTransform]
This method does the same thing as the concatenateTransform method. It is here for backward compatibility with previous releases which misspelled the method name.- Parameters:
modTransform- the AffineTransform to append to the current usr2dev transform.
-
getTransform
Gets the current user-to-device AffineTransform.- Returns:
- a reference to the current AffineTransform.
- See Also:
-
setAreaOfInterest
Sets the current area of interest. The old area is discarded.- Parameters:
newAoi- The new area of interest.- See Also:
-
getAreaOfInterest
Gets the ares of interest currently contained in the RenderContext.- Returns:
- a reference to the area of interest of the RenderContext, or null if none is specified.
- See Also:
-
clone
-
concatenateTransform(AffineTransform).