javax.media.jai.widget
Class ImageCanvas

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Canvas
          extended byjavax.media.jai.widget.ImageCanvas
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Serializable

Deprecated. as of JAI 1.1

public class ImageCanvas
extends Canvas

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.

See Also:
Serialized Form

Nested Class Summary
static interface ImageCanvas.PaintListener
          Deprecated. An interface used to notify listeners during a paint just after the image has been painted on the image canvas.
 
Nested classes inherited from class java.awt.Canvas
Canvas.AccessibleAWTCanvas
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  int canvasHeight
          Deprecated. The height of the canvas.
protected  int canvasWidth
          Deprecated. The width of the canvas.
protected  ColorModel colorModel
          Deprecated. The image's ColorModel or one we supply.
protected  boolean drawBorder
          Deprecated.  
protected  RenderedImage im
          Deprecated. The source RenderedImage.
protected  int imHeight
          Deprecated.  
protected  int imWidth
          Deprecated.  
protected  int maxTileX
          Deprecated. The image's max X tile.
protected  int maxTileY
          Deprecated. The image's max Y tile.
protected  int minTileX
          Deprecated. The image's min X tile.
protected  int minTileY
          Deprecated. The image's min Y tile.
protected  int originX
          Deprecated. The pixel to display in the upper left corner or the canvas.
protected  int originY
          Deprecated. The pixel to display in the upper left corner or the canvas.
protected  int padX
          Deprecated. used to center image in it's container
protected  int padY
          Deprecated.  
protected  SampleModel sampleModel
          Deprecated. The image's SampleModel.
protected  int tileGridXOffset
          Deprecated. The image's tile grid X offset.
protected  int tileGridYOffset
          Deprecated. The image's tile grid Y offset.
protected  int tileHeight
          Deprecated. The image's tile height.
protected  int tileWidth
          Deprecated. The image's tile width.
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ImageCanvas(RenderedImage im)
          Deprecated. Constructs an ImageCanvas to display a RenderedImage.
ImageCanvas(RenderedImage im, boolean drawBorder)
          Deprecated. Constructs an ImageCanvas to display a RenderedImage.
 
Method Summary
 void addNotify()
          Deprecated.  
 void addPaintListener(ImageCanvas.PaintListener pl)
          Deprecated. Adds the specified PaintListener to the canvas.
 Dimension getMaximumSize()
          Deprecated.  
 Dimension getMinimumSize()
          Deprecated.  
 Dimension getPreferredSize()
          Deprecated.  
 int getXOrigin()
          Deprecated.  
 int getXPad()
          Deprecated.  
 int getYOrigin()
          Deprecated.  
 int getYPad()
          Deprecated.  
 void paint(Graphics g)
          Deprecated. Paint the image onto a Graphics object.
 void removePaintListener(ImageCanvas.PaintListener pl)
          Deprecated. Removes the specified PaintListener from the canvas.
 void set(RenderedImage im)
          Deprecated. Changes the source image to a new RenderedImage.
 void setBounds(int x, int y, int width, int height)
          Deprecated. Records a new size.
 void setOrigin(int x, int y)
          Deprecated. Changes the pixel to set Origin at x,y
 void update(Graphics g)
          Deprecated. There is no need to erase prior to drawing, so we override the default update method to simply call paint().
 
Methods inherited from class java.awt.Canvas
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

im

protected RenderedImage im
Deprecated. 
The source RenderedImage.


sampleModel

protected SampleModel sampleModel
Deprecated. 
The image's SampleModel.


colorModel

protected ColorModel colorModel
Deprecated. 
The image's ColorModel or one we supply.


minTileX

protected int minTileX
Deprecated. 
The image's min X tile.


maxTileX

protected int maxTileX
Deprecated. 
The image's max X tile.


minTileY

protected int minTileY
Deprecated. 
The image's min Y tile.


maxTileY

protected int maxTileY
Deprecated. 
The image's max Y tile.


tileWidth

protected int tileWidth
Deprecated. 
The image's tile width.


tileHeight

protected int tileHeight
Deprecated. 
The image's tile height.


tileGridXOffset

protected int tileGridXOffset
Deprecated. 
The image's tile grid X offset.


tileGridYOffset

protected int tileGridYOffset
Deprecated. 
The image's tile grid Y offset.


imWidth

protected int imWidth
Deprecated. 

imHeight

protected int imHeight
Deprecated. 

padX

protected int padX
Deprecated. 
used to center image in it's container


padY

protected int padY
Deprecated. 

drawBorder

protected boolean drawBorder
Deprecated. 

originX

protected int originX
Deprecated. 
The pixel to display in the upper left corner or the canvas.


originY

protected int originY
Deprecated. 
The pixel to display in the upper left corner or the canvas.


canvasWidth

protected int canvasWidth
Deprecated. 
The width of the canvas.


canvasHeight

protected int canvasHeight
Deprecated. 
The height of the canvas.

Constructor Detail

ImageCanvas

public ImageCanvas(RenderedImage im,
                   boolean drawBorder)
Deprecated. 
Constructs an ImageCanvas to display a RenderedImage.

Parameters:
im - a RenderedImage to be displayed.
drawBorder - true if a raised border is desired.

ImageCanvas

public ImageCanvas(RenderedImage im)
Deprecated. 
Constructs an ImageCanvas to display a RenderedImage.

Parameters:
im - a RenderedImage to be displayed.
Method Detail

addNotify

public void addNotify()
Deprecated. 

set

public void set(RenderedImage im)
Deprecated. 
Changes the source image to a new RenderedImage.


setOrigin

public void setOrigin(int x,
                      int y)
Deprecated. 
Changes the pixel to set Origin at x,y


getXOrigin

public int getXOrigin()
Deprecated. 

getYOrigin

public int getYOrigin()
Deprecated. 

getXPad

public int getXPad()
Deprecated. 

getYPad

public int getYPad()
Deprecated. 

getMinimumSize

public Dimension getMinimumSize()
Deprecated. 

getPreferredSize

public Dimension getPreferredSize()
Deprecated. 

getMaximumSize

public Dimension getMaximumSize()
Deprecated. 

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Deprecated. 
Records a new size. Called by the AWT.


update

public void update(Graphics g)
Deprecated. 
There is no need to erase prior to drawing, so we override the default update method to simply call paint().


paint

public void paint(Graphics g)
Deprecated. 
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.


addPaintListener

public void addPaintListener(ImageCanvas.PaintListener pl)
Deprecated. 
Adds the specified PaintListener to the canvas.

Since:
JAI 1.1

removePaintListener

public void removePaintListener(ImageCanvas.PaintListener pl)
Deprecated. 
Removes the specified PaintListener from the canvas.

Since:
JAI 1.1