|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectes.prodevelop.gvsig.mobile.gui.tool.ToolBar
Element of the GUI which represents a container of buttons displayed for allowing the user to access specific actions.
A ToolBar
contains:
ToolBarGroupButton
representing the Tool BarTBButton
(the buttons offered in the Tool Bar)ToolBarHelpButton
for displaying help about buttons
Field Summary | |
static int |
MAX_BUTTON_COUNT
|
Constructor Summary | |
ToolBar(MainWindow _mw,
ToolBarGroupButton gButton,
int _index)
Creates a new instance of a ToolBar given the window
to be included in, a ToolBarGroupButton representing
the new Tool Bar, the index order of this new ToolBar among all
existing ToolBars, and the name of this toolbar |
Method Summary | |
void |
addButton(TBButton button,
int index)
Adds a button in the toolbar. |
void |
createMenu()
Create a Drop-down menu associated to the ToolBar with the buttons visible in the ToolBar as the items list |
TBButton[] |
getAllButtons()
Returns the array of all buttons of type TBButton that
the ToolBar contains, including the ones in a combo list
For a TBActionButton or TBSelectableButton
it returns that button.
|
int |
getButtonCount()
Returns the number of buttons existing in the toolbar. |
TBButton[] |
getButtons()
Returns the array of visible buttons of type TBButton that
the ToolBar contains.
|
ToolBarGroupButton |
getGroupButton()
Gets the group button associated to the toolbar |
TBHelpButton |
getHelpButton()
Gets the help button of the toolbar |
TBMenu |
getMenu()
|
int |
getToolXOrigin(int position,
int screenWidth)
Calculates the X position of a TBButton in the screen,
given the order (number) of the button for which we want to know the
X position and the size of the Window |
static int |
getToolYOrigin(int position,
int screenWidth)
Calculates the Y position of a TBButton in the screen,
given the order (number) of the button for which we want to know the
Y position and the size of the Window |
MainWindow |
getWindow()
Returns the MainWindow of the toolbar |
boolean |
isSelected()
|
void |
paintEmptyButtons(java.awt.Graphics g)
Add empty button images. |
void |
removeMenu()
Removes the menu displayed associated to the help button of the tool bar |
void |
reorder(int width)
Reconfigures the toolbar after adding new buttons. |
void |
repaint()
Stub method. |
void |
setActiveTool(int index)
Stub method. |
void |
setButtonsVisible(boolean visibility)
Sets all buttons in the ToolBar to Visible or Invisible |
void |
unselectAllButtons()
Unselects all buttons in the ToolBar
It doesn't change other widgets but TBButton 's |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int MAX_BUTTON_COUNT
Constructor Detail |
public ToolBar(MainWindow _mw, ToolBarGroupButton gButton, int _index)
ToolBar
given the window
to be included in, a ToolBarGroupButton
representing
the new Tool Bar, the index order of this new ToolBar among all
existing ToolBars, and the name of this toolbar
_mw
- MainWindow of the appgButton
- A ToolBarGroupButton
representing the Tool Bar_index
- Index (order) number of the toolbarMethod Detail |
public void paintEmptyButtons(java.awt.Graphics g)
g
- public void addButton(TBButton button, int index) throws GvsigMobileException
TBButton
addButton
in interface IToolContainer
button
- TBButton
to be added to the ToolBarindex
- number of the position that the new button will have in the
array of buttons that the ToolBar
contains.
It must be an int
between 0 and the actual size of
the array.
GvsigMobileException
public int getButtonCount()
getButtonCount
in interface IToolContainer
public TBButton[] getButtons()
TBButton
that
the ToolBar contains.
For a TBActionButton
or TBSelectableButton
it returns that button.
For a TBComboButton
it returns the active button in the list
getButtons
in interface IToolContainer
TBButton
public TBButton[] getAllButtons()
TBButton
that
the ToolBar contains, including the ones in a combo list
For a TBActionButton
or TBSelectableButton
it returns that button.
For a TBComboButton
it returns the active button in the list
TBButton
public int getToolXOrigin(int position, int screenWidth)
TBButton
in the screen,
given the order (number) of the button for which we want to know the
X position and the size of the Window
position
- Order number of the button in the buttons
array of the ToolBar (display order from left to right)screenWidth
- Screen width in pixels of the MapControl
public static int getToolYOrigin(int position, int screenWidth)
TBButton
in the screen,
given the order (number) of the button for which we want to know the
Y position and the size of the Window
position
- Order number of the button in the buttons
array of the ToolBar (display order from left to right)screenWidth
- Screen width in pixels of the Window
public ToolBarGroupButton getGroupButton()
ToolBarGroupButton
of the toolbarpublic void reorder(int width)
It should be called after all the buttons in a ToolBar
have been added
width
- of the screenpublic TBHelpButton getHelpButton()
TBHelpButton
of the ToolBar
public void setButtonsVisible(boolean visibility)
ToolBar
to Visible or Invisible
visibility
- Visibility end state:true
: Set all buttons to visiblefalse
: Set all buttons to invisiblepublic void unselectAllButtons()
ToolBar
It doesn't change other widgets but TBButton
's
public MainWindow getWindow()
getWindow
in interface IToolContainer
public void setActiveTool(int index)
setActiveTool
in interface IToolContainer
index
- of the new tool to be set to active in the containerpublic void repaint()
repaint
in interface IToolContainer
public void createMenu()
ToolBar
as the items list
public TBMenu getMenu()
public void removeMenu()
public boolean isSelected()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |