All Packages Class Hierarchy This Package Previous Next Index
Class tea.awt.bar.IconButton
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----tea.awt.bar.IconButton
- public class IconButton
- extends Canvas
- implements MouseListener
This component is a Button with an image in it. The drawn image may be
a gif or a jpeg image. If you use an animated gif image, the icon will be
animated. Usually you can use this component in Toolbars, but it's
possible to add it in other containers. In a Toolbar the IconButton
accesses the Statusbar of the Docker with an explicative message
when the mouse enters it.
- Version:
- 1.0 beta - 31 May 1997
- Author:
- Leonardo Boselli
- See Also:
- Toolbar
-
IconButton(Image, Dimension)
- Initialized the icon.
-
IconButton(Image, Dimension, String, String, ActionListener, StatusListener)
- Initialized the icon.
-
addActionListener(ActionListener)
- Adds an ActionListener to this IconButton.
-
getActionCommand()
- Gets the action command of this IconButton.
-
getComment()
- Gets the descriptive message of this IconButton.
-
getMinimumSize()
- Returns the minimum dimensions of this IconButton.
-
getStatusListener()
- Returns the StatusListener defined for displaying the description of
the IconButton.
-
isActive()
- Checks if the IconButton is active or not.
-
mouseClicked(MouseEvent)
- Implements the corrsponding method of the MouseListener interface.
-
mouseEntered(MouseEvent)
- Implements the corrsponding method of the MouseListener interface.
-
mouseExited(MouseEvent)
- Implements the corrsponding method of the MouseListener interface.
-
mousePressed(MouseEvent)
- Implements the corrsponding method of the MouseListener interface.
-
mouseReleased(MouseEvent)
- Implements the corrsponding method of the MouseListener interface.
-
paint(Graphics)
- Paints this IconButton.
-
removeActionListener(ActionListener)
- Removes an ActionListener from this IconButton.
-
setActionCommand(String)
- Sets the action command of this IconButton.
-
setActive(boolean)
- Sets the IconButton to an active or inactive state.
-
setComment(String)
- Sets the descriptive message of this IconButton.
-
setStatusListener(StatusListener)
- Defines the StatusListener for explicative messages.
IconButton
public IconButton(Image img,
Dimension sz)
- Initialized the icon. No actionCommand, comment and
StatusListener are added.
- Parameters:
- img - the image to be displayed.
- sz - the size of the image.
IconButton
public IconButton(Image img,
Dimension sz,
String c,
String ac,
ActionListener al,
StatusListener sl)
- Initialized the icon. All significative data is specified.
- Parameters:
- img - the image to be displayed.
- sz - the size of the image.
- c - the explicative message to be displayed in the Statusbar.
- ac - the actionCommand.
- al - the ActionListener of the actionCommand.
- ac - the StatusListener of the explicative message.
setStatusListener
public void setStatusListener(StatusListener sl)
- Defines the StatusListener for explicative messages.
- Parameters:
- sl - the StatusListener
getStatusListener
public StatusListener getStatusListener()
- Returns the StatusListener defined for displaying the description of
the IconButton.
- Returns:
- the StatusListener
isActive
public boolean isActive()
- Checks if the IconButton is active or not.
- Returns:
- the status of the IconButton
setActive
public void setActive(boolean e)
- Sets the IconButton to an active or inactive state.
- Parameters:
- e - sets the state to this value.
getComment
public String getComment()
- Gets the descriptive message of this IconButton.
- Returns:
- the descriptive message
setComment
public void setComment(String c)
- Sets the descriptive message of this IconButton.
- Parameters:
- c - the descriptive message
setActionCommand
public void setActionCommand(String ac)
- Sets the action command of this IconButton.
- Parameters:
- ac - the action command
getActionCommand
public String getActionCommand()
- Gets the action command of this IconButton.
- Returns:
- the action command.
addActionListener
public synchronized void addActionListener(ActionListener l)
- Adds an ActionListener to this IconButton. ActionListeners may be one or more.
- Parameters:
- l - the ActionListener.
removeActionListener
public synchronized void removeActionListener(ActionListener l)
- Removes an ActionListener from this IconButton.
- Parameters:
- l - the ActionListener.
paint
public void paint(Graphics g)
- Paints this IconButton.
- Parameters:
- g - the Graphics to be painted.
- Overrides:
- paint in class Canvas
getMinimumSize
public Dimension getMinimumSize()
- Returns the minimum dimensions of this IconButton.
- Returns:
- the minimun dimensions.
- Overrides:
- getMinimumSize in class Component
mouseClicked
public void mouseClicked(MouseEvent me)
- Implements the corrsponding method of the MouseListener interface.
- Parameters:
- me - the MouseEvent.
mouseEntered
public void mouseEntered(MouseEvent me)
- Implements the corrsponding method of the MouseListener interface.
- Parameters:
- me - the MouseEvent.
mouseExited
public void mouseExited(MouseEvent me)
- Implements the corrsponding method of the MouseListener interface.
- Parameters:
- me - the MouseEvent.
mousePressed
public void mousePressed(MouseEvent me)
- Implements the corrsponding method of the MouseListener interface.
- Parameters:
- me - the MouseEvent.
mouseReleased
public void mouseReleased(MouseEvent me)
- Implements the corrsponding method of the MouseListener interface.
- Parameters:
- me - the MouseEvent.
All Packages Class Hierarchy This Package Previous Next Index