Class RupsMenuBar

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Observer, Accessible, MenuElement

public class RupsMenuBar extends JMenuBar implements Observer
See Also:
  • Field Details

  • Constructor Details

    • RupsMenuBar

      public RupsMenuBar(Observable observable)
      Creates a JMenuBar.
      Parameters:
      observable - the controller to which this menu bar is added
  • Method Details

    • update

      public void update(Observable observable, Object obj)
      Specified by:
      update in interface Observer
      See Also:
    • addItem

      protected void addItem(JMenu menu, String caption, ActionListener action)
      Create an item with a certain caption and a certain action, then add the item to a menu.
      Parameters:
      menu - the menu to which the item has to be added
      caption - the caption of the item
      action - the action corresponding with the caption
    • enableItems

      protected void enableItems(boolean enabled)
      Enables/Disables a series of menu items.
      Parameters:
      enabled - true for enabling; false for disabling
    • enableItem

      protected void enableItem(String caption, boolean enabled)
      Enables/disables a specific menu item
      Parameters:
      caption - the caption of the item that needs to be enabled/disabled
      enabled - true for enabling; false for disabling