From: Freek D. <mac...@us...> - 2010-01-31 22:22:44
|
Update of /cvsroot/rails/18xx/rails/ui/swing/gamespecific/_18EU In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv382/rails/ui/swing/gamespecific/_18EU Modified Files: GameStatus_18EU.java GameUIManager_18EU.java Log Message: Fix indentation: Java files contain 4 spaces, not tabs Index: GameStatus_18EU.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/gamespecific/_18EU/GameStatus_18EU.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** GameStatus_18EU.java 14 Jan 2010 20:44:04 -0000 1.10 --- GameStatus_18EU.java 31 Jan 2010 22:22:35 -0000 1.11 *************** *** 71,76 **** RadioButtonDialog dialog = new RadioButtonDialog (gameUIManager, ! LocalText.getText("PleaseSelect"), ! LocalText.getText("SelectCompanyToMergeMinorInto", minor.getName()), options, -1); --- 71,76 ---- RadioButtonDialog dialog = new RadioButtonDialog (gameUIManager, ! LocalText.getText("PleaseSelect"), ! LocalText.getText("SelectCompanyToMergeMinorInto", minor.getName()), options, -1); Index: GameUIManager_18EU.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/gamespecific/_18EU/GameUIManager_18EU.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GameUIManager_18EU.java 14 Jan 2010 20:43:18 -0000 1.2 --- GameUIManager_18EU.java 31 Jan 2010 22:22:36 -0000 1.3 *************** *** 15,122 **** public class GameUIManager_18EU extends GameUIManager { ! @Override ! public void dialogActionPerformed () { ! if (currentDialog instanceof RadioButtonDialog ! && currentDialogAction instanceof MergeCompanies) { ! RadioButtonDialog dialog = (RadioButtonDialog) currentDialog; ! MergeCompanies action = (MergeCompanies) currentDialogAction; PublicCompanyI minor = action.getMergingCompany(); if (action.getSelectedTargetCompany() == null) { ! // Step 1: selection of the major company to merge into ! int choice = dialog.getSelectedOption(); ! if (choice < 0) return; ! PublicCompanyI major = action.getTargetCompanies().get(choice); ! action.setSelectedTargetCompany(major); ! if (major != null && action.canReplaceToken(choice)) { ! boolean replaceToken = ! JOptionPane.showConfirmDialog(statusWindow, LocalText.getText( ! "WantToReplaceToken", ! minor.getName(), ! major.getName() ), ! LocalText.getText("PleaseSelect"), ! JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION; ! action.setReplaceToken(replaceToken); ! } } else { ! // To be added later when ReplaceToken dialog is modeless } ! } else if (currentDialog instanceof RadioButtonDialog ! && currentDialogAction instanceof StartCompany_18EU) { ! RadioButtonDialog dialog = (RadioButtonDialog) currentDialog; ! StartCompany_18EU action = (StartCompany_18EU) currentDialogAction; ! if (action.getPrice() == 0) { ! // The price will be set first ! int index = dialog.getSelectedOption(); ! if (index < 0) return; ! action.setStartPrice(action.getStartPrices()[index]); ! // Set up another dialog for the next step ! List<PublicCompanyI> minors = action.getMinorsToMerge(); ! if (minors != null && !minors.isEmpty()) { ! // Up to phase 6, a minor must be exchanged ! String[] options = new String[minors.size()]; ! int i = 0; ! for (PublicCompanyI minor : minors) { ! options[i++] = ! "Minor " + minor.getName() + " " ! + minor.getLongName(); ! } ! dialog = new RadioButtonDialog (this, ! LocalText.getText("PleaseSelect"), ! LocalText.getText( ! "SelectMinorToMerge", ! action.getCertificate().getCompany().getName()), ! options, -1); ! setCurrentDialog(dialog, action); ! return; ! } else { ! // From phase 6, no minors are involved, but a home station must be chosen ! List<City> cities = action.getAvailableHomeStations(); ! if (cities != null && !cities.isEmpty()) { ! String[] options = new String[cities.size()]; ! for (int i = 0; i < options.length; i++) { ! options[i] = cities.get(i).toString(); ! } ! dialog = new RadioButtonDialog (this, ! LocalText.getText("PleaseSelect"), ! LocalText.getText( ! "SelectHomeStation", ! action.getCertificate().getCompany().getName()), ! options, -1); ! setCurrentDialog(dialog, action); ! return; ! } ! } ! } else if (action.getMinorsToMerge() != null) { ! // Up to phase 5: a minor to merge has been selected (or not) int choice = dialog.getSelectedOption(); ! if (choice < 0) { ! // Also reset price ! action.setStartPrice(0); ! return; ! } ! action.setChosenMinor(action.getMinorsToMerge().get(choice)); ! } else if (action.getAvailableHomeStations() != null) { ! // From phase 6: a home station has been selected (or not) int index = dialog.getSelectedOption(); if (index < 0) { ! // Also reset price ! action.setStartPrice(0); ! return; } action.setHomeStation(action.getAvailableHomeStations().get(index)); --- 15,122 ---- public class GameUIManager_18EU extends GameUIManager { ! @Override ! public void dialogActionPerformed () { ! if (currentDialog instanceof RadioButtonDialog ! && currentDialogAction instanceof MergeCompanies) { ! RadioButtonDialog dialog = (RadioButtonDialog) currentDialog; ! MergeCompanies action = (MergeCompanies) currentDialogAction; PublicCompanyI minor = action.getMergingCompany(); if (action.getSelectedTargetCompany() == null) { ! // Step 1: selection of the major company to merge into ! int choice = dialog.getSelectedOption(); ! if (choice < 0) return; ! PublicCompanyI major = action.getTargetCompanies().get(choice); ! action.setSelectedTargetCompany(major); ! if (major != null && action.canReplaceToken(choice)) { ! boolean replaceToken = ! JOptionPane.showConfirmDialog(statusWindow, LocalText.getText( ! "WantToReplaceToken", ! minor.getName(), ! major.getName() ), ! LocalText.getText("PleaseSelect"), ! JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION; ! action.setReplaceToken(replaceToken); ! } } else { ! // To be added later when ReplaceToken dialog is modeless } ! } else if (currentDialog instanceof RadioButtonDialog ! && currentDialogAction instanceof StartCompany_18EU) { ! RadioButtonDialog dialog = (RadioButtonDialog) currentDialog; ! StartCompany_18EU action = (StartCompany_18EU) currentDialogAction; ! if (action.getPrice() == 0) { ! // The price will be set first ! int index = dialog.getSelectedOption(); ! if (index < 0) return; ! action.setStartPrice(action.getStartPrices()[index]); ! // Set up another dialog for the next step ! List<PublicCompanyI> minors = action.getMinorsToMerge(); ! if (minors != null && !minors.isEmpty()) { ! // Up to phase 6, a minor must be exchanged ! String[] options = new String[minors.size()]; ! int i = 0; ! for (PublicCompanyI minor : minors) { ! options[i++] = ! "Minor " + minor.getName() + " " ! + minor.getLongName(); ! } ! dialog = new RadioButtonDialog (this, ! LocalText.getText("PleaseSelect"), ! LocalText.getText( ! "SelectMinorToMerge", ! action.getCertificate().getCompany().getName()), ! options, -1); ! setCurrentDialog(dialog, action); ! return; ! } else { ! // From phase 6, no minors are involved, but a home station must be chosen ! List<City> cities = action.getAvailableHomeStations(); ! if (cities != null && !cities.isEmpty()) { ! String[] options = new String[cities.size()]; ! for (int i = 0; i < options.length; i++) { ! options[i] = cities.get(i).toString(); ! } ! dialog = new RadioButtonDialog (this, ! LocalText.getText("PleaseSelect"), ! LocalText.getText( ! "SelectHomeStation", ! action.getCertificate().getCompany().getName()), ! options, -1); ! setCurrentDialog(dialog, action); ! return; ! } ! } ! } else if (action.getMinorsToMerge() != null) { ! // Up to phase 5: a minor to merge has been selected (or not) int choice = dialog.getSelectedOption(); ! if (choice < 0) { ! // Also reset price ! action.setStartPrice(0); ! return; ! } ! action.setChosenMinor(action.getMinorsToMerge().get(choice)); ! } else if (action.getAvailableHomeStations() != null) { ! // From phase 6: a home station has been selected (or not) int index = dialog.getSelectedOption(); if (index < 0) { ! // Also reset price ! action.setStartPrice(0); ! return; } action.setHomeStation(action.getAvailableHomeStations().get(index)); *************** *** 126,131 **** } ! super.dialogActionPerformed(true); ! } } --- 126,131 ---- } ! super.dialogActionPerformed(true); ! } } |