Package gui

Class OptionsPanel

All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class OptionsPanel extends JPanel implements ActionListener
An instance is a JPanel with info for the user,
including a slider to speed up McDiver's movements.
See Also:
  • Constructor Details

    • OptionsPanel

      public OptionsPanel(int x, int y, int width, int height, long seed)
      Constructor: an instance is a JPanel with top-left corner (x, y), width width,
      height height, and random number seed seed --which was used t generate the graph.
  • Method Details

    • updateBonus

      public void updateBonus(double b)
      Update bonus multiplier b as displayed by the GUI
    • updateCoins

      public void updateCoins(int c, int score)
      Update the number of coins c picked up as displayed on the GUI.
      Score is the current player's score.
    • changePhaseLabel

      public void changePhaseLabel(String s)
      Change phase label to s.
    • updateStepsLeft

      public void updateStepsLeft(int t)
      Update the steps t left as displayed on the GUI.
    • updateMaxStepsLeft

      public void updateMaxStepsLeft(int m)
      Update the maximum number of steps left, m, for this stage.
    • paintComponent

      public void paintComponent(Graphics page)
      Paint the component
      Overrides:
      paintComponent in class JComponent
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      When showSeed button clicked, print the seed in the console.
      Specified by:
      actionPerformed in interface ActionListener