Class java.awt.image.renderable.RenderContext
java.lang.Object
|
+----java.awt.image.renderable.RenderContext
- public class RenderContext
- extends Object
- implements 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 getImage method. Most of the methods of RenderContexts are
not meant to used by users, but by the RenderableImage and operator
classed which it may be passed to.
The AffineTransform and Hashtable parameters passed into and out of
this class are cloned. The Shape parameters are not necessarily
cloneable and are therefore only reference copied. Changing
instances of Shape that are also in use by instances of
RenderContext may have undesired side effects.
Methods inherited from class java.lang.Object
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RenderContext
public RenderContext(AffineTransform usr2dev,
Shape aoi,
Hashtable 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 Hashtable.
- Parameters:
usr2dev
- an AffineTransform.
aoi
- a Shape representing the area of interest.
hints
- a Hashtable containing rendering hints.
RenderContext
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
- an AffineTransform.
RenderContext
public RenderContext(AffineTransform usr2dev,
Hashtable 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 Hashtable containing rendering hints.
RenderContext
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
- an AffineTransform.
aoi
- a Shape representing the area of interest.
getKeys
public Enumeration getKeys()
- Returns an Enumeration of the hint keys.
- Returns:
- returns an enumeration of the keys in the
hints Hashtable, or null if no hints are present.
observeHint
public Object observeHint(Object key)
- Searches for a key in the Hashtable of rendering hints.
If the key is found, the associated value is returned.
The key and value are also copied into the hintsObserved
Hashtable.
- Parameters:
key
- the hint's key, as an Object.
- Returns:
- the Object value associated with the key.
getHint
public Object getHint(Object key)
- Returns the value of a hint from the hints Hashtable.
If there are no hints, or the desired key is not present,
null is returned.
- Parameters:
key
- the hint's key, as an Object.
- Returns:
- the hint associated with the key, or null.
setHint
public void setHint(Object key,
Object value)
- Sets a hint in the hints Hashtable.
- Parameters:
key
- the hint's key, as an Object.
value
- the value to assign to the hint.
getHintsObserved
public Hashtable getHintsObserved()
- Returns a copy of the Hashtable of hints that have been observed
by this renderContext. The hint keys and values are copied
by reference.
- Returns:
- a Hashtable containing the hints observed.
unobserveHint
public void unobserveHint(Object key)
- Removes a hint from the hintsObserved Hashtable.
- Parameters:
key
- The key for the hint to be removed from
the observed hints table.
addHintsObserved
public void addHintsObserved(Hashtable sourceHints)
- Adds hints from a supplied Hashtable to the Hashtable of
observed hints. The hints will also be copied into the hints
hashtable. If the current hints tables are null, new tables
will be created. The tables will each be copies of the
supplied table, because all the hints will be considered to
have been observed.
- Parameters:
sourceHints
- The source hints to add to this RenderContext's
hintsObserved Hashtable.
addHintsObserved
public void addHintsObserved(RenderContext rc)
- Adds the observed hints from another RenderContext to this
RenderContext's observed hints table.
- Parameters:
rc
- The RenderContext from which to get the observed hints.
setHintsObserved
public void setHintsObserved(Hashtable sourceObserved)
- Sets hintsObserved to a new table. This is accomplished by
cloning the input parameter. Any current observed hints are
removed from the hints table and discarded. All entries in the
new observed hints table are added to the hints table.
- Parameters:
sourceObserved
- The source of observedHints.
setTransform
public void setTransform(AffineTransform newTransform)
- Sets the current user-to-device AffineTransform contained
in the RenderContext to a given transform.
- Parameters:
newTransform
- the new AffineTransform.
transform
public void transform(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
- the AffineTransform to prepend to the
current usr2dev transform.
getTransform
public AffineTransform getTransform()
- Gets the current user-to-device AffineTransform.
- Returns:
- A reference to the current AffineTransform.
setAreaOfInterest
public void setAreaOfInterest(Shape newAoi)
- Sets the current area of interest. The old area is discarded.
- Parameters:
newAoi
- The new area of interest.
getAreaOfInterest
public Shape 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.
clone
public Object clone()
- Makes a copy of a RenderContext. The area of interest is copied
by reference. The usr2dev Transform and hints tables are
actually cloned.
- Returns:
- The new cloned RenderContext.
- Overrides:
- clone in class Object
Submit a bug or feature
Submit comments/suggestions about new javadoc look.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.