Esempio n. 1
0
 public void loginMaintainer(boolean st) {
   mpanel.displayPasswordState(st);
   mpanel.clearPassword();
   if (st == true) {
     // login successful
     mpanel.setActive(MaintenancePanel.WORKING, true);
     mpanel.setActive(MaintenancePanel.PSWD, false);
     MachineryController machctrl = mCtrl.getMachineryController();
     machctrl.setDoorState(false);
   }
 }
Esempio n. 2
0
  // exit button listener;
  public void logoutMaintainer() {

    MachineryController machctrl = mCtrl.getMachineryController();

    boolean ds = machctrl.isDoorClosed();

    if (ds == false) {
      MessageDialog msg = new MessageDialog(mpanel, "Please Lock the Door before You Leave");
      msg.setLocation(500, 500);
      return;
    }

    mpanel.setActive(MaintenancePanel.DIALOG, true);
  }
Esempio n. 3
0
  // TransferCashButtonListener
  // get all the cash from store and set store cash 0;
  public void transferAll() {
    StoreController sctrl = mCtrl.getStoreController();
    MachineryController machctrl = mCtrl.getMachineryController();

    int cc; // coin quantity;

    try {

      cc = sctrl.transferAll();
      mpanel.displayCoins(cc);
      machctrl.displayCoinStock();
      // the cash qty current is displayed in the Maintenance panel needs to be update to be 0;
      // not required.
      mpanel.updateCurrentQtyDisplay(Store.CASH, 0);
    } catch (VMCSException e) {
      System.out.println("MaintenanceController.transferAll:" + e);
    }
  }