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

public Class RenderContext

extends Object
implements Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable
Imports
java.util.*, java.awt.geom.*, java.awt.*, java.awt.image.*

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

Modifier and TypeField and Description
pack-priv Shape
aoi

The area of interest.

pack-priv RenderingHints
hints

Table of hints.

pack-priv AffineTransform
usr2dev

Transform to convert user coordinates to device coordinates.

Constructor Summary

AccessConstructor and Description
public
RenderContext(AffineTransform
an AffineTransform.
usr2dev
,
Shape
a Shape representing the area of interest.
aoi
,
RenderingHints
a RenderingHints object containing rendering hints.
hints
)

Constructs a RenderContext with a given transform.

public
RenderContext(AffineTransform
an AffineTransform.
usr2dev
)

Constructs a RenderContext with a given transform.

public
RenderContext(AffineTransform
an AffineTransform.
usr2dev
,
RenderingHints
a RenderingHints object containing rendering hints.
hints
)

Constructs a RenderContext with a given transform and rendering hints.

public
RenderContext(AffineTransform
an AffineTransform.
usr2dev
,
Shape
a Shape representing the area of interest.
aoi
)

Constructs a RenderContext with a given transform and area of interest.

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

the new cloned RenderContext.
clone
()

Overrides java.lang.Object.clone.

Makes a copy of a RenderContext.

public void
concatenateTransform(AffineTransform
the AffineTransform to append to the current usr2dev transform.
modTransform
)

Modifies the current user-to-device transform by appending another transform.

public void
concetenateTransform(AffineTransform
the AffineTransform to append to the current usr2dev transform.
modTransform
)
Deprecated replaced by concatenateTransform(AffineTransform).

Modifies the current user-to-device transform by appending another transform.

public Shape

Returns:

a reference to the area of interest of the RenderContext, or null if none is specified.
getAreaOfInterest
()

Gets the ares of interest currently contained in the RenderContext.

public RenderingHints

Returns:

a RenderingHints object that represents the rendering hints of this RenderContext.
getRenderingHints
()

Gets the rendering hints of this RenderContext.

public AffineTransform

Returns:

a reference to the current AffineTransform.
getTransform
()

Gets the current user-to-device AffineTransform.

public void
preConcatenateTransform(AffineTransform
the AffineTransform to prepend to the current usr2dev transform.
modTransform
)

Modifies the current user-to-device transform by prepending another transform.

public void
preConcetenateTransform(AffineTransform
the AffineTransform to prepend to the current usr2dev transform.
modTransform
)
Deprecated replaced by preConcatenateTransform(AffineTransform).

Modifies the current user-to-device transform by prepending another transform.

public void
setAreaOfInterest(Shape
The new area of interest.
newAoi
)

Sets the current area of interest.

public void
setRenderingHints(RenderingHints
a RenderingHints object that represents the rendering hints to assign to this RenderContext.
hints
)

Sets the rendering hints of this RenderContext.

public void
setTransform(AffineTransform
the new AffineTransform.
newTransform
)

Sets the current user-to-device AffineTransform contained in the RenderContext to a given transform.

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

aoiback to summary
pack-priv Shape aoi

The area of interest. May be null.

hintsback to summary
pack-priv RenderingHints hints

Table of hints. May be null.

usr2devback to summary
pack-priv AffineTransform usr2dev

Transform to convert user coordinates to device coordinates.

Constructor Detail

RenderContextback to summary
public RenderContext(AffineTransform usr2dev, Shape aoi, RenderingHints hints)

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:AffineTransform

an AffineTransform.

aoi:Shape

a Shape representing the area of interest.

hints:RenderingHints

a RenderingHints object containing rendering hints.

RenderContextback to summary
public RenderContext(AffineTransform usr2dev)

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:AffineTransform

an AffineTransform.

RenderContextback to summary
public RenderContext(AffineTransform usr2dev, RenderingHints 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:AffineTransform

an AffineTransform.

hints:RenderingHints

a RenderingHints object containing rendering hints.

RenderContextback to summary
public RenderContext(AffineTransform usr2dev, Shape aoi)

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:AffineTransform

an AffineTransform.

aoi:Shape

a Shape representing the area of interest.

Method Detail

cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

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.

Returns:Object

the new cloned RenderContext.

concatenateTransformback to summary
public void concatenateTransform(AffineTransform modTransform)

Modifies the current user-to-device transform by appending another transform. In matrix notation the operation is:

[this] = [this] x [modTransform]
Parameters
modTransform:AffineTransform

the AffineTransform to append to the current usr2dev transform.

Since
1.3
concetenateTransformback to summary
public void concetenateTransform(AffineTransform 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.
Parameters
modTransform:AffineTransform

the AffineTransform to append to the current usr2dev transform.

Annotations
@Deprecated
getAreaOfInterestback to summary
public Shape getAreaOfInterest()

Gets the ares of interest currently contained in the RenderContext.

Returns:Shape

a reference to the area of interest of the RenderContext, or null if none is specified.

See Also
setAreaOfInterest(Shape)
getRenderingHintsback to summary
public RenderingHints getRenderingHints()

Gets the rendering hints of this RenderContext.

Returns:RenderingHints

a RenderingHints object that represents the rendering hints of this RenderContext.

See Also
setRenderingHints(RenderingHints)
getTransformback to summary
public AffineTransform getTransform()

Gets the current user-to-device AffineTransform.

Returns:AffineTransform

a reference to the current AffineTransform.

See Also
setTransform(AffineTransform)
preConcatenateTransformback to summary
public void preConcatenateTransform(AffineTransform modTransform)

Modifies the current user-to-device transform by prepending another transform. In matrix notation the operation is:

[this] = [modTransform] x [this]
Parameters
modTransform:AffineTransform

the AffineTransform to prepend to the current usr2dev transform.

Since
1.3
preConcetenateTransformback to summary
public void preConcetenateTransform(AffineTransform 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.
Parameters
modTransform:AffineTransform

the AffineTransform to prepend to the current usr2dev transform.

Annotations
@Deprecated
setAreaOfInterestback to summary
public void setAreaOfInterest(Shape newAoi)

Sets the current area of interest. The old area is discarded.

Parameters
newAoi:Shape

The new area of interest.

See Also
getAreaOfInterest
setRenderingHintsback to summary
public void setRenderingHints(RenderingHints hints)

Sets the rendering hints of this RenderContext.

Parameters
hints:RenderingHints

a RenderingHints object that represents the rendering hints to assign to this RenderContext.

See Also
getRenderingHints
setTransformback to summary
public void setTransform(AffineTransform newTransform)

Sets the current user-to-device AffineTransform contained in the RenderContext to a given transform.

Parameters
newTransform:AffineTransform

the new AffineTransform.

See Also
getTransform