es.prodevelop.gvsig.mobile.gui.tool
Interface IToolContainer

All Known Implementing Classes:
TBComboButton, TBMenu, ToolBar

public interface IToolContainer

Interface for specifying the common issues of a buttons container, e.g. a ToolBar or a TBComboButton

Author:
mmontesinos

Method Summary
 void addButton(TBButton button, int index)
          Method used for adding a TBButton to a IToolContainer
 int getButtonCount()
          Gets the total number of buttons in the container
 TBButton[] getButtons()
          Gets the array of TBButtons that the object contain
 MainWindow getWindow()
          Gets the MainWindow the IToolContainer is attached to
 void repaint()
          Forces repaint of the container after changes have been made
 void setActiveTool(int index)
          Sets the index of the active tool in the container.
 

Method Detail

addButton

public void addButton(TBButton button,
                      int index)
               throws GvsigMobileException
Method used for adding a TBButton to a IToolContainer

Parameters:
button - to be added
index - position in the array of buttons
Throws:
GvsigMobileException

getButtons

public TBButton[] getButtons()
Gets the array of TBButtons that the object contain

Returns:
an array of code>TBButtons

getButtonCount

public int getButtonCount()
Gets the total number of buttons in the container

Returns:
total number of buttons (buttons array length)

getWindow

public MainWindow getWindow()
Gets the MainWindow the IToolContainer is attached to

Returns:
the MainWindow of the object

setActiveTool

public void setActiveTool(int index)
Sets the index of the active tool in the container. Use only if an active tool makes sense in the container. For instance it's necessary in a combobutton list but not in a toolbar

Parameters:
index - of the new tool to be set to active in the container

repaint

public void repaint()
Forces repaint of the container after changes have been made