All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class javaUI.J_MenuBar

java.lang.Object
   |
   +----javaUI.J_MenuBar

public final class J_MenuBar
extends java.lang.Object
This class encapsulates the Mac menu bar. All other windows' MenuBar objects are actually references to the MenuBar of J_MenuBar.the_frame, which is a Frame object kept off-screen (so that we still have a menu bar even when there are no application windows open).

Because there is only one menu bar in a Mac application, all of J_MenuBar's methods are static. You should call new J_MenuBar() early in the program's execution to initialize the menu bar, but that individual instance can be thrown away.

Note that it is an error to call new J_MenuBar() more than once.


Variable Index

 o CLEAR
 o CLOSE
 o COPY
 o CUT
 o DUPLICATE
 o INPUT_SETTINGS_
 o NEW
 o NEW_VIRTUAL_4CONTROL
 o OPEN
 o PASTE
 o PREFERENCES_
 o QUIT
 o REDO
 o REVERT
 o SAVE
 o SAVE_AS_
 o SELECT_ALL
 o UNDO

Constructor Index

 o J_MenuBar()

Method Index

 o get_MBar()
 o getItem(int)
 o removeActionListener(int)
Similar to MenuItem's removeActionListener.
 o removeActionListener(int, ActionListener)
Similar to MenuItem's removeActionListener.
 o swapActionListener(int, ActionListener)
Similar to MenuItem's addActionListener method, except that in J_MenuBar, a menu item can have at most one ActionListener at a time.

Variables

 o NEW
 public static final int NEW
 o OPEN
 public static final int OPEN
 o CLOSE
 public static final int CLOSE
 o SAVE
 public static final int SAVE
 o SAVE_AS_
 public static final int SAVE_AS_
 o REVERT
 public static final int REVERT
 o QUIT
 public static final int QUIT
 o UNDO
 public static final int UNDO
 o REDO
 public static final int REDO
 o CUT
 public static final int CUT
 o COPY
 public static final int COPY
 o PASTE
 public static final int PASTE
 o CLEAR
 public static final int CLEAR
 o DUPLICATE
 public static final int DUPLICATE
 o SELECT_ALL
 public static final int SELECT_ALL
 o INPUT_SETTINGS_
 public static final int INPUT_SETTINGS_
 o NEW_VIRTUAL_4CONTROL
 public static final int NEW_VIRTUAL_4CONTROL
 o PREFERENCES_
 public static final int PREFERENCES_

Constructors

 o J_MenuBar
 public J_MenuBar() throws javaUI.E_Double_Init

Methods

 o get_MBar
 public static java.awt.MenuBar get_MBar()
 o getItem
 public static javaUI.J_MenuBar.MenuCommandItem getItem(int i)
 o swapActionListener
 public static void swapActionListener(int what,
                                       java.awt.event.ActionListener who)
Similar to MenuItem's addActionListener method, except that in J_MenuBar, a menu item can have at most one ActionListener at a time. A call to swapActionListener removes the old ActionListener (if any) before adding the new one. Note that J_MenuBar automatically enables any menu item for which there is a registered ActionListener, and disables any menu item for which there isn't.

Parameters:
what - an integer constant representing the menu item
who - the ActionListener object requesting ActionEvents
See Also:
addActionListener
 o removeActionListener
 public static void removeActionListener(int what,
                                         java.awt.event.ActionListener who)
Similar to MenuItem's removeActionListener. Note that J_MenuBar automatically enables any menu item for which there is a registered ActionListener, and disables any menu item for which there isn't.

Parameters:
what - an integer constant representing the menu item
who - the ActionListener object requesting no longer to receive ActionEvents
See Also:
removeActionListener
 o removeActionListener
 public static void removeActionListener(int what)
Similar to MenuItem's removeActionListener. Removes the currently-registered ActionListener object. Note that J_MenuBar automatically enables any menu item for which there is a registered ActionListener, and disables any menu item for which there isn't.

Parameters:
what - an integer constant representing the menu item
See Also:
removeActionListener

All Packages  Class Hierarchy  This Package  Previous  Next  Index