Package ch.sahits.game.event

Examples of ch.sahits.game.event.ViewChangeEvent


        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){
      if (((ViewChangeEvent)e).getAddresse()==dialogUpdater.getClass()){
        EViewChangeEvent change = (EViewChangeEvent) eventNotice;
        switch (change) {
        case CLOSE_DIALOG:
          dialogUpdater.updateDialog(null);
          new ViewChangeEvent(NoticeView.class).notify(EViewChangeEvent.NOTICE_HIDE);
          break;

        default:
          break;
        }
View Full Code Here


      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

        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()){
        EViewChangeEvent change = (EViewChangeEvent) eventNotice;
View Full Code Here

      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 run() {
      new ViewChangeEvent(MainView.class).notify(EViewChangeEvent.CLOSE_DIALOG);
      Event.remove(dialog);
    }   
View Full Code Here

  @Override
  public void gameUpdate(Event e, Object notice) {
    if (e instanceof KeyPressEvent){
      KeyEvent key= ((KeyPressEvent)e).getKey();
      if (key.getKeyCode()==KeyEvent.VK_ESCAPE){
        new ViewChangeEvent(MainView.class).notify(EViewChangeEvent.CLOSE_DIALOG);
        new ViewChangeEvent(NoticeView.class).notify(EViewChangeEvent.NOTICE_HIDE);
        Event.remove(this);
      }
    }
    if (e instanceof MouseClickEvent){
      footerPolygons.testAndExecute((Point) notice);
View Full Code Here

  @Override
  public void gameUpdate(Event e, Object notice) {
    if (e instanceof KeyPressEvent){
      KeyEvent key= ((KeyPressEvent)e).getKey();
      if (key.getKeyCode()==KeyEvent.VK_ESCAPE){
        new ViewChangeEvent(MainView.class).notify(EViewChangeEvent.CLOSE_DIALOG);
        new ViewChangeEvent(NoticeView.class).notify(EViewChangeEvent.NOTICE_HIDE);
        Event.remove(this);
      }
    }
    if (e instanceof MouseClickEvent){
      footerPolygons.testAndExecute((Point) notice);
View Full Code Here

  @Override
  public void gameUpdate(Event e, Object notice) {
    if (e instanceof KeyPressEvent){
      KeyEvent key= ((KeyPressEvent)e).getKey();
      if (key.getKeyCode()==KeyEvent.VK_ESCAPE){
        new ViewChangeEvent(MainView.class).notify(EViewChangeEvent.CLOSE_DIALOG);
        new ViewChangeEvent(NoticeView.class).notify(EViewChangeEvent.NOTICE_HIDE);
        Event.remove(this);
      }
    }
    if (e instanceof MouseClickEvent){
      footerPolygons.testAndExecute((Point) notice);
View Full Code Here

  @Override
  public void gameUpdate(Event e, Object notice) {
    if (e instanceof KeyPressEvent){
      KeyEvent key= ((KeyPressEvent)e).getKey();
      if (key.getKeyCode()==KeyEvent.VK_ESCAPE){
        new ViewChangeEvent(MainView.class).notify(EViewChangeEvent.CLOSE_DIALOG);
        new ViewChangeEvent(NoticeView.class).notify(EViewChangeEvent.NOTICE_HIDE);
        Event.remove(this);
      }
    }
    if (e instanceof MouseClickEvent){
      polygons.testAndExecute((Point) notice);
View Full Code Here

  }

  @Override
  public final void gameUpdate(Event e, Object notice) {
    if (e instanceof ViewChangeEvent){
      ViewChangeEvent event = (ViewChangeEvent) e;
      ClassChecker cc = new ClassChecker(getClass());
      if (event.getAddresse().equals(getClass()) ||
          cc.implementsInterfaceIndirectly(event.getAddresse())){
        if (notice instanceof EViewChangeEvent){
          EViewChangeEvent change = (EViewChangeEvent) notice;
          switch (change) {
          case DISPLAY_NEW_SP:
            for (Iterator<RenderablePart> iter = iterator(); iter.hasNext();) {
View Full Code Here

TOP

Related Classes of ch.sahits.game.event.ViewChangeEvent

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.