net.curre.prefcount.gui.menu
Class AwtMenuBar

java.lang.Object
  extended by java.awt.MenuComponent
      extended by java.awt.MenuBar
          extended by net.curre.prefcount.gui.menu.AwtMenuBar
All Implemented Interfaces:
java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, PrefCountMenuBar

public class AwtMenuBar
extends java.awt.MenuBar
implements PrefCountMenuBar

Object of this class represents a menu bar for Mac OS. This menu bar is assumed to be placed at the top fo the screen. Other platforms are not supported by this class just because swing menu bar is a better option when not on Mac OS.

Note that we are using awt menu bar because swing menu bar is not compatible with the substance look-and-feel library when running on Mac.

Created date: Jan 24, 2008

Author:
Yevgeny Nyden
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.MenuBar
java.awt.MenuBar.AccessibleAWTMenuBar
 
Nested classes/interfaces inherited from class java.awt.MenuComponent
java.awt.MenuComponent.AccessibleAWTMenuComponent
 
Nested classes/interfaces inherited from interface net.curre.prefcount.gui.menu.PrefCountMenuBar
PrefCountMenuBar.MenuBarType
 
Constructor Summary
AwtMenuBar(PrefCountMenuBar.MenuBarType menuBarType, javax.swing.JPanel topPanel)
          Constructor that sets the type of this menu bar, initializes necessary data structures, and creates the menus.
 
Method Summary
 void disableActionMenu()
          Disables the action menu.
 void disableLanguageMenu()
          Disables the language menu.
 void refreshMenuItemsLabels()
          Resets menu labels.
 void toggleBackAction(boolean enabled)
          Enables/disables the back menu item on the action menu.
 void toggleComputeAction(boolean enabled)
          Enables/disables the compute menu item on the action menu.
 void toggleNextAction(boolean enabled)
          Enables/disables the next menu item on the action menu.
 
Methods inherited from class java.awt.MenuBar
add, addNotify, countMenus, deleteShortcut, getAccessibleContext, getHelpMenu, getMenu, getMenuCount, getShortcutMenuItem, remove, remove, removeNotify, setHelpMenu, shortcuts
 
Methods inherited from class java.awt.MenuComponent
dispatchEvent, getFont, getName, getParent, getPeer, getTreeLock, paramString, postEvent, processEvent, setFont, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Constructor Detail

AwtMenuBar

public AwtMenuBar(PrefCountMenuBar.MenuBarType menuBarType,
                  javax.swing.JPanel topPanel)
Constructor that sets the type of this menu bar, initializes necessary data structures, and creates the menus.

Parameters:
menuBarType - Type of this menu bar (for which frame it was created).
topPanel - Reference to the main window top panel - the language indicator icon will be added there if menu bar type is MAIN_WINDOW.
Throws:
java.lang.IllegalArgumentException - If menu bar type is not supported.
java.lang.UnsupportedOperationException - When running on not Mac OS.
Method Detail

refreshMenuItemsLabels

public void refreshMenuItemsLabels()
Resets menu labels.

Specified by:
refreshMenuItemsLabels in interface PrefCountMenuBar

disableLanguageMenu

public void disableLanguageMenu()
Disables the language menu.

Specified by:
disableLanguageMenu in interface PrefCountMenuBar

disableActionMenu

public void disableActionMenu()
Disables the action menu.

Specified by:
disableActionMenu in interface PrefCountMenuBar

toggleNextAction

public void toggleNextAction(boolean enabled)
Enables/disables the next menu item on the action menu.

Specified by:
toggleNextAction in interface PrefCountMenuBar
Parameters:
enabled - True when the menu item should be enabled; false if disabled.

toggleBackAction

public void toggleBackAction(boolean enabled)
Enables/disables the back menu item on the action menu.

Specified by:
toggleBackAction in interface PrefCountMenuBar
Parameters:
enabled - True when the menu item should be enabled; false if disabled.

toggleComputeAction

public void toggleComputeAction(boolean enabled)
Enables/disables the compute menu item on the action menu.

Specified by:
toggleComputeAction in interface PrefCountMenuBar
Parameters:
enabled - True when the menu item should be enabled; false if disabled.


Copyright © 2008. All Rights Reserved.