| java.awt.Canvas javax.media.jai.widget.ImageCanvas
ImageCanvas | public class ImageCanvas extends Canvas (Code) | | A simple output widget for a RenderedImage. ImageCanvas subclasses
java.awt.Canvas, and can be used in any context that calls for a
Canvas. It monitors resize and update events and automatically
requests tiles from its source on demand. Any displayed area outside
the image is displayed in grey.
There is currently no policy regarding what sorts of widgets,
if any, will be part of JAI.
Due to the limitations of BufferedImage, only TYPE_BYTE of band
1, 2, 3, 4, and TYPE_USHORT of band 1, 2, 3 images can be displayed
using this widget.
This class has been deprecated. The source
code has been moved to the samples/widget
directory. These widgets are no longer
supported.
|
Inner Class :public interface PaintListener | |
Field Summary | |
protected int | canvasHeight The height of the canvas. | protected int | canvasWidth The width of the canvas. | protected ColorModel | colorModel The image's ColorModel or one we supply. | protected boolean | drawBorder | protected RenderedImage | im The source RenderedImage. | protected int | imHeight | protected int | imWidth | protected int | maxTileX The image's max X tile. | protected int | maxTileY The image's max Y tile. | protected int | minTileX The image's min X tile. | protected int | minTileY The image's min Y tile. | protected int | originX The pixel to display in the upper left corner or the canvas. | protected int | originY The pixel to display in the upper left corner or the canvas. | protected int | padX | protected int | padY | protected SampleModel | sampleModel The image's SampleModel. | protected int | tileGridXOffset The image's tile grid X offset. | protected int | tileGridYOffset The image's tile grid Y offset. | protected int | tileHeight The image's tile height. | protected int | tileWidth The image's tile width. |
Constructor Summary | |
public | ImageCanvas(RenderedImage im, boolean drawBorder) Constructs an ImageCanvas to display a RenderedImage. | public | ImageCanvas(RenderedImage im) Constructs an ImageCanvas to display a RenderedImage. |
canvasHeight | protected int canvasHeight(Code) | | The height of the canvas.
|
canvasWidth | protected int canvasWidth(Code) | | The width of the canvas.
|
colorModel | protected ColorModel colorModel(Code) | | The image's ColorModel or one we supply.
|
drawBorder | protected boolean drawBorder(Code) | | |
im | protected RenderedImage im(Code) | | The source RenderedImage.
|
imHeight | protected int imHeight(Code) | | |
imWidth | protected int imWidth(Code) | | |
maxTileX | protected int maxTileX(Code) | | The image's max X tile.
|
maxTileY | protected int maxTileY(Code) | | The image's max Y tile.
|
minTileX | protected int minTileX(Code) | | The image's min X tile.
|
minTileY | protected int minTileY(Code) | | The image's min Y tile.
|
originX | protected int originX(Code) | | The pixel to display in the upper left corner or the canvas.
|
originY | protected int originY(Code) | | The pixel to display in the upper left corner or the canvas.
|
padX | protected int padX(Code) | | used to center image in it's container
|
sampleModel | protected SampleModel sampleModel(Code) | | The image's SampleModel.
|
tileGridXOffset | protected int tileGridXOffset(Code) | | The image's tile grid X offset.
|
tileGridYOffset | protected int tileGridYOffset(Code) | | The image's tile grid Y offset.
|
tileHeight | protected int tileHeight(Code) | | The image's tile height.
|
tileWidth | protected int tileWidth(Code) | | The image's tile width.
|
ImageCanvas | public ImageCanvas(RenderedImage im, boolean drawBorder)(Code) | | Constructs an ImageCanvas to display a RenderedImage.
Parameters: im - a RenderedImage to be displayed. Parameters: drawBorder - true if a raised border is desired. |
ImageCanvas | public ImageCanvas(RenderedImage im)(Code) | | Constructs an ImageCanvas to display a RenderedImage.
Parameters: im - a RenderedImage to be displayed. |
addNotify | public void addNotify()(Code) | | |
addPaintListener | public void addPaintListener(PaintListener pl)(Code) | | Adds the specified PaintListener to the canvas.
since: JAI 1.1 |
getXOrigin | public int getXOrigin()(Code) | | |
getXPad | public int getXPad()(Code) | | |
getYOrigin | public int getYOrigin()(Code) | | |
getYPad | public int getYPad()(Code) | | |
paint | public synchronized void paint(Graphics g)(Code) | | Paint the image onto a Graphics object. The painting is
performed tile-by-tile, and includes a grey region covering the
unused portion of image tiles as well as the general
background.
|
removePaintListener | public void removePaintListener(PaintListener pl)(Code) | | Removes the specified PaintListener from the canvas.
since: JAI 1.1 |
set | public synchronized void set(RenderedImage im)(Code) | | Changes the source image to a new RenderedImage.
|
setBounds | public void setBounds(int x, int y, int width, int height)(Code) | | Records a new size. Called by the AWT.
|
setOrigin | public void setOrigin(int x, int y)(Code) | | Changes the pixel to set Origin at x,y
|
update | public void update(Graphics g)(Code) | | There is no need to erase prior to drawing, so we override the
default update method to simply call paint().
|
|
|