Package ch.sahits.game.graphic.display.model

Examples of ch.sahits.game.graphic.display.model.ViewChangeCityPlayerProxy


      if (polyName.equals(polyNames[0])){ // loading crane
        if (city.getActiveShip()!=null){ // if there is an active ship
          BufferedImage dialogImg = dialogUpdater.getDialogFringe();
          Point topLeft = new Point(getBounds().x+(getBounds().width-dialogImg.getWidth())/2,getBounds().y+(getBounds().height-600)/2);
          // update the notice
          ViewChangeCityPlayerProxy proxy = new ViewChangeCityPlayerProxy(city, EViewChangeEvent.NOTICE_TRADE);
          new ViewChangeEvent(NoticeView.class).notify(proxy);
          // Open the dialog
          final double dialogScale = scaleMap.get(SCENE_IMAGE_NAME);
          if (city.getActiveShip()!=null){
            // city 2 ship
            dialogUpdater.updateDialog(new TradeDialog(topLeft, dialogScale,city,ETransferDialogType.CITY_TO_SHIP));
          } else if (city.getPlayer().findBuildings(city.getCity())!=null){
            // city 2 branch office
            dialogUpdater.updateDialog(new TradeDialog(topLeft, dialogScale,city,ETransferDialogType.CITY_TO_STORAGE));
          }
        }
      } // end loading crane
      else if (polyName.equals(polyNames[1])){ // stairs
        // replace the scene with the market scene
        ViewChangeCityPlayerProxy proxy = new ViewChangeCityPlayerProxy(city, EViewChangeEvent.MAIN_VIEW_MARKET);
        new ViewChangeEvent(MainView.class).notify(proxy);
      } else if (polyName.equals(polyNames[2])){ // trading office
        displayTradingOfficeBalanceDialog(city, dialogUpdater);
      }
    } else if (e instanceof ViewChangeEvent){
View Full Code Here


  public void displayTradingOfficeBalanceDialog(CityPlayerProxy city,
      IUpdatableDialog dialogUpdater) {
    BufferedImage dialogImg = dialogUpdater.getDialogFringe();
    Point topLeft = new Point(getBounds().x+(getBounds().width-dialogImg.getWidth())/2,getBounds().y+(getBounds().height-600)/2);
    // update the notice
    ViewChangeCityPlayerProxy proxy = new ViewChangeCityPlayerProxy(city, EViewChangeEvent.NOTICE_TRADING_OFFICE);
    new ViewChangeEvent(NoticeView.class).notify(proxy);
    final double dialogScale = scaleMap.get(SCENE_IMAGE_NAME);
    dialogUpdater.updateDialog(new TradingOfficeBalanceDialog(topLeft,dialogScale,city));
  }
View Full Code Here

      if (polyName.equals(polyNames[0])){ // market booth
        displayTradingStockdialog(city, dialogUpdater);
      } // end market booth
      else if (polyName.equals(polyNames[1])){ // Floor
        // Back to port
        ViewChangeCityPlayerProxy proxy = new ViewChangeCityPlayerProxy(city, EViewChangeEvent.MAIN_VIEW_PORT);
        new ViewChangeEvent(MainView.class).notify(proxy);
       
      }
    } else if (e instanceof ViewChangeEvent){
      if (((ViewChangeEvent)e).getAddresse()==dialogUpdater.getClass()){
View Full Code Here

  public void displayTradingStockdialog(CityPlayerProxy city,
      IUpdatableDialog dialogUpdater) {
    BufferedImage dialogImg = dialogUpdater.getDialogFringe();
    Point topLeft = new Point(getBounds().x+(getBounds().width-dialogImg.getWidth())/2,getBounds().y+(getBounds().height-600)/2);
    // update the notice
    ViewChangeCityPlayerProxy proxy = new ViewChangeCityPlayerProxy(city, EViewChangeEvent.NOTICE_MARKET_BOOTH);
    new ViewChangeEvent(NoticeView.class).notify(proxy);
    // Open the dialog
    final double dialogScale = scaleMap.get(SCENE_IMAGE_NAME);
    dialogUpdater.updateDialog(new TradingStockDialog(topLeft, dialogScale, city));
  }
View Full Code Here

  }
  @Override
  public void gameUpdate(Event e, Object eventNotice) {
    if (e instanceof ViewChangeEvent && ((ViewChangeEvent)e).getAddresse() == getClass() && eventNotice instanceof ViewChangeCityPlayerProxy){
      ViewChangeCityPlayerProxy proxy = (ViewChangeCityPlayerProxy) eventNotice;
      EViewChangeEvent changeEvent = proxy.getViewChangeEvent();
      switch (changeEvent) {
      case MAIN_VIEW_MARKET:
        handleViewChange(EScene.MARKET);
        break;
      case MAIN_VIEW_PORT:
View Full Code Here

        if (notice instanceof EViewChangeEvent){
          if (notice==EViewChangeEvent.NOTICE_HIDE){
            resetNoticeView();
          }
        } else if (notice instanceof ViewChangeCityPlayerProxy){
          ViewChangeCityPlayerProxy n = (ViewChangeCityPlayerProxy) notice;
          if (n.getViewChangeEvent()==EViewChangeEvent.NOTICE_TRADE){
            try {
              createTradeNotice(n);
            } catch (Exception e1) {
              logger.error("Could not create notice for trade dialog", e1);
            }
          } else if (n.getViewChangeEvent()==EViewChangeEvent.NOTICE_MARKET_BOOTH){
            try {
              createMarketBoothNotice(n);
            } catch (Exception e1){
              logger.error("Could not create notice for market booth dialog", e1);
            }
          } else if (n.getViewChangeEvent()==EViewChangeEvent.NOTICE_TRADING_OFFICE){
            try {
              createTradingOfficeNotice(n);
            } catch (Exception e1){
              logger.error("Could not create notice for trading office", e1);
            }
View Full Code Here

TOP

Related Classes of ch.sahits.game.graphic.display.model.ViewChangeCityPlayerProxy

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.