Skip to content

MenuState.java

Raphael Lutz edited this page Aug 19, 2018 · 1 revision

Extends the State class. Represents the starting state of the software : the menu.

Fields

  • UIManager uiManager : a link to the user-interface manager.
  • int xStart = 200 : the x starting position of the buttons from the left side.
  • int yStart = 200 : the y starting position of the buttons from the upper side.
  • int buttonYMargin = 20 : the vertical margin between buttons.
  • int buttonWidth = 100 : the width of the buttons.
  • int buttonHeight = 30 : the height of the buttons.
  • int descriptionMargin = 20 : the horizontal margin between the buttons and the description.
  • UITextButton network1, network2, network3 : the 3 buttons giving access to the simulations.

Methods

  • MenuState(Simulation simulation) : constructor of the class. Initializes the buttons and adds it to the UIManager.
  • void tick(int n) : called at each 1/60 of second, ticks the UIManager regardless of the n.
  • void tick() : does nothing.
  • void render(Graphics g) : renders the menu on g (background, title and buttons).

Getters and setters

The getters and setters for the UIManager.

Clone this wiki locally