java.awt.image.renderable
public class: RenderContext [javadoc |
source]
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.
| Field Summary |
|---|
| RenderingHints | hints | Table of hints. May be null. |
| AffineTransform | usr2dev | Transform to convert user coordinates to device coordinates. |
| Shape | aoi | The area of interest. May be null. |
| Constructor: |
public RenderContext(AffineTransform usr2dev) {
this(usr2dev, null, null);
}
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.
|
public RenderContext(AffineTransform usr2dev,
RenderingHints hints) {
this(usr2dev, null, hints);
}
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.
|
public RenderContext(AffineTransform usr2dev,
Shape aoi) {
this(usr2dev, aoi, null);
}
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.
|
public RenderContext(AffineTransform usr2dev,
Shape aoi,
RenderingHints hints) {
this.hints = hints;
this.aoi = aoi;
this.usr2dev = (AffineTransform)usr2dev.clone();
}
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.
|
| Method from java.awt.image.renderable.RenderContext Summary: |
|---|
|
clone, concatenateTransform, concetenateTransform, getAreaOfInterest, getRenderingHints, getTransform, preConcatenateTransform, preConcetenateTransform, setAreaOfInterest, setRenderingHints, setTransform |
| Methods from java.lang.Object: |
|---|
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from java.awt.image.renderable.RenderContext Detail: |
public Object clone() {
RenderContext newRenderContext = new RenderContext(usr2dev,
aoi, hints);
return newRenderContext;
}
Makes a copy of a RenderContext. The area of interest is copied
by reference. The usr2dev AffineTransform and hints are cloned,
while the area of interest is copied by reference. |
public void concatenateTransform(AffineTransform modTransform) {
this.concetenateTransform(modTransform);
}
Modifies the current user-to-device transform by appending another
transform. In matrix notation the operation is:
[this] = [this] x [modTransform]
|
public void concetenateTransform(AffineTransform modTransform) {
usr2dev.concatenate(modTransform);
} Deprecated! replaced - by
concatenateTransform(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. |
public Shape getAreaOfInterest() {
return aoi;
}
Gets the ares of interest currently contained in the
RenderContext. |
public RenderingHints getRenderingHints() {
return hints;
}
Gets the rendering hints of this RenderContext. |
public AffineTransform getTransform() {
return (AffineTransform)usr2dev.clone();
}
Gets the current user-to-device AffineTransform. |
public void preConcatenateTransform(AffineTransform modTransform) {
this.preConcetenateTransform(modTransform);
}
Modifies the current user-to-device transform by prepending another
transform. In matrix notation the operation is:
[this] = [modTransform] x [this]
|
public void preConcetenateTransform(AffineTransform modTransform) {
usr2dev.preConcatenate(modTransform);
} Deprecated! replaced - by
preConcatenateTransform(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. |
public void setAreaOfInterest(Shape newAoi) {
aoi = newAoi;
}
Sets the current area of interest. The old area is discarded. |
public void setRenderingHints(RenderingHints hints) {
this.hints = hints;
}
Sets the rendering hints of this RenderContext. |
public void setTransform(AffineTransform newTransform) {
usr2dev = (AffineTransform)newTransform.clone();
}
Sets the current user-to-device AffineTransform contained
in the RenderContext to a given transform. |