All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ncsa.awt.ImageButton

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----ncsa.awt.ImageButton

public class ImageButton
extends Canvas

Variable Index

 o str_def
This is used by the Habanero Framework to set the default image for the session

Constructor Index

 o ImageButton(Image, Image, Image)
Constructs a button with an image, an alternate image when the button has been pressed, and a image to use when the button has been disabled.
 o ImageButton(Image, Image, Image, int, int)
Constructs a button with an image, an alternate image when the button has been pressed, and a image to use when the button has been disabled.
 o ImageButton(String)
Constructs a button with an image, but no alternate images
 o ImageButton(String, String)
Constructs a button with an image, and an alternate image when the button has been pressed.
 o ImageButton(String, String, String)
Constructs a button with an image, an alternate image when the button has been pressed, and a image to use when the button has been disabled.
 o ImageButton(String, String, String, int, int)
Constructs a button with an image, an alternate image when the button has been pressed, a image that is displayed when the button has been disabled, and an image that is displayed when the cursor is over the button.

Method Index

 o addActionListener(ActionListener)
 o changeImages(Image, Image, Image)
Lets you change the image of the ImageButton on the fly.
 o changeImages(String, String, String)
Lets you change the image of the ImageButton on the fly.
 o contains(int, int)
 o drawImageAt(Graphics, int, int)
 o getImage()
 o getMinimumSize()
 o getPreferredSize()
 o getRefCon()
 o getSize()
 o hilite()
Hilites the ImageButton.
 o isEnabled()
Returns whether the ImageButton is enabled.
 o isHilited()
Hilites the ImageButton.
 o main(String[])
 o paint(Graphics)
 o processMouseEvent(MouseEvent)
 o processMouseMotionEvent(MouseEvent)
 o removeActionListener(ActionListener)
 o resizeImages()
 o setBounds(int, int, int, int)
 o setEnabled(boolean)
 o setIBDisabled(Image)
 o setIBHilited(Image)
 o setIBNormal(Image)
 o setRefCon(int)
 o unhilite()
Unhilites the ImageButton.

Variables

 o str_def
 public static String str_def
This is used by the Habanero Framework to set the default image for the session

Constructors

 o ImageButton
 public ImageButton(String normal)
Constructs a button with an image, but no alternate images

Parameters:
normal - the file containing the normal button image to use
 o ImageButton
 public ImageButton(String normal,
                    String hilited)
Constructs a button with an image, and an alternate image when the button has been pressed.

Parameters:
normal - the file containing the normal button image
hilited - the file containing the hilited button image
 o ImageButton
 public ImageButton(String normal,
                    String hilited,
                    String disabled)
Constructs a button with an image, an alternate image when the button has been pressed, and a image to use when the button has been disabled.

Parameters:
normal - the file containing the normal button image
hilited - the file containing the hilited button image
disabled - the file containing the disabled button image
 o ImageButton
 public ImageButton(String normal,
                    String hilited,
                    String disabled,
                    int imgWidth,
                    int imgHeight)
Constructs a button with an image, an alternate image when the button has been pressed, a image that is displayed when the button has been disabled, and an image that is displayed when the cursor is over the button.

Parameters:
normal - the file containing the normal button image
hilited - the file containing the hilited button image
disabled - the file containing the disabled button image
hightlight - the file containing the hightlight button image
 o ImageButton
 public ImageButton(Image normal,
                    Image hilited,
                    Image disabled)
Constructs a button with an image, an alternate image when the button has been pressed, and a image to use when the button has been disabled.

Parameters:
normal - the normal button image
hilited - the hilited button image
disabled - the disabled button image
 o ImageButton
 public ImageButton(Image normal,
                    Image hilited,
                    Image disabled,
                    int imgWidth,
                    int imgHeight)
Constructs a button with an image, an alternate image when the button has been pressed, and a image to use when the button has been disabled. Resizes the image to the proper dimensions.

Parameters:
normal - the normal button image
hilited - the hilited button image
disabled - the disabled button image
imgWidth - the desired width of the image
imgHeight - the desired height of the image

Methods

 o setIBNormal
 public void setIBNormal(Image img)
 o setIBHilited
 public void setIBHilited(Image img)
 o setIBDisabled
 public void setIBDisabled(Image img)
 o resizeImages
 public void resizeImages()
 o changeImages
 public void changeImages(String normal,
                          String hilited,
                          String disabled)
Lets you change the image of the ImageButton on the fly.

Parameters:
normal, - hilited, disabled names of the new images use null for default
 o changeImages
 public void changeImages(Image normal,
                          Image hilited,
                          Image disabled)
Lets you change the image of the ImageButton on the fly.

Parameters:
normal, - hilited, disabled new images use null for default
 o paint
 public void paint(Graphics g)
Overrides:
paint in class Canvas
 o drawImageAt
 public void drawImageAt(Graphics g,
                         int x,
                         int y)
 o contains
 public boolean contains(int x,
                         int y)
Overrides:
contains in class Component
 o setEnabled
 public void setEnabled(boolean b)
Overrides:
setEnabled in class Component
 o unhilite
 public void unhilite()
Unhilites the ImageButton. Takes care of the redraw

 o hilite
 public void hilite()
Hilites the ImageButton. Takes care of the redraw

 o isEnabled
 public boolean isEnabled()
Returns whether the ImageButton is enabled.

Overrides:
isEnabled in class Component
 o isHilited
 public boolean isHilited()
Hilites the ImageButton. Takes care of the redraw

 o addActionListener
 public void addActionListener(ActionListener listener)
 o removeActionListener
 public void removeActionListener(ActionListener listener)
 o processMouseMotionEvent
 public void processMouseMotionEvent(MouseEvent e)
Overrides:
processMouseMotionEvent in class Component
 o processMouseEvent
 public void processMouseEvent(MouseEvent e)
Overrides:
processMouseEvent in class Component
 o getPreferredSize
 public Dimension getPreferredSize()
Overrides:
getPreferredSize in class Component
 o getMinimumSize
 public Dimension getMinimumSize()
Overrides:
getMinimumSize in class Component
 o getSize
 public Dimension getSize()
Overrides:
getSize in class Component
 o setBounds
 public void setBounds(int x,
                       int y,
                       int w,
                       int h)
Overrides:
setBounds in class Component
 o setRefCon
 public void setRefCon(int r)
 o getRefCon
 public int getRefCon()
 o getImage
 public Image getImage()
 o main
 public static void main(String foo[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index