org.argouml.ui.menubar
Class GenericArgoMenuBar

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JMenuBar
                          |
                          +--org.argouml.ui.menubar.GenericArgoMenuBar
All Implemented Interfaces:
javax.accessibility.Accessible, ArgoEventListener, ArgoModuleEventListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.MenuElement, java.io.Serializable

public class GenericArgoMenuBar
extends javax.swing.JMenuBar
implements ArgoModuleEventListener

GenericArgoMenuBar defines the menubar for all operating systems which do not explicitely ask for a different kind of menu bar, such as Mac OS X.

Menu's and the mnemonics of menu's and the menuitems are separated in the PropertyResourceBundle menu.properties.

menuitems are separated in the PropertyResourceBundle action.properties.

The key's in menu.properties have the following structure:

 menu:                    [file].[name of menu]
  e.g:                    menu.file

 mnemonics of menu's:     [file].[name of menu].mnemonic
  e.g:                    menu.file.mnemonic

 mnemonics of menuitems:  [file].[flag for item].[name of menuitem].mnemonic
  e.g:                    menu.item.new.mnemonic
 

See Also:
Serialized Form

Field Summary
protected  ArgoJMenu _arrange
          this should be invoked automatically when importing sources.
protected  javax.swing.JMenu _createDiagrams
          Toolbar:create diagram
private  javax.swing.JToolBar _createDiagramToolbar
           
protected  ArgoJMenu _critique
          currently undergoing significant testing
protected  javax.swing.JMenu _edit
          Edit menu
private  javax.swing.JToolBar _editToolbar
           
private  javax.swing.JToolBar _fileToolbar
           
protected  javax.swing.JMenu _generate
          currently supports rudimentary java generation, new modules for php and html/javadocs are planned feel free to contribute here!
protected  javax.swing.JMenu _help
          It needs it.
private  LastRecentlyUsedMenuList _lruList
          lru project list
protected  javax.swing.JMenu _select
          unknown where this appears in the UI
protected  javax.swing.JMenu _tools
          currently disactivated
protected  ArgoJMenu _view
          toolbar: view under which is the goto diagram/ find zoom!!! this should be activated as a right click command.
private  javax.swing.JToolBar _viewToolbar
           
private static java.lang.String MENU
          Name and prepareKey-Strings of/for the PropertyResourceBundle menu.properties.
private static java.lang.String MENUITEM
           
 
Fields inherited from class javax.swing.JMenuBar
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
 
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
GenericArgoMenuBar()
           
 
Method Summary
 void addFileSaved(java.lang.String filename)
          Adds the entry to the lru list.
private  void appendPluggableMenus(javax.swing.JMenuItem menuitem, java.lang.String key)
          Scans through all loaded modules to see if it has an item to add in this diagram.
 javax.swing.JToolBar getCreateDiagramToolbar()
          Get the create diagram toolbar.
 javax.swing.JToolBar getEditToolbar()
          Get the edit toolbar.
 javax.swing.JToolBar getFileToolbar()
          Getter for the file toolbar.
protected static javax.swing.KeyStroke getShortcut(java.lang.String key)
          Deprecated. in 0.15.1. No longer needed since we have moved from the MenuResouceBundle.java to menu.properties.
 javax.swing.JToolBar getViewToolbar()
          Getter for the view toolbar.
protected  void initMenus()
          construct the ordinary all purpose Argo Menu Bar.
protected static java.lang.String menuLocalize(java.lang.String key)
           
 void moduleDisabled(ArgoModuleEvent event)
          Invoked when a module has been disabled.
 void moduleEnabled(ArgoModuleEvent event)
          Invoked when a module has been enabled.
 void moduleLoaded(ArgoModuleEvent event)
          Invoked when a module has been loaded.
 void moduleUnloaded(ArgoModuleEvent event)
          Invoked when a module has been unloaded.
private static java.lang.String prepareKey(java.lang.String str)
          Prepares one part of the key for menu- or/and menuitem-mnemonics used in menu.properties.
(package private) static void setAccelerator(javax.swing.JMenuItem item, javax.swing.KeyStroke keystroke)
           
protected static void setMnemonic(javax.swing.JMenuItem item, java.lang.String key)
          This should be a user specified option.
protected static void setMnemonic(javax.swing.JMenuItem item, java.lang.String key, char defMnemonic)
          Deprecated. since 0.15.2. Use @{link #setMnemonic(JMenuItem item, String key)} instead.
 
Methods inherited from class javax.swing.JMenuBar
add, addNotify, getAccessibleContext, getComponent, getComponentAtIndex, getComponentIndex, getHelpMenu, getMargin, getMenu, getMenuCount, getSelectionModel, getSubElements, getUI, getUIClassID, isBorderPainted, isSelected, menuSelectionChanged, paintBorder, paramString, processKeyBinding, processKeyEvent, processMouseEvent, removeNotify, setBorderPainted, setHelpMenu, setMargin, setSelected, setSelectionModel, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MENU

private static final java.lang.String MENU
Name and prepareKey-Strings of/for the PropertyResourceBundle menu.properties. MENU = Prefix for menu-keys MENUITEM = Prefix for menuitem-keys

See Also:
Constant Field Values

MENUITEM

private static final java.lang.String MENUITEM
See Also:
Constant Field Values

_fileToolbar

private javax.swing.JToolBar _fileToolbar

_editToolbar

private javax.swing.JToolBar _editToolbar

_viewToolbar

private javax.swing.JToolBar _viewToolbar

_createDiagramToolbar

private javax.swing.JToolBar _createDiagramToolbar

_lruList

private LastRecentlyUsedMenuList _lruList
lru project list


_edit

protected javax.swing.JMenu _edit
Edit menu


_select

protected javax.swing.JMenu _select
unknown where this appears in the UI


_view

protected ArgoJMenu _view
toolbar: view under which is the goto diagram/ find zoom!!! this should be activated as a right click command. editor tabs/details tabs/ adjust grid etc.


_createDiagrams

protected javax.swing.JMenu _createDiagrams
Toolbar:create diagram


_tools

protected javax.swing.JMenu _tools
currently disactivated


_generate

protected javax.swing.JMenu _generate
currently supports rudimentary java generation, new modules for php and html/javadocs are planned feel free to contribute here!


_arrange

protected ArgoJMenu _arrange
this should be invoked automatically when importing sources.


_critique

protected ArgoJMenu _critique
currently undergoing significant testing


_help

protected javax.swing.JMenu _help
It needs it. Currently there is only an about text. hyperlinking to online docs at argouml.org considered basic improvement.

Constructor Detail

GenericArgoMenuBar

public GenericArgoMenuBar()
Method Detail

getShortcut

protected static final javax.swing.KeyStroke getShortcut(java.lang.String key)
Deprecated. in 0.15.1. No longer needed since we have moved from the MenuResouceBundle.java to menu.properties.

Gets the shortcut for a key.


setMnemonic

protected static final void setMnemonic(javax.swing.JMenuItem item,
                                        java.lang.String key,
                                        char defMnemonic)
Deprecated. since 0.15.2. Use @{link #setMnemonic(JMenuItem item, String key)} instead.

This should be a user specified option. New laws for handicapped people who cannot use the mouse require software developers in US to make all components of User interface accessible through keyboard

Since:
09/14/2003

setMnemonic

protected static final void setMnemonic(javax.swing.JMenuItem item,
                                        java.lang.String key)
This should be a user specified option. New laws for handicapped people who cannot use the mouse require software developers in US to make all components of User interface accessible through keyboard

Parameters:
item - is the JMenuItem to do this for.
key - is the key that we do this for.

menuLocalize

protected static final java.lang.String menuLocalize(java.lang.String key)

setAccelerator

static final void setAccelerator(javax.swing.JMenuItem item,
                                 javax.swing.KeyStroke keystroke)

appendPluggableMenus

private void appendPluggableMenus(javax.swing.JMenuItem menuitem,
                                  java.lang.String key)
Scans through all loaded modules to see if it has an item to add in this diagram.

Parameters:
menuitem - The menuitem which this menuitem would attach to.
key - Non-localized string that tells the module where we are.

moduleLoaded

public void moduleLoaded(ArgoModuleEvent event)
Description copied from interface: ArgoModuleEventListener
Invoked when a module has been loaded.

Specified by:
moduleLoaded in interface ArgoModuleEventListener

moduleUnloaded

public void moduleUnloaded(ArgoModuleEvent event)
Description copied from interface: ArgoModuleEventListener
Invoked when a module has been unloaded.

Specified by:
moduleUnloaded in interface ArgoModuleEventListener

moduleEnabled

public void moduleEnabled(ArgoModuleEvent event)
Description copied from interface: ArgoModuleEventListener
Invoked when a module has been enabled.

Specified by:
moduleEnabled in interface ArgoModuleEventListener

moduleDisabled

public void moduleDisabled(ArgoModuleEvent event)
Description copied from interface: ArgoModuleEventListener
Invoked when a module has been disabled.

Specified by:
moduleDisabled in interface ArgoModuleEventListener

initMenus

protected void initMenus()
construct the ordinary all purpose Argo Menu Bar.


getCreateDiagramToolbar

public javax.swing.JToolBar getCreateDiagramToolbar()
Get the create diagram toolbar.

Returns:
Value of property _createDiagramToolbar.

getEditToolbar

public javax.swing.JToolBar getEditToolbar()
Get the edit toolbar.

Returns:
the edit toolbar.

getFileToolbar

public javax.swing.JToolBar getFileToolbar()
Getter for the file toolbar.

Returns:
the file toolbar.

getViewToolbar

public javax.swing.JToolBar getViewToolbar()
Getter for the view toolbar.

Returns:
the view toolbar.

prepareKey

private static java.lang.String prepareKey(java.lang.String str)
Prepares one part of the key for menu- or/and menuitem-mnemonics used in menu.properties. The method changes the parameter str to lower cases. Spaces in the parameter str are changed to hyphens.

Parameters:
str -
Returns:
the prepared str

addFileSaved

public void addFileSaved(java.lang.String filename)
Adds the entry to the lru list.

Parameters:
filename - of the project


ArgoUML © 1996-2004 (20040306)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook