Class spt.gui.ImageButton
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class spt.gui.ImageButton

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----spt.gui.ImageButton

public class ImageButton
extends Panel
A push button with an image on it. A text label may also be displayed.

Variable Index

 o BOTTOM
Bottom of the image
 o LEFT
Left of the image
 o RIGHT
Right of the image
 o TOP
Top of the image

Constructor Index

 o ImageButton(Image)
 o ImageButton(Image, String)
A null image or label is ok; a null image and label is pretty darn useless.

Method Index

 o addNotify()
 o disable()
Disables the button.
 o enable()
Enables the button.
 o getImageLabelGap()
 o getLabel()
 o getLabelPosition()
 o getPadding()
 o mouseDown(Event, int, int)
 o mouseExit(Event, int, int)
 o mouseUp(Event, int, int)
 o paint(Graphics)
 o repaintImage()
 o resize()
Resize the button the the size of its image plus padding and border.
 o setAudioClip(AudioClip)
Set the audio clip to play when the button is pushed.
 o setDrawPushedIn(boolean)
Make the button "depress" when clicked? If false the button will behave normally, except when pushed it will give no visual feedback.
 o setFont(Font)
 o setImage(Image)
The image to be shown.
 o setImageLabelGap(int)
Set the gap, in pixels, between the label, if any, and image.
 o setImageScale(double)
Scale the image to the given value (1.0 = 100%).
 o setImageScale(float)
Scale the image to the given value (1.0 = 100%).
 o setLabel(String)
 o setLabelPosition(int)
Set the position of the label in relation to the image: TOP, LEFT, RIGHT or BOTTOM.
 o setPadding(int)
Set the padding, in pixels, between the button border and its image.
 o setShowBorder(boolean)
Show the border of the button? Useful when you just want the image without the 3D button look around it.

Variables

 o LEFT
  public final static int LEFT
Left of the image
 o TOP
  public final static int TOP
Top of the image
 o RIGHT
  public final static int RIGHT
Right of the image
 o BOTTOM
  public final static int BOTTOM
Bottom of the image

Constructors

 o ImageButton
  public ImageButton(Image image)
 o ImageButton
  public ImageButton(Image image,
                     String label)
A null image or label is ok; a null image and label is pretty darn useless.

Methods

 o addNotify
  public synchronized void addNotify()
Overrides:
addNotify in class Panel
 o setFont
  public void setFont(Font f)
Overrides:
setFont in class Component
 o setShowBorder
  public void setShowBorder(boolean b)
Show the border of the button? Useful when you just want the image without the 3D button look around it.
 o setDrawPushedIn
  public void setDrawPushedIn(boolean b)
Make the button "depress" when clicked? If false the button will behave normally, except when pushed it will give no visual feedback.
 o getLabelPosition
  public int getLabelPosition()
 o setLabelPosition
  public void setLabelPosition(int a)
Set the position of the label in relation to the image: TOP, LEFT, RIGHT or BOTTOM.
 o getLabel
  public String getLabel()
 o setLabel
  public void setLabel(String l)
 o setAudioClip
  public void setAudioClip(AudioClip a)
Set the audio clip to play when the button is pushed.
 o setPadding
  public void setPadding(int p)
Set the padding, in pixels, between the button border and its image.
 o getPadding
  public int getPadding()
 o setImageLabelGap
  public void setImageLabelGap(int g)
Set the gap, in pixels, between the label, if any, and image.
 o getImageLabelGap
  public int getImageLabelGap()
 o setImage
  public void setImage(Image i)
The image to be shown.
 o setImageScale
  public void setImageScale(double f)
Scale the image to the given value (1.0 = 100%).
 o setImageScale
  public void setImageScale(float pct)
Scale the image to the given value (1.0 = 100%).
 o enable
  public void enable()
Enables the button.
Overrides:
enable in class Component
 o disable
  public void disable()
Disables the button. A grayed-out version of the image is shown.
Overrides:
disable in class Component
 o resize
  public void resize()
Resize the button the the size of its image plus padding and border.
 o repaintImage
  protected void repaintImage()
 o paint
  public synchronized void paint(Graphics g)
Overrides:
paint in class Component
 o mouseDown
  public boolean mouseDown(Event e,
                           int x,
                           int y)
Overrides:
mouseDown in class Component
 o mouseUp
  public boolean mouseUp(Event e,
                         int x,
                         int y)
Overrides:
mouseUp in class Component
 o mouseExit
  public boolean mouseExit(Event e,
                           int x,
                           int y)
Overrides:
mouseExit in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index