Class GameMenuBar

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

public class GameMenuBar extends JMenuBar
Menu bar for game.
Author:
Molly
See Also:
  • Constructor Details

    • GameMenuBar

      public GameMenuBar(Base base)
      Modular menu bar for the program. Default menu has home button.
      Parameters:
      base - the JFrame that these menu actions connect to
  • Method Details

    • setPause

      public void setPause()
      Game is paused so set pause button to display "un pause".
    • setUnPause

      public void setUnPause()
      Game is un-paused so set pause button to display "pause".
    • addGameButtons

      public void addGameButtons()
      Adds buttons to the menu bar that are only relevant to the game window. Pause, New - level 1, level 2, Save.
    • addLoadButton

      public void addLoadButton()
      Add load button to menubar.
    • addExitButton

      public void addExitButton()
      Add exit button to menubar.
    • getIcon

      public ImageIcon getIcon(String filename)
      Get icon to put on menuitem.
      Parameters:
      filename - filename for icon
      Returns:
      Image to put on menu item