es.prodevelop.gvsig.mobile.gui.tool
Class TBMenu

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byes.prodevelop.gvsig.mobile.gui.tool.TBMenu
All Implemented Interfaces:
java.awt.image.ImageObserver, IToolContainer, java.awt.MenuContainer, java.io.Serializable

public class TBMenu
extends java.awt.Container
implements IToolContainer

A TBMenu is a rectangle which is shown to get mor Class that represents a drop-down menu in a toolbar. It is displayed after a TBDropDownButton in a TBComboButton is clicked

Author:
mmontesinos
See Also:
Serialized Form

Field Summary
static java.awt.Image BACKGROUND_STRIP
           
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
TBMenu(IToolContainer _owner, int xTop, int yTop)
          Creates an instance of TBMenu in a Window from a position (usually the bottom-left corner of a combo button after checking that there's enough space in the screen)
 
Method Summary
 void addButton(TBButton button, int index)
          Adds a new item to the menu.
 void close()
          Closes the TBMenu and removes all its components
 int getButtonCount()
          Returns the number of buttons existing in the menu.
 TBButton[] getButtons()
          Returns the array of buttons of type TBButton that the menu contains
 IToolContainer getOwner()
           
 TBButton getTool(int index)
          Returns one tool in the list of tools displayed in the menu, given its index
 MainWindow getWindow()
          Returns the MainWindow of the menu
 void paint(java.awt.Graphics g)
          Override method of paint method which forces the paint of the component
 void setActiveTool(int index)
          stub method.
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, getAccessibleContext, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface es.prodevelop.gvsig.mobile.gui.tool.IToolContainer
repaint
 

Field Detail

BACKGROUND_STRIP

public static java.awt.Image BACKGROUND_STRIP
Constructor Detail

TBMenu

public TBMenu(IToolContainer _owner,
              int xTop,
              int yTop)
Creates an instance of TBMenu in a Window from a position (usually the bottom-left corner of a combo button after checking that there's enough space in the screen)

Parameters:
_owner - ToolBar widget which displays the menu. It must accomplish IToolContainer interface and contain the array of TBButtons to be displayed in the menu
xTop - X Coordinate of the left border of the menu
yTop - Y Coordinate of the top border of the menu
Method Detail

addButton

public void addButton(TBButton button,
                      int index)
               throws GvsigMobileException
Adds a new item to the menu. The items must be instances of TBButton

Specified by:
addButton in interface IToolContainer
Parameters:
button - Button to be added to the menu
index - position in the array of buttons
Throws:
GvsigMobileException

getTool

public TBButton getTool(int index)
                 throws GvsigMobileException
Returns one tool in the list of tools displayed in the menu, given its index

Parameters:
index - index number of the tool in the array of buttons following the order number specified in the creation of the menu
Returns:
the tool in the index number
Throws:
GvsigMobileException

close

public void close()
Closes the TBMenu and removes all its components


getButtonCount

public int getButtonCount()
Returns the number of buttons existing in the menu.

Specified by:
getButtonCount in interface IToolContainer
Returns:
the number of buttons

getButtons

public TBButton[] getButtons()
Returns the array of buttons of type TBButton that the menu contains

Specified by:
getButtons in interface IToolContainer
Returns:
array of buttons of type TBButton

getWindow

public MainWindow getWindow()
Returns the MainWindow of the menu

Specified by:
getWindow in interface IToolContainer
Returns:
MainWindow where the menu has been placed

getOwner

public IToolContainer getOwner()
Returns:
Returns the owner, which is IToolContainer compliant

setActiveTool

public void setActiveTool(int index)
stub method. Not used

Specified by:
setActiveTool in interface IToolContainer
Parameters:
index - of the new tool to be set to active in the container

paint

public void paint(java.awt.Graphics g)
Override method of paint method which forces the paint of the component