Package info.walnutstreet.vs.ps03.client.controller

Examples of info.walnutstreet.vs.ps03.client.controller.ConnectionHandler


            TableItem[] items = table.getItems();
            for (TableItem tableItem : items) {
              int goodInTableId = Integer.parseInt(tableItem.getText(0));
              if (id == goodInTableId) {
                ClientCacheController controller = ClientCacheController.getInstance();
                GoodObject object = controller.lookForGoodDetail(id);
                double p = num * object.getPrice();
                tableItem.setText(1, Integer.toString(num));
                tableItem.setText(3, Double.toString(p));
                break;
              }
            }
View Full Code Here


    ClientObjectBundle bundle = new ClientObjectBundle(ClientCommands.CLIENT_BUY_GOODS, null);
    send(bundle);
  }
 
  public void changeGoodreservation(int id,int ammount){
    ClientObjectBundle bundle = new ClientObjectBundle(ClientCommands.CLIENT_CHANGE_RESERVATION, new GoodReservationUpdate(id, ammount));
    send(bundle);   
  }
View Full Code Here

        if ( dbserverInterface.buyArticle(element.getKey(), element.getValue()))
        {
          GoodObject ob=goodsFromDatabase.get(element.getKey());
          ob.setBooked(ob.getBooked()+element.getValue());
          ob.setAvailable(ob.getAvailable()-element.getValue());
          goodUpdates.add(new GoodUpdate(element.getKey(),ob.getAvailable(),ob.getBooked()));
        }
      } catch (RemoteException e) {
        DataStore.logger.error(e.getLocalizedMessage());
      }
    }
View Full Code Here

      // TODO [xtreme6400] logger
   
  }

  public void reserve_good(int num, int goodId) {
    ClientObjectBundle bundle = new ClientObjectBundle(ClientCommands.CLIENT_RESERVE_GOOD, new Order(num, goodId));
    send(bundle);
  }
View Full Code Here

   * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
   */
  @Override
  public void widgetSelected(SelectionEvent event) {
    ViewGoodDetailsSelectionListener.logger.debug("Listener: ViewGoodDetailsSelectionListener - view details");
    ClientCacheController controller = ClientCacheController.getInstance();
    this.dialog.updateGood(controller.lookForGoodDetail(this.goodId));
    this.dialog.open();
  }
View Full Code Here

    BuyGoodSelectNumOfGoodDialog.logger.debug("UI: look for information about the good to set maximum limit");
    Thread lookupOperation = new Thread() {
      public void run() {
        display.asyncExec(new Runnable() {
          public void run() {
            ClientCacheController controller = ClientCacheController.getInstance();
            GoodObject object = controller.lookForGoodDetail(goodId);
           
            shell.setText(object.getName());
            int upperLimit = object.getAvailable();
            if (upperLimit > 0) {
              spinner.setMinimum(1);
View Full Code Here

    Thread lookupOperation = new Thread() {
      public void run() {
        display.asyncExec(new Runnable() {
          public void run() {
            ClientCacheController controller = ClientCacheController.getInstance();
            GoodObject object = controller.lookForGoodDetail(goodId);

            double total = num * object.getPrice();

            TableItem item = new TableItem(table, SWT.None);
            item.setText(0, Integer.toString(object.getId()));
View Full Code Here

          public void run() {
            TableItem[] items = table.getItems();
            for (TableItem tableItem : items) {
              int goodInTableId = Integer.parseInt(tableItem.getText(0));
              if (id == goodInTableId) {
                ClientCacheController controller = ClientCacheController.getInstance();
                GoodObject object = controller.lookForGoodDetail(id);
                double p = num * object.getPrice();
                tableItem.setText(1, Integer.toString(num));
                tableItem.setText(3, Double.toString(p));
                break;
              }
View Full Code Here

    ConnectDialogConnectListener.logger.debug("Listener: ConnectDialogConnectListener - try to connect");
    this.dialog.result = false;
    String hostname = this.dialog.getHostname();
    int port = this.dialog.getPort();

    ConnectionController controller = ConnectionController.getInstance();
   
    if (this.dialog.result = controller.connect(hostname, port)) {
      controller.start();
      super.widgetSelected(event);
    }
  }
View Full Code Here

    int id = Integer.parseInt(this.idOfGood.getText());
    int num = Integer.parseInt(this.numOfGood.getText());

    ConnectionController.getInstance().changeGoodreservation(id, num);
   
    UiUpdateController controller2 = UiUpdateController.getInstance();
    controller2.editNumInMyList(id, num);
  }
View Full Code Here

TOP

Related Classes of info.walnutstreet.vs.ps03.client.controller.ConnectionHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.