Venice 0.7beta

org.mov.ui
Class MainMenu

java.lang.Object
  extended by org.mov.ui.MainMenu
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, ModuleListener

public class MainMenu
extends java.lang.Object
implements java.awt.event.ActionListener, ModuleListener

The main menu of the application.

Author:
Daniel Makovec

Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Called when a menu item is selected.
 void buildMacroMenu()
          Take the list of menu item and add them to the given menu.
 void disableMenus()
          Disable the menus.
 void enableMenus()
          Enable the menus.
static MainMenu getInstance()
          Return the instance of the main menu.
static MainMenu getInstance(javax.swing.JFrame frame, DesktopManager desktopManager)
          Construct a new main menu and attach it to the given frame.
 void moduleAdded(ModuleEvent moduleEvent)
          Called by the desktop manager to notify us when a new module is added
 void moduleRemoved(ModuleEvent moduleEvent)
          Called by the desktop manager to notify us when a module is removed
 void moduleRenamed(ModuleEvent moduleEvent)
          Called by the desktop manager to notify us when a module is renamed
 void updatePortfolioMenu()
          Inform menu that the list of portfolios has changed and that its menus should be redrawn
 void updateWatchScreenMenu()
          Inform menu that the list of watch screens has changed and that its menus should be redrawn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static MainMenu getInstance(javax.swing.JFrame frame,
                                   DesktopManager desktopManager)
Construct a new main menu and attach it to the given frame.

Parameters:
frame - the window frame
desktopManager - the desktop to lunch internal frames on

getInstance

public static MainMenu getInstance()
Return the instance of the main menu. Will return null if not yet created.

Returns:
the main menu instance

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Called when a menu item is selected.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - an action

moduleAdded

public void moduleAdded(ModuleEvent moduleEvent)
Called by the desktop manager to notify us when a new module is added

Specified by:
moduleAdded in interface ModuleListener
Parameters:
moduleEvent - Module Event

moduleRemoved

public void moduleRemoved(ModuleEvent moduleEvent)
Called by the desktop manager to notify us when a module is removed

Specified by:
moduleRemoved in interface ModuleListener
Parameters:
moduleEvent - Module Event

moduleRenamed

public void moduleRenamed(ModuleEvent moduleEvent)
Called by the desktop manager to notify us when a module is renamed

Specified by:
moduleRenamed in interface ModuleListener
Parameters:
moduleEvent - Module Event

updatePortfolioMenu

public void updatePortfolioMenu()
Inform menu that the list of portfolios has changed and that its menus should be redrawn


updateWatchScreenMenu

public void updateWatchScreenMenu()
Inform menu that the list of watch screens has changed and that its menus should be redrawn


buildMacroMenu

public void buildMacroMenu()
Take the list of menu item and add them to the given menu. Return a hashmap which maps each menu created with the given menu item.


disableMenus

public void disableMenus()
Disable the menus. This shadows the menus and disables user action.


enableMenus

public void enableMenus()
Enable the menus. This re-enables the menus and allows user actions.


Venice 0.7beta