javax.media.jai
Interface TileRequest


public interface TileRequest

Interface representing a TileScheduler request to compute a specific set of tiles for a given image with optional monitoring by TileComputationListeners.

Since:
JAI 1.1
See Also:
TileScheduler, TileComputationListener, RenderedOp, OpImage

Field Summary
static int TILE_STATUS_CANCELLED
          Status value indicating that the tile computation has been cancelled.
static int TILE_STATUS_COMPUTED
          Status value indicating that the tile has been computed successfully.
static int TILE_STATUS_FAILED
          Status value indicating that the tile computation failed.
static int TILE_STATUS_PENDING
          Status value indicating that the tile has yet to be processed.
static int TILE_STATUS_PROCESSING
          Status value indicating that the tile has is being processed.
 
Method Summary
 void cancelTiles(Point[] tileIndices)
          Issues a request to the TileScheduler which generated this TileRequest to cancel all tiles in the supplied parameter array which are associated with this request.
 PlanarImage getImage()
          Returns the image associated with the request.
 Point[] getTileIndices()
          Returns the tile indices of all tiles associated with the request.
 TileComputationListener[] getTileListeners()
          Returns the array of TileComputationListeners specified as monitoring the request.
 int getTileStatus(int tileX, int tileY)
          Returns one of the TILE_STATUS_* constants defined in this interface to indicate the status of the specified tile (optional operation).
 boolean isStatusAvailable()
          Whether this TileRequest implementation supports the getTileStatus() method.
 

Field Detail

TILE_STATUS_PENDING

public static final int TILE_STATUS_PENDING
Status value indicating that the tile has yet to be processed.

See Also:
Constant Field Values

TILE_STATUS_PROCESSING

public static final int TILE_STATUS_PROCESSING
Status value indicating that the tile has is being processed.

See Also:
Constant Field Values

TILE_STATUS_COMPUTED

public static final int TILE_STATUS_COMPUTED
Status value indicating that the tile has been computed successfully.

See Also:
Constant Field Values

TILE_STATUS_CANCELLED

public static final int TILE_STATUS_CANCELLED
Status value indicating that the tile computation has been cancelled.

See Also:
Constant Field Values

TILE_STATUS_FAILED

public static final int TILE_STATUS_FAILED
Status value indicating that the tile computation failed.

See Also:
Constant Field Values
Method Detail

getImage

public PlanarImage getImage()
Returns the image associated with the request. This is the image which is actually specified to the TileScheduler. For most PlanarImages (including OpImages) this will be the image on which queueTiles() was invoked; for RenderedOp nodes this will be the rendering of the node.


getTileIndices

public Point[] getTileIndices()
Returns the tile indices of all tiles associated with the request.


getTileListeners

public TileComputationListener[] getTileListeners()
Returns the array of TileComputationListeners specified as monitoring the request. The returned value should be null if there are no such listeners.


isStatusAvailable

public boolean isStatusAvailable()
Whether this TileRequest implementation supports the getTileStatus() method.


getTileStatus

public int getTileStatus(int tileX,
                         int tileY)
Returns one of the TILE_STATUS_* constants defined in this interface to indicate the status of the specified tile (optional operation). Implementations for which status is available, i.e., for which isStatusAvailable() returns true, may but are not required to support all status levels defined by this interface. The status levels must however be a subset of those herein defined.

Parameters:
tileX - The X index of the tile in the tile array.
tileY - The Y index of the tile in the tile array.
Throws:
UnsupportedOperationException - if isStatusAvailable() returns false.
IllegalArgumentException - if the specified tile is not associated with this request.

cancelTiles

public void cancelTiles(Point[] tileIndices)
Issues a request to the TileScheduler which generated this TileRequest to cancel all tiles in the supplied parameter array which are associated with this request. Any tiles in the array which are not associated with this request will be ignored. If the parameter is null a request to cancel all tiles in the request will be issued. This method should merely be a convenience wrapper around the cancelTiles() method of the TileScheduler which created the TileRequest.