Package ch.sahits.game.event

Examples of ch.sahits.game.event.ViewChangeEvent


  @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);
      footerPolygons.testAndExecute((Point) notice);
    }
    if (e instanceof ViewChangeEvent){
      ViewChangeEvent event = (ViewChangeEvent) e;
      if (event.getAddresse()==getClass()){
        if (notice instanceof ETransferDialogType){
          logger.debug("Change dialog type from "+type+" to "+notice);
          setDialogType((ETransferDialogType) 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

      if (fullNotice!=null){
        offsetPolys.testAndExecute((Point) notice, noticeOffset);
      }
    }
    if (e instanceof ViewChangeEvent){
      ViewChangeEvent event = (ViewChangeEvent) e;
      if (event.getAddresse()==NoticeView.class){
        if (notice instanceof EViewChangeEvent){
          if (notice==EViewChangeEvent.NOTICE_HIDE){
            resetNoticeView();
          }
        } else if (notice instanceof ViewChangeCityPlayerProxy){
View Full Code Here

          doUpdate=true;
        }
        break;
      }
      if (doUpdate){
        new ViewChangeEvent(TradeDialog.class).notify(dialogType);
        try {
          createOrUpdateTradeNotice();
        } catch (Exception e) {
          logger.error("Could not create notice for trade dialog", e);
        }
View Full Code Here

     
      default:
        throw new IllegalArgumentException("Unhandled notice type item in market booth: "+selected);
      }
      if (doUpdate){
        new ViewChangeEvent(MainView.class).notify(selected);
        try {
          createOrUpdateTradingOfficeNotice();
        } catch (Exception e) {
          logger.error("Could not create notice for trading office dialog", e);
        }
View Full Code Here

        break;
      default:
        throw new IllegalArgumentException("Unhandled notice type item in market booth: "+selected);
      }
      if (doUpdate){
        new ViewChangeEvent(MainView.class).notify(selected);
        try {
          creatOrUpdateMarketBoothNotice();
        } catch (Exception e) {
          logger.error("Could not create notice for trade dialog", e);
        }
View Full Code Here

          // change page state
          pageState = PageState.HISTORY;
          state = MouseState.HISTORY_PAGE;
        } // end history
        if (polyName.equals(names[TEXT_FOCUS_NEW])){
          new ViewChangeEvent(GameView.class).notify(EViewChangeEvent.DISPLAY_NEW_SP);
        }
      }     
    } // end of mouse click

  }
View Full Code Here

    if (e instanceof ViewChangeRequestEvent){
      ViewChangeRequestEvent event = (ViewChangeRequestEvent) e;
      if (event.getAdressee().equals(ChangeRequest.ALL)){
        if (eventNotice.equals(EViewChangeEvent.START_GAME)){
          // notify the human player of the gameview change
          new ViewChangeEvent(IMainGameView.class).notify(EViewChangeEvent.START_GAME);
        }
      }
    }
    // TODO Auto-generated method stub
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.