Class iicm.widgets.ImageButton
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class iicm.widgets.ImageButton

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----iicm.widgets.ImageButton

public class ImageButton
extends Canvas
ImageButton - image button

Constructor Index

 o ImageButton(String, Image, int, int, boolean, ImageButtonGroup)
constructor

Method Index

 o getState()
 o minimumSize()
 o mouseDown(Event, int, int)
 o paint(Graphics)
 o preferredSize()
 o setState(boolean)
 o subimage(Image, int, int, int, int, Component)
small helper to crop a subimage area out of an image.
 o update(Graphics)
 o waitForImage(Image, Component)
small helper to wait until an image is completely loaded

Constructors

 o ImageButton
  public ImageButton(String label,
                     Image img,
                     int width,
                     int height,
                     boolean state,
                     ImageButtonGroup group)
constructor
Parameters:
label - label used when img is null
width - image width, substituted by label width when img is null
height - allows uniform button height if some images are not available, width determined from image or label
state - initial state flag
group - ImageButtonGroup for radio buttons, null for toggle buttons

Methods

 o subimage
  public static Image subimage(Image img,
                               int x,
                               int y,
                               int w,
                               int h,
                               Component target)
small helper to crop a subimage area out of an image. will wait until cropping has been completed when target is non-null.
 o waitForImage
  public static boolean waitForImage(Image img,
                                     Component target)
small helper to wait until an image is completely loaded
Returns:
flag whether all was ok
 o minimumSize
  public Dimension minimumSize()
Overrides:
minimumSize in class Component
 o preferredSize
  public Dimension preferredSize()
Overrides:
preferredSize in class Component
 o update
  public void update(Graphics g)
Overrides:
update in class Component
 o paint
  public void paint(Graphics g)
Overrides:
paint in class Canvas
 o mouseDown
  public boolean mouseDown(Event evt,
                           int x,
                           int y)
Overrides:
mouseDown in class Component
 o setState
  public void setState(boolean value)
 o getState
  public boolean getState()

All Packages  Class Hierarchy  This Package  Previous  Next  Index