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;
}