javax.media.jai
Class RenderedOp

java.lang.Object
  |
  +--javax.media.jai.PlanarImage
        |
        +--javax.media.jai.RenderedOp

public class RenderedOp
extends PlanarImage
implements java.io.Serializable

A node in a rendered imaging chain. A RenderedOp stores an operation name (as a String), a ParameterBlock containing sources and miscellaneous parameters, and a RenderingHints containing rendering hints. A set of nodes may be joined together via the source Vectors within their ParameterBlocks to form a directed acyclic graph (DAG). The topology i.e., connectivity of the graph may be altered by changing the ParameterBlocks; the operation name, parameters, and rendering hints may also be changed.

Such chains are useful as arguments to a RemoteImage; they convey the structure of an imaging chain in a compact representation and at a suitably high level of abstraction to allow the server some leeway in materializing the results.

When any RenderedImage method is called on a RenderedOp, (any of getWidth(), getHeight(), getMinX(), getMinY(), getNumXTiles(), getNumYTiles(), getMinTileX(), getMinTileY(), getTileWidth(), getTileHeight(), getTileGridXOffset(), getTileGridYOffset(),getTile(), getData(), copyData(), getColorModel(), getSampleModel(), or getProperty() with a synthesized property name), the RenderedOp is implicitly rendered and becomes "frozen." Its operation name, ParameterBlock, and rendering hints may no longer be changed.

Furthermore, when some of the methods from PlanarImage are called, such as "get" and "set" methods on its source objects, the RenderedOp is implictly rendered and becomes "frozen."

Serialization of a "frozen" node has the effect of "thawing" it; in other words, the instance variable holding the reference to the rendering of the node is transient and is not placed into the serialized byte stream. This allows working chains to be passed to a remote server using remote method invocation (RMI). Note that RenderedOp nodes used to instantiate operations which have a corresponding OperationDescriptor the isImmediate() method of which returns true are rendered upon deserialization.

A node may be rendered explicitly by means of the createInstance() method. This method returns a PlanarImage rendering without freezing the node. This allows a chain to be manipulated dynamically and rendered multiple times.

The translation between RenderedOp chains and OpImage chains makes use of two levels of indirection provided by the OperationRegistry and RenderedImageFactory (RIF) facilities. First, the local OperationRegistry is used to map the operation name into a RIF. This RIF then constructs one or more OpImages to do the actual work (or returns a RenderedImage by other means). The local OperationRegistry is used in order to take advantage of RIFs that are known to a server without having to burden the client.

RenderedOp represents a single PlanarImage; its companion class, CollectionOp represents CollectionImage nodes.

The RenderedOp synthesizes several poperty values, which may not be removed. These are: image_width, image_height, image_min_x_coord, and image_min_y_coord.

See Also:
CollectionOp, Serialized Form

Field Summary
protected  PlanarImage theImage
          The rendering of the current image, not preserved over RMI.
protected  PropertySource thePropertySource
          The PropertySource containing the combined properties of all of the node's sources.
 
Fields inherited from class javax.media.jai.PlanarImage
colorModel, height, minX, minY, sampleModel, snapshot, source0, source1, sources, tileGridXOffset, tileGridYOffset, tileHeight, tileWidth, width
 
Constructor Summary
RenderedOp(OperationRegistry registry, java.lang.String opName, java.awt.image.renderable.ParameterBlock pb, java.awt.RenderingHints hints)
          Constructs a RenderedOp that will be used to instantiate a particular rendered operation from a given operation registry, an operation name, a ParameterBlock, and a set of rendering hints.
RenderedOp(java.lang.String opName, java.awt.image.renderable.ParameterBlock pb, java.awt.RenderingHints hints)
          Constructs a RenderedOp that will be used to instantiate a particular rendered operation from a given operation registry, an operation name, a ParameterBlock, and a set of rendering hints.
 
Method Summary
 void addNodeSource(java.lang.Object source)
          Adds a source to the ParameterBlock of this node.
 void addPropertyGenerator(PropertyGenerator pg)
          Adds a PropertyGenerator to the node.
 void addSink(PlanarImage sink)
          Renders the node if it has not already been rendered, and adds a PlanarImage sink to the list of sinks of the rendered image.
 void addSource(PlanarImage source)
          Renders the node if it has not already been rendered, and adds a PlanarImage source to the list of sources of the rendered image.
 java.awt.image.WritableRaster copyData()
          Renders the node if it has not already been rendered, and copies and returns the entire rendered image into a single raster.
 java.awt.image.WritableRaster copyData(java.awt.image.WritableRaster raster)
          Renders the node if it has not already been rendered, and copies a specified rectangle of the rendered image into the given WritableRaster.
 PlanarImage createInstance()
          Instantiate a PlanarImage that computes the result of this RenderedOp.
 byte getByteParameter(int index)
          Returns the specified parameter stored in the ParameterBlock of this node as a byte.
 char getCharParameter(int index)
          Returns the specified parameter stored in the ParameterBlock of this node as a char.
 java.awt.image.ColorModel getColorModel()
          Renders the node if it has not already been rendered, and returns the ColorModel of the rendered image.
 java.awt.image.Raster getData()
          Renders the node if it has not already been rendered, and returns the entire rendered image as a Raster.
 java.awt.image.Raster getData(java.awt.Rectangle rect)
          Renders the node if it has not already been rendered, and returns a specified rectangular region of the rendered image as a Raster.
 double getDoubleParameter(int index)
          Returns the specified parameter stored in the ParameterBlock of this node as a double.
 float getFloatParameter(int index)
          Returns the specified parameter stored in the ParameterBlock of this node as a float.
 int getHeight()
          Renders the node if it has not already been rendered, and returns the height of the rendered image.
 int getIntParameter(int index)
          Returns the specified parameter stored in the ParameterBlock of this node as an int.
 long getLongParameter(int index)
          Returns the specified parameter stored in the ParameterBlock of this node as a long.
 int getMaxX()
          Renders the node if it has not already been rendered, and returns the X coordinate of the column immediately to the right of the rightmost column of the rendered image.
 int getMaxY()
          Renders the node if it has not already been rendered, and returns the Y coordinate of the row immediately below the bottom row of the rendered image.
 int getMinX()
          Renders the node if it has not already been rendered, and returns the X coordinate of the leftmost column of the rendered image.
 int getMinY()
          Renders the node if it has not already been rendered, and returns the X coordinate of the uppermost row of the rendered image.
 java.lang.Object getNodeSource(int index)
           
 int getNumParameters()
          Returns the number of parameters stored in the ParameterBlock of this node.
 int getNumSources()
          Returns the number of sources stored in the ParameterBlock of this node.
 java.lang.Object getObjectParameter(int index)
          Returns the specified parameter stored in the ParameterBlock of this node as an Object.
 java.lang.String getOperationName()
          Returns the name of the operation this node represents as a String.
 java.awt.image.renderable.ParameterBlock getParameterBlock()
          Returns the ParameterBlock of this node.
 java.util.Vector getParameters()
          Returns the parameters stored in the ParameterBlock of this node.
 java.lang.Object getProperty(java.lang.String name)
          Returns the property associated with the specified property name, or java.awt.Image.UndefinedProperty if the specified property is not set on the image.
 java.lang.String[] getPropertyNames()
          Returns the names of properties available from this node.
 OperationRegistry getRegistry()
          Returns the OperationRegistry that is used by this node.
 PlanarImage getRendering()
          Returns the PlanarImage rendering associated with this RenderedOp node.
 java.awt.RenderingHints getRenderingHints()
          Returns the RenderingHints of this node.
 java.awt.image.SampleModel getSampleModel()
          Renders the node if it has not already been rendered, and returns the SampleModel of the rendered image.
 short getShortParameter(int index)
          Returns the specified parameter stored in the ParameterBlock of this node as a short.
 java.util.Vector getSinks()
          Renders the node if it has not already been rendered, and returns a Vector containing the currently available PlanarImage sinks of the rendered image, or null if no sinks are present.
 PlanarImage getSource(int index)
          Renders the node if it has not already been rendered, and returns the specified PlanarImage source of the rendered image.
 java.util.Vector getSources()
          Returns the sources stored in the ParameterBlock of this node.
 java.awt.image.Raster getTile(int tileX, int tileY)
          Renders the node if it has not already been rendered, and returns the specified tile of the rendered image.
 int getTileGridXOffset()
          Renders the node if it has not already been rendered, and returns the tile grid X offset of the rendered image.
 int getTileGridYOffset()
          Renders the node if it has not already been rendered, and returns the tile grid Y offset of the rendered image.
 int getTileHeight()
          Renders the node if it has not already been rendered, and returns the tile height of the rendered image.
 java.awt.image.Raster[] getTiles(java.awt.Point[] tileIndices)
          Renders the node if it has not already been rendered, and returns the tiles indicated by the tileIndices of the rendered image as an array of Rasters.
 int getTileWidth()
          Renders the node if it has not already been rendered, and returns the tile width of the rendered image.
 int getWidth()
          Renders the node if it has not already been rendered, and returns the width of the rendered image.
 void prefetchTiles(java.awt.Point[] tileIndices)
          Renders the node if it has not already been rendered.
 boolean removeSink(PlanarImage sink)
          Renders the node if it has not already been rendered, and removes a PlanarImage sink from the list of sinks of the rendered image.
 boolean removeSource(PlanarImage source)
          Renders the node if it has not already been rendered, and removes a PlanarImage source from the list of sources of the rendered image.
 void removeSources()
          Removes all the sources stored in the ParameterBlock of this node.
 void setNodeSource(java.lang.Object source, int index)
          Sets the specified source stored in the ParameterBlock of this node to a new source object.
 void setOperationName(java.lang.String opName)
          Sets the name of the operation this node represents.
 void setParameter(byte param, int index)
          Sets one of the node's parameters to a byte.
 void setParameter(char param, int index)
          Sets one of the node's parameters to a char.
 void setParameter(double param, int index)
          Sets one of the node's parameters to a double.
 void setParameter(float param, int index)
          Sets one of the node's parameters to a float.
 void setParameter(int param, int index)
          Sets one of the node's parameters to an int.
 void setParameter(long param, int index)
          Sets one of the node's parameters to a long.
 void setParameter(java.lang.Object param, int index)
          Sets one of the node's parameters to an Object.
 void setParameter(short param, int index)
          Sets one of the node's parameters to a short.
 void setParameterBlock(java.awt.image.renderable.ParameterBlock pb)
          Sets the ParameterBlock of this node.
 void setProperty(java.lang.String name, java.lang.Object value)
          Sets a local property on a node.
 void setRegistry(OperationRegistry registry)
          Sets the OperationRegistry that is used by this node.
 void setRenderingHints(java.awt.RenderingHints hints)
          Sets the RenderingHints of this node.
 void setSource(PlanarImage source, int index)
          Renders the node if it has not already been rendered, and sets the specified source of the rendered image to the supplied PlanarImage.
 void setSources(java.util.List sourceList)
          Replaces the sources in the ParameterBlock of this node with a new list of sources.
 void suppressProperty(java.lang.String name)
          Removes a named property from the property environment of this node.
 
Methods inherited from class javax.media.jai.PlanarImage
copyExtendedData, createColorModel, createSnapshot, dispose, finalize, getAsBufferedImage, getAsBufferedImage, getBounds, getExtendedData, getGraphics, getMaxTileX, getMaxTileY, getMinTileX, getMinTileY, getNumXTiles, getNumYTiles, getProperties, getPropertyNames, getSplits, getTileRect, removeSinks, setImageParameters, setImageParameters, setProperties, tileXToX, tileXToX, tileYToY, tileYToY, wrapRenderedImage, XToTileX, XToTileX, YToTileY, YToTileY
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theImage

protected transient PlanarImage theImage
The rendering of the current image, not preserved over RMI.

thePropertySource

protected transient PropertySource thePropertySource
The PropertySource containing the combined properties of all of the node's sources.
Constructor Detail

RenderedOp

public RenderedOp(OperationRegistry registry,
                  java.lang.String opName,
                  java.awt.image.renderable.ParameterBlock pb,
                  java.awt.RenderingHints hints)
Constructs a RenderedOp that will be used to instantiate a particular rendered operation from a given operation registry, an operation name, a ParameterBlock, and a set of rendering hints. All input parameters are saved by reference.
Parameters:
registry - The OperationRegistry to be used for instantiation. if null, the default registry is used.
opName - The operation name.
pb - The sources and other parameters. If null, it is assumed that this node has no sources and parameters.
hints - The rendering hints. If null, it is assumed that no hints are associated with the rendering.
Throws:
NullPointerException - if opName is null.

RenderedOp

public RenderedOp(java.lang.String opName,
                  java.awt.image.renderable.ParameterBlock pb,
                  java.awt.RenderingHints hints)
Constructs a RenderedOp that will be used to instantiate a particular rendered operation from a given operation registry, an operation name, a ParameterBlock, and a set of rendering hints. The default operation registry is used. All input parameters are saved by reference.
Parameters:
opName - The operation name.
pb - The sources and other parameters. If null, it is assumed that this node has no sources and parameters.
hints - The rendering hints. If null, it is assumed that no hints are associated with the rendering.
Throws:
NullPointerException - if opName is null.
Method Detail

getRegistry

public OperationRegistry getRegistry()
Returns the OperationRegistry that is used by this node. If the registry had not been set, the default registry is returned.

setRegistry

public void setRegistry(OperationRegistry registry)
Sets the OperationRegistry that is used by this node. If the specified registry is null, the default registry is used. If this node has been rendered and frozen, this method has no effect. The parameter is saved by reference.
Parameters:
registry - The new OperationRegistry to be set; it may be null.

getOperationName

public java.lang.String getOperationName()
Returns the name of the operation this node represents as a String.

setOperationName

public void setOperationName(java.lang.String opName)
Sets the name of the operation this node represents. If this node has been rendered and frozen, this method has no effect. The parameter is saved by reference.
Parameters:
opName - The new operation name to be set.
Throws:
NullPointerException - if opName is null.

getParameterBlock

public java.awt.image.renderable.ParameterBlock getParameterBlock()
Returns the ParameterBlock of this node.

setParameterBlock

public void setParameterBlock(java.awt.image.renderable.ParameterBlock pb)
Sets the ParameterBlock of this node. If this node has been rendered and frozen, this method has no effect. If the speicifed new ParameterBlock is null, it is assumed that this node has no input sources and parameters. The parameter is saved by reference.

This method does not validate the content of the supplied ParameterBlock. The caller should ensure that the sources and parameters in the ParameterBlock are suitable for the operation this node represents; otherwise some form of error or exception may occur at the time of rendering.

Parameters:
pb - The new ParameterBlock to be set; it may be null.

getRenderingHints

public java.awt.RenderingHints getRenderingHints()
Returns the RenderingHints of this node. It may be null.

setRenderingHints

public void setRenderingHints(java.awt.RenderingHints hints)
Sets the RenderingHints of this node. If this node has been rendered and frozen, this method has no effect. The parameter is saved by reference.
Parameters:
hints - The new RenderingHints to be set; it may be null.

createInstance

public PlanarImage createInstance()
Instantiate a PlanarImage that computes the result of this RenderedOp. The default OperationRegistry is used to translate operation names into actual OpImages.

During this method, all the sources supplied in the ParameterBlock are checked. If any of the sources is a RenderedOp, a rendering of that source is created. This propagates all the way up to the top of the op chain. If any of the sources is a Collection, then the collection is passed to the operation as-is. If there is a RenderedOp anywhere in the collection, it is up to the individual operation to create the rendering for that RenderedOp.

This method does not validate the sources and parameters stored in the ParameterBlock against the specification of the operation this node represents. It is the responsibility of the caller to ensure that the data in the ParameterBlock are suitable for this operation. Otherwise, some kind of exception or error will occure.

Returns:
The resulting image as a PlanarImage.

getRendering

public PlanarImage getRendering()
Returns the PlanarImage rendering associated with this RenderedOp node.

This method does not validate the sources and parameters stored in the ParameterBlock against the specification of the operation this node represents. It is the caller's responsibility to ensure that the data in the ParameterBlock are suitable for this operation. Otherwise, an exception or error will occur.


getPropertyNames

public java.lang.String[] getPropertyNames()
Returns the names of properties available from this node. These properties are a combination of those derived from prior nodes in the imaging chain, those set locally, and a number of locally derived, immutable properties based on the rendering associated with this node -- height, width, and so forth.
Returns:
An array of Strings containing valid property names.
Overrides:
getPropertyNames in class PlanarImage

getProperty

public java.lang.Object getProperty(java.lang.String name)
Returns the property associated with the specified property name, or java.awt.Image.UndefinedProperty if the specified property is not set on the image.
Parameters:
name - A String naming the property.
Throws:
java.lang.IllegalArgumentException - if name is null.
Overrides:
getProperty in class PlanarImage

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
Sets a local property on a node. The synthetic properties (containing image width, height, and position) may not be set. Local property settings override properties derived from prior nodes in the imaging chain.

Properties may be set on a RenderedOp node only prior to the creation of a rendering at that node. In general this means that setProperty() should be called only immediately after construction of a node.

If the node is serialized then serializable properties will also be serialized but non-serializable properties will be lost.

Parameters:
name - A String representing the property name.
value - The property's value, as an Object.
Throws:
RuntimeException - if method is called on a rendered node.
RuntimeException - if name conflicts with Synthetic property.
IllegalArgumentException - if name is null.
IllegalArgumentException - if value is null.
Overrides:
setProperty in class PlanarImage

addPropertyGenerator

public void addPropertyGenerator(PropertyGenerator pg)
Adds a PropertyGenerator to the node. The property values emitted by this property generator override any previous definitions.
Parameters:
pg - A PropertyGenerator to be added to this node's property environment.
Throws:
IllegalArgumentException - if pg is null.

suppressProperty

public void suppressProperty(java.lang.String name)
Removes a named property from the property environment of this node. Subsequent calls to getProperty(name) will return null, and name will not appear on the list of properties emitted by getPropertyNames().
Parameters:
name - A String naming the property to be suppressed.
Throws:
IllegalArgumentException - if name is null.
RuntimeException - if name conflicts with Synthetic property.

getNumSources

public int getNumSources()
Returns the number of sources stored in the ParameterBlock of this node. This may differ from the number of sources of the rendered image.
Overrides:
getNumSources in class PlanarImage

getSources

public java.util.Vector getSources()
Returns the sources stored in the ParameterBlock of this node. This may differ from the source vector of the rendered image.
Overrides:
getSources in class PlanarImage

getNodeSource

public java.lang.Object getNodeSource(int index)

addNodeSource

public void addNodeSource(java.lang.Object source)
Adds a source to the ParameterBlock of this node. If this node has been rendered, this method has no effect.
Parameters:
source - The source to be added to the ParameterBlock

setSources

public void setSources(java.util.List sourceList)
Replaces the sources in the ParameterBlock of this node with a new list of sources. If this node has been rendered, this method has no effect.
Parameters:
sourceList - A List of sources.
Throws:
java.lang.IllegalArgumentException - if sourceList is null.
Overrides:
setSources in class PlanarImage

setNodeSource

public void setNodeSource(java.lang.Object source,
                          int index)
Sets the specified source stored in the ParameterBlock of this node to a new source object. If this node has been rendered, this method has no effect.
Parameters:
source - The Source to be set.
index - The Index at which it is to be set.
Throws:
java.lang.IllegalArgumentException - if source is null.
ArrayIndexOutOfBoundsException - if index is invalid.

removeSources

public void removeSources()
Removes all the sources stored in the ParameterBlock of this node. If this node has been rendered, this method has no effect.
Overrides:
removeSources in class PlanarImage

getNumParameters

public int getNumParameters()
Returns the number of parameters stored in the ParameterBlock of this node.

getParameters

public java.util.Vector getParameters()
Returns the parameters stored in the ParameterBlock of this node.

getByteParameter

public byte getByteParameter(int index)
Returns the specified parameter stored in the ParameterBlock of this node as a byte. An ArrayIndexOutOfBoundsException may occur if an invalid index is supplied
Parameters:
index - The index of the parameter.
Throws:
ArrayIndexOutOfBoundsException - if index is invalid.

getCharParameter

public char getCharParameter(int index)
Returns the specified parameter stored in the ParameterBlock of this node as a char. An ArrayIndexOutOfBoundsException may occur if an invalid index is supplied
Parameters:
index - The index of the parameter.
Throws:
ArrayIndexOutOfBoundsException - if index is invalid.

getShortParameter

public short getShortParameter(int index)
Returns the specified parameter stored in the ParameterBlock of this node as a short. An ArrayIndexOutOfBoundsException may occur if an invalid index is supplied
Parameters:
index - The index of the parameter.
Throws:
ArrayIndexOutOfBoundsException - if index is invalid.

getIntParameter

public int getIntParameter(int index)
Returns the specified parameter stored in the ParameterBlock of this node as an int. An ArrayIndexOutOfBoundsException may occur if an invalid index is supplied
Parameters:
index - The index of the parameter.
Throws:
ArrayIndexOutOfBoundsException - if index is invalid.

getLongParameter

public long getLongParameter(int index)
Returns the specified parameter stored in the ParameterBlock of this node as a long. An ArrayIndexOutOfBoundsException may occur if an invalid index is supplied
Parameters:
index - The index of the parameter.
Throws:
ArrayIndexOutOfBoundsException - if index is invalid.

getFloatParameter

public float getFloatParameter(int index)
Returns the specified parameter stored in the ParameterBlock of this node as a float. An ArrayIndexOutOfBoundsException may occur if an invalid index is supplied
Parameters:
index - The index of the parameter.
Throws:
ArrayIndexOutOfBoundsException - if index is invalid.

getDoubleParameter

public double getDoubleParameter(int index)
Returns the specified parameter stored in the ParameterBlock of this node as a double. An ArrayIndexOutOfBoundsException may occur if an invalid index is supplied
Parameters:
index - The index of the parameter.
Throws:
ArrayIndexOutOfBoundsException - if index is invalid.

getObjectParameter

public java.lang.Object getObjectParameter(int index)
Returns the specified parameter stored in the ParameterBlock of this node as an Object. An ArrayIndexOutOfBoundsException may occur if an invalid index is supplied
Parameters:
index - The index of the parameter.
Throws:
ArrayIndexOutOfBoundsException - if index is invalid.

setParameter

public void setParameter(byte param,
                         int index)
Sets one of the node's parameters to a byte. If the node has been rendered, this has no effect. If the index lies beyond the current source list, the list is extended with nulls as needed.
Parameters:
param - The parameter, as a byte.
index - The index of the parameter.

setParameter

public void setParameter(char param,
                         int index)
Sets one of the node's parameters to a char. If the node has been rendered, this has no effect. If the index lies beyond the current source list, the list is extended with nulls as needed.
Parameters:
param - The parameter, as a char.
index - The index of the parameter.

setParameter

public void setParameter(short param,
                         int index)
Sets one of the node's parameters to a short. If the node has been rendered, this has no effect. If the index lies beyond the current source list, the list is extended with nulls as needed.
Parameters:
param - The parameter, as a short.
index - The index of the parameter.

setParameter

public void setParameter(int param,
                         int index)
Sets one of the node's parameters to an int. If the node has been rendered, this has no effect. If the index lies beyond the current source list, the list is extended with nulls as needed.
Parameters:
param - The parameter, as an int.
index - The index of the parameter.

setParameter

public void setParameter(long param,
                         int index)
Sets one of the node's parameters to a long. If the node has been rendered, this has no effect. If the index lies beyond the current source list, the list is extended with nulls as needed.
Parameters:
param - The parameter, as a long.
index - The index of the parameter.

setParameter

public void setParameter(float param,
                         int index)
Sets one of the node's parameters to a float. If the node has been rendered, this has no effect. If the index lies beyond the current source list, the list is extended with nulls as needed.
Parameters:
param - The parameter, as a float.
index - The index of the parameter.

setParameter

public void setParameter(double param,
                         int index)
Sets one of the node's parameters to a double. If the node has been rendered, this has no effect. If the index lies beyond the current source list, the list is extended with nulls as needed.
Parameters:
param - The parameter, as a double.
index - The index of the parameter.

setParameter

public void setParameter(java.lang.Object param,
                         int index)
Sets one of the node's parameters to an Object. If the node has been rendered, this has no effect. If the index lies beyond the current source list, the list is extended with nulls as needed.
Parameters:
param - The parameter, as an Object.
index - The index of the parameter.

getMinX

public int getMinX()
Renders the node if it has not already been rendered, and returns the X coordinate of the leftmost column of the rendered image.
Overrides:
getMinX in class PlanarImage

getMaxX

public int getMaxX()
Renders the node if it has not already been rendered, and returns the X coordinate of the column immediately to the right of the rightmost column of the rendered image.
Overrides:
getMaxX in class PlanarImage

getMinY

public int getMinY()
Renders the node if it has not already been rendered, and returns the X coordinate of the uppermost row of the rendered image.
Overrides:
getMinY in class PlanarImage

getMaxY

public int getMaxY()
Renders the node if it has not already been rendered, and returns the Y coordinate of the row immediately below the bottom row of the rendered image.
Overrides:
getMaxY in class PlanarImage

getWidth

public int getWidth()
Renders the node if it has not already been rendered, and returns the width of the rendered image.
Overrides:
getWidth in class PlanarImage

getHeight

public int getHeight()
Renders the node if it has not already been rendered, and returns the height of the rendered image.
Overrides:
getHeight in class PlanarImage

getTileWidth

public int getTileWidth()
Renders the node if it has not already been rendered, and returns the tile width of the rendered image.
Overrides:
getTileWidth in class PlanarImage

getTileHeight

public int getTileHeight()
Renders the node if it has not already been rendered, and returns the tile height of the rendered image.
Overrides:
getTileHeight in class PlanarImage

getTileGridXOffset

public int getTileGridXOffset()
Renders the node if it has not already been rendered, and returns the tile grid X offset of the rendered image.
Overrides:
getTileGridXOffset in class PlanarImage

getTileGridYOffset

public int getTileGridYOffset()
Renders the node if it has not already been rendered, and returns the tile grid Y offset of the rendered image.
Overrides:
getTileGridYOffset in class PlanarImage

getSampleModel

public java.awt.image.SampleModel getSampleModel()
Renders the node if it has not already been rendered, and returns the SampleModel of the rendered image.
Overrides:
getSampleModel in class PlanarImage

getColorModel

public java.awt.image.ColorModel getColorModel()
Renders the node if it has not already been rendered, and returns the ColorModel of the rendered image.
Overrides:
getColorModel in class PlanarImage

getTile

public java.awt.image.Raster getTile(int tileX,
                                     int tileY)
Renders the node if it has not already been rendered, and returns the specified tile of the rendered image.
Parameters:
tileX - The X index of the tile.
tileY - The Y index of the tile.
Returns:
The requested tile as a Raster.
Overrides:
getTile in class PlanarImage

getTiles

public java.awt.image.Raster[] getTiles(java.awt.Point[] tileIndices)
Renders the node if it has not already been rendered, and returns the tiles indicated by the tileIndices of the rendered image as an array of Rasters.
Parameters:
tileIndices - An array of Points representing TileIndices.
Returns:
An array of Raster containing the tiles corresponding to the given TileIndices.
Overrides:
getTiles in class PlanarImage

prefetchTiles

public void prefetchTiles(java.awt.Point[] tileIndices)
Renders the node if it has not already been rendered. Hints that the given tiles of the rendered image might be needed in the near future.
Parameters:
tileIndices - A list of tileIndices indicating which tiles to prefetch.
Overrides:
prefetchTiles in class PlanarImage

getData

public java.awt.image.Raster getData()
Renders the node if it has not already been rendered, and returns the entire rendered image as a Raster.
Overrides:
getData in class PlanarImage

getData

public java.awt.image.Raster getData(java.awt.Rectangle rect)
Renders the node if it has not already been rendered, and returns a specified rectangular region of the rendered image as a Raster.
Overrides:
getData in class PlanarImage

copyData

public java.awt.image.WritableRaster copyData()
Renders the node if it has not already been rendered, and copies and returns the entire rendered image into a single raster.
Overrides:
copyData in class PlanarImage

copyData

public java.awt.image.WritableRaster copyData(java.awt.image.WritableRaster raster)
Renders the node if it has not already been rendered, and copies a specified rectangle of the rendered image into the given WritableRaster.
Parameters:
raster - A WritableRaster to be filled with image data.
Returns:
A reference to the supplied WritableRaster.
Overrides:
copyData in class PlanarImage

getSource

public PlanarImage getSource(int index)
Renders the node if it has not already been rendered, and returns the specified PlanarImage source of the rendered image. If there is no source corresponding to the specified index, this method will throw an ArrayIndexOutOfBoundsException. The source returned may differ from the source stored in the ParameterBlock of this node.
Parameters:
index - The index of the desired source.
Returns:
A PlanarImage source.
Overrides:
getSource in class PlanarImage

addSource

public void addSource(PlanarImage source)
Renders the node if it has not already been rendered, and adds a PlanarImage source to the list of sources of the rendered image.
Parameters:
source - A PlanarImage to be added as a source.
Throws:
IllegalArgumentException - if source is null.
Overrides:
addSource in class PlanarImage

removeSource

public boolean removeSource(PlanarImage source)
Renders the node if it has not already been rendered, and removes a PlanarImage source from the list of sources of the rendered image.
Parameters:
source - A PlanarImage to be removed.
Returns:
true if the element was present, false otherwise.
Throws:
IllegalArgumentException - if source is null.
Overrides:
removeSource in class PlanarImage

setSource

public void setSource(PlanarImage source,
                      int index)
Renders the node if it has not already been rendered, and sets the specified source of the rendered image to the supplied PlanarImage. An ArrayIndexOutOfBoundsException may be thrown if an invalid index is supplied
Parameters:
source - The source, as a PlanarImage.
index - The index of the source.

getSinks

public java.util.Vector getSinks()
Renders the node if it has not already been rendered, and returns a Vector containing the currently available PlanarImage sinks of the rendered image, or null if no sinks are present.
Overrides:
getSinks in class PlanarImage

addSink

public void addSink(PlanarImage sink)
Renders the node if it has not already been rendered, and adds a PlanarImage sink to the list of sinks of the rendered image.
Throws:
IllegalArgumentException - if sink is null.
Overrides:
addSink in class PlanarImage

removeSink

public boolean removeSink(PlanarImage sink)
Renders the node if it has not already been rendered, and removes a PlanarImage sink from the list of sinks of the rendered image.
Throws:
IllegalArgumentException - if sink is null.
Overrides:
removeSink in class PlanarImage



Casa de Bender