public void actionPerformed(ActionEvent e) {
   MainMenu M = new MainMenu();
   Object source = e.getSource();
   EmployeeNewReservation o = new EmployeeNewReservation();
   EmployeeCheckRoom c = new EmployeeCheckRoom();
   EmployeeCheckOut b = new EmployeeCheckOut();
   if (source == order) {
     o.setEmployeeNewReservation();
     dispose();
   }
   if (source == exit) {
     M.setLoginPage();
     dispose();
   }
   if (source == check) {
     c.setEmployeeCheckRoom();
     dispose();
   }
   if (source == bill) {
     b.setEmployeeCheckOut();
     dispose();
   }
 }
Esempio n. 2
0
 public boolean check4newHighScore(int points, int levels) {
   boolean n = false;
   readRS();
   for (int i = 0; i < 5; i++) {
     ScoreItem item = (ScoreItem) list.elementAt(i);
     if (points > item.points) {
       if (currentName == null) {
         menu.show(
             new Alert(null, "Neuer Score", null, AlertType.INFO),
             new NameInputField(points, levels, i + 1));
         n = true;
       } else {
         list.insertElementAt(
             new ScoreItem(currentName, points, levels, System.currentTimeMillis()), i);
         list.removeElementAt(5);
         save2RS();
         currentName = null;
         // menu.abortGame();
       }
       return n;
     }
   }
   return n;
 }
Esempio n. 3
0
 public void commandAction(Command comm, Displayable disp) {
   if (comm == toMain) menu.show(menu);
 }
Esempio n. 4
0
  public void init() {
    try {
      Wallpaper =
          ImageIO.read(
              new File("Background3.jpg")); // must download an image(currently jsut a place holder)
      Wallpaper2 =
          ImageIO.read(
              new File(
                  "LevelSelectBackground.jpg")); // must download an image(currently jsut a place
      // holder)
      // rest of images are uploaded on
      PlayButtonSelect = ImageIO.read(new File("PlayButtonActive.png"));
      PlayButtonDeselect = ImageIO.read(new File("PlayButtonNonActive.png"));

      Level1Select = ImageIO.read(new File("Icon-UI-Level1Hover.png"));
      Level1noSelect = ImageIO.read(new File("Icon-UI-Level1noHover.png"));
      Level2Select = ImageIO.read(new File("Icon-UI-Level2Hover.png"));
      Level2noSelect = ImageIO.read(new File("Icon-UI-Level2noHover.png"));
      Level3Select = ImageIO.read(new File("Icon-UI-Level3Hover.png"));
      Level3noSelect = ImageIO.read(new File("Icon-UI-Level3noHover.png"));
    } catch (IOException e) {
    }
    MM.addPlayButton(
        new PlayButton(
            50,
            70,
            width = PlayButtonSelect.getWidth(),
            height = PlayButtonSelect.getHeight(),
            PlayButtonDeselect,
            PlayButtonSelect,
            this,
            MM));

    MM.addLevelButton(
        new LevelSelectButtons(
            110,
            250,
            width = Level1Select.getWidth(),
            height = Level1Select.getHeight(),
            Level1noSelect,
            Level1Select,
            this));
    // MM.addLevelButton(new LevelSelect2(380,250,width = Level1Select.getWidth(),height =
    // Level1Select.getHeight(), Level2noSelect, Level2Select,this));
    MM.addLevelButton(
        new LevelSelectButtons(
            380,
            250,
            width = Level1Select.getWidth(),
            height = Level1Select.getHeight(),
            Level2noSelect,
            Level2Select,
            this));
    MM.addLevelButton(
        new LevelSelectButtons(
            650,
            250,
            width = Level1Select.getWidth(),
            height = Level1Select.getHeight(),
            Level3noSelect,
            Level3Select,
            this));

    MM.addBackground(new Background(0, 0, Wallpaper, Wallpaper2));

    setContentPane(MM);
    setSize(1000, 700);
  }