Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Class java.awt.image.renderable.RenderableImageOp

java.lang.Object
    |
    +----java.awt.image.renderable.RenderableImageOp

public class RenderableImageOp
extends Object
implements RenderableImage
This class handles the renderable aspects of an operation with help from its associated instance of a ContextualRenderedImageFactory.


Constructor Summary
 RenderableImageOp(String CRIFName, ParameterBlock pb)
Constructs a RenderedImageOp given the name of a class implementing the ContextualRenderedImageFactory interface, and a ParameterBlock containing RenderableImage sources and other parameters.
 

Method Summary
RenderedImage  getDefaultRendering()
Gets a RenderedImage instance of this image with a default width and height in pixels.
float  getHeight()
Gets the height in user coordinate space.
RenderedImage  getImage(RenderContext renderContext)
Produces a RenderedImage which represents this RenderableImageOp (including its Renderable sources) rendered according to the given RenderContext.
float  getMaxXCoord()
Gets the maxumum X coordinate for image data.
float  getMaxYCoord()
Gets the maximum Y coordinate for image data.
float  getMinXCoord()
Gets the minimum X coordinate for image data.
float  getMinYCoord()
Gets the minimum Y coordinate for image data.
Object  getProperty(String name)
Gets a property from the property set of this image.
String[]  getPropertyNames()
Return a list of names recognized by getProperty(String).
RenderedImage  getScaledRendering(int w, int h, Hashtable hints)
Gets a RenderedImage instance of this image with width w, and height h in pixels.
Vector  getSources()
Returns a vector of RenderableImages that are the sources of image data for this RenderableImage.
float  getWidth()
Gets the width in user coordinate space.
ParameterBlock  setParameterBlock(ParameterBlock pb)
Change the current ParameterBlock of the operation, allowing editing of image rendering chains.
 
Methods inherited from class java.lang.Object
 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RenderableImageOp

public RenderableImageOp(String CRIFName,
                         ParameterBlock pb) throws ClassNotFoundException, IllegalAccessException, InstantiationException
Constructs a RenderedImageOp given the name of a class implementing the ContextualRenderedImageFactory interface, and a ParameterBlock containing RenderableImage sources and other parameters. Any RenderedImage sources referenced by the ParameterBlock will be ignored.
Parameters:
name - a String containing the name of a class implementing ContextualRenderedImageFactory that implements the desired operation. This will be dynamically loaded by Class.forName().
pb - a ParameterBlock conating this operation's source images and other parameters necessary for the operation to run.
Throws:
ClassNotFoundException - if the class cannot be found.
IllegalAccessException - if the class or initializer is not accessible.
InstantiationException - if the CRIF class is an abstract class, an interface, not an instance of ContextualRenderedImageFactory, or if its instantiation fails for any other reason.
See Also:
Class
Method Detail

getImage

public RenderedImage getImage(RenderContext renderContext)
Produces a RenderedImage which represents this RenderableImageOp (including its Renderable sources) rendered according to the given RenderContext.

This method supports chaining of either Renderable or RenderedImage operations. If the first source of sources in the ParameterBlock used to construct the RenderableImageOp are RenderableImages, then a three step process is followed:

  1. It calls mapRenderContext() on its associated CRIF for each RenderableImage source in the ParameterBlock;
  2. It calls getImage() on each of its RenderableImage sources using the backwards-mapped RenderContexts obtaing in step 1, resulting in a rendering of each source;
  3. It calls the ContextualRenderedImageFactory.createOp() method with a new ParameterBlock containing the parameters of the RenderableImageOp and the RenderedImages that were created in the getImage() calls.

If the first element or elements in the source Vector of the ParameterBlock used to construct the RenderableImageOp are instances of RenderedImage, then the CRIF.createOp() method is called immediately using the original ParameterBlock. This provides a basis case for the recursion.

Implements:
getImage in interface RenderableImage
Parameters:
renderContext - The RenderContext to use to perform the rendering.
Returns:
a RenderedImage containing the desired output image.

getSources

public Vector getSources()
Returns a vector of RenderableImages that are the sources of image data for this RenderableImage. Note that this method will often return an empty vector.
Implements:
getSources in interface RenderableImage
Returns:
a Vector of RenderableImages.

getProperty

public Object getProperty(String name)
Gets a property from the property set of this image.
Implements:
getProperty in interface RenderableImage
Parameters:
name - a String containging the name of the desired property.
Returns:
a reference to the property Object.

getPropertyNames

public String[] getPropertyNames()
Return a list of names recognized by getProperty(String).
Implements:
getPropertyNames in interface RenderableImage

getWidth

public float getWidth()
Gets the width in user coordinate space. The default width and height for image sources should be 1 unit high, by aspect ratio wide.
Implements:
getWidth in interface RenderableImage
Returns:
the width of the image in user coordinates.

getHeight

public float getHeight()
Gets the height in user coordinate space. The default width and height for image sources should be 1 unit high, by aspect ratio wide.
Implements:
getHeight in interface RenderableImage
Returns:
the height of the image in user coordinates.

getMinXCoord

public float getMinXCoord()
Gets the minimum X coordinate for image data. Be aware that a RenderableImage may have "infinite" extent, in which case this function will return -Float.MAX_VALUE.
Implements:
getMinXCoord in interface RenderableImage
Returns:
The minimum X coordinate of the rendering-independent image.

getMaxXCoord

public float getMaxXCoord()
Gets the maxumum X coordinate for image data. Be aware that a RenderableImage may have "infinite" extent, in which case this function will return Float.MAX_VALUE.
Implements:
getMaxXCoord in interface RenderableImage
Returns:
The maximum X coordinate of the rendering-independent image.

getMinYCoord

public float getMinYCoord()
Gets the minimum Y coordinate for image data. Be aware that a RenderableImage may have "infinite" extent, in which case this function will return -Float.MAX_VALUE.
Implements:
getMinYCoord in interface RenderableImage
Returns:
The minimum Y coordinate of the rendering-independent image.

getMaxYCoord

public float getMaxYCoord()
Gets the maximum Y coordinate for image data. Be aware that a RenderableImage may have "infinite" extent, in which case this function will return Float.MAX_VALUE.
Implements:
getMaxYCoord in interface RenderableImage
Returns:
The maximum Y coordinate of the rendering-independent image.

getScaledRendering

public RenderedImage getScaledRendering(int w,
                                        int h,
                                        Hashtable hints)
Gets a RenderedImage instance of this image with width w, and height h in pixels. The RenderContext is built automatically with an appropriate usr2dev transform and an area of interest of the full image. All the rendering hints come from hints passed in.
Implements:
getScaledRendering in interface RenderableImage
Parameters:
w - the width of rendered image in pixels.
h - the height of rendered image in pixels.
hints - a Hashtable of Hints to use during rendering.
Returns:
a RenderedImage containing the rendered data.

getDefaultRendering

public RenderedImage getDefaultRendering()
Gets a RenderedImage instance of this image with a default width and height in pixels. The RenderContext is built automatically with an appropriate usr2dev transform and an area of interest of the full image. All the rendering hints come from hints passed in. Implementors of this interface must be sure that there is a defined default width and height.
Implements:
getDefaultRendering in interface RenderableImage
Returns:
a RenderedImage containing the rendered data.

setParameterBlock

public ParameterBlock setParameterBlock(ParameterBlock pb)
Change the current ParameterBlock of the operation, allowing editing of image rendering chains. The effects of such a change will be visible when a new rendering is created from this RenderableImageOp or any dependent RenderableImageOp.
Parameters:
pb - the new ParameterBlock.
Returns:
the old ParameterBlock.

Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

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.