Class ncsa.horizon.awt.ImageCanvas
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ncsa.horizon.awt.ImageCanvas

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----ncsa.horizon.awt.ImageCanvas

public class ImageCanvas
extends Canvas
implements ImageObserver, Cloneable
A Canvas object for displaying images. Features include

Variable Index

 o doclear
 o mode
 o msgfont
 o offscreen
 o size
 o SIZE_IMAGE_CENTER
Trim the image to the Canvas size (centered)
 o SIZE_IMAGE_FIT
Fit the image to the Canvas size (default)
 o SIZE_IMAGE_FLUSH
Scale the image to the Canvas size (centered)
 o SIZE_IMAGE_SCALE
Scale the image to the Canvas size (centered)
 o SIZE_IMAGE_TRUNCATE
Trim the image to the Canvas size (flush top/left)
 o tracker
 o view

Constructor Index

 o ImageCanvas()
 o ImageCanvas(Dimension)
 o ImageCanvas(int, int)

Method Index

 o clone()
make a copy of this canvas in an efficient manner
 o displayImage(Image)
 o imageUpdate(Image, int, int, int, int, int)
 o offpaint()
 o paint(Graphics)
 o paintMessage(Graphics, String)
 o preferredSize()
 o setMode(int)
Set the display mode for sizing or trimming the viewable image.
 o setPreferredSize(Dimension)
 o setPreferredSize(int, int)
 o tryPaint(Graphics)
 o viewSize()
determine the dimesions necessary to fit the current image into the display canvas (while preserving the aspect ratio.)
 o viewSize(int, int)
determine the dimesions necessary to fit an image of width wd and height ht into the display canvas (while preserving the aspect ratio).

Variables

 o SIZE_IMAGE_FIT
  public final static int SIZE_IMAGE_FIT
Fit the image to the Canvas size (default)
 o SIZE_IMAGE_CENTER
  public final static int SIZE_IMAGE_CENTER
Trim the image to the Canvas size (centered)
 o SIZE_IMAGE_TRUNCATE
  public final static int SIZE_IMAGE_TRUNCATE
Trim the image to the Canvas size (flush top/left)
 o SIZE_IMAGE_SCALE
  public final static int SIZE_IMAGE_SCALE
Scale the image to the Canvas size (centered)
 o SIZE_IMAGE_FLUSH
  public final static int SIZE_IMAGE_FLUSH
Scale the image to the Canvas size (centered)
 o view
  protected Image view
 o mode
  protected int mode
 o offscreen
  protected Image offscreen
 o tracker
  protected MediaTracker tracker
 o msgfont
  protected static Font msgfont
 o doclear
  protected boolean doclear
 o size
  protected Dimension size

Constructors

 o ImageCanvas
  public ImageCanvas()
 o ImageCanvas
  public ImageCanvas(int w,
                     int h)
 o ImageCanvas
  public ImageCanvas(Dimension sz)

Methods

 o preferredSize
  public Dimension preferredSize()
Overrides:
preferredSize in class Component
 o setPreferredSize
  public void setPreferredSize(int w,
                               int h)
 o setPreferredSize
  public void setPreferredSize(Dimension sz)
 o displayImage
  public void displayImage(Image im)
 o offpaint
  public void offpaint()
 o viewSize
  public Dimension viewSize(int wd,
                            int ht)
determine the dimesions necessary to fit an image of width wd and height ht into the display canvas (while preserving the aspect ratio). An input dimension < 0 means use the corresponding dimension of the current image being displayed.
 o viewSize
  public Dimension viewSize()
determine the dimesions necessary to fit the current image into the display canvas (while preserving the aspect ratio.)
 o paint
  public void paint(Graphics g)
Overrides:
paint in class Canvas
 o tryPaint
  public boolean tryPaint(Graphics g)
 o paintMessage
  protected void paintMessage(Graphics g,
                              String msg)
 o imageUpdate
  public boolean imageUpdate(Image img,
                             int flags,
                             int x,
                             int y,
                             int width,
                             int height)
Overrides:
imageUpdate in class Component
 o clone
  public Object clone()
make a copy of this canvas in an efficient manner
Overrides:
clone in class Object
 o setMode
  public void setMode(int _mode)
Set the display mode for sizing or trimming the viewable image.
Parameters:
_mode - The mode to use. Valid modes are SIZE_IMAGE_FIT, SIZE_IMAGE_CENTER, and SIZE_IMAGE_TRUNCATE.

All Packages  Class Hierarchy  This Package  Previous  Next  Index