You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
(46) |
Dec
(57) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(51) |
Feb
(10) |
Mar
|
Apr
|
May
(14) |
Jun
|
Jul
(13) |
Aug
(30) |
Sep
(83) |
Oct
(56) |
Nov
(148) |
Dec
(107) |
2010 |
Jan
(260) |
Feb
(164) |
Mar
(183) |
Apr
(99) |
May
(160) |
Jun
(40) |
Jul
(33) |
Aug
(48) |
Sep
(22) |
Oct
(24) |
Nov
(1) |
Dec
(12) |
2011 |
Jan
(6) |
Feb
(15) |
Mar
(13) |
Apr
(37) |
May
(27) |
Jun
(29) |
Jul
(33) |
Aug
(20) |
Sep
(17) |
Oct
(20) |
Nov
(33) |
Dec
(17) |
2012 |
Jan
(39) |
Feb
(38) |
Mar
(20) |
Apr
(21) |
May
(17) |
Jun
(22) |
Jul
(16) |
Aug
(3) |
Sep
(9) |
Oct
(10) |
Nov
|
Dec
|
From: Erik V. <ev...@us...> - 2010-01-14 20:41:28
|
Update of /cvsroot/rails/18xx/rails/common In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv3066/rails/common Added Files: ServerToClient.java GuiHints.java Log Message: New classes for the server-to-client communication --- NEW FILE: ServerToClient.java --- package rails.common; import java.io.Serializable; /** * Instances of this class are intended to carry all data that * (after the foreseen client/server split) would be sent from * the server (game enigine) to the client (GUI) after completion * of the processing of each player action. * All contents of this class must be Serializable. * <p>This class is still in its infancy. Over time it will probably * absorb the current PossibleActions and DisplayBuffer classes, * and also include many details that the GUI now obtains * via direct calls to server methods. * @author VosE * */ public class ServerToClient implements Serializable { public static final long serialVersionUID = 1L; private GuiHints guiHints = null; public GuiHints getUiHints() { return guiHints; } public void setUiHints(GuiHints guiHints) { this.guiHints = guiHints; } } --- NEW FILE: GuiHints.java --- package rails.common; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import rails.game.RoundI; /** * This class contains hints from the server (game engine) to the client (GUI) * about the preferred visibility of the various window types. * It is up to the GUI (and its user) to decide what to do with these hints, * but the current implementation should exactly follow these hints. * @author VosE * */ public class GuiHints implements Serializable { public static final long serialVersionUID = 1L; /** What round type is currently active in the engine? */ private Class<? extends RoundI> currentRoundType = null; /** Which windows should be visible? */ private List<VisibilityHint> visibilityHints; /** Which window type is active and should be on top? */ private GuiDef.Panel activePanel; public Class<? extends RoundI> getCurrentRoundType() { return currentRoundType; } public void setCurrentRoundType(Class<? extends RoundI> currentRoundType) { this.currentRoundType = currentRoundType; } public List<VisibilityHint> getVisibilityHints() { return visibilityHints; } public void setVisibilityHint(GuiDef.Panel type, boolean visibility) { if (visibilityHints == null) { visibilityHints = new ArrayList<VisibilityHint>(4); } visibilityHints.add (new VisibilityHint(type, visibility)); } public void clearVisibilityHints () { if (visibilityHints == null) { visibilityHints = new ArrayList<VisibilityHint>(4); } else { visibilityHints.clear(); } } public GuiDef.Panel getActivePanel() { return activePanel; } public void setActivePanel(GuiDef.Panel activePanel) { this.activePanel = activePanel; } public class VisibilityHint { GuiDef.Panel type; boolean visibility; VisibilityHint (GuiDef.Panel type, boolean visibility) { this.type = type; this.visibility = visibility; } public GuiDef.Panel getType() { return type; } public boolean getVisibility() { return visibility; } } } |
From: Erik V. <ev...@us...> - 2010-01-14 20:40:37
|
Update of /cvsroot/rails/18xx/rails/common In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv2974/rails/common Added Files: GuiDef.java Removed Files: Defs.java Log Message: Renamed --- Defs.java DELETED --- --- NEW FILE: GuiDef.java --- package rails.common; public class GuiDef { /** Identifiers and default names for configurable UI classes */ public enum ClassName { GAME_UI_MANAGER ("rails.ui.swing.GameUIManager"), OR_UI_MANAGER ("rails.ui.swing.ORUIManager"), STATUS_WINDOW ("rails.ui.swing.StatusWindow"), GAME_STATUS ("rails.ui.swing.GameStatus"), OR_WINDOW ("rails.ui.swing.ORWindow"); private String defaultClassName; ClassName (String defaultClassName) { this.defaultClassName = defaultClassName; } public String getDefaultClassName () { return defaultClassName; } } public static String getDefaultClassName (ClassName key) { return key.getDefaultClassName(); } /** Definitions for key/value pairs in the communication * between GameManager and GameUIManager. */ public enum Parm { HAS_ANY_PAR_PRICE, CAN_ANY_COMPANY_HOLD_OWN_SHARES, CAN_ANY_COMPANY_BUY_PRIVATES, DO_BONUS_TOKENS_EXIST, HAS_ANY_COMPANY_LOANS } /** * Definitions for UI window types, used by the server * to pass visibility hints to the UI. */ public enum Panel { START_ROUND, STATUS, MAP, STOCK_MARKET } } |
From: Erik V. <ev...@us...> - 2010-01-11 23:07:03
|
Update of /cvsroot/rails/18xx/rails/ui/swing/gamespecific/_18EU In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv20271/rails/ui/swing/gamespecific/_18EU Modified Files: GameStatus_18EU.java Added Files: GameUIManager_18EU.java Log Message: More dialogs made modal Index: GameStatus_18EU.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/gamespecific/_18EU/GameStatus_18EU.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** GameStatus_18EU.java 11 Sep 2009 19:26:44 -0000 1.8 --- GameStatus_18EU.java 11 Jan 2010 23:06:18 -0000 1.9 *************** *** 4,9 **** import java.util.List; - import javax.swing.JOptionPane; - import rails.game.City; import rails.game.PublicCompanyI; --- 4,7 ---- *************** *** 73,103 **** } } - int choice = - new RadioButtonDialog(this, - LocalText.getText("PleaseSelect"), - LocalText.getText("SelectCompanyToMergeMinorInto", - minor.getName()), options, -1) // - .getSelectedOption(); - if (choice < 0) return null; - - PublicCompanyI major = targets.get(choice); - action.setSelectedTargetCompany(major); - - if (major != null - && action.canReplaceToken(choice)) { - boolean replaceToken = - JOptionPane.showConfirmDialog(this, LocalText.getText( - "WantToReplaceToken", - minor.getName(), - major.getName() ), - LocalText.getText("PleaseSelect"), - JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION; - action.setReplaceToken(replaceToken); - } else { - return chosenAction; - } } ! return chosenAction; } --- 71,83 ---- } } + RadioButtonDialog dialog = new RadioButtonDialog (gameUIManager, + LocalText.getText("PleaseSelect"), + LocalText.getText("SelectCompanyToMergeMinorInto", + minor.getName()), + options, -1); + gameUIManager.setCurrentDialog(dialog, action); } ! return null; } *************** *** 113,137 **** ((StartCompany_18EU) chosenAction).getMinorsToMerge(); ! if (minors == null || minors.isEmpty()) { ! // Do nothing ! } else if (minors.size() == 1) { ! PublicCompanyI minor = minors.get(0); ! int answer = ! JOptionPane.showConfirmDialog( ! parent, ! LocalText.getText( ! "MergeMinorConfirm", ! minor.getName(), ! action.getCertificate().getCompany().getName() ), ! LocalText.getText("PleaseConfirm"), ! JOptionPane.OK_CANCEL_OPTION, ! JOptionPane.QUESTION_MESSAGE); ! if (answer == JOptionPane.OK_OPTION) { ! action.setChosenMinor(minor); ! chosenAction = action; ! } else { ! chosenAction = null; ! } ! } else { String[] options = new String[minors.size()]; int i = 0; --- 93,98 ---- ((StartCompany_18EU) chosenAction).getMinorsToMerge(); ! if (minors != null && !minors.isEmpty()) { ! // Up to phase 6, a minor must be exchanged String[] options = new String[minors.size()]; int i = 0; *************** *** 141,179 **** + minor.getLongName(); } ! int choice = ! new RadioButtonDialog( ! this, // ! LocalText.getText("PleaseSelect"), // ! LocalText.getText( ! "SelectMinorToMerge", ! action.getCertificate().getCompany().getName()), ! options, -1).getSelectedOption(); ! if (choice >= 0) { ! action.setChosenMinor(minors.get(choice)); ! chosenAction = action; ! } else { ! chosenAction = null; ! } ! } ! 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(); ! } ! int index = ! new RadioButtonDialog( ! this, // ! LocalText.getText("PleaseSelect"), // ! LocalText.getText( ! "SelectHomeStation", // ! action.getCertificate().getCompany().getName()), ! options, -1).getSelectedOption(); ! if (index >= 0) { ! action.setHomeStation(cities.get(index)); ! } else { ! return null; ! } } } --- 102,132 ---- + minor.getLongName(); } ! RadioButtonDialog dialog = new RadioButtonDialog (gameUIManager, ! LocalText.getText("PleaseSelect"), ! LocalText.getText( ! "SelectMinorToMerge", ! action.getCertificate().getCompany().getName()), ! options, -1); ! gameUIManager.setCurrentDialog(dialog, action); ! return null; ! } 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(); ! } ! RadioButtonDialog dialog = new RadioButtonDialog (gameUIManager, ! LocalText.getText("PleaseSelect"), ! LocalText.getText( ! "SelectMinorToMerge", ! action.getCertificate().getCompany().getName()), ! options, -1); ! gameUIManager.setCurrentDialog(dialog, action); ! return null; ! ! } } } --- NEW FILE: GameUIManager_18EU.java --- package rails.ui.swing.gamespecific._18EU; import javax.swing.JOptionPane; import rails.game.PublicCompanyI; import rails.game.action.MergeCompanies; import rails.game.specific._18EU.StartCompany_18EU; import rails.ui.swing.GameUIManager; import rails.ui.swing.elements.RadioButtonDialog; import rails.util.LocalText; 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.getMinorsToMerge() != null) { // Up to phase 5: a minor to merge has been selected (or not) int choice = dialog.getSelectedOption(); if (choice >= 0) { action.setChosenMinor(action.getMinorsToMerge().get(choice)); } else { return; } } else if (action.getAvailableHomeStations() != null) { // From phase 6: a home station has been selected (or not) int index = dialog.getSelectedOption(); if (index >= 0) { action.setHomeStation(action.getAvailableHomeStations().get(index)); } else { return; } } } else { super.dialogActionPerformed(false); } super.dialogActionPerformed(true); } } |
From: Erik V. <ev...@us...> - 2010-01-11 23:06:55
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv20271/rails/ui/swing Modified Files: StatusWindow.java ORUIManager.java GameUIManager.java GameStatus.java Log Message: More dialogs made modal Index: StatusWindow.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/StatusWindow.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** StatusWindow.java 8 Jan 2010 21:27:48 -0000 1.32 --- StatusWindow.java 11 Jan 2010 23:06:08 -0000 1.33 *************** *** 15,19 **** import rails.game.*; import rails.game.action.*; ! import rails.ui.swing.elements.*; import rails.util.Config; import rails.util.LocalText; --- 15,20 ---- import rails.game.*; import rails.game.action.*; ! import rails.ui.swing.elements.ActionButton; ! import rails.ui.swing.elements.ActionMenuItem; import rails.util.Config; import rails.util.LocalText; *************** *** 24,28 **** */ public class StatusWindow extends JFrame implements ActionListener, ! KeyListener, ActionPerformer, DialogOwner { private static final long serialVersionUID = 1L; --- 25,29 ---- */ public class StatusWindow extends JFrame implements ActionListener, ! KeyListener, ActionPerformer { private static final long serialVersionUID = 1L; *************** *** 532,552 **** } - /** Stub */ - public void dialogActionPerformed () { - - } - - public JDialog getCurrentDialog() { - return gameUIManager.getCurrentDialog(); - } - - public PossibleAction getCurrentDialogAction () { - return gameUIManager.getCurrentDialogAction(); - } - - public void setCurrentDialog (JDialog dialog, PossibleAction action) { - gameUIManager.setCurrentDialog(dialog, action); - } - public void displayServerMessage() { String[] message = DisplayBuffer.get(); --- 533,536 ---- Index: ORUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORUIManager.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** ORUIManager.java 8 Jan 2010 21:58:38 -0000 1.43 --- ORUIManager.java 11 Jan 2010 23:06:14 -0000 1.44 *************** *** 11,16 **** import rails.game.action.*; import rails.game.special.*; ! import rails.ui.swing.elements.CheckBoxDialog; ! import rails.ui.swing.elements.DialogOwner; import rails.ui.swing.hexmap.GUIHex; import rails.ui.swing.hexmap.HexMap; --- 11,15 ---- import rails.game.action.*; import rails.game.special.*; ! import rails.ui.swing.elements.*; import rails.ui.swing.hexmap.GUIHex; import rails.ui.swing.hexmap.HexMap; *************** *** 1096,1124 **** Bank.format(minNumber * loanAmount))); numberRepaid = minNumber; } else { ! List<String> options = new ArrayList<String>(); ! for (int i=minNumber; i<=maxNumber; i++) { if (i == 0) { ! options.add(LocalText.getText("None")); } else { ! options.add(LocalText.getText("RepayLoan", i, Bank.format(loanAmount), ! Bank.format(i * loanAmount))); } } ! Object choice = JOptionPane.showInputDialog(orWindow, LocalText.getText("SelectLoansToRepay", action.getCompanyName()), ! LocalText.getText("Select"), ! JOptionPane.QUESTION_MESSAGE, ! null, ! options.toArray(), ! options.get(minNumber == 0 ? 1 : minNumber)); ! ! numberRepaid = minNumber + options.indexOf(choice); ! } - action.setNumberTaken(numberRepaid); - orWindow.process(action); } --- 1095,1120 ---- Bank.format(minNumber * loanAmount))); numberRepaid = minNumber; + action.setNumberTaken(numberRepaid); + orWindow.process(action); } else { ! //List<String> options = new ArrayList<String>(); ! String[] options = new String[maxNumber-minNumber+1]; ! for (int i=minNumber, j=0; i<=maxNumber; i++, j++) { if (i == 0) { ! options[j] = LocalText.getText("None"); } else { ! options[j] = LocalText.getText("RepayLoan", i, Bank.format(loanAmount), ! Bank.format(i * loanAmount)); } } ! RadioButtonDialog currentDialog = new RadioButtonDialog (gameUIManager, ! LocalText.getText("Select"), LocalText.getText("SelectLoansToRepay", action.getCompanyName()), ! options, ! 0); ! gameUIManager.setCurrentDialog (currentDialog, action); } } Index: GameStatus.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/GameStatus.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** GameStatus.java 5 Jan 2010 20:54:05 -0000 1.35 --- GameStatus.java 11 Jan 2010 23:06:15 -0000 1.36 *************** *** 626,636 **** if (options.size() > 1) { if (startCompany) { ! index = ! new RadioButtonDialog(this, ! LocalText.getText("PleaseSelect"), ! LocalText.getText("WHICH_START_PRICE", ! playerName, ! companyName), ! options.toArray(new String[0]), -1).getSelectedOption(); } else { String sp = --- 626,637 ---- if (options.size() > 1) { if (startCompany) { ! RadioButtonDialog dialog = new RadioButtonDialog (gameUIManager, ! LocalText.getText("PleaseSelect"), ! LocalText.getText("WHICH_START_PRICE", ! playerName, ! companyName), ! options.toArray(new String[0]), -1); ! gameUIManager.setCurrentDialog(dialog, actions.get(0)); ! return; } else { String sp = Index: GameUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/GameUIManager.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** GameUIManager.java 8 Jan 2010 21:27:54 -0000 1.31 --- GameUIManager.java 11 Jan 2010 23:06:15 -0000 1.32 *************** *** 12,17 **** import rails.game.*; import rails.game.action.*; ! import rails.ui.swing.elements.CheckBoxDialog; ! import rails.ui.swing.elements.DialogOwner; import rails.util.*; --- 12,16 ---- import rails.game.*; import rails.game.action.*; ! import rails.ui.swing.elements.*; import rails.util.*; *************** *** 125,129 **** // In some cases an Undo requires a different follow-up lastAction = action; ! if (action != null) action.setActed(); log.debug("==Passing to server: " + action); --- 124,131 ---- // In some cases an Undo requires a different follow-up lastAction = action; ! if (action != null) { ! action.setActed(); ! action.setPlayerName(getCurrentPlayer().getName()); ! } log.debug("==Passing to server: " + action); *************** *** 428,470 **** public void dialogActionPerformed () { ! if (currentDialog instanceof CheckBoxDialog ! && currentDialogAction instanceof ExchangeTokens) { ! CheckBoxDialog dialog = (CheckBoxDialog) currentDialog; ! ExchangeTokens action = (ExchangeTokens) currentDialogAction; ! boolean[] exchanged = dialog.getSelectedOptions(); ! String[] options = dialog.getOptions(); ! int numberSelected = 0; ! for (int index=0; index < options.length; index++) { ! if (exchanged[index]) { ! numberSelected++; ! } ! } ! int minNumber = action.getMinNumberToExchange(); ! int maxNumber = action.getMaxNumberToExchange(); ! if (numberSelected < minNumber ! || numberSelected > maxNumber) { ! if (minNumber == maxNumber) { ! JOptionPane.showMessageDialog(null, ! LocalText.getText("YouMustSelect1", minNumber)); ! } else { ! JOptionPane.showMessageDialog(null, ! LocalText.getText("YouMustSelect2", minNumber, maxNumber)); ! } ! exchangeTokens (action); ! return; ! } ! for (int index=0; index < options.length; index++) { ! if (exchanged[index]) { ! action.getTokensToExchange().get(index).setSelected(true); ! } ! } ! } else { ! return; ! } processOnServer(currentDialogAction); --- 430,503 ---- public void dialogActionPerformed () { + dialogActionPerformed(false); + } ! public void dialogActionPerformed (boolean ready) { ! if (!ready) { ! if (currentDialog instanceof RadioButtonDialog ! && currentDialogAction instanceof StartCompany) { ! RadioButtonDialog dialog = (RadioButtonDialog) currentDialog; ! StartCompany action = (StartCompany) currentDialogAction; ! int index = dialog.getSelectedOption(); ! if (index > 0) { ! int price = action.getStartPrices()[index]; ! action.setStartPrice(price); ! action.setNumberBought(action.getCertificate().getShares()); ! } else { ! // No selection done - no action ! return; ! } ! ! ! } else if (currentDialog instanceof CheckBoxDialog ! && currentDialogAction instanceof ExchangeTokens) { ! ! CheckBoxDialog dialog = (CheckBoxDialog) currentDialog; ! ExchangeTokens action = (ExchangeTokens) currentDialogAction; ! boolean[] exchanged = dialog.getSelectedOptions(); ! String[] options = dialog.getOptions(); ! ! int numberSelected = 0; ! for (int index=0; index < options.length; index++) { ! if (exchanged[index]) { ! numberSelected++; ! } ! } ! ! int minNumber = action.getMinNumberToExchange(); ! int maxNumber = action.getMaxNumberToExchange(); ! if (numberSelected < minNumber ! || numberSelected > maxNumber) { ! if (minNumber == maxNumber) { ! JOptionPane.showMessageDialog(null, ! LocalText.getText("YouMustSelect1", minNumber)); ! } else { ! JOptionPane.showMessageDialog(null, ! LocalText.getText("YouMustSelect2", minNumber, maxNumber)); ! } ! exchangeTokens (action); ! return; ! ! } ! for (int index=0; index < options.length; index++) { ! if (exchanged[index]) { ! action.getTokensToExchange().get(index).setSelected(true); ! } ! } ! } else if (currentDialog instanceof RadioButtonDialog ! && currentDialogAction instanceof RepayLoans) { ! ! RadioButtonDialog dialog = (RadioButtonDialog) currentDialog; ! RepayLoans action = (RepayLoans) currentDialogAction; ! int selected = dialog.getSelectedOption(); ! action.setNumberTaken(action.getMinNumber() + selected); ! } else { ! return; ! } ! } processOnServer(currentDialogAction); |
From: Erik V. <ev...@us...> - 2010-01-11 23:06:55
|
Update of /cvsroot/rails/18xx/data/18EU In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv20271/data/18EU Modified Files: Game.xml Log Message: More dialogs made modal Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/18EU/Game.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Game.xml 3 Sep 2009 21:36:54 -0000 1.9 --- Game.xml 11 Jan 2010 23:06:17 -0000 1.10 *************** *** 14,17 **** --- 14,18 ---- <GameStatus class="rails.ui.swing.gamespecific._18EU.GameStatus_18EU"/> <StatusWindow class="rails.ui.swing.gamespecific._18EU.StatusWindow_18EU"/> + <GameUIManager class="rails.ui.swing.gamespecific._18EU.GameUIManager_18EU"/> <EndOfGame> <Bankruptcy/> |
From: Erik V. <ev...@us...> - 2010-01-11 23:06:49
|
Update of /cvsroot/rails/18xx/rails/ui/swing/gamespecific/_1856 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv20271/rails/ui/swing/gamespecific/_1856 Modified Files: StatusWindow_1856.java Log Message: More dialogs made modal Index: StatusWindow_1856.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/gamespecific/_1856/StatusWindow_1856.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** StatusWindow_1856.java 8 Jan 2010 21:27:46 -0000 1.4 --- StatusWindow_1856.java 11 Jan 2010 23:06:05 -0000 1.5 *************** *** 1,11 **** package rails.ui.swing.gamespecific._1856; - import javax.swing.JDialog; - import rails.game.*; import rails.game.action.*; import rails.game.specific._1856.CGRFormationRound; import rails.ui.swing.StatusWindow; ! import rails.ui.swing.elements.RadioButtonDialog2; import rails.util.LocalText; import rails.util.Util; --- 1,9 ---- package rails.ui.swing.gamespecific._1856; import rails.game.*; import rails.game.action.*; import rails.game.specific._1856.CGRFormationRound; import rails.ui.swing.StatusWindow; ! import rails.ui.swing.elements.RadioButtonDialog; import rails.util.LocalText; import rails.util.Util; *************** *** 95,140 **** } ! /* ! Object choice = JOptionPane.showInputDialog(this, ! message, ! LocalText.getText("Select"), ! JOptionPane.QUESTION_MESSAGE, ! null, ! options.toArray(), ! options.get(0)); ! ! numberRepaid = minNumber + options.indexOf(choice); ! ! action.setNumberTaken(numberRepaid); ! process (action); ! */ ! RadioButtonDialog2 currentDialog = new RadioButtonDialog2 (this, LocalText.getText("Select"), message, options, 0); ! setCurrentDialog (currentDialog, action); ! } ! ! @Override ! public void dialogActionPerformed () { ! ! JDialog currentDialog = getCurrentDialog(); ! PossibleAction currentDialogAction = getCurrentDialogAction(); ! ! if (currentDialog instanceof RadioButtonDialog2 ! && currentDialogAction instanceof RepayLoans) { ! ! RadioButtonDialog2 dialog = (RadioButtonDialog2) currentDialog; ! RepayLoans action = (RepayLoans) currentDialogAction; ! int selected = dialog.getSelectedOption(); ! action.setNumberTaken(selected); ! } else { ! return; ! } ! ! gameUIManager.processOnServer(currentDialogAction); } - } --- 93,103 ---- } ! RadioButtonDialog currentDialog = new RadioButtonDialog (gameUIManager, LocalText.getText("Select"), message, options, 0); ! gameUIManager.setCurrentDialog (currentDialog, action); } } |
From: Erik V. <ev...@us...> - 2010-01-11 23:06:47
|
Update of /cvsroot/rails/18xx/rails/ui/swing/elements In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv20271/rails/ui/swing/elements Modified Files: RadioButtonDialog.java Removed Files: RadioButtonDialog2.java Log Message: More dialogs made modal --- RadioButtonDialog2.java DELETED --- Index: RadioButtonDialog.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/elements/RadioButtonDialog.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RadioButtonDialog.java 4 Jun 2008 19:00:39 -0000 1.5 --- RadioButtonDialog.java 11 Jan 2010 23:06:21 -0000 1.6 *************** *** 4,7 **** --- 4,8 ---- import java.awt.*; import java.awt.event.*; + import javax.swing.*; *************** *** 22,25 **** --- 23,27 ---- Dimension size, optSize; ButtonGroup group; + DialogOwner owner; String message; *************** *** 32,38 **** Logger.getLogger(RadioButtonDialog.class.getPackage().getName()); ! public RadioButtonDialog(JComponent owner, String title, String message, String[] options, int selectedOption) { ! super((Frame) null, title, true); // Modal !? this.message = message; this.options = options; --- 34,41 ---- Logger.getLogger(RadioButtonDialog.class.getPackage().getName()); ! public RadioButtonDialog(DialogOwner owner, String title, String message, String[] options, int selectedOption) { ! super((Frame) null, title, false); // Non-modal ! this.owner = owner; this.message = message; this.options = options; *************** *** 44,47 **** --- 47,51 ---- // Center on owner + /* int x = (int) owner.getLocationOnScreen().getX() *************** *** 50,53 **** --- 54,60 ---- (int) owner.getLocationOnScreen().getY() + (owner.getHeight() - getHeight()) / 2; + */ + int x = 400; + int y = 400; setLocation(x, y); *************** *** 66,73 **** buttonPane.add(okButton); ! cancelButton = new JButton(LocalText.getText("Cancel")); ! cancelButton.setMnemonic(KeyEvent.VK_C); ! cancelButton.addActionListener(this); ! buttonPane.add(cancelButton); choiceButtons = new JRadioButton[numOptions]; --- 73,83 ---- buttonPane.add(okButton); ! if (selectedOption < 0) { ! // If an option has been preselected, selection is mandatory. ! cancelButton = new JButton(LocalText.getText("Cancel")); ! cancelButton.setMnemonic(KeyEvent.VK_C); ! cancelButton.addActionListener(this); ! buttonPane.add(cancelButton); ! } choiceButtons = new JRadioButton[numOptions]; *************** *** 119,130 **** } } else if (arg0.getSource().equals(cancelButton)) { ! chosenOption = -1; } this.setVisible(false); this.dispose(); ! } ! public int getSelectedOption() { return chosenOption; } --- 129,140 ---- } } else if (arg0.getSource().equals(cancelButton)) { ! return; } this.setVisible(false); this.dispose(); ! owner.dialogActionPerformed(); } ! public synchronized int getSelectedOption() { return chosenOption; } |
From: Brett L. <wak...@us...> - 2010-01-10 18:22:03
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6067/rails/game Modified Files: Game.java Log Message: update version string to 1.1.2 Index: Game.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Game.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** Game.java 20 Dec 2009 22:13:25 -0000 1.42 --- Game.java 10 Jan 2010 18:21:54 -0000 1.43 *************** *** 12,16 **** public class Game { ! public static final String version = "1.1.1"; /** The component Manager */ --- 12,16 ---- public class Game { ! public static final String version = "1.1.2"; /** The component Manager */ |
From: Brett L. <wak...@us...> - 2010-01-10 18:22:02
|
Update of /cvsroot/rails/18xx In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6067 Modified Files: rails.sh rails.bat build.xml Log Message: update version string to 1.1.2 Index: rails.bat =================================================================== RCS file: /cvsroot/rails/18xx/rails.bat,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** rails.bat 20 Dec 2009 22:13:24 -0000 1.5 --- rails.bat 10 Jan 2010 18:21:53 -0000 1.6 *************** *** 1,2 **** ! java -jar rails-1.1.1.jar %1 \ No newline at end of file --- 1,2 ---- ! java -jar rails-1.1.2.jar %1 \ No newline at end of file Index: rails.sh =================================================================== RCS file: /cvsroot/rails/18xx/rails.sh,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** rails.sh 20 Dec 2009 22:13:22 -0000 1.5 --- rails.sh 10 Jan 2010 18:21:47 -0000 1.6 *************** *** 1,3 **** #!/bin/bash ! java -jar ./rails-1.1.1.jar $1 --- 1,3 ---- #!/bin/bash ! java -jar ./rails-1.1.2.jar $1 Index: build.xml =================================================================== RCS file: /cvsroot/rails/18xx/build.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** build.xml 20 Dec 2009 22:13:24 -0000 1.7 --- build.xml 10 Jan 2010 18:21:53 -0000 1.8 *************** *** 10,14 **** <property name="target" value="1.5"/> <property name="source" value="1.5"/> ! <property name="version" value="1.1.1"/> <path id="18xx.classpath"> <pathelement location="classes"/> --- 10,14 ---- <property name="target" value="1.5"/> <property name="source" value="1.5"/> ! <property name="version" value="1.1.2"/> <path id="18xx.classpath"> <pathelement location="classes"/> |
From: Erik V. <ev...@us...> - 2010-01-09 13:30:33
|
Update of /cvsroot/rails/18xx/rails/ui/swing/hexmap In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4849/rails/ui/swing/hexmap Modified Files: GUIHex.java Log Message: Fixed phase-dependent revenues on non-offboard (red) hexes. Index: GUIHex.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/hexmap/GUIHex.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** GUIHex.java 5 Jan 2010 20:53:15 -0000 1.34 --- GUIHex.java 9 Jan 2010 13:30:24 -0000 1.35 *************** *** 605,619 **** // TEMPORARY tt.append("<small> rot=" + currentTileOrientation + "</small>"); ! if (currentTile.getColourName().equalsIgnoreCase(Tile.RED_COLOUR_NAME)) { ! if (model.hasOffBoardValues()) { ! tt.append("<br>Offboard value "); ! tt.append(model.getCurrentOffBoardValue(hexMap.getPhase())).append(" ["); ! int[] values = model.getOffBoardValues(); ! for (int i = 0; i < values.length; i++) { ! if (i > 0) tt.append(","); ! tt.append(values[i]); ! } ! tt.append("]"); } } else if (currentTile.hasStations()) { Station st; --- 605,618 ---- // TEMPORARY tt.append("<small> rot=" + currentTileOrientation + "</small>"); ! ! if (model.hasOffBoardValues()) { ! tt.append("<br>Value "); ! tt.append(model.getCurrentOffBoardValue(hexMap.getPhase())).append(" ["); ! int[] values = model.getOffBoardValues(); ! for (int i = 0; i < values.length; i++) { ! if (i > 0) tt.append(","); ! tt.append(values[i]); } + tt.append("]"); } else if (currentTile.hasStations()) { Station st; |
From: Erik V. <ev...@us...> - 2010-01-08 21:58:49
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28119/rails/ui/swing Modified Files: ORUIManager.java Log Message: Added missing company name parameter to repay loans display text Index: ORUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORUIManager.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** ORUIManager.java 8 Jan 2010 21:27:54 -0000 1.42 --- ORUIManager.java 8 Jan 2010 21:58:38 -0000 1.43 *************** *** 1109,1113 **** } Object choice = JOptionPane.showInputDialog(orWindow, ! LocalText.getText("SelectLoansToRepay"), LocalText.getText("Select"), JOptionPane.QUESTION_MESSAGE, --- 1109,1113 ---- } Object choice = JOptionPane.showInputDialog(orWindow, ! LocalText.getText("SelectLoansToRepay", action.getCompanyName()), LocalText.getText("Select"), JOptionPane.QUESTION_MESSAGE, |
From: Erik V. <ev...@us...> - 2010-01-08 21:58:18
|
Update of /cvsroot/rails/18xx/rails/game/move In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27997/rails/game/move Removed Files: MoveableHolderI.java Log Message: Renamed some interfaces --- MoveableHolderI.java DELETED --- |
From: Erik V. <ev...@us...> - 2010-01-08 21:31:38
|
Update of /cvsroot/rails/18xx/rails/game/special In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24524/rails/game/special Modified Files: SpecialProperty.java SpecialPropertyI.java Log Message: Renamed some interfaces Index: SpecialProperty.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/special/SpecialProperty.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** SpecialProperty.java 28 Dec 2009 13:17:12 -0000 1.19 --- SpecialProperty.java 8 Jan 2010 21:30:53 -0000 1.20 *************** *** 8,12 **** import rails.game.*; ! import rails.game.move.MoveableHolderI; import rails.game.move.ObjectMove; import rails.game.state.BooleanState; --- 8,12 ---- import rails.game.*; ! import rails.game.move.MoveableHolder; import rails.game.move.ObjectMove; import rails.game.state.BooleanState; *************** *** 17,21 **** protected PrivateCompanyI privateCompany; ! protected MoveableHolderI holder = null; protected int closingValue = 0; protected BooleanState exercised; --- 17,21 ---- protected PrivateCompanyI privateCompany; ! protected MoveableHolder holder = null; protected int closingValue = 0; protected BooleanState exercised; *************** *** 90,94 **** } ! public MoveableHolderI getHolder() { return holder; } --- 90,94 ---- } ! public MoveableHolder getHolder() { return holder; } *************** *** 155,159 **** * Only to be used for special properties that have the "transfer" attribute. */ ! public void moveTo(MoveableHolderI newHolder) { if (transferText.equals("")) return; //if (newHolder instanceof Portfolio) { --- 155,159 ---- * Only to be used for special properties that have the "transfer" attribute. */ ! public void moveTo(MoveableHolder newHolder) { if (transferText.equals("")) return; //if (newHolder instanceof Portfolio) { Index: SpecialPropertyI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/special/SpecialPropertyI.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SpecialPropertyI.java 4 Jun 2008 19:00:38 -0000 1.6 --- SpecialPropertyI.java 8 Jan 2010 21:30:54 -0000 1.7 *************** *** 5,9 **** import rails.game.PrivateCompanyI; import rails.game.move.Moveable; ! import rails.game.move.MoveableHolderI; public interface SpecialPropertyI extends ConfigurableComponentI, Moveable { --- 5,9 ---- import rails.game.PrivateCompanyI; import rails.game.move.Moveable; ! import rails.game.move.MoveableHolder; public interface SpecialPropertyI extends ConfigurableComponentI, Moveable { *************** *** 39,43 **** public String getName(); ! public void moveTo(MoveableHolderI newHolder); } --- 39,43 ---- public String getName(); ! public void moveTo(MoveableHolder newHolder); } |
From: Erik V. <ev...@us...> - 2010-01-08 21:31:38
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18AL In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24524/rails/game/specific/_18AL Modified Files: NameableTrain.java Log Message: Renamed some interfaces Index: NameableTrain.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18AL/NameableTrain.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NameableTrain.java 4 Jun 2008 19:00:34 -0000 1.3 --- NameableTrain.java 8 Jan 2010 21:30:48 -0000 1.4 *************** *** 3,7 **** import rails.game.Train; import rails.game.TrainTypeI; ! import rails.game.move.MoveableHolderI; import rails.game.move.ObjectMove; import rails.game.move.StateChange; --- 3,7 ---- import rails.game.Train; import rails.game.TrainTypeI; ! import rails.game.move.MoveableHolder; import rails.game.move.ObjectMove; import rails.game.move.StateChange; *************** *** 29,33 **** @Override ! public void moveTo(MoveableHolderI to) { if (holder != to) { if (getNameToken() != null) { --- 29,33 ---- @Override ! public void moveTo(MoveableHolder to) { if (holder != to) { if (getNameToken() != null) { |
From: Erik V. <ev...@us...> - 2010-01-08 21:31:30
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24524/rails/game/specific/_1856 Modified Files: PublicCompany_CGR.java Log Message: Renamed some interfaces Index: PublicCompany_CGR.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/PublicCompany_CGR.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PublicCompany_CGR.java 30 Dec 2009 11:32:00 -0000 1.6 --- PublicCompany_CGR.java 8 Jan 2010 21:30:46 -0000 1.7 *************** *** 115,119 **** List<PublicCertificateI>certs = new ArrayList<PublicCertificateI>(certificates); int share = 0; ! MoveableHolderI scrapHeap = bank.getScrapHeap(); for (PublicCertificateI cert : certs) { if (share >= 100) { --- 115,119 ---- List<PublicCertificateI>certs = new ArrayList<PublicCertificateI>(certificates); int share = 0; ! MoveableHolder scrapHeap = bank.getScrapHeap(); for (PublicCertificateI cert : certs) { if (share >= 100) { |
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24524/rails/game Modified Files: Company.java City.java StartRound.java PublicCompanyI.java Tile.java Token.java MapHex.java GameManagerI.java Train.java PrivateCompanyI.java Portfolio.java PublicCertificate.java PrivateCompany.java TokenI.java Added Files: StationHolder.java TokenHolder.java Removed Files: StationHolderI.java TokenHolderI.java Log Message: Renamed some interfaces Index: Portfolio.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Portfolio.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** Portfolio.java 5 Jan 2010 20:55:31 -0000 1.41 --- Portfolio.java 8 Jan 2010 21:30:46 -0000 1.42 *************** *** 21,25 **** * @author Erik */ ! public class Portfolio implements TokenHolderI, MoveableHolderI { /** Owned private companies */ --- 21,25 ---- * @author Erik */ ! public class Portfolio implements TokenHolder, MoveableHolder { /** Owned private companies */ --- NEW FILE: TokenHolder.java --- /* $Header: /cvsroot/rails/18xx/rails/game/TokenHolder.java,v 1.1 2010/01/08 21:30:46 evos Exp $ */ package rails.game; import java.util.List; import rails.game.move.MoveableHolder; /** * Interface for implementing a TokenHolder * * A TokenHolder is any object that can have a token played upon it. */ public interface TokenHolder extends MoveableHolder { /** * Add a token. Subclasses may override this method to implement side * effects. * * @param token The token object to add. * @return True if successful. */ public boolean addToken(TokenI token); /** * Remove a token. Subclasses may override this method to implement side * effects. * * @param token The token object to remove. * @return True if successful. */ public boolean removeToken(TokenI token); /** * @return ArrayList of all tokens we have. */ public List<TokenI> getTokens(); /** * Do we have any tokens? * * @return Boolean */ public boolean hasTokens(); /** * Each station must have a name, which includes the tile Id (if on a tile) * or the hex name (if on a MapHex). * * @return */ public String getName(); } Index: PrivateCompanyI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PrivateCompanyI.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PrivateCompanyI.java 15 Jan 2009 20:53:28 -0000 1.7 --- PrivateCompanyI.java 8 Jan 2010 21:30:46 -0000 1.8 *************** *** 4,11 **** import java.util.List; ! import rails.game.move.MoveableHolderI; import rails.game.special.SpecialPropertyI; ! public interface PrivateCompanyI extends CompanyI, Certificate, MoveableHolderI { public static final String TYPE_TAG = "Private"; --- 4,11 ---- import java.util.List; ! import rails.game.move.MoveableHolder; import rails.game.special.SpecialPropertyI; ! public interface PrivateCompanyI extends CompanyI, Certificate, MoveableHolder { public static final String TYPE_TAG = "Private"; Index: StartRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StartRound.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** StartRound.java 8 Dec 2009 19:32:44 -0000 1.32 --- StartRound.java 8 Jan 2010 21:30:46 -0000 1.33 *************** *** 10,14 **** import rails.util.LocalText; ! public abstract class StartRound extends Round implements StartRoundI { protected StartPacket startPacket = null; --- 10,14 ---- import rails.util.LocalText; ! public abstract class StartRound extends Round { protected StartPacket startPacket = null; Index: PrivateCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PrivateCompany.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** PrivateCompany.java 26 Dec 2009 12:48:02 -0000 1.27 --- PrivateCompany.java 8 Jan 2010 21:30:46 -0000 1.28 *************** *** 131,135 **** } ! public void moveTo(MoveableHolderI newHolder) { new ObjectMove(this, portfolio, newHolder); } --- 131,135 ---- } ! public void moveTo(MoveableHolder newHolder) { new ObjectMove(this, portfolio, newHolder); } Index: TokenI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/TokenI.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TokenI.java 4 Jun 2008 19:00:32 -0000 1.4 --- TokenI.java 8 Jan 2010 21:30:46 -0000 1.5 *************** *** 13,21 **** public interface TokenI extends Moveable { ! public void setHolder(TokenHolderI holder); public String getUniqueId(); ! public TokenHolderI getHolder(); public String getName(); --- 13,21 ---- public interface TokenI extends Moveable { ! public void setHolder(TokenHolder holder); public String getUniqueId(); ! public TokenHolder getHolder(); public String getName(); Index: PublicCompanyI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompanyI.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** PublicCompanyI.java 1 Jan 2010 13:59:29 -0000 1.40 --- PublicCompanyI.java 8 Jan 2010 21:30:46 -0000 1.41 *************** *** 10,14 **** * Interface to be used to access PublicCompany instances. */ ! public interface PublicCompanyI extends CompanyI, CashHolder, TokenHolderI { public static final int CAPITALISE_FULL = 0; --- 10,14 ---- * Interface to be used to access PublicCompany instances. */ ! public interface PublicCompanyI extends CompanyI, CashHolder, TokenHolder { public static final int CAPITALISE_FULL = 0; Index: PublicCertificate.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCertificate.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** PublicCertificate.java 30 Aug 2009 18:15:18 -0000 1.16 --- PublicCertificate.java 8 Jan 2010 21:30:46 -0000 1.17 *************** *** 7,11 **** import org.apache.log4j.Logger; ! import rails.game.move.MoveableHolderI; import rails.game.move.ObjectMove; import rails.util.LocalText; --- 7,11 ---- import org.apache.log4j.Logger; ! import rails.game.move.MoveableHolder; import rails.game.move.ObjectMove; import rails.util.LocalText; *************** *** 70,74 **** } ! public void moveTo(MoveableHolderI newHolder) { new ObjectMove(this, portfolio, newHolder); } --- 70,74 ---- } ! public void moveTo(MoveableHolder newHolder) { new ObjectMove(this, portfolio, newHolder); } *************** *** 81,85 **** } ! public MoveableHolderI getHolder() { return portfolio; } --- 81,85 ---- } ! public MoveableHolder getHolder() { return portfolio; } Index: Company.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Company.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Company.java 4 Nov 2009 20:33:22 -0000 1.10 --- Company.java 8 Jan 2010 21:30:37 -0000 1.11 *************** *** 4,8 **** import org.apache.log4j.Logger; ! import rails.game.move.MoveableHolderI; import rails.game.state.BooleanState; --- 4,8 ---- import org.apache.log4j.Logger; ! import rails.game.move.MoveableHolder; import rails.game.state.BooleanState; *************** *** 123,127 **** } ! public MoveableHolderI getHolder() { return portfolio; } --- 123,127 ---- } ! public MoveableHolder getHolder() { return portfolio; } Index: Train.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Train.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Train.java 4 Nov 2009 20:33:22 -0000 1.15 --- Train.java 8 Jan 2010 21:30:46 -0000 1.16 *************** *** 4,8 **** import org.apache.log4j.Logger; ! import rails.game.move.MoveableHolderI; import rails.game.move.ObjectMove; import rails.game.state.BooleanState; --- 4,8 ---- import org.apache.log4j.Logger; ! import rails.game.move.MoveableHolder; import rails.game.move.ObjectMove; import rails.game.state.BooleanState; *************** *** 121,125 **** } ! public void moveTo(MoveableHolderI to) { new ObjectMove(this, holder, to); --- 121,125 ---- } ! public void moveTo(MoveableHolder to) { new ObjectMove(this, holder, to); Index: City.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/City.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** City.java 4 May 2009 20:29:14 -0000 1.8 --- City.java 8 Jan 2010 21:30:46 -0000 1.9 *************** *** 26,30 **** * @author Erik Vos */ ! public class City implements TokenHolderI { private int number; private String uniqueId; --- 26,30 ---- * @author Erik Vos */ ! public class City implements TokenHolder { private int number; private String uniqueId; Index: MapHex.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/MapHex.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** MapHex.java 7 Dec 2009 17:47:29 -0000 1.32 --- MapHex.java 8 Jan 2010 21:30:46 -0000 1.33 *************** *** 38,42 **** */ public class MapHex extends ModelObject implements ConfigurableComponentI, ! StationHolderI, TokenHolderI { public static final int EW = 0; --- 38,42 ---- */ public class MapHex extends ModelObject implements ConfigurableComponentI, ! StationHolder, TokenHolder { public static final int EW = 0; *************** *** 582,587 **** // Move the tokens ! Map<TokenI, TokenHolderI> tokenDestinations = ! new HashMap<TokenI, TokenHolderI>(); for (City oldCity : cities) { --- 582,587 ---- // Move the tokens ! Map<TokenI, TokenHolder> tokenDestinations = ! new HashMap<TokenI, TokenHolder>(); for (City oldCity : cities) { --- StationHolderI.java DELETED --- --- TokenHolderI.java DELETED --- Index: Token.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Token.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Token.java 8 Sep 2009 21:48:59 -0000 1.6 --- Token.java 8 Jan 2010 21:30:46 -0000 1.7 *************** *** 9,13 **** import java.util.Map; ! import rails.game.move.MoveableHolderI; import rails.game.move.ObjectMove; --- 9,13 ---- import java.util.Map; ! import rails.game.move.MoveableHolder; import rails.game.move.ObjectMove; *************** *** 17,21 **** public abstract class Token implements TokenI { ! protected TokenHolderI holder = null; protected String description = ""; protected String uniqueId; --- 17,21 ---- public abstract class Token implements TokenI { ! protected TokenHolder holder = null; protected String description = ""; protected String uniqueId; *************** *** 38,51 **** } ! public void setHolder(TokenHolderI holder) { this.holder = holder; } ! public TokenHolderI getHolder() { return holder; } ! public void moveTo(MoveableHolderI newHolder) { ! if (newHolder instanceof TokenHolderI) { new ObjectMove(this, holder, newHolder); } --- 38,51 ---- } ! public void setHolder(TokenHolder holder) { this.holder = holder; } ! public TokenHolder getHolder() { return holder; } ! public void moveTo(MoveableHolder newHolder) { ! if (newHolder instanceof TokenHolder) { new ObjectMove(this, holder, newHolder); } *************** *** 64,68 **** * @param to */ ! public static void transfer(TokenI token, TokenHolderI from, TokenHolderI to) { to.addToken(token); from.removeToken(token); --- 64,68 ---- * @param to */ ! public static void transfer(TokenI token, TokenHolder from, TokenHolder to) { to.addToken(token); from.removeToken(token); Index: Tile.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Tile.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Tile.java 20 Dec 2009 14:58:24 -0000 1.32 --- Tile.java 8 Jan 2010 21:30:46 -0000 1.33 *************** *** 10,14 **** import rails.util.Tag; ! public class Tile extends ModelObject implements TileI, StationHolderI { /** The 'internal id', identifying the tile in the XML files */ --- 10,14 ---- import rails.util.Tag; ! public class Tile extends ModelObject implements TileI, StationHolder { /** The 'internal id', identifying the tile in the XML files */ --- NEW FILE: StationHolder.java --- /* $Header: /cvsroot/rails/18xx/rails/game/StationHolder.java,v 1.1 2010/01/08 21:30:46 evos Exp $ * * Created on Jan 2, 2007 * Change Log: */ package rails.game; /** * @author Erik Vos */ public interface StationHolder { public String getName(); } Index: GameManagerI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/GameManagerI.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** GameManagerI.java 27 Nov 2009 20:35:18 -0000 1.23 --- GameManagerI.java 8 Jan 2010 21:30:46 -0000 1.24 *************** *** 8,15 **** import rails.game.model.ModelObject; import rails.game.move.MoveStack; ! import rails.game.move.MoveableHolderI; import rails.game.special.SpecialPropertyI; ! public interface GameManagerI extends MoveableHolderI, ConfigurableComponentI { /** --- 8,15 ---- import rails.game.model.ModelObject; import rails.game.move.MoveStack; ! import rails.game.move.MoveableHolder; import rails.game.special.SpecialPropertyI; ! public interface GameManagerI extends MoveableHolder, ConfigurableComponentI { /** |
From: Erik V. <ev...@us...> - 2010-01-08 21:31:13
|
Update of /cvsroot/rails/18xx/rails/game/move In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24524/rails/game/move Modified Files: Moveable.java ObjectMove.java Added Files: MoveableHolder.java Log Message: Renamed some interfaces --- NEW FILE: MoveableHolder.java --- package rails.game.move; public interface MoveableHolder { public boolean addObject(Moveable object); public boolean removeObject(Moveable object); public String getName(); } Index: Moveable.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/move/Moveable.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Moveable.java 4 Jun 2008 19:00:33 -0000 1.3 --- Moveable.java 8 Jan 2010 21:30:54 -0000 1.4 *************** *** 3,11 **** public interface Moveable { ! public void moveTo(MoveableHolderI newHolder); public String getName(); ! public MoveableHolderI getHolder(); } --- 3,11 ---- public interface Moveable { ! public void moveTo(MoveableHolder newHolder); public String getName(); ! public MoveableHolder getHolder(); } Index: ObjectMove.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/move/ObjectMove.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ObjectMove.java 7 Oct 2009 19:00:38 -0000 1.6 --- ObjectMove.java 8 Jan 2010 21:31:00 -0000 1.7 *************** *** 12,17 **** Moveable moveableObject; ! MoveableHolderI from; ! MoveableHolderI to; String objectClassName; --- 12,17 ---- Moveable moveableObject; ! MoveableHolder from; ! MoveableHolder to; String objectClassName; *************** *** 29,34 **** */ ! public ObjectMove(Moveable moveableObject, MoveableHolderI from, ! MoveableHolderI to) { this.moveableObject = moveableObject; --- 29,34 ---- */ ! public ObjectMove(Moveable moveableObject, MoveableHolder from, ! MoveableHolder to) { this.moveableObject = moveableObject; |
From: Erik V. <ev...@us...> - 2010-01-08 21:28:33
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv23981/rails/ui/swing Modified Files: StatusWindow.java ORUIManager.java StartRoundWindow.java GameUIManager.java Log Message: Added nonmodal RadioButtonDialog2 and apply to Repay Loans Index: StatusWindow.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/StatusWindow.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** StatusWindow.java 1 Jan 2010 18:59:20 -0000 1.31 --- StatusWindow.java 8 Jan 2010 21:27:48 -0000 1.32 *************** *** 15,20 **** import rails.game.*; import rails.game.action.*; ! import rails.ui.swing.elements.ActionButton; ! import rails.ui.swing.elements.ActionMenuItem; import rails.util.Config; import rails.util.LocalText; --- 15,19 ---- import rails.game.*; import rails.game.action.*; ! import rails.ui.swing.elements.*; import rails.util.Config; import rails.util.LocalText; *************** *** 25,29 **** */ public class StatusWindow extends JFrame implements ActionListener, ! KeyListener, ActionPerformer { private static final long serialVersionUID = 1L; --- 24,28 ---- */ public class StatusWindow extends JFrame implements ActionListener, ! KeyListener, ActionPerformer, DialogOwner { private static final long serialVersionUID = 1L; *************** *** 525,530 **** } ! gameUIManager.processOnServer(executedAction); ! return true; } --- 524,528 ---- } ! return gameUIManager.processOnServer(executedAction); } *************** *** 534,537 **** --- 532,552 ---- } + /** Stub */ + public void dialogActionPerformed () { + + } + + public JDialog getCurrentDialog() { + return gameUIManager.getCurrentDialog(); + } + + public PossibleAction getCurrentDialogAction () { + return gameUIManager.getCurrentDialogAction(); + } + + public void setCurrentDialog (JDialog dialog, PossibleAction action) { + gameUIManager.setCurrentDialog(dialog, action); + } + public void displayServerMessage() { String[] message = DisplayBuffer.get(); Index: StartRoundWindow.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/StartRoundWindow.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** StartRoundWindow.java 16 Nov 2009 18:11:19 -0000 1.33 --- StartRoundWindow.java 8 Jan 2010 21:27:54 -0000 1.34 *************** *** 79,83 **** private final StartPacket packet; private final int[] crossIndex; ! private final StartRoundI round; private final GameUIManager gameUIManager; --- 79,83 ---- private final StartPacket packet; private final int[] crossIndex; ! private final StartRound round; private final GameUIManager gameUIManager; Index: ORUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORUIManager.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** ORUIManager.java 7 Jan 2010 20:48:06 -0000 1.41 --- ORUIManager.java 8 Jan 2010 21:27:54 -0000 1.42 *************** *** 30,36 **** public GameUIManager gameUIManager; - protected JDialog currentDialog = null; - protected PossibleAction currentDialogAction = null; - private OperatingRound oRound; private PublicCompanyI[] companies; --- 30,33 ---- *************** *** 449,469 **** orWindow.setVisible(true); orWindow.toFront(); ! ! currentDialogAction = action; ! currentDialog = new CheckBoxDialog(this, LocalText.getText("DestinationsReached"), LocalText.getText("DestinationsReachedPrompt"), options.toArray(new String[0])); } } ! public void dialogActionPerformed () { if (currentDialog instanceof CheckBoxDialog && currentDialogAction instanceof ReachDestinations) { ! CheckBoxDialog dialog = (CheckBoxDialog) currentDialog; ReachDestinations action = (ReachDestinations) currentDialogAction; ! boolean[] destined = dialog.getSelectedOptions(); String[] options = dialog.getOptions(); --- 446,469 ---- orWindow.setVisible(true); orWindow.toFront(); ! ! CheckBoxDialog dialog = new CheckBoxDialog(this, LocalText.getText("DestinationsReached"), LocalText.getText("DestinationsReachedPrompt"), options.toArray(new String[0])); + setCurrentDialog (dialog, action); } } ! public void dialogActionPerformed () { + JDialog currentDialog = getCurrentDialog(); + PossibleAction currentDialogAction = getCurrentDialogAction(); + if (currentDialog instanceof CheckBoxDialog && currentDialogAction instanceof ReachDestinations) { ! CheckBoxDialog dialog = (CheckBoxDialog) currentDialog; ReachDestinations action = (ReachDestinations) currentDialogAction; ! boolean[] destined = dialog.getSelectedOptions(); String[] options = dialog.getOptions(); *************** *** 474,489 **** } } ! // Prevent that a null action gets processed if (action.getReachedCompanies() == null || action.getReachedCompanies().isEmpty()) return; ! } else { return; } ! gameUIManager.processOnServer(currentDialogAction); } public void hexClicked(GUIHex clickedHex, GUIHex selectedHex) { --- 474,501 ---- } } ! // Prevent that a null action gets processed if (action.getReachedCompanies() == null || action.getReachedCompanies().isEmpty()) return; ! } else { return; } ! gameUIManager.processOnServer(currentDialogAction); } + public JDialog getCurrentDialog() { + return gameUIManager.getCurrentDialog(); + } + + public PossibleAction getCurrentDialogAction () { + return gameUIManager.getCurrentDialogAction(); + } + + public void setCurrentDialog (JDialog dialog, PossibleAction action) { + gameUIManager.setCurrentDialog(dialog, action); + } + public void hexClicked(GUIHex clickedHex, GUIHex selectedHex) { Index: GameUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/GameUIManager.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** GameUIManager.java 7 Jan 2010 20:48:11 -0000 1.30 --- GameUIManager.java 8 Jan 2010 21:27:54 -0000 1.31 *************** *** 162,170 **** statusWindow.setGameActions(); ! if (result) { ! return activeWindow.processImmediateAction(); ! } else { ! return false; ! } } --- 162,168 ---- statusWindow.setGameActions(); ! if (!result) return false; ! ! return activeWindow.processImmediateAction(); } *************** *** 420,428 **** orWindow.toFront(); ! currentDialogAction = action; ! currentDialog = new CheckBoxDialog(this, LocalText.getText("ExchangeTokens"), prompt, options.toArray(new String[0])); } --- 418,426 ---- orWindow.toFront(); ! CheckBoxDialog dialog = new CheckBoxDialog(this, LocalText.getText("ExchangeTokens"), prompt, options.toArray(new String[0])); + setCurrentDialog (dialog, action); } *************** *** 439,447 **** String[] options = dialog.getOptions(); for (int index=0; index < options.length; index++) { if (exchanged[index]) { ! action.getTokensToExchange().get(index).setSelected(true); } } } else { return; --- 437,467 ---- String[] options = dialog.getOptions(); + int numberSelected = 0; for (int index=0; index < options.length; index++) { if (exchanged[index]) { ! numberSelected++; } } + + int minNumber = action.getMinNumberToExchange(); + int maxNumber = action.getMaxNumberToExchange(); + if (numberSelected < minNumber + || numberSelected > maxNumber) { + if (minNumber == maxNumber) { + JOptionPane.showMessageDialog(null, + LocalText.getText("YouMustSelect1", minNumber)); + } else { + JOptionPane.showMessageDialog(null, + LocalText.getText("YouMustSelect2", minNumber, maxNumber)); + } + exchangeTokens (action); + return; + + } + for (int index=0; index < options.length; index++) { + if (exchanged[index]) { + action.getTokensToExchange().get(index).setSelected(true); + } + } } else { return; *************** *** 451,454 **** --- 471,490 ---- } + public JDialog getCurrentDialog() { + return currentDialog; + } + + public PossibleAction getCurrentDialogAction () { + return currentDialogAction; + } + + public void setCurrentDialog (JDialog dialog, PossibleAction action) { + if (currentDialog != null) { + currentDialog.dispose(); + } + currentDialog = dialog; + currentDialogAction = action; + } + public void saveGame(GameAction saveAction) { |
From: Erik V. <ev...@us...> - 2010-01-08 21:28:26
|
Update of /cvsroot/rails/18xx/rails/ui/swing/gamespecific/_1856 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv23981/rails/ui/swing/gamespecific/_1856 Modified Files: StatusWindow_1856.java Log Message: Added nonmodal RadioButtonDialog2 and apply to Repay Loans Index: StatusWindow_1856.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/gamespecific/_1856/StatusWindow_1856.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** StatusWindow_1856.java 11 Sep 2009 19:26:44 -0000 1.3 --- StatusWindow_1856.java 8 Jan 2010 21:27:46 -0000 1.4 *************** *** 1,8 **** package rails.ui.swing.gamespecific._1856; ! import java.util.ArrayList; ! import java.util.List; ! ! import javax.swing.JOptionPane; import rails.game.*; --- 1,5 ---- package rails.ui.swing.gamespecific._1856; ! import javax.swing.JDialog; import rails.game.*; *************** *** 10,14 **** --- 7,13 ---- import rails.game.specific._1856.CGRFormationRound; import rails.ui.swing.StatusWindow; + import rails.ui.swing.elements.RadioButtonDialog2; import rails.util.LocalText; + import rails.util.Util; public class StatusWindow_1856 extends StatusWindow { *************** *** 37,40 **** --- 36,40 ---- } + @Override public boolean processImmediateAction() { *************** *** 74,96 **** int maxNumber = action.getMaxNumber(); int loanAmount = action.getPrice(); - int numberRepaid = 0; ! List<String> options = new ArrayList<String>(); for (int i=minNumber; i<=maxNumber; i++) { if (i == 0) { ! options.add(LocalText.getText("None")); } else { ! options.add(LocalText.getText("RepayLoan", i, Bank.format(loanAmount), ! Bank.format(i * loanAmount))); } } ! int displayBufSize = DisplayBuffer.getSize(); ! String[] message = new String[displayBufSize+1]; ! System.arraycopy (DisplayBuffer.get(),0,message,0,displayBufSize); ! message[displayBufSize] = LocalText.getText("SelectLoansToRepay", action.getCompanyName()); Object choice = JOptionPane.showInputDialog(this, message, --- 74,99 ---- int maxNumber = action.getMaxNumber(); int loanAmount = action.getPrice(); ! String[] options = new String[maxNumber-minNumber+1]; for (int i=minNumber; i<=maxNumber; i++) { if (i == 0) { ! options[i] = LocalText.getText("None"); } else { ! options[i] = LocalText.getText("RepayLoan", i, Bank.format(loanAmount), ! Bank.format(i * loanAmount)); } } ! ! String message = LocalText.getText("SelectLoansToRepay", action.getCompanyName()); + String[] waitingMessages = DisplayBuffer.get(); + if (waitingMessages != null) { + message = "<html>" + Util.joinWithDelimiter(waitingMessages, "<br>") + + "<br>" + message; + } + /* Object choice = JOptionPane.showInputDialog(this, message, *************** *** 105,108 **** --- 108,140 ---- action.setNumberTaken(numberRepaid); process (action); + */ + RadioButtonDialog2 currentDialog = new RadioButtonDialog2 (this, + LocalText.getText("Select"), + message, + options, + 0); + setCurrentDialog (currentDialog, action); } + + @Override + public void dialogActionPerformed () { + + JDialog currentDialog = getCurrentDialog(); + PossibleAction currentDialogAction = getCurrentDialogAction(); + + if (currentDialog instanceof RadioButtonDialog2 + && currentDialogAction instanceof RepayLoans) { + + RadioButtonDialog2 dialog = (RadioButtonDialog2) currentDialog; + RepayLoans action = (RepayLoans) currentDialogAction; + int selected = dialog.getSelectedOption(); + action.setNumberTaken(selected); + } else { + return; + } + + gameUIManager.processOnServer(currentDialogAction); + } + + } |
From: Erik V. <ev...@us...> - 2010-01-08 21:28:16
|
Update of /cvsroot/rails/18xx/rails/ui/swing/elements In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv23981/rails/ui/swing/elements Modified Files: CheckBoxDialog.java DialogOwner.java Added Files: RadioButtonDialog2.java Log Message: Added nonmodal RadioButtonDialog2 and apply to Repay Loans Index: CheckBoxDialog.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/elements/CheckBoxDialog.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CheckBoxDialog.java 7 Jan 2010 20:48:13 -0000 1.4 --- CheckBoxDialog.java 8 Jan 2010 21:27:54 -0000 1.5 *************** *** 12,16 **** /** ! * A generic dialog for presenting choices by radio buttons. */ public class CheckBoxDialog extends JDialog implements ActionListener { --- 12,16 ---- /** ! * A generic dialog for presenting choices by checkboxes. */ public class CheckBoxDialog extends JDialog implements ActionListener { *************** *** 42,46 **** public CheckBoxDialog(DialogOwner owner, String title, String message, String[] options, boolean[] selectedOptions) { ! super((Frame) null, title, false); // Modal !? this.owner = owner; this.message = message; --- 42,46 ---- public CheckBoxDialog(DialogOwner owner, String title, String message, String[] options, boolean[] selectedOptions) { ! super((Frame) null, title, false); // Non-modal this.owner = owner; this.message = message; *************** *** 131,134 **** --- 131,135 ---- } } else if (arg0.getSource().equals(cancelButton)) { + return; } setVisible(false); Index: DialogOwner.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/elements/DialogOwner.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DialogOwner.java 7 Jan 2010 20:48:14 -0000 1.1 --- DialogOwner.java 8 Jan 2010 21:27:54 -0000 1.2 *************** *** 1,6 **** --- 1,16 ---- package rails.ui.swing.elements; + import javax.swing.JDialog; + + import rails.game.action.PossibleAction; + public interface DialogOwner { public void dialogActionPerformed (); + + public JDialog getCurrentDialog(); + + public PossibleAction getCurrentDialogAction(); + + public void setCurrentDialog (JDialog dialog, PossibleAction action); } --- NEW FILE: RadioButtonDialog2.java --- /* $Header: /cvsroot/rails/18xx/rails/ui/swing/elements/RadioButtonDialog2.java,v 1.1 2010/01/08 21:27:54 evos Exp $*/ package rails.ui.swing.elements; import java.awt.*; import java.awt.event.*; import javax.swing.*; import org.apache.log4j.Logger; import rails.util.LocalText; /** * A generic dialog for presenting choices by radio buttons. */ public class RadioButtonDialog2 extends JDialog implements ActionListener { private static final long serialVersionUID = 1L; GridBagConstraints gc; JPanel optionsPane, buttonPane; JButton okButton, cancelButton; JRadioButton[] choiceButtons; Dimension size, optSize; ButtonGroup group; DialogOwner owner; String message; int numOptions; String[] options; int selectedOption; int chosenOption = -1; protected static Logger log = Logger.getLogger(RadioButtonDialog2.class.getPackage().getName()); public RadioButtonDialog2(DialogOwner owner, String title, String message, String[] options, int selectedOption) { super((Frame) null, title, false); // Non-modal this.owner = owner; this.message = message; this.options = options; this.numOptions = options.length; this.selectedOption = selectedOption; initialize(); pack(); // Center on owner /* int x = (int) owner.getLocationOnScreen().getX() + (owner.getWidth() - getWidth()) / 2; int y = (int) owner.getLocationOnScreen().getY() + (owner.getHeight() - getHeight()) / 2; */ int x = 400; int y = 400; setLocation(x, y); this.setVisible(true); } private void initialize() { gc = new GridBagConstraints(); optionsPane = new JPanel(); buttonPane = new JPanel(); okButton = new JButton(LocalText.getText("OK")); okButton.setMnemonic(KeyEvent.VK_O); okButton.addActionListener(this); buttonPane.add(okButton); if (selectedOption < 0) { // If an option has been preselected, selection is mandatory. cancelButton = new JButton(LocalText.getText("Cancel")); cancelButton.setMnemonic(KeyEvent.VK_C); cancelButton.addActionListener(this); buttonPane.add(cancelButton); } choiceButtons = new JRadioButton[numOptions]; this.getContentPane().setLayout(new GridBagLayout()); this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); optionsPane.setLayout(new GridBagLayout()); // optionsPane.setBorder(BorderFactory.createLoweredBevelBorder()); optionsPane.add(new JLabel(message), constraints(0, 0, 10, 10, 10, 10)); choiceButtons = new JRadioButton[numOptions]; group = new ButtonGroup(); for (int i = 0; i < numOptions; i++) { choiceButtons[i] = new JRadioButton(options[i], i == selectedOption); optionsPane.add(choiceButtons[i], constraints(0, 1 + i, 0, 0, 0, 0)); choiceButtons[i].setPreferredSize(size); group.add(choiceButtons[i]); } getContentPane().add(optionsPane, constraints(0, 0, 0, 0, 0, 0)); getContentPane().add(buttonPane, constraints(0, 1, 0, 0, 0, 0)); } private GridBagConstraints constraints(int gridx, int gridy, int leftinset, int topinset, int rightinset, int bottominset) { if (gridx >= 0) gc.gridx = gridx; if (gridy >= 0) gc.gridy = gridy; gc.fill = GridBagConstraints.BOTH; gc.weightx = 0.5; gc.weighty = 0.5; if (leftinset >= 0) gc.insets.left = leftinset; if (topinset >= 0) gc.insets.top = topinset; if (rightinset >= 0) gc.insets.right = rightinset; if (bottominset >= 0) gc.insets.bottom = bottominset; return gc; } public void actionPerformed(ActionEvent arg0) { if (arg0.getSource().equals(okButton)) { for (int i = 0; i < numOptions; i++) { if (choiceButtons[i].isSelected()) { chosenOption = i; break; } } } else if (arg0.getSource().equals(cancelButton)) { return; } this.setVisible(false); this.dispose(); owner.dialogActionPerformed(); } public synchronized int getSelectedOption() { return chosenOption; } } |
From: Erik V. <ev...@us...> - 2010-01-08 21:26:50
|
Update of /cvsroot/rails/18xx In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv23886 Modified Files: LocalisedText.properties Log Message: Added messages for checkbox dialog Index: LocalisedText.properties =================================================================== RCS file: /cvsroot/rails/18xx/LocalisedText.properties,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** LocalisedText.properties 1 Jan 2010 14:02:49 -0000 1.89 --- LocalisedText.properties 8 Jan 2010 21:26:39 -0000 1.90 *************** *** 472,474 **** YouCannotRepayAllLoans={0} can repay max. {1} out of {2} loans of {3}, but cannot save it from merging into CGR YouMustRaiseCash=You must raise {0} cash by selling shares ! --- 472,475 ---- YouCannotRepayAllLoans={0} can repay max. {1} out of {2} loans of {3}, but cannot save it from merging into CGR YouMustRaiseCash=You must raise {0} cash by selling shares ! YouMustSelect1=You must select {0} item(s) ! YouMustSelect2=You must select between {0} and {1} items |
From: Erik V. <ev...@us...> - 2010-01-08 21:26:29
|
Update of /cvsroot/rails/18xx/rails/util In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv23815/rails/util Modified Files: Util.java Log Message: Added joinWithDelimiter Index: Util.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/util/Util.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Util.java 28 Dec 2009 14:53:00 -0000 1.17 --- Util.java 8 Jan 2010 21:26:14 -0000 1.18 *************** *** 10,14 **** import rails.game.ConfigurationException; import rails.game.move.Moveable; ! import rails.game.move.MoveableHolderI; public final class Util { --- 10,14 ---- import rails.game.ConfigurationException; import rails.game.move.Moveable; ! import rails.game.move.MoveableHolder; public final class Util { *************** *** 34,37 **** --- 34,46 ---- } + public static String joinWithDelimiter (String[] sa, String delimiter) { + StringBuffer b = new StringBuffer(); + for (String s : sa) { + if (b.length() > 0) b.append(delimiter); + b.append(s); + } + return b.toString(); + } + public static int parseInt(String value) throws ConfigurationException { *************** *** 71,75 **** */ public static <T extends Moveable> void moveObjects(List<T> objects, ! MoveableHolderI to) { if (objects == null || objects.isEmpty()) return; --- 80,84 ---- */ public static <T extends Moveable> void moveObjects(List<T> objects, ! MoveableHolder to) { if (objects == null || objects.isEmpty()) return; |
From: Erik V. <ev...@us...> - 2010-01-08 20:47:50
|
Update of /cvsroot/rails/18xx/data/1830 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18144/data/1830 Modified Files: Tiles.xml Log Message: Added value 10 to tile #4 Index: Tiles.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1830/Tiles.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Tiles.xml 18 Dec 2009 20:02:21 -0000 1.7 --- Tiles.xml 8 Jan 2010 20:47:04 -0000 1.8 *************** *** 84,88 **** <Track from="city1" gauge="normal" to="side4"/> </Tile><Tile colour="yellow" id="4" name="4"> ! <Station id="city1" position="0" type="Town"/> <Track from="city1" gauge="normal" to="side3"/> <Track from="city1" gauge="normal" to="side0"/> --- 84,88 ---- <Track from="city1" gauge="normal" to="side4"/> </Tile><Tile colour="yellow" id="4" name="4"> ! <Station id="city1" position="0" type="Town" value="10"/> <Track from="city1" gauge="normal" to="side3"/> <Track from="city1" gauge="normal" to="side0"/> |
From: Erik V. <ev...@us...> - 2010-01-08 20:47:50
|
Update of /cvsroot/rails/18xx/data/18AL In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18144/data/18AL Modified Files: Tiles.xml Log Message: Added value 10 to tile #4 Index: Tiles.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/18AL/Tiles.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Tiles.xml 18 Dec 2009 20:02:21 -0000 1.7 --- Tiles.xml 8 Jan 2010 20:47:06 -0000 1.8 *************** *** 43,47 **** <Track from="city1" gauge="normal" to="side4"/> </Tile><Tile colour="yellow" id="4" name="4"> ! <Station id="city1" position="0" type="Town"/> <Track from="city1" gauge="normal" to="side3"/> <Track from="city1" gauge="normal" to="side0"/> --- 43,47 ---- <Track from="city1" gauge="normal" to="side4"/> </Tile><Tile colour="yellow" id="4" name="4"> ! <Station id="city1" position="0" type="Town" value="10"/> <Track from="city1" gauge="normal" to="side3"/> <Track from="city1" gauge="normal" to="side0"/> |
From: Erik V. <ev...@us...> - 2010-01-08 20:47:50
|
Update of /cvsroot/rails/18xx/data/18EU In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18144/data/18EU Modified Files: Tiles.xml Log Message: Added value 10 to tile #4 Index: Tiles.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/18EU/Tiles.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Tiles.xml 18 Dec 2009 20:02:21 -0000 1.8 --- Tiles.xml 8 Jan 2010 20:47:06 -0000 1.9 *************** *** 41,45 **** <Track from="city1" gauge="normal" to="side4"/> </Tile><Tile colour="yellow" id="4" name="4"> ! <Station id="city1" position="0" type="Town"/> <Track from="city1" gauge="normal" to="side3"/> <Track from="city1" gauge="normal" to="side0"/> --- 41,45 ---- <Track from="city1" gauge="normal" to="side4"/> </Tile><Tile colour="yellow" id="4" name="4"> ! <Station id="city1" position="0" type="Town" value="10"/> <Track from="city1" gauge="normal" to="side3"/> <Track from="city1" gauge="normal" to="side0"/> |