Exemplo n.º 1
0
 // invoked in CoinDisplayListener
 public void displayCoin(int idx) {
   StoreController sctrl = mCtrl.getStoreController();
   CashStoreItem item;
   try {
     item = (CashStoreItem) sctrl.getStoreItem(Store.CASH, idx);
     mpanel.getCoinDisplay().displayQty(idx, item.getQuantity());
   } catch (VMCSException e) {
     System.out.println("MaintenanceController.displayCoin:" + e);
   }
 }
Exemplo n.º 2
0
 // invoked in DrinkDisplayListener;
 public void displayDrinks(int idx) {
   StoreController sctrl = mCtrl.getStoreController();
   DrinksStoreItem item;
   try {
     item = (DrinksStoreItem) sctrl.getStoreItem(Store.DRINK, idx);
     DrinksBrand db = (DrinksBrand) item.getContent();
     mpanel.getDrinksDisplay().displayQty(idx, item.getQuantity());
     mpanel.displayPrice(db.getPrice());
   } catch (VMCSException e) {
     System.out.println("MaintenanceController.displayDrink:" + e);
   }
 }
Exemplo 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);
    }
  }
Exemplo n.º 4
0
 // TotalCashButtonListener
 public void getTotalCash() {
   StoreController sctrl = mCtrl.getStoreController();
   int tc = sctrl.getTotalCash();
   mpanel.displayTotalCash(tc);
 }
Exemplo n.º 5
0
 // invoked by PriceDisplayListener
 public void setPrice(int pr) {
   StoreController sctrl = mCtrl.getStoreController();
   int curIdx = mpanel.getCurIdx();
   sctrl.setPrice(curIdx, pr);
   mpanel.getDrinksDisplay().getPriceDisplay().setValue(pr + "C");
 }