javax.media.jai
Class RemoteImage

java.lang.Object
  extended byjavax.media.jai.PlanarImage
      extended byjavax.media.jai.RemoteImage
All Implemented Interfaces:
ImageJAI, PropertyChangeEmitter, PropertySource, RenderedImage, WritablePropertySource

Deprecated. as of JAI 1.1 in favor of javax.media.jai.remote.RemoteJAI.

public class RemoteImage
extends PlanarImage

A sub-class of PlanarImage which represents an image on a remote server machine.

The image may be constructed from a RenderedImage or from an imaging chain in either the rendered or renderable mode. Network errors (detected via throws of RemoteExceptions) are dealt with through retries; when the limit of retries is exceeded, a null Raster may be returned. The default number of retries is set to 5 and the default timeout is set to 1 second.

Note that the registry of the server will be used. In particular if an OperationRegistry was present in the RenderingHints used to construct a RenderedOp or RenderableOp it will not be serialized and transmitted to the server.

Image layout attributes, once requested, are cached locally for speed.


Field Summary
protected  boolean[] fieldValid
          Deprecated. Valid bits for locally cached variables.
protected  int numRetries
          Deprecated. The number of retries.
protected  String[] propertyNames
          Deprecated. Locally cached version of properties.
protected  com.sun.media.jai.rmi.RMIImage remoteImage
          Deprecated. The RMIImage our data will come from.
protected  int timeout
          Deprecated. The amount of time between retries (milliseconds).
 
Fields inherited from class javax.media.jai.PlanarImage
colorModel, eventManager, height, minX, minY, properties, sampleModel, tileFactory, tileGridXOffset, tileGridYOffset, tileHeight, tileWidth, width
 
Constructor Summary
RemoteImage(String serverName, RenderableOp source, RenderContext renderContext)
          Deprecated. Constructs a RemoteImage from a RenderableOp and RenderContext.
RemoteImage(String serverName, RenderedImage source)
          Deprecated. Constructs a RemoteImage from a RenderedImage.
RemoteImage(String serverName, RenderedOp source)
          Deprecated. Constructs a RemoteImage from a RenderedOp, i.e., an imaging directed acyclic graph (DAG).
 
Method Summary
 WritableRaster copyData(WritableRaster raster)
          Deprecated. Returns an arbitrary rectangular region of the RemoteImage in a user-supplied WritableRaster.
protected  void finalize()
          Deprecated. Disposes of any resources allocated for remote operation.
 ColorModel getColorModel()
          Deprecated. Returns the ColorModel associated with this image.
 Raster getData()
          Deprecated. Returns the image as one large tile.
 Raster getData(Rectangle rect)
          Deprecated. Returns an arbitrary rectangular region of the RemoteImage.
 int getHeight()
          Deprecated. Returns the height of the RemoteImage in pixels.
 int getMaxX()
          Deprecated. Returns the X coordinate of the column immediately to the right of the rightmost column of the image.
 int getMaxY()
          Deprecated. Returns the Y coordinate of the row immediately below the bottom row of the image.
 int getMinX()
          Deprecated. Returns the X coordinate of the leftmost column of the image.
 int getMinY()
          Deprecated. Returns the Y coordinate of the uppermost row of the image.
 int getNumRetries()
          Deprecated. Gets the number of retries.
 Object getProperty(String name)
          Deprecated. Gets a property from the property set of this image.
 String[] getPropertyNames()
          Deprecated. Returns a list of names recognized by getProperty.
 SampleModel getSampleModel()
          Deprecated. Returns the SampleModel associated with this image.
 Vector getSources()
          Deprecated. Returns a vector of RenderedImages that are the sources of image data for this RenderedImage.
 Raster getTile(int x, int y)
          Deprecated. Returns tile (x, y).
 int getTileGridXOffset()
          Deprecated. Returns the X offset of the tile grid.
 int getTileGridYOffset()
          Deprecated. Returns the Y offset of the tile grid.
 int getTileHeight()
          Deprecated. Returns the height of a tile in pixels.
 int getTileWidth()
          Deprecated. Returns the width of a tile in pixels.
 int getTimeout()
          Deprecated. Gets the amount of time between retries.
 int getWidth()
          Deprecated. Returns the width of the RemoteImage in pixels.
protected  void requestField(int fieldIndex)
          Deprecated. Causes an instance variable of the remote object to be cached locally, retrying with a default/user specified timeout.
protected  void requestField(int fieldIndex, int retries, int timeout)
          Deprecated. Cause an instance variable of the remote object to be cached locally, retrying a given number of times with a given timeout.
 void setNumRetries(int numRetries)
          Deprecated. Set the number of retries.
 void setTimeout(int timeout)
          Deprecated. Set the amount of time between retries.
 
Methods inherited from class javax.media.jai.PlanarImage
addPropertyChangeListener, addPropertyChangeListener, addSink, addSink, addSource, addTileComputationListener, cancelTiles, copyData, copyExtendedData, createColorModel, createSnapshot, createWritableRaster, dispose, getAsBufferedImage, getAsBufferedImage, getBounds, getDefaultColorModel, getExtendedData, getGraphics, getImageID, getMaxTileX, getMaxTileY, getMinTileX, getMinTileY, getNumBands, getNumSources, getNumXTiles, getNumYTiles, getProperties, getPropertyClass, getPropertyNames, getSinks, getSource, getSourceImage, getSourceObject, getSplits, getTileComputationListeners, getTileFactory, getTileIndices, getTileRect, getTiles, getTiles, overlapsMultipleTiles, prefetchTiles, queueTiles, removeProperty, removePropertyChangeListener, removePropertyChangeListener, removeSink, removeSink, removeSinks, removeSource, removeSources, removeTileComputationListener, setImageLayout, setProperties, setProperty, setSource, setSources, tileXToX, tileXToX, tileYToY, tileYToY, toString, wrapRenderedImage, XToTileX, XToTileX, YToTileY, YToTileY
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

remoteImage

protected com.sun.media.jai.rmi.RMIImage remoteImage
Deprecated. 
The RMIImage our data will come from.


fieldValid

protected boolean[] fieldValid
Deprecated. 
Valid bits for locally cached variables.


propertyNames

protected String[] propertyNames
Deprecated. 
Locally cached version of properties.


timeout

protected int timeout
Deprecated. 
The amount of time between retries (milliseconds).


numRetries

protected int numRetries
Deprecated. 
The number of retries.

Constructor Detail

RemoteImage

public RemoteImage(String serverName,
                   RenderedImage source)
Deprecated. 
Constructs a RemoteImage from a RenderedImage.

The RenderedImage source should ideally be a lightweight reference to an image available locally on the server or over a further network link.

Although it is legal to use any RenderedImage, one should be aware that this will require copying of the image data via transmission over a network link.

The name of the server must be supplied in the form appropriate to the implementation. In the reference port of JAI, RMI is used to implement remote imaging so that the server name must be supplied in the format

 host:port
 
where the port number is optional and may be supplied only if the host name is supplied. If this parameter is null the default is to search for the RMIImage service on the local host at the default rmiregistry port (1099).

Parameters:
serverName - The name of the server in the appropriate format.
source - A RenderedImage source which must not be null.
Throws:
IllegalArgumentException - if source is null.

RemoteImage

public RemoteImage(String serverName,
                   RenderedOp source)
Deprecated. 
Constructs a RemoteImage from a RenderedOp, i.e., an imaging directed acyclic graph (DAG).

This DAG will be copied over to the server where it will be transformed into an OpImage chain using the server's local OperationRegistry and available RenderedImageFactory objects.

The name of the server must be supplied in the form appropriate to the implementation. In the reference port of JAI, RMI is used to implement remote imaging so that the server name must be supplied in the format

 host:port
 
where the port number is optional and may be supplied only if the host name is supplied. If this parameter is null the default is to search for the RMIImage service on the local host at the default rmiregistry port (1099).

Note that the properties of the RemoteImage will be those of the RenderedOp node and not of its rendering.

Parameters:
serverName - The name of the server in the appropriate format.
source - A RenderedOp source which must not be null.
Throws:
IllegalArgumentException - if source is null.

RemoteImage

public RemoteImage(String serverName,
                   RenderableOp source,
                   RenderContext renderContext)
Deprecated. 
Constructs a RemoteImage from a RenderableOp and RenderContext. The entire RenderableOp DAG will be copied over to the server.

The name of the server must be supplied in the form appropriate to the implementation. In the reference port of JAI, RMI is used to implement remote imaging so that the server name must be supplied in the format

 host:port
 
where the port number is optional and may be supplied only if the host name is supplied. If this parameter is null the default is to search for the RMIImage service on the local host at the default rmiregistry port (1099).

Note that the properties of the RemoteImage will be those of the RenderableOp node and not of its rendering.

Parameters:
serverName - The name of the server in the appropriate format.
source - A RenderableOp source which must not be null.
renderContext - The rendering context which may be null.
Throws:
IllegalArgumentException - if source is null.
Method Detail

finalize

protected void finalize()
Deprecated. 
Disposes of any resources allocated for remote operation.

Overrides:
finalize in class PlanarImage

setTimeout

public void setTimeout(int timeout)
Deprecated. 
Set the amount of time between retries.

Parameters:
timeout - The time interval between retries (milliseconds). If this is non-positive the time interval is not changed.

getTimeout

public int getTimeout()
Deprecated. 
Gets the amount of time between retries.


setNumRetries

public void setNumRetries(int numRetries)
Deprecated. 
Set the number of retries.

Parameters:
numRetries - The number of retries. If this is non-positive the number of retries is not changed.

getNumRetries

public int getNumRetries()
Deprecated. 
Gets the number of retries.


requestField

protected void requestField(int fieldIndex,
                            int retries,
                            int timeout)
Deprecated. 
Cause an instance variable of the remote object to be cached locally, retrying a given number of times with a given timeout.

Parameters:
fieldIndex - the index of the desired field.
retries - the maximum number of retries; must be positive.
timeout - the timeout interval between retries, in milliseconds; must be positive.
Throws:
ArrayIndexOutOfBoundsException - if fieldIndex is negative or >= NUM_VARS.
IllegalArgumentException - if retries or timeout is non-positive.

requestField

protected void requestField(int fieldIndex)
Deprecated. 
Causes an instance variable of the remote object to be cached locally, retrying with a default/user specified timeout.

Parameters:
fieldIndex - the index of the desired field.
Throws:
ArrayIndexOutOfBoundsException - if fieldIndex is negative or >= NUM_VARS.

getMinX

public int getMinX()
Deprecated. 
Returns the X coordinate of the leftmost column of the image.

Specified by:
getMinX in interface RenderedImage
Overrides:
getMinX in class PlanarImage

getMaxX

public int getMaxX()
Deprecated. 
Returns the X coordinate of the column immediately to the right of the rightmost column of the image.

Overrides:
getMaxX in class PlanarImage

getMinY

public int getMinY()
Deprecated. 
Returns the Y coordinate of the uppermost row of the image.

Specified by:
getMinY in interface RenderedImage
Overrides:
getMinY in class PlanarImage

getMaxY

public int getMaxY()
Deprecated. 
Returns the Y coordinate of the row immediately below the bottom row of the image.

Overrides:
getMaxY in class PlanarImage

getWidth

public int getWidth()
Deprecated. 
Returns the width of the RemoteImage in pixels.

Specified by:
getWidth in interface RenderedImage
Overrides:
getWidth in class PlanarImage

getHeight

public int getHeight()
Deprecated. 
Returns the height of the RemoteImage in pixels.

Specified by:
getHeight in interface RenderedImage
Overrides:
getHeight in class PlanarImage

getTileWidth

public int getTileWidth()
Deprecated. 
Returns the width of a tile in pixels.

Specified by:
getTileWidth in interface RenderedImage
Overrides:
getTileWidth in class PlanarImage

getTileHeight

public int getTileHeight()
Deprecated. 
Returns the height of a tile in pixels.

Specified by:
getTileHeight in interface RenderedImage
Overrides:
getTileHeight in class PlanarImage

getTileGridXOffset

public int getTileGridXOffset()
Deprecated. 
Returns the X offset of the tile grid.

Specified by:
getTileGridXOffset in interface RenderedImage
Overrides:
getTileGridXOffset in class PlanarImage

getTileGridYOffset

public int getTileGridYOffset()
Deprecated. 
Returns the Y offset of the tile grid.

Specified by:
getTileGridYOffset in interface RenderedImage
Overrides:
getTileGridYOffset in class PlanarImage

getSampleModel

public SampleModel getSampleModel()
Deprecated. 
Returns the SampleModel associated with this image.

Specified by:
getSampleModel in interface RenderedImage
Overrides:
getSampleModel in class PlanarImage

getColorModel

public ColorModel getColorModel()
Deprecated. 
Returns the ColorModel associated with this image.

Specified by:
getColorModel in interface RenderedImage
Overrides:
getColorModel in class PlanarImage

getSources

public Vector getSources()
Deprecated. 
Returns a vector of RenderedImages that are the sources of image data for this RenderedImage. Note that this method will often return null.

Specified by:
getSources in interface RenderedImage
Overrides:
getSources in class PlanarImage

getProperty

public Object getProperty(String name)
Deprecated. 
Gets a property from the property set of this image. If the property name is not recognized, java.awt.Image.UndefinedProperty will be returned.

Specified by:
getProperty in interface PropertySource
Overrides:
getProperty in class PlanarImage
Parameters:
name - the name of the property to get, as a String.
Returns:
a reference to the property Object, or the value java.awt.Image.UndefinedProperty.
Throws:
IllegalArgumentException - if propertyName is null.

getPropertyNames

public String[] getPropertyNames()
Deprecated. 
Returns a list of names recognized by getProperty.

Specified by:
getPropertyNames in interface PropertySource
Overrides:
getPropertyNames in class PlanarImage
Returns:
an array of Strings containing valid property names or null.

getTile

public Raster getTile(int x,
                      int y)
Deprecated. 
Returns tile (x, y). Note that x and y are indexes into the tile array not pixel locations. The Raster that is returned is a copy.

Specified by:
getTile in interface RenderedImage
Specified by:
getTile in class PlanarImage
Parameters:
x - the X index of the requested tile in the tile array
y - the Y index of the requested tile in the tile array

getData

public Raster getData()
Deprecated. 
Returns the image as one large tile.

Specified by:
getData in interface RenderedImage
Overrides:
getData in class PlanarImage
Returns:
A Raster containing the entire image data.

getData

public Raster getData(Rectangle rect)
Deprecated. 
Returns an arbitrary rectangular region of the RemoteImage.

The rect parameter may be null, in which case the entire image data is returned in the Raster.

If rect is non-null but does not intersect the image bounds at all, an IllegalArgumentException will be thrown.

Specified by:
getData in interface RenderedImage
Overrides:
getData in class PlanarImage
Parameters:
rect - The Rectangle of interest.
Returns:
A Raster containing the specified image data.

copyData

public WritableRaster copyData(WritableRaster raster)
Deprecated. 
Returns an arbitrary rectangular region of the RemoteImage in a user-supplied WritableRaster. The rectangular region is the entire image if the argument is null or the intersection of the argument bounds with the image bounds if the region is non-null. If the argument is non-null but has bounds which have an empty intersection with the image bounds the return value will be null. The return value may also be null if the argument is non-null but is incompatible with the Raster returned from the remote image.

Specified by:
copyData in interface RenderedImage
Overrides:
copyData in class PlanarImage
Parameters:
raster - A WritableRaster to hold the copied pixel data of this image.
Returns:
A reference to the supplied WritableRaster, or to a new WritableRaster if the supplied one was null.