Class tea.set.ImageCanvas
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class tea.set.ImageCanvas

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----tea.set.ImageCanvas

public class ImageCanvas
extends Canvas
ImageCanvas is a simple widget for displaying an image. The default size of ImageCanvas is the size of the image. If the ImageCanvas is resized to another size, the image is automatically scaled to fit the size of the widget.
Example:
add("Center", new ImageCanvas(getImage(url)));
See Also:
ImageLabel

Constructor Index

 o ImageCanvas(Image)
Construct an ImageCanvas with specified image.

Method Index

 o getImage()
Return the image inside this canvas.
 o minimumSize()
Return the minimum size of the image.
 o paint(Graphics)
Paint the image.
 o preferredSize()
Return the preferred size of the image.

Constructors

 o ImageCanvas
  public ImageCanvas(Image image)
Construct an ImageCanvas with specified image.
Parameters:
image - canvas image.

Methods

 o getImage
  public Image getImage()
Return the image inside this canvas.
Returns:
canvas image.
 o minimumSize
  public Dimension minimumSize()
Return the minimum size of the image.
Returns:
minimum size.
Overrides:
minimumSize in class Component
 o preferredSize
  public Dimension preferredSize()
Return the preferred size of the image.
Returns:
preferred size.
Overrides:
preferredSize in class Component
 o paint
  public void paint(Graphics g)
Paint the image.
Parameters:
g - Graphics context of this component.
Overrides:
paint in class Canvas

All Packages  Class Hierarchy  This Package  Previous  Next  Index