All Packages Class Hierarchy This Package Previous Next Index
Class tea.awt.bar.Toolbar
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----tea.awt.bar.Toolbar
- public class Toolbar
- extends Panel
- implements ActionListener, LanguageSpeaker
This container is a Toolbar. It can contain several components of
every kind, but its preferred component is the IconButton. It can also
be contained by several containers, but its preferred container is a
Docker. A Toolbar with IconButtons in a Docker
performs some automatic tasks (e.g. Statusbar interaction). Placement
of the Toolbar in the Docker takes place through a Popup
Menu.
The Toolbar can also be easily internationalized because implements
LanguageSpeaker (internally supported languages are English and
Italian).
- Version:
- 1.0 beta - 31 May 1997
- Author:
- Leonardo Boselli
- See Also:
- IconButton, LanguageSpeaker
-
HORIZONTAL
- The flag for the horizontal placement.
-
VERTICAL
- The flag for the vertical placement.
-
Toolbar()
- Constructs the LanguageLearner and the Popup Menu.
-
actionPerformed(ActionEvent)
- Implements the ActionListener interface and performs the placement of
the toolbar delivering the event to the parent Docker.
-
addIcon(Image, Dimension, String, String, ActionListener, StatusListener)
- Adds an IconButton to the Toolbar with the specified size.
-
addIcon(Image, String, String, ActionListener, StatusListener)
- Adds an IconButton to the Toolbar (icons are squares and the iconSize
is used).
-
changeSpokenLanguage(String)
- Implements the LanguageSpeaker interface and listens to the changes of
the spoken language.
-
getIconSize()
- Gets the icon size (used when icons are entered without their own size).
-
getLanguageLearner()
- Returns a LanguageLearner for the Toolbar (it's used to learn other
languages).
-
getMaximumSize()
- Returns the maximum dimensions of this IconButton.
-
getMinimumSize()
- Returns the minimum dimensions of the Toolbar.
-
getPreferredSize()
- Returns the preferred dimensions of this IconButton.
-
getSpokenLanguages()
- Gets the languages spoken by the Toolbar.
-
getStatusListener()
- Returns the StatusListener of the inner IconButtons.
-
isMoveable()
- Determines if the Toolbar is moveable or not.
-
isMoveable(boolean)
- Sets the moveable state of the Toolbar.
-
paint(Graphics)
- Paints the Toolbar.
-
processMouseEvent(MouseEvent)
- Processes the MouseEvent.
-
setActiveIcon(String, boolean)
- Sets the state of the related IconButton.
-
setDocker(Docker)
- Defines the Docker of the Toolbar.
-
setIconSize(int)
- Sets the icon size (used when icons are entered without their own size).
-
setOrientation(int)
- Places the Toolbar in the correct orientation.
-
setStatusListener(StatusListener)
- Defines the StatusListener of the inner IconButtons.
HORIZONTAL
public static final int HORIZONTAL
- The flag for the horizontal placement.
VERTICAL
public static final int VERTICAL
- The flag for the vertical placement.
Toolbar
public Toolbar()
- Constructs the LanguageLearner and the Popup Menu.
- See Also:
- LanguageLearner
setStatusListener
public void setStatusListener(StatusListener sl)
- Defines the StatusListener of the inner IconButtons. The Toolbar
has only a StatusListener at a time. It's called automatically
if you use setDocker().
- Parameters:
- sl - the StatusListener.
- See Also:
- setDocker
setDocker
public void setDocker(Docker d)
- Defines the Docker of the Toolbar. It's useful when the Toolbar
is owned by a container contained in a Docker: this happens with
MultiDocker frames. Otherwise (when the parent of the Toolbar is the
Docker) you can ignore it.
- Parameters:
- d - the Docker.
getStatusListener
public StatusListener getStatusListener()
- Returns the StatusListener of the inner IconButtons. The Toolbar
has only a StatusListener at a time.
- Returns:
- the StatusListener.
setOrientation
public void setOrientation(int o)
- Places the Toolbar in the correct orientation.
- Parameters:
- o - the orintation. You must use the defined values.
- See Also:
- HORIZONTAL, VERTICAL
setActiveIcon
public void setActiveIcon(String action,
boolean active)
- Sets the state of the related IconButton. The IconButton is selected
through its actionCommnad. If the IconButton is inactive it can't
send its actionCommand to its ActionListeners.
- Parameters:
- action - the actionCommand of the selected IconButton.
- active - the active or inactive flag.
isMoveable
public boolean isMoveable()
- Determines if the Toolbar is moveable or not.
- Returns:
- the moveable state.
isMoveable
public void isMoveable(boolean m)
- Sets the moveable state of the Toolbar.
- Parameters:
- m - the moveable state.
getIconSize
public int getIconSize()
- Gets the icon size (used when icons are entered without their own size).
- Returns:
- m the size (width and height are the same).
setIconSize
public void setIconSize(int is)
- Sets the icon size (used when icons are entered without their own size).
- Parameters:
- is - the size (width and height are the same).
addIcon
public void addIcon(Image img,
String c,
String ac,
ActionListener al,
StatusListener sl)
- Adds an IconButton to the Toolbar (icons are squares and the iconSize
is used).
- Parameters:
- img - the image of the icon.
- c - the descriptive text.
- ac - the action command.
- al - the ActionListener.
- sl - the StatusListener.
addIcon
public void addIcon(Image img,
Dimension sz,
String c,
String ac,
ActionListener al,
StatusListener sl)
- Adds an IconButton to the Toolbar with the specified size.
- Parameters:
- img - the image of the icon.
- sz - the size of the icon.
- c - the descriptive text.
- ac - the action command.
- al - the ActionListener.
- al - the StatusListener.
paint
public void paint(Graphics g)
- Paints the Toolbar.
- Parameters:
- g - the Graphics to be painted.
- Overrides:
- paint in class Container
getMinimumSize
public Dimension getMinimumSize()
- Returns the minimum dimensions of the Toolbar.
- Returns:
- the minimum dimensions.
- Overrides:
- getMinimumSize in class Container
getPreferredSize
public Dimension getPreferredSize()
- Returns the preferred dimensions of this IconButton.
- Returns:
- the preferred dimensions.
- Overrides:
- getPreferredSize in class Container
getMaximumSize
public Dimension getMaximumSize()
- Returns the maximum dimensions of this IconButton.
- Returns:
- the maximum dimensions.
- Overrides:
- getMaximumSize in class Container
processMouseEvent
protected void processMouseEvent(MouseEvent me)
- Processes the MouseEvent.
- Parameters:
- me - the MouseEvent.
- Overrides:
- processMouseEvent in class Component
actionPerformed
public void actionPerformed(ActionEvent ae)
- Implements the ActionListener interface and performs the placement of
the toolbar delivering the event to the parent Docker.
- Parameters:
- ae - the ActionEvent.
changeSpokenLanguage
public boolean changeSpokenLanguage(String l)
- Implements the LanguageSpeaker interface and listens to the changes of
the spoken language.
- Parameters:
- l - the spoken language.
- Returns:
- if the language is supported or not.
getSpokenLanguages
public Enumeration getSpokenLanguages()
- Gets the languages spoken by the Toolbar.
- Returns:
- languages spoken.
getLanguageLearner
public LanguageLearner getLanguageLearner()
- Returns a LanguageLearner for the Toolbar (it's used to learn other
languages).
- Returns:
- the LanguageLearner.
All Packages Class Hierarchy This Package Previous Next Index