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