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-08 20:47:50
|
Update of /cvsroot/rails/18xx/data/18Kaas In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18144/data/18Kaas Modified Files: Tiles.xml Log Message: Added value 10 to tile #4 Index: Tiles.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/18Kaas/Tiles.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Tiles.xml 18 Dec 2009 20:02:21 -0000 1.3 --- Tiles.xml 8 Jan 2010 20:47:06 -0000 1.4 *************** *** 58,62 **** <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"/> --- 58,62 ---- <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:42
|
Update of /cvsroot/rails/18xx/tiles In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18144/tiles Modified Files: Rails18xx.ini CombineTiles.pl TileDictionary.18t Log Message: Added value 10 to tile #4 Index: Rails18xx.ini =================================================================== RCS file: /cvsroot/rails/18xx/tiles/Rails18xx.ini,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Rails18xx.ini 18 Dec 2009 20:03:31 -0000 1.3 --- Rails18xx.ini 8 Jan 2010 20:46:57 -0000 1.4 *************** *** 108,112 **** FileNameTemplate=tile<c0000>.<r> [Images] ! Folder=C:\Projects\Rails\18xx\tiles ImageFormat=3 ImageScale=1 --- 108,112 ---- FileNameTemplate=tile<c0000>.<r> [Images] ! Folder=C:\Projects\Rails\18xx\tiles\TDwithID ImageFormat=3 ImageScale=1 Index: TileDictionary.18t =================================================================== RCS file: /cvsroot/rails/18xx/tiles/TileDictionary.18t,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TileDictionary.18t 15 Dec 2009 18:56:11 -0000 1.5 --- TileDictionary.18t 8 Jan 2010 20:47:04 -0000 1.6 *************** *** 351,354 **** --- 351,355 ---- item JunType = jtWhistlestop + Revenue = 10 end> end Index: CombineTiles.pl =================================================================== RCS file: /cvsroot/rails/18xx/tiles/CombineTiles.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CombineTiles.pl 18 Dec 2009 20:03:31 -0000 1.1 --- CombineTiles.pl 8 Jan 2010 20:47:04 -0000 1.2 *************** *** 29,33 **** # Notes on creating new tiles: ! # 1. In TileDesigner, save SVG tiles with size=170 and filename template=tile<c0>. # Do this with ID checked into directory tiles/TDwithID, and again # with ID unchecked into directory tiles/TDwoID. --- 29,33 ---- # Notes on creating new tiles: ! # 1. In TileDesigner, export SVG tiles with size=170 and filename template=tile<c0>. # Do this with ID checked into directory tiles/TDwithID, and again # with ID unchecked into directory tiles/TDwoID. |
From: Erik V. <ev...@us...> - 2010-01-08 20:47:35
|
Update of /cvsroot/rails/18xx/data/1856 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18144/data/1856 Modified Files: Tiles.xml Log Message: Added value 10 to tile #4 Index: Tiles.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1856/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:46:54 -0000 1.8 *************** *** 53,57 **** <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"/> --- 53,57 ---- <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:19
|
Update of /cvsroot/rails/18xx/data/1870 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18144/data/1870 Modified Files: Tiles.xml Log Message: Added value 10 to tile #4 Index: Tiles.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1870/Tiles.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Tiles.xml 18 Dec 2009 20:02:21 -0000 1.6 --- Tiles.xml 8 Jan 2010 20:47:06 -0000 1.7 *************** *** 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:17
|
Update of /cvsroot/rails/18xx/data/1835 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18144/data/1835 Modified Files: Tiles.xml Log Message: Added value 10 to tile #4 Index: Tiles.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1835/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:08 -0000 1.8 *************** *** 119,123 **** <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"/> --- 119,123 ---- <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:42:19
|
Update of /cvsroot/rails/18xx/tiles/svg In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv17304/tiles/svg Modified Files: tile4.svg Log Message: Added value 10 to tile #4 Index: tile4.svg =================================================================== RCS file: /cvsroot/rails/18xx/tiles/svg/tile4.svg,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tile4.svg 18 Dec 2009 19:59:43 -0000 1.3 --- tile4.svg 8 Jan 2010 20:42:05 -0000 1.4 *************** *** 1,2 **** <?xml version="1.0"?> ! <svg version="1.1" xmlns="http://www.w3.org/2000/svg"><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="#FFFF00" stroke="#FFFF00" stroke-width="1" stroke-linejoin="round"/><text x="245" y="318" dy="0.3em" fill="#000000" stroke="#000000" text-anchor="middle" font-family="Arial" font-size="31" font-weight="bold">4</text><line x1="166" y1="170" x2="226" y2="170" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt"/><path d="M 196,170 L 196,340" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 196,0" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 196,340" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 196,0" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><line x1="170" y1="170" x2="222" y2="170" stroke="#000000" stroke-width="26" stroke-linecap="butt"/><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="none" stroke="black" stroke-width="1" stroke-linejoin="round"/></svg> --- 1,2 ---- <?xml version="1.0"?> ! <svg version="1.1" xmlns="http://www.w3.org/2000/svg"><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="#FFFF00" stroke="#FFFF00" stroke-width="1" stroke-linejoin="round"/><line x1="166" y1="170" x2="226" y2="170" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt"/><path d="M 196,170 L 196,340" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 196,0" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 196,340" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 196,0" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><line x1="170" y1="170" x2="222" y2="170" stroke="#000000" stroke-width="26" stroke-linecap="butt"/><ellipse rx="38" ry="34" cx="123" cy="43" fill="#FFFFFF" stroke="#000000" stroke-width="2" stroke-linejoin="round"/><text x="123" y="43" dy="0.3em" fill="#000000" stroke="#000000" text-anchor="middle" font-family="Bookman Old Style" font-size="51">10</text><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="none" stroke="black" stroke-width="1" stroke-linejoin="round"/></svg> |
From: Erik V. <ev...@us...> - 2010-01-08 20:41:56
|
Update of /cvsroot/rails/18xx/tiles In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv17122/tiles Modified Files: Tiles.xml Log Message: Added value 10 to tile #4 Index: Tiles.xml =================================================================== RCS file: /cvsroot/rails/18xx/tiles/Tiles.xml,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Tiles.xml 18 Dec 2009 20:03:31 -0000 1.20 --- Tiles.xml 8 Jan 2010 20:41:04 -0000 1.21 *************** *** 85,89 **** </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"/> --- 85,89 ---- </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-07 20:48:51
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30381/rails/ui/swing Modified Files: ORUIManager.java GameUIManager.java Log Message: Created non-modal version of CheckBoxDialog and a method to deal with such dialogs in the UI Managers. ExchangeTokens and ReachDestination action dialogs now no longer block other windows. Index: ORUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORUIManager.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** ORUIManager.java 1 Jan 2010 18:59:52 -0000 1.40 --- ORUIManager.java 7 Jan 2010 20:48:06 -0000 1.41 *************** *** 3,6 **** --- 3,7 ---- import java.util.*; + import javax.swing.JDialog; import javax.swing.JOptionPane; *************** *** 11,14 **** --- 12,16 ---- 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; *************** *** 16,20 **** import rails.util.Util; ! public class ORUIManager { protected ORWindow orWindow; --- 18,22 ---- import rails.util.Util; ! public class ORUIManager implements DialogOwner { protected ORWindow orWindow; *************** *** 28,31 **** --- 30,36 ---- public GameUIManager gameUIManager; + protected JDialog currentDialog = null; + protected PossibleAction currentDialogAction = null; + private OperatingRound oRound; private PublicCompanyI[] companies; *************** *** 434,438 **** protected void reachDestinations (ReachDestinations action) { - int index; List<String> options = new ArrayList<String>(); List<PublicCompanyI> companies = action.getPossibleCompanies(); --- 439,442 ---- *************** *** 445,468 **** orWindow.setVisible(true); orWindow.toFront(); ! boolean[] destined = ! new CheckBoxDialog(orPanel, ! LocalText.getText("DestinationsReached"), ! LocalText.getText("DestinationsReachedPrompt"), ! options.toArray(new String[0])) ! .getSelectedOptions(); ! for (index=0; index < options.size(); index++) { if (destined[index]) { ! action.addReachedCompany(companies.get(index)); } } ! // Prevent that a null action gets processed if (action.getReachedCompanies() == null || action.getReachedCompanies().isEmpty()) return; ! ! if (orWindow.process(action)) { ! updateMessage(); ! } } } --- 449,487 ---- 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(); ! ! for (int index=0; index < options.length; index++) { if (destined[index]) { ! action.addReachedCompany(action.getPossibleCompanies().get(index)); } } ! // Prevent that a null action gets processed if (action.getReachedCompanies() == null || action.getReachedCompanies().isEmpty()) return; ! ! } else { ! return; } + + gameUIManager.processOnServer(currentDialogAction); } Index: GameUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/GameUIManager.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** GameUIManager.java 30 Dec 2009 22:10:18 -0000 1.29 --- GameUIManager.java 7 Jan 2010 20:48:11 -0000 1.30 *************** *** 5,10 **** import java.util.*; ! import javax.swing.JFileChooser; ! import javax.swing.JOptionPane; import org.apache.log4j.Logger; --- 5,9 ---- import java.util.*; ! import javax.swing.*; import org.apache.log4j.Logger; *************** *** 14,17 **** --- 13,17 ---- import rails.game.action.*; import rails.ui.swing.elements.CheckBoxDialog; + import rails.ui.swing.elements.DialogOwner; import rails.util.*; *************** *** 19,23 **** * This class is called by main() and loads all of the UI components */ ! public class GameUIManager { public static GameUIManager instance = null; --- 19,23 ---- * This class is called by main() and loads all of the UI components */ ! public class GameUIManager implements DialogOwner { public static GameUIManager instance = null; *************** *** 28,31 **** --- 28,35 ---- public ORWindow orWindow; // TEMPORARY private StartRoundWindow startRoundWindow; + + protected JDialog currentDialog = null; + protected PossibleAction currentDialogAction = null; + public static ImageLoader imageLoader; *************** *** 233,237 **** orWindow.setVisible(true); stockChart.setVisible(false); ! } else if (SwitchableUIRound.class.isAssignableFrom(currentRoundType) ) { log.debug("UI entering switchable round type"); --- 237,241 ---- orWindow.setVisible(true); stockChart.setVisible(false); ! } else if (SwitchableUIRound.class.isAssignableFrom(currentRoundType) ) { log.debug("UI entering switchable round type"); *************** *** 350,353 **** --- 354,358 ---- playerName, c.getName() ); + String discardedTrainName = (String) JOptionPane.showInputDialog(orWindow, *************** *** 370,374 **** public void exchangeTokens (ExchangeTokens action) { ! int index, cityNumber; String prompt, cityName, hexName, oldCompName; String[] ct; --- 375,379 ---- public void exchangeTokens (ExchangeTokens action) { ! int cityNumber; String prompt, cityName, hexName, oldCompName; String[] ct; *************** *** 414,430 **** orWindow.setVisible(true); orWindow.toFront(); ! boolean[] exchanged = ! new CheckBoxDialog(orWindow.getORPanel(), ! LocalText.getText("ExchangeTokens"), ! prompt, ! options.toArray(new String[0])) ! .getSelectedOptions(); ! for (index=0; index < options.size(); index++) { if (exchanged[index]) { ! oldTokens.get(index).setSelected(true); } } ! orWindow.process(action); } } --- 419,452 ---- orWindow.setVisible(true); orWindow.toFront(); ! ! currentDialogAction = action; ! currentDialog = new CheckBoxDialog(this, ! LocalText.getText("ExchangeTokens"), ! prompt, ! options.toArray(new String[0])); ! ! } ! } ! ! 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(); ! ! for (int index=0; index < options.length; index++) { if (exchanged[index]) { ! action.getTokensToExchange().get(index).setSelected(true); } } ! } else { ! return; } + + processOnServer(currentDialogAction); } |
From: Erik V. <ev...@us...> - 2010-01-07 20:48:24
|
Update of /cvsroot/rails/18xx/rails/ui/swing/elements In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30381/rails/ui/swing/elements Modified Files: CheckBoxDialog.java Added Files: DialogOwner.java Log Message: Created non-modal version of CheckBoxDialog and a method to deal with such dialogs in the UI Managers. ExchangeTokens and ReachDestination action dialogs now no longer block other windows. Index: CheckBoxDialog.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/elements/CheckBoxDialog.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CheckBoxDialog.java 30 Dec 2009 19:54:31 -0000 1.3 --- CheckBoxDialog.java 7 Jan 2010 20:48:13 -0000 1.4 *************** *** 4,7 **** --- 4,8 ---- import java.awt.*; import java.awt.event.*; + import javax.swing.*; *************** *** 16,19 **** --- 17,22 ---- private static final long serialVersionUID = 1L; + + protected DialogOwner owner = null; GridBagConstraints gc; JPanel optionsPane, buttonPane; *************** *** 32,43 **** Logger.getLogger(CheckBoxDialog.class.getPackage().getName()); ! public CheckBoxDialog(JComponent owner, String title, String message, String[] options) { this (owner, title, message, options, null); } ! ! public CheckBoxDialog(JComponent owner, String title, String message, String[] options, boolean[] selectedOptions) { ! super((Frame) null, title, true); // Modal !? this.message = message; this.options = options; --- 35,47 ---- Logger.getLogger(CheckBoxDialog.class.getPackage().getName()); ! public CheckBoxDialog(DialogOwner owner, String title, String message, String[] options) { this (owner, title, message, options, null); } ! ! public CheckBoxDialog(DialogOwner owner, String title, String message, String[] options, boolean[] selectedOptions) { ! super((Frame) null, title, false); // Modal !? ! this.owner = owner; this.message = message; this.options = options; *************** *** 53,56 **** --- 57,61 ---- // Center on owner + /* int x = (int) owner.getLocationOnScreen().getX() *************** *** 59,62 **** --- 64,70 ---- (int) owner.getLocationOnScreen().getY() + (owner.getHeight() - getHeight()) / 2; + */ + int x = 400; + int y = 400; setLocation(x, y); *************** *** 126,129 **** --- 134,142 ---- setVisible(false); dispose(); + owner.dialogActionPerformed (); + } + + public String[] getOptions () { + return options; } --- NEW FILE: DialogOwner.java --- package rails.ui.swing.elements; public interface DialogOwner { public void dialogActionPerformed (); } |
From: Erik V. <ev...@us...> - 2010-01-05 20:55:42
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4699/rails/game Modified Files: Portfolio.java Player.java Log Message: Player worth is now recalculated at every certificate move (bug fix) Index: Portfolio.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Portfolio.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** Portfolio.java 5 Nov 2009 22:50:37 -0000 1.40 --- Portfolio.java 5 Jan 2010 20:55:31 -0000 1.41 *************** *** 147,150 **** --- 147,153 ---- getShareModel(certificate.getCompany()).addShare(certificate.getShare()); + if (owner instanceof Player) { + ((Player)owner).updateWorth(); + } } *************** *** 175,178 **** --- 178,184 ---- getShareModel(certificate.getCompany()).addShare( -certificate.getShare()); + if (owner instanceof Player) { + ((Player)owner).updateWorth(); + } } Index: Player.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Player.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Player.java 17 Nov 2009 19:31:25 -0000 1.22 --- Player.java 5 Jan 2010 20:55:32 -0000 1.23 *************** *** 97,100 **** --- 97,104 ---- } + public void updateWorth () { + worth.update(); + } + public CertCountModel getCertCountModel() { return certCount; |
From: Erik V. <ev...@us...> - 2010-01-05 20:54:15
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4302/rails/ui/swing Modified Files: GameStatus.java MessagePanel.java ORPanel.java Added Files: GridPanel.java Log Message: Created common superclass GridPanel for GameStatus and ORPanel to abstract common features. Index: MessagePanel.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/MessagePanel.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MessagePanel.java 29 Dec 2009 21:58:11 -0000 1.6 --- MessagePanel.java 5 Jan 2010 20:54:05 -0000 1.7 *************** *** 2,9 **** package rails.ui.swing; ! import java.awt.*; ! import javax.swing.*; ! import rails.util.*; public class MessagePanel extends JPanel { --- 2,8 ---- package rails.ui.swing; ! import java.awt.Color; ! import javax.swing.*; public class MessagePanel extends JPanel { Index: GameStatus.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/GameStatus.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** GameStatus.java 3 Jan 2010 20:31:29 -0000 1.34 --- GameStatus.java 5 Jan 2010 20:54:05 -0000 1.35 *************** *** 1,9 **** package rails.ui.swing; ! import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.*; - import java.util.List; import javax.swing.*; --- 1,9 ---- package rails.ui.swing; ! import java.awt.GridBagConstraints; ! import java.awt.GridBagLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.*; import javax.swing.*; *************** *** 14,19 **** import rails.game.*; import rails.game.action.*; - import rails.game.model.ModelObject; - import rails.game.state.BooleanState; import rails.ui.swing.elements.*; import rails.util.LocalText; --- 14,17 ---- *************** *** 23,46 **** * rails.game status information. */ ! public class GameStatus extends JPanel implements ActionListener, RowHideable { private static final long serialVersionUID = 1L; - private static final int NARROW_GAP = 1; - private static final int WIDE_GAP = 3; - private static final int WIDE_LEFT = 1; - private static final int WIDE_RIGHT = 2; - private static final int WIDE_TOP = 4; - private static final int WIDE_BOTTOM = 8; - private static final String BUY_FROM_IPO_CMD = "BuyFromIPO"; private static final String BUY_FROM_POOL_CMD = "BuyFromPool"; private static final String SELL_CMD = "Sell"; - private static GameStatus gameStatus; protected StatusWindow parent; - private GridBagConstraints gbc; - private Color buttonHighlight = new Color(255, 160, 80); - // Grid elements per function protected Field certPerPlayer[][]; --- 21,33 ---- * rails.game status information. */ ! public class GameStatus extends GridPanel implements ActionListener { private static final long serialVersionUID = 1L; private static final String BUY_FROM_IPO_CMD = "BuyFromIPO"; private static final String BUY_FROM_POOL_CMD = "BuyFromPool"; private static final String SELL_CMD = "Sell"; protected StatusWindow parent; // Grid elements per function protected Field certPerPlayer[][]; *************** *** 90,98 **** protected int futureTrainsXOffset, futureTrainsYOffset, futureTrainsWidth; protected int rightCompCaptionXOffset; - - /** 2D-array of fields to enable show/hide per row or column */ - protected JComponent[][] fields; - /** Array of Observer objects to set row visibility */ - protected RowVisibility[] rowVisibilityObservers; private Caption[] upperPlayerCaption; --- 77,80 ---- *************** *** 100,110 **** private Caption treasurySharesCaption; - protected int np; // Number of players - protected GridBagLayout gb; - - protected int nc; // Number of companies - protected Player[] players; - protected PublicCompanyI[] companies; - //protected CompanyManagerI cm; protected Portfolio ipo, pool; --- 82,85 ---- *************** *** 120,126 **** protected boolean hasCompanyLoans = false; - private PublicCompanyI c; - private JComponent f; - // Current actor. // Players: 0, 1, 2, ... --- 95,98 ---- *************** *** 144,152 **** public void init(StatusWindow parent, GameUIManager gameUIManager) { - gameStatus = this; this.parent = parent; this.gameUIManager = gameUIManager; bank = gameUIManager.getGameManager().getBank(); gb = new GridBagLayout(); this.setLayout(gb); --- 116,126 ---- public void init(StatusWindow parent, GameUIManager gameUIManager) { this.parent = parent; this.gameUIManager = gameUIManager; bank = gameUIManager.getGameManager().getBank(); + gridPanel = this; + parentFrame = parent; + gb = new GridBagLayout(); this.setLayout(gb); *************** *** 256,260 **** fields = new JComponent[1+lastX][2+lastY]; rowVisibilityObservers = new RowVisibility[nc]; ! addField(new Caption(LocalText.getText("COMPANY")), 0, 0, 1, 2, WIDE_RIGHT + WIDE_BOTTOM, true); --- 230,234 ---- fields = new JComponent[1+lastX][2+lastY]; rowVisibilityObservers = new RowVisibility[nc]; ! addField(new Caption(LocalText.getText("COMPANY")), 0, 0, 1, 2, WIDE_RIGHT + WIDE_BOTTOM, true); *************** *** 317,324 **** c = companies[i]; companyIndex.put(c, new Integer(i)); ! rowVisibilityObservers[i] = new RowVisibility (this, certPerPlayerYOffset + i, c.getClosedModel()); boolean visible = !c.isClosed(); ! f = new Caption(c.getName()); f.setForeground(c.getFgColour()); --- 291,298 ---- c = companies[i]; companyIndex.put(c, new Integer(i)); ! rowVisibilityObservers[i] = new RowVisibility (this, certPerPlayerYOffset + i, c.getClosedModel()); boolean visible = !c.isClosed(); ! f = new Caption(c.getName()); f.setForeground(c.getFgColour()); *************** *** 521,556 **** } - private void addField(JComponent comp, int x, int y, int width, int height, - int wideGapPositions, boolean visible) { - - int padTop, padLeft, padBottom, padRight; - gbc.gridx = x; - gbc.gridy = y; - gbc.gridwidth = width; - gbc.gridheight = height; - gbc.weightx = gbc.weighty = 0.5; - gbc.fill = GridBagConstraints.BOTH; - padTop = (wideGapPositions & WIDE_TOP) > 0 ? WIDE_GAP : NARROW_GAP; - padLeft = (wideGapPositions & WIDE_LEFT) > 0 ? WIDE_GAP : NARROW_GAP; - padBottom = - (wideGapPositions & WIDE_BOTTOM) > 0 ? WIDE_GAP : NARROW_GAP; - padRight = (wideGapPositions & WIDE_RIGHT) > 0 ? WIDE_GAP : NARROW_GAP; - gbc.insets = new Insets(padTop, padLeft, padBottom, padRight); - - add(comp, gbc); - - if (fields[x][y] == null) fields[x][y] = comp; - comp.setVisible(visible); - } - - public static GameStatus getInstance() { - return gameStatus; - } - - @Override - public void repaint() { - super.repaint(); - } - public void actionPerformed(ActionEvent actor) { JComponent source = (JComponent) actor.getSource(); --- 495,498 ---- *************** *** 937,949 **** certInTreasuryButton[i].setVisible(clickable); } ! ! public void setRowVisibility (int rowIndex, boolean value) { ! for (int j=0; j < fields.length; j++) { ! if (fields[j][rowIndex] != null) { ! fields[j][rowIndex].setVisible(value); ! } ! } ! parent.pack(); ! } ! } --- 879,882 ---- certInTreasuryButton[i].setVisible(clickable); } ! } --- NEW FILE: GridPanel.java --- /* $Header: /cvsroot/rails/18xx/rails/ui/swing/GridPanel.java,v 1.1 2010/01/05 20:54:05 evos Exp $*/ package rails.ui.swing; import java.awt.*; import java.awt.event.*; import java.util.*; import java.util.List; import javax.swing.*; import org.apache.log4j.Logger; import rails.game.*; import rails.game.model.ModelObject; import rails.game.state.BooleanState; import rails.ui.swing.elements.ViewObject; public abstract class GridPanel extends JPanel implements ActionListener, KeyListener { protected static final int NARROW_GAP = 1; protected static final int WIDE_GAP = 3; protected static final int WIDE_LEFT = 1; protected static final int WIDE_RIGHT = 2; protected static final int WIDE_TOP = 4; protected static final int WIDE_BOTTOM = 8; protected JPanel gridPanel; protected JFrame parentFrame; protected GridBagLayout gb; protected GridBagConstraints gbc; protected static Color buttonHighlight = new Color(255, 160, 80); protected int np; protected Player[] players; protected int nc; protected PublicCompanyI[] companies; protected RoundI round; protected PublicCompanyI c; protected JComponent f; protected List<ViewObject> observers = new ArrayList<ViewObject>(); /** 2D-array of fields to enable show/hide per row or column */ protected JComponent[][] fields; /** Array of Observer objects to set row visibility */ protected RowVisibility[] rowVisibilityObservers; protected List<JMenuItem> menuItemsToReset = new ArrayList<JMenuItem>(); protected static Logger log = Logger.getLogger(GridPanel.class.getPackage().getName()); public void redisplay() { revalidate(); } protected void deRegisterObservers() { log.debug("Deregistering observers"); for (ViewObject vo : observers) { vo.deRegister(); } } protected void addField(JComponent comp, int x, int y, int width, int height, int wideGapPositions) { addField (comp, x, y, width, height, wideGapPositions, true); } protected void addField(JComponent comp, int x, int y, int width, int height, int wideGapPositions, boolean visible) { int padTop, padLeft, padBottom, padRight; gbc.gridx = x; gbc.gridy = y; gbc.gridwidth = width; gbc.gridheight = height; gbc.weightx = gbc.weighty = 0.5; gbc.fill = GridBagConstraints.BOTH; padTop = (wideGapPositions & WIDE_TOP) > 0 ? WIDE_GAP : NARROW_GAP; padLeft = (wideGapPositions & WIDE_LEFT) > 0 ? WIDE_GAP : NARROW_GAP; padBottom = (wideGapPositions & WIDE_BOTTOM) > 0 ? WIDE_GAP : NARROW_GAP; padRight = (wideGapPositions & WIDE_RIGHT) > 0 ? WIDE_GAP : NARROW_GAP; gbc.insets = new Insets(padTop, padLeft, padBottom, padRight); gridPanel.add(comp, gbc); if (comp instanceof ViewObject && ((ViewObject) comp).getModel() != null) { observers.add((ViewObject) comp); } if (fields != null && fields[x][y] == null) fields[x][y] = comp; comp.setVisible(visible); } public void displayPopup(String text) { JOptionPane.showMessageDialog(this, text); } public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_F1) { HelpWindow.displayHelp(GameManager.getInstance().getHelp()); e.consume(); } } public void keyReleased(KeyEvent e) {} public void keyTyped(KeyEvent e) {} public void setRowVisibility (int rowIndex, boolean value) { for (int j=0; j < fields.length; j++) { if (fields[j][rowIndex] != null) { fields[j][rowIndex].setVisible(value); } } parentFrame.pack(); } class RowVisibility implements ViewObject { private GridPanel parent; private ModelObject modelObject; private int rowIndex; private boolean lastValue; public RowVisibility (GridPanel parent, int rowIndex, ModelObject model) { this.parent = parent; this.modelObject = model; this.rowIndex = rowIndex; modelObject.addObserver(this); lastValue = !((BooleanState)modelObject).booleanValue(); } public boolean lastValue () { return lastValue; } /** Needed to satisfy the ViewObject interface. */ public ModelObject getModel() { return modelObject; } /** Needed to satisfy the Observer interface. * The closedObject model will send true if the company is closed. */ public void update(Observable o1, Object o2) { if (o2 instanceof Boolean) { lastValue = !(Boolean)o2; parent.setRowVisibility(rowIndex, lastValue); } } /** Needed to satisfy the ViewObject interface. Currently not used. */ public void deRegister() { if (modelObject != null) modelObject.deleteObserver(this); } } } Index: ORPanel.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORPanel.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** ORPanel.java 3 Jan 2010 20:31:29 -0000 1.37 --- ORPanel.java 5 Jan 2010 20:54:05 -0000 1.38 *************** *** 4,8 **** import java.awt.*; import java.awt.event.*; - import java.util.ArrayList; import java.util.List; --- 4,7 ---- *************** *** 17,30 **** import rails.util.LocalText; ! public class ORPanel extends JPanel ! implements ActionListener, KeyListener, RowHideable { private static final long serialVersionUID = 1L; - private static final int NARROW_GAP = 1; - private static final int WIDE_GAP = 3; - private static final int WIDE_LEFT = 1; - private static final int WIDE_RIGHT = 2; - private static final int WIDE_TOP = 4; - private static final int WIDE_BOTTOM = 8; public static final String BUY_PRIVATE_CMD = "BuyPrivate"; --- 16,23 ---- import rails.util.LocalText; ! public class ORPanel extends GridPanel ! implements ActionListener, KeyListener { private static final long serialVersionUID = 1L; public static final String BUY_PRIVATE_CMD = "BuyPrivate"; *************** *** 58,64 **** private ActionMenuItem repayLoans; - private GridBagLayout gb; - private GridBagConstraints gbc; - // Grid elements per function private Caption leftCompName[]; --- 51,54 ---- *************** *** 106,124 **** private ActionButton redoButton; - private int nc = 0; // Number of companies - - private Player[] players; - private PublicCompanyI[] companies; - private RoundI round; - private PublicCompanyI c; - private JComponent f; - - private List<ViewObject> observers = new ArrayList<ViewObject>(); - - /** 2D-array of fields to enable show/hide per row or column */ - protected JComponent[][] fields; - /** Array of Observer objects to set row visibility */ - protected RowVisibility[] rowVisibilityObservers; - // Current state private int playerIndex = -1; --- 96,99 ---- *************** *** 127,132 **** private PublicCompanyI orComp = null; - private List<JMenuItem> menuItemsToReset = new ArrayList<JMenuItem>(); - protected static Logger log = Logger.getLogger(ORPanel.class.getPackage().getName()); --- 102,105 ---- *************** *** 145,148 **** --- 118,124 ---- statusPanel.setOpaque(true); + gridPanel = statusPanel; + parentFrame = parent; + round = gameUIManager.getCurrentRound(); privatesCanBeBought = gameUIManager.getGameParameterAsBoolean(Defs.Parm.CAN_ANY_COMPANY_BUY_PRIVATES); *************** *** 224,228 **** log.debug("ORPanel.recreate() called"); ! companies = (or).getOperatingCompanies(); nc = companies.length; --- 200,204 ---- log.debug("ORPanel.recreate() called"); ! companies = or.getOperatingCompanies(); nc = companies.length; *************** *** 236,250 **** } - public void redisplay() { - revalidate(); - } - - private void deRegisterObservers() { - log.debug("Deregistering observers"); - for (ViewObject vo : observers) { - vo.deRegister(); - } - } - private void initButtonPanel() { buttonPanel = new JPanel(); --- 212,215 ---- *************** *** 316,320 **** /* Top titles */ ! addField(new Caption("Company"), 0, 0, lastXWidth = 1, 2, WIDE_BOTTOM + WIDE_RIGHT); --- 281,285 ---- /* Top titles */ ! addField(new Caption("Company"), 0, 0, lastXWidth = 1, 2, WIDE_BOTTOM + WIDE_RIGHT); *************** *** 397,404 **** fields = new JComponent[1+currentXOffset][2+nc]; rowVisibilityObservers = new RowVisibility[nc]; ! for (int i = 0; i < nc; i++) { c = companies[i]; ! rowVisibilityObservers[i] = new RowVisibility (this, leftCompNameYOffset + i, c.getClosedModel()); observers.add(rowVisibilityObservers[i]); --- 362,369 ---- fields = new JComponent[1+currentXOffset][2+nc]; rowVisibilityObservers = new RowVisibility[nc]; ! for (int i = 0; i < nc; i++) { c = companies[i]; ! rowVisibilityObservers[i] = new RowVisibility (this, leftCompNameYOffset + i, c.getClosedModel()); observers.add(rowVisibilityObservers[i]); *************** *** 493,528 **** } - private void addField(JComponent comp, int x, int y, int width, int height, - int wideGapPositions) { - addField (comp, x, y, width, height, wideGapPositions, true); - } - - private void addField(JComponent comp, int x, int y, int width, int height, - int wideGapPositions, boolean visible) { - - int padTop, padLeft, padBottom, padRight; - gbc.gridx = x; - gbc.gridy = y; - gbc.gridwidth = width; - gbc.gridheight = height; - gbc.weightx = gbc.weighty = 0.5; - gbc.fill = GridBagConstraints.BOTH; - padTop = (wideGapPositions & WIDE_TOP) > 0 ? WIDE_GAP : NARROW_GAP; - padLeft = (wideGapPositions & WIDE_LEFT) > 0 ? WIDE_GAP : NARROW_GAP; - padBottom = - (wideGapPositions & WIDE_BOTTOM) > 0 ? WIDE_GAP : NARROW_GAP; - padRight = (wideGapPositions & WIDE_RIGHT) > 0 ? WIDE_GAP : NARROW_GAP; - gbc.insets = new Insets(padTop, padLeft, padBottom, padRight); - - statusPanel.add(comp, gbc); - - if (comp instanceof ViewObject - && ((ViewObject) comp).getModel() != null) { - observers.add((ViewObject) comp); - } - - if (fields != null && fields[x][y] == null) fields[x][y] = comp; - comp.setVisible(visible); - } public void finish() { --- 458,461 ---- *************** *** 806,838 **** } - public void displayPopup(String text) { - JOptionPane.showMessageDialog(this, text); - } - - public void keyPressed(KeyEvent e) { - if (e.getKeyCode() == KeyEvent.VK_F1) { - HelpWindow.displayHelp(GameManager.getInstance().getHelp()); - e.consume(); - } - } - - public void keyReleased(KeyEvent e) {} - - public void keyTyped(KeyEvent e) {} - public PublicCompanyI[] getOperatingCompanies() { return companies; } - public void setRowVisibility (int rowIndex, boolean value) { - - for (int j=0; j < fields.length; j++) { - if (fields[j][rowIndex] != null) { - fields[j][rowIndex].setVisible(value); - } - } - orWindow.pack(); - } - - } --- 739,745 ---- |
From: Erik V. <ev...@us...> - 2010-01-05 20:54:12
|
Update of /cvsroot/rails/18xx/rails/ui/swing/elements In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4302/rails/ui/swing/elements Removed Files: RowVisibility.java RowHideable.java Log Message: Created common superclass GridPanel for GameStatus and ORPanel to abstract common features. --- RowHideable.java DELETED --- --- RowVisibility.java DELETED --- |
From: Erik V. <ev...@us...> - 2010-01-05 20:53:27
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4088/rails/game/specific/_1856 Modified Files: CGRFormationRound.java Log Message: Cleaned up imports Index: CGRFormationRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/CGRFormationRound.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** CGRFormationRound.java 1 Jan 2010 14:01:18 -0000 1.29 --- CGRFormationRound.java 5 Jan 2010 20:53:16 -0000 1.30 *************** *** 7,11 **** import rails.game.move.CashMove; import rails.game.special.SellBonusToken; - import rails.game.special.SpecialPropertyI; import rails.game.state.BooleanState; import rails.game.state.IntegerState; --- 7,10 ---- |
From: Erik V. <ev...@us...> - 2010-01-05 20:53:27
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4088/rails/game Modified Files: Bonus.java Log Message: Cleaned up imports Index: Bonus.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Bonus.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Bonus.java 27 Dec 2009 23:16:35 -0000 1.4 --- Bonus.java 5 Jan 2010 20:53:17 -0000 1.5 *************** *** 4,9 **** import java.util.List; - import rails.game.action.LayTile; - /** * An object of class Bonus represent extra income for the owning company, --- 4,7 ---- *************** *** 52,56 **** return name.substring(0, 2); } ! StringBuffer b = new StringBuffer(); for (MapHex location : locations) { --- 50,54 ---- return name.substring(0, 2); } ! StringBuffer b = new StringBuffer(); for (MapHex location : locations) { *************** *** 100,104 **** } } ! public boolean equals (Bonus b) { return (b.name.equals(name)) --- 98,102 ---- } } ! public boolean equals (Bonus b) { return (b.name.equals(name)) |
From: Erik V. <ev...@us...> - 2010-01-05 20:53:27
|
Update of /cvsroot/rails/18xx/rails/ui/swing/hexmap In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4088/rails/ui/swing/hexmap Modified Files: GUIHex.java Log Message: Cleaned up imports Index: GUIHex.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/hexmap/GUIHex.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** GUIHex.java 29 Dec 2009 22:10:01 -0000 1.33 --- GUIHex.java 5 Jan 2010 20:53:15 -0000 1.34 *************** *** 12,16 **** import rails.game.model.ModelObject; import rails.ui.swing.GUIToken; - import rails.ui.swing.GameUIManager; import rails.ui.swing.elements.ViewObject; import rails.util.Util; --- 12,15 ---- *************** *** 324,328 **** Map<PublicCompanyI, City> homes = getHexModel().getHomes(); ! if (homes != null) { City city; --- 323,327 ---- Map<PublicCompanyI, City> homes = getHexModel().getHomes(); ! if (homes != null) { City city; |
From: Erik V. <ev...@us...> - 2010-01-05 20:53:27
|
Update of /cvsroot/rails/18xx/rails/util In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4088/rails/util Modified Files: ListAndFixSavedFiles.java Log Message: Cleaned up imports Index: ListAndFixSavedFiles.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/util/ListAndFixSavedFiles.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ListAndFixSavedFiles.java 27 Dec 2009 23:06:03 -0000 1.2 --- ListAndFixSavedFiles.java 5 Jan 2010 20:53:16 -0000 1.3 *************** *** 1,52 **** package rails.util; ! import java.awt.Color; ! import java.awt.GridBagConstraints; ! import java.awt.GridBagLayout; ! import java.awt.event.ActionEvent; ! import java.awt.event.ActionListener; ! import java.awt.event.KeyEvent; ! import java.awt.event.KeyListener; ! import java.awt.event.WindowAdapter; ! import java.awt.event.WindowEvent; ! import java.io.File; ! import java.io.FileInputStream; ! import java.io.FileOutputStream; ! import java.io.FileWriter; ! import java.io.IOException; ! import java.io.ObjectInputStream; ! import java.io.ObjectOutputStream; ! import java.io.PrintWriter; ! import java.text.SimpleDateFormat; ! import java.util.ArrayList; ! import java.util.Date; import java.util.List; - import java.util.Map; ! import javax.swing.BorderFactory; ! import javax.swing.JFileChooser; ! import javax.swing.JFrame; ! import javax.swing.JMenu; ! import javax.swing.JMenuBar; ! import javax.swing.JMenuItem; ! import javax.swing.JOptionPane; ! import javax.swing.JPanel; ! import javax.swing.JScrollBar; ! import javax.swing.JScrollPane; ! import javax.swing.JTextArea; ! import javax.swing.KeyStroke; ! import javax.swing.ScrollPaneConstants; ! import javax.swing.SwingUtilities; import org.apache.log4j.Logger; ! import rails.game.ConfigurationException; ! import rails.game.DisplayBuffer; ! import rails.game.Game; ! import rails.game.GameManager; import rails.game.action.PossibleAction; import rails.ui.swing.elements.ActionMenuItem; ! public class ListAndFixSavedFiles extends JFrame implements ActionListener, KeyListener { --- 1,19 ---- package rails.util; ! import java.awt.*; ! import java.awt.event.*; ! import java.io.*; ! import java.util.*; import java.util.List; ! import javax.swing.*; import org.apache.log4j.Logger; ! import rails.game.*; import rails.game.action.PossibleAction; import rails.ui.swing.elements.ActionMenuItem; ! public class ListAndFixSavedFiles extends JFrame implements ActionListener, KeyListener { *************** *** 61,68 **** private JMenuItem saveItem, loadItem; private JMenuItem trimItem; ! private List<Object> savedObjects = new ArrayList<Object>(512); private List<PossibleAction> executedActions; ! private static String saveDirectory; private String filepath; --- 28,35 ---- private JMenuItem saveItem, loadItem; private JMenuItem trimItem; ! private List<Object> savedObjects = new ArrayList<Object>(512); private List<PossibleAction> executedActions; ! private static String saveDirectory; private String filepath; *************** *** 76,80 **** public static void main(String[] args) { // TODO Auto-generated method stub ! String myConfigFile = System.getProperty("configfile"); System.out.println("Cmdline configfile setting = " + myConfigFile); --- 43,47 ---- public static void main(String[] args) { // TODO Auto-generated method stub ! String myConfigFile = System.getProperty("configfile"); System.out.println("Cmdline configfile setting = " + myConfigFile); *************** *** 95,107 **** saveDirectory = Config.get("save.directory"); System.out.println("Save directory = " + saveDirectory); ! new ListAndFixSavedFiles (); ! } ! public ListAndFixSavedFiles () { ! super(); ! messageWindow = this; --- 62,74 ---- saveDirectory = Config.get("save.directory"); System.out.println("Save directory = " + saveDirectory); ! new ListAndFixSavedFiles (); ! } ! public ListAndFixSavedFiles () { ! super(); ! messageWindow = this; *************** *** 124,128 **** gbc.fill = GridBagConstraints.BOTH; messagePanel.add(messageScroller, gbc); ! menuBar = new JMenuBar(); fileMenu = new JMenu(LocalText.getText("FILE")); --- 91,95 ---- gbc.fill = GridBagConstraints.BOTH; messagePanel.add(messageScroller, gbc); ! menuBar = new JMenuBar(); fileMenu = new JMenu(LocalText.getText("FILE")); *************** *** 130,134 **** editMenu = new JMenu(LocalText.getText("EDIT")); editMenu.setMnemonic(KeyEvent.VK_E); ! loadItem = new ActionMenuItem(LocalText.getText("LOAD")); loadItem.setActionCommand("LOAD"); --- 97,101 ---- editMenu = new JMenu(LocalText.getText("EDIT")); editMenu.setMnemonic(KeyEvent.VK_E); ! loadItem = new ActionMenuItem(LocalText.getText("LOAD")); loadItem.setActionCommand("LOAD"); *************** *** 160,166 **** menuBar.add(fileMenu); menuBar.add(editMenu); ! setJMenuBar(menuBar); ! setContentPane(messagePanel); --- 127,133 ---- menuBar.add(fileMenu); menuBar.add(editMenu); ! setJMenuBar(menuBar); ! setContentPane(messagePanel); *************** *** 171,204 **** addKeyListener(this); ! setVisible(true); saveDirectory = Config.get("save.directory"); load(); ! } ! private void load() { ! JFileChooser jfc = new JFileChooser(); jfc.setCurrentDirectory(new File(saveDirectory)); if (jfc.showOpenDialog(getContentPane()) == JFileChooser.APPROVE_OPTION) { ! File selectedFile = jfc.getSelectedFile(); filepath = selectedFile.getPath(); saveDirectory = selectedFile.getParent(); ! log.debug("Loading game from file " + filepath); String filename = filepath.replaceAll(".*[/\\\\]", ""); ! try { ObjectInputStream ois = new ObjectInputStream(new FileInputStream( new File(filepath))); ! // New in 1.0.7: Rails version & save date/time. // Allow for older saved file versions. ! Object object = ois.readObject(); savedObjects.add(object); --- 138,171 ---- addKeyListener(this); ! setVisible(true); saveDirectory = Config.get("save.directory"); load(); ! } ! private void load() { ! JFileChooser jfc = new JFileChooser(); jfc.setCurrentDirectory(new File(saveDirectory)); if (jfc.showOpenDialog(getContentPane()) == JFileChooser.APPROVE_OPTION) { ! File selectedFile = jfc.getSelectedFile(); filepath = selectedFile.getPath(); saveDirectory = selectedFile.getParent(); ! log.debug("Loading game from file " + filepath); String filename = filepath.replaceAll(".*[/\\\\]", ""); ! try { ObjectInputStream ois = new ObjectInputStream(new FileInputStream( new File(filepath))); ! // New in 1.0.7: Rails version & save date/time. // Allow for older saved file versions. ! Object object = ois.readObject(); savedObjects.add(object); *************** *** 215,219 **** savedObjects.add(object); } ! long versionID = (Long) object; add("Saved versionID="+versionID+" (object="+object+")"); --- 182,186 ---- savedObjects.add(object); } ! long versionID = (Long) object; add("Saved versionID="+versionID+" (object="+object+")"); *************** *** 222,226 **** savedObjects.add(name); add("Saved game="+name); ! Map<String, String> selectedGameOptions = (Map<String, String>) ois.readObject(); --- 189,193 ---- savedObjects.add(name); add("Saved game="+name); ! Map<String, String> selectedGameOptions = (Map<String, String>) ois.readObject(); *************** *** 229,233 **** add("Option "+key+"="+selectedGameOptions.get(key)); } ! List<String> playerNames = (List<String>) ois.readObject(); savedObjects.add(playerNames); --- 196,200 ---- add("Option "+key+"="+selectedGameOptions.get(key)); } ! List<String> playerNames = (List<String>) ois.readObject(); savedObjects.add(playerNames); *************** *** 236,240 **** add("Player "+(i++)+": "+player); } ! Game game = new Game(name, playerNames, selectedGameOptions); --- 203,207 ---- add("Player "+(i++)+": "+player); } ! Game game = new Game(name, playerNames, selectedGameOptions); *************** *** 242,246 **** throw new ConfigurationException("Error in setting up " + name); } ! executedActions = (List<PossibleAction>) ois.readObject(); --- 209,213 ---- throw new ConfigurationException("Error in setting up " + name); } ! executedActions = (List<PossibleAction>) ois.readObject(); *************** *** 250,254 **** add("Action "+(i++)+": "+action.toString()); } ! ois.close(); } catch (Exception e) { System.out.println(e.getMessage()); --- 217,221 ---- add("Action "+(i++)+": "+action.toString()); } ! ois.close(); } catch (Exception e) { System.out.println(e.getMessage()); *************** *** 258,262 **** } ! public void add (String text) { if (text.length() > 0) { --- 225,229 ---- } ! public void add (String text) { if (text.length() > 0) { *************** *** 286,292 **** List<PossibleAction> toRemove = executedActions.subList(index, executedActions.size()); toRemove.clear(); ! } catch (NumberFormatException e) { ! } } --- 253,259 ---- List<PossibleAction> toRemove = executedActions.subList(index, executedActions.size()); toRemove.clear(); ! } catch (NumberFormatException e) { ! } } *************** *** 297,301 **** } } ! private void save() { JFileChooser jfc = new JFileChooser(); --- 264,268 ---- } } ! private void save() { JFileChooser jfc = new JFileChooser(); *************** *** 310,314 **** filepath = selectedFile.getPath(); saveDirectory = selectedFile.getParent(); ! try { try { --- 277,281 ---- filepath = selectedFile.getPath(); saveDirectory = selectedFile.getParent(); ! try { try { *************** *** 331,335 **** } ! public void keyPressed(KeyEvent e) { } --- 298,302 ---- } ! public void keyPressed(KeyEvent e) { } |
From: Erik V. <ev...@us...> - 2010-01-03 20:31:44
|
Update of /cvsroot/rails/18xx/rails/ui/swing/elements In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv9651/rails/ui/swing/elements Added Files: RowVisibility.java RowHideable.java Log Message: Both Game Status and OR/Map windows now hide closed company rows. --- NEW FILE: RowHideable.java --- package rails.ui.swing.elements; public interface RowHideable { void setRowVisibility(int rowIndex, boolean lastValue); } --- NEW FILE: RowVisibility.java --- package rails.ui.swing.elements; import java.util.Observable; import javax.swing.JComponent; import rails.game.model.ModelObject; import rails.game.state.BooleanState; public class RowVisibility implements ViewObject { private RowHideable parent; private ModelObject modelObject; private int rowIndex; private boolean lastValue; public RowVisibility (RowHideable parent, int rowIndex, ModelObject model) { this.parent = parent; this.modelObject = model; this.rowIndex = rowIndex; modelObject.addObserver(this); lastValue = !((BooleanState)modelObject).booleanValue(); } public boolean lastValue () { return lastValue; } /** Needed to satisfy the ViewObject interface. */ public ModelObject getModel() { return modelObject; } /** Needed to satisfy the Observer interface. * The closedObject model will send true if the company is closed. */ public void update(Observable o1, Object o2) { if (o2 instanceof Boolean) { lastValue = !(Boolean)o2; parent.setRowVisibility(rowIndex, lastValue); } } /** Needed to satisfy the ViewObject interface. Currently not used. */ public void deRegister() { if (modelObject != null) modelObject.deleteObserver(this); } } |
From: Erik V. <ev...@us...> - 2010-01-03 20:31:42
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv9651/rails/ui/swing Modified Files: GameStatus.java ORPanel.java Log Message: Both Game Status and OR/Map windows now hide closed company rows. Index: GameStatus.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/GameStatus.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** GameStatus.java 1 Jan 2010 16:40:42 -0000 1.33 --- GameStatus.java 3 Jan 2010 20:31:29 -0000 1.34 *************** *** 23,27 **** * rails.game status information. */ ! public class GameStatus extends JPanel implements ActionListener { private static final long serialVersionUID = 1L; --- 23,27 ---- * rails.game status information. */ ! public class GameStatus extends JPanel implements ActionListener, RowHideable { private static final long serialVersionUID = 1L; *************** *** 318,322 **** companyIndex.put(c, new Integer(i)); rowVisibilityObservers[i] ! = new RowVisibility (certPerPlayerYOffset + i, c.getClosedModel()); boolean visible = !c.isClosed(); --- 318,322 ---- companyIndex.put(c, new Integer(i)); rowVisibilityObservers[i] ! = new RowVisibility (this, certPerPlayerYOffset + i, c.getClosedModel()); boolean visible = !c.isClosed(); *************** *** 938,942 **** } ! protected void setRowVisibility (int rowIndex, boolean value) { for (int j=0; j < fields.length; j++) { if (fields[j][rowIndex] != null) { --- 938,942 ---- } ! public void setRowVisibility (int rowIndex, boolean value) { for (int j=0; j < fields.length; j++) { if (fields[j][rowIndex] != null) { *************** *** 947,987 **** } - class RowVisibility implements ViewObject - { - private ModelObject modelObject; - private int rowIndex; - private boolean lastValue; - - RowVisibility (int rowIndex, ModelObject model) { - this.modelObject = model; - this.rowIndex = rowIndex; - modelObject.addObserver(this); - lastValue = !((BooleanState)modelObject).booleanValue(); - } - - protected boolean lastValue () { - return lastValue; - } - - /** Needed to satisfy the ViewObject interface. */ - public ModelObject getModel() { - return modelObject; - } - - /** Needed to satisfy the Observer interface. - * The closedObject model will send true if the company is closed. */ - public void update(Observable o1, Object o2) { - if (o2 instanceof Boolean) { - lastValue = !(Boolean)o2; - setRowVisibility(rowIndex, lastValue); - } - } - - /** Needed to satisfy the ViewObject interface. Currently not used. */ - public void deRegister() { - if (modelObject != null) - modelObject.deleteObserver(this); - } - } - } --- 947,949 ---- Index: ORPanel.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORPanel.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** ORPanel.java 29 Dec 2009 21:58:11 -0000 1.36 --- ORPanel.java 3 Jan 2010 20:31:29 -0000 1.37 *************** *** 17,21 **** import rails.util.LocalText; ! public class ORPanel extends JPanel implements ActionListener, KeyListener { private static final long serialVersionUID = 1L; --- 17,22 ---- import rails.util.LocalText; ! public class ORPanel extends JPanel ! implements ActionListener, KeyListener, RowHideable { private static final long serialVersionUID = 1L; *************** *** 115,118 **** --- 116,124 ---- private List<ViewObject> observers = new ArrayList<ViewObject>(); + /** 2D-array of fields to enable show/hide per row or column */ + protected JComponent[][] fields; + /** Array of Observer objects to set row visibility */ + protected RowVisibility[] rowVisibilityObservers; + // Current state private int playerIndex = -1; *************** *** 310,315 **** /* Top titles */ ! addField(new Caption("Company"), 0, 0, lastXWidth = 1, 2, WIDE_BOTTOM ! + WIDE_RIGHT); presidentXOffset = currentXOffset += lastXWidth; --- 316,321 ---- /* Top titles */ ! addField(new Caption("Company"), 0, 0, lastXWidth = 1, 2, ! WIDE_BOTTOM + WIDE_RIGHT); presidentXOffset = currentXOffset += lastXWidth; *************** *** 389,394 **** --- 395,408 ---- WIDE_BOTTOM); + fields = new JComponent[1+currentXOffset][2+nc]; + rowVisibilityObservers = new RowVisibility[nc]; + for (int i = 0; i < nc; i++) { c = companies[i]; + rowVisibilityObservers[i] + = new RowVisibility (this, leftCompNameYOffset + i, c.getClosedModel()); + observers.add(rowVisibilityObservers[i]); + + boolean visible = !c.isClosed(); f = leftCompName[i] = new Caption(c.getName()); *************** *** 396,400 **** f.setForeground(c.getFgColour()); addField(f, leftCompNameXOffset, leftCompNameYOffset + i, 1, 1, ! WIDE_RIGHT); f = --- 410,414 ---- f.setForeground(c.getFgColour()); addField(f, leftCompNameXOffset, leftCompNameYOffset + i, 1, 1, ! WIDE_RIGHT, visible); f = *************** *** 402,412 **** new Field(c.hasStarted() && !c.isClosed() ? c.getPresident().getNameAndPriority() : ""); ! addField(f, presidentXOffset, presidentYOffset + i, 1, 1, 0); f = sharePrice[i] = new Field(c.getCurrentPriceModel()); ! addField(f, sharePriceXOffset, sharePriceYOffset + i, 1, 1, 0); f = cash[i] = new Field(c.getCashModel()); ! addField(f, cashXOffset, cashYOffset + i, 1, 1, WIDE_RIGHT); if (privatesCanBeBought) { --- 416,426 ---- new Field(c.hasStarted() && !c.isClosed() ? c.getPresident().getNameAndPriority() : ""); ! addField(f, presidentXOffset, presidentYOffset + i, 1, 1, 0, visible); f = sharePrice[i] = new Field(c.getCurrentPriceModel()); ! addField(f, sharePriceXOffset, sharePriceYOffset + i, 1, 1, 0, visible); f = cash[i] = new Field(c.getCashModel()); ! addField(f, cashXOffset, cashYOffset + i, 1, 1, WIDE_RIGHT, visible); if (privatesCanBeBought) { *************** *** 416,420 **** c.getPortfolio().getPrivatesOwnedModel()); addField(f, privatesXOffset, privatesYOffset + i, 1, 1, ! WIDE_RIGHT); f = --- 430,434 ---- c.getPortfolio().getPrivatesOwnedModel()); addField(f, privatesXOffset, privatesYOffset + i, 1, 1, ! WIDE_RIGHT, visible); f = *************** *** 422,426 **** new Field(c.getPrivatesSpentThisTurnModel()); addField(f, privatesXOffset + 1, privatesYOffset + i, 1, 1, ! WIDE_RIGHT); } --- 436,440 ---- new Field(c.getPrivatesSpentThisTurnModel()); addField(f, privatesXOffset + 1, privatesYOffset + i, 1, 1, ! WIDE_RIGHT, visible); } *************** *** 432,485 **** f = compLoans[i] = new Field (""); } ! addField (f, loansXOffset, loansYOffset + i, 1, 1, WIDE_RIGHT); } f = tiles[i] = new Field(c.getTilesLaidThisTurnModel()); ! addField(f, tilesXOffset, tilesYOffset + i, 1, 1, 0); f = tileCost[i] = new Field(c.getTilesCostThisTurnModel()); ! addField(f, tilesXOffset + 1, tilesYOffset + i, 1, 1, WIDE_RIGHT); f = tokens[i] = new Field(c.getTokensLaidThisTurnModel()); ! addField(f, tokensXOffset, tokensYOffset + i, 1, 1, 0); f = tokenCost[i] = new Field(c.getTokensCostThisTurnModel()); ! addField(f, tokensXOffset + 1, tokensYOffset + i, 1, 1, 0); f = tokensLeft[i] = new Field(c.getBaseTokensModel()); addField(f, tokensXOffset + 2, tokensYOffset + i, 1, 1, ! bonusTokensExist ? 0 : WIDE_RIGHT); if (bonusTokensExist) { f = tokenBonus[i] = new Field(c.getBonusTokensModel()); addField(f, tokensXOffset + 3, tokensYOffset + i, 1, 1, ! WIDE_RIGHT); } f = revenue[i] = new Field(c.getLastRevenueModel()); ! addField(f, revXOffset, revYOffset + i, 1, 1, 0); f = revenueSelect[i] = new Spinner(0, 0, 0, 10); ! addField(f, revXOffset, revYOffset + i, 1, 1, 0); f = decision[i] = new Field(c.getLastRevenueAllocationModel()); ! addField(f, revXOffset + 1, revYOffset + i, 1, 1, WIDE_RIGHT); f = trains[i] = new Field(c.getPortfolio().getTrainsModel()); ! addField(f, trainsXOffset, trainsYOffset + i, 1, 1, 0); f = newTrainCost[i] = new Field(c.getTrainsSpentThisTurnModel()); ! addField(f, trainsXOffset + 1, trainsYOffset + i, 1, 1, WIDE_RIGHT); f = rightCompName[i] = new Caption(c.getName()); f.setBackground(companies[i].getBgColour()); f.setForeground(companies[i].getFgColour()); ! addField(f, rightCompNameXOffset, rightCompNameYOffset + i, 1, 1, 0); } } - private void addField(JComponent comp, int x, int y, int width, int height, int wideGapPositions) { int padTop, padLeft, padBottom, padRight; --- 446,503 ---- f = compLoans[i] = new Field (""); } ! addField (f, loansXOffset, loansYOffset + i, 1, 1, WIDE_RIGHT, visible); } f = tiles[i] = new Field(c.getTilesLaidThisTurnModel()); ! addField(f, tilesXOffset, tilesYOffset + i, 1, 1, 0, visible); f = tileCost[i] = new Field(c.getTilesCostThisTurnModel()); ! addField(f, tilesXOffset + 1, tilesYOffset + i, 1, 1, WIDE_RIGHT, visible); f = tokens[i] = new Field(c.getTokensLaidThisTurnModel()); ! addField(f, tokensXOffset, tokensYOffset + i, 1, 1, 0, visible); f = tokenCost[i] = new Field(c.getTokensCostThisTurnModel()); ! addField(f, tokensXOffset + 1, tokensYOffset + i, 1, 1, 0, visible); f = tokensLeft[i] = new Field(c.getBaseTokensModel()); addField(f, tokensXOffset + 2, tokensYOffset + i, 1, 1, ! bonusTokensExist ? 0 : WIDE_RIGHT, visible); if (bonusTokensExist) { f = tokenBonus[i] = new Field(c.getBonusTokensModel()); addField(f, tokensXOffset + 3, tokensYOffset + i, 1, 1, ! WIDE_RIGHT, visible); } f = revenue[i] = new Field(c.getLastRevenueModel()); ! addField(f, revXOffset, revYOffset + i, 1, 1, 0, visible); f = revenueSelect[i] = new Spinner(0, 0, 0, 10); ! addField(f, revXOffset, revYOffset + i, 1, 1, 0, visible); f = decision[i] = new Field(c.getLastRevenueAllocationModel()); ! addField(f, revXOffset + 1, revYOffset + i, 1, 1, WIDE_RIGHT, visible); f = trains[i] = new Field(c.getPortfolio().getTrainsModel()); ! addField(f, trainsXOffset, trainsYOffset + i, 1, 1, 0, visible); f = newTrainCost[i] = new Field(c.getTrainsSpentThisTurnModel()); ! addField(f, trainsXOffset + 1, trainsYOffset + i, 1, 1, WIDE_RIGHT, visible); f = rightCompName[i] = new Caption(c.getName()); f.setBackground(companies[i].getBgColour()); f.setForeground(companies[i].getFgColour()); ! addField(f, rightCompNameXOffset, rightCompNameYOffset + i, 1, 1, 0, visible); } } private void addField(JComponent comp, int x, int y, int width, int height, int wideGapPositions) { + addField (comp, x, y, width, height, wideGapPositions, true); + } + + private void addField(JComponent comp, int x, int y, int width, int height, + int wideGapPositions, boolean visible) { int padTop, padLeft, padBottom, padRight; *************** *** 503,507 **** observers.add((ViewObject) comp); } ! } public void finish() { --- 521,528 ---- observers.add((ViewObject) comp); } ! ! if (fields != null && fields[x][y] == null) fields[x][y] = comp; ! comp.setVisible(visible); ! } public void finish() { *************** *** 804,806 **** --- 825,838 ---- } + public void setRowVisibility (int rowIndex, boolean value) { + + for (int j=0; j < fields.length; j++) { + if (fields[j][rowIndex] != null) { + fields[j][rowIndex].setVisible(value); + } + } + orWindow.pack(); + } + + } |
From: Erik V. <ev...@us...> - 2010-01-01 19:51:35
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv20014/rails/game Modified Files: StartRound_1830.java Log Message: Minor cleanup Index: StartRound_1830.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StartRound_1830.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** StartRound_1830.java 8 Dec 2009 19:32:44 -0000 1.27 --- StartRound_1830.java 1 Jan 2010 18:57:21 -0000 1.28 *************** *** 151,162 **** } - /* - * it is possible that the last unsold item was sold in the above - * loop. go to next round if that happened - */ - //if (gameManager.getStartPacket().areAllSold()) { - // return false; - //} - if (possibleActions.isEmpty()) { numPasses.add(1); --- 151,154 ---- *************** *** 172,177 **** possibleActions.add(new NullAction(NullAction.PASS)); } ! ! return true; } --- 164,169 ---- possibleActions.add(new NullAction(NullAction.PASS)); } ! ! return true; } |
From: Erik V. <ev...@us...> - 2010-01-01 19:51:29
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv20302/rails/game Modified Files: GameManager.java Log Message: Always add SAVE Index: GameManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/GameManager.java,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** GameManager.java 28 Dec 2009 14:50:04 -0000 1.73 --- GameManager.java 1 Jan 2010 18:58:43 -0000 1.74 *************** *** 741,745 **** possibleActions.add(new GameAction(GameAction.REDO)); } - possibleActions.add(new GameAction(GameAction.SAVE)); return result; --- 741,744 ---- |
From: Erik V. <ev...@us...> - 2010-01-01 19:00:02
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv20601/rails/ui/swing Modified Files: ORUIManager.java Log Message: DiscardTrains was not handled after Load Index: ORUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORUIManager.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** ORUIManager.java 31 Dec 2009 09:59:05 -0000 1.39 --- ORUIManager.java 1 Jan 2010 18:59:52 -0000 1.40 *************** *** 1204,1207 **** --- 1204,1208 ---- } else if (possibleActions.contains(DiscardTrain.class)) { + gameUIManager.discardTrains(possibleActions.getType(DiscardTrain.class).get(0)); } else if (possibleActions.contains(RepayLoans.class)) { |
From: Erik V. <ev...@us...> - 2010-01-01 18:59:28
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv20460/rails/ui/swing Modified Files: StatusWindow.java Log Message: Permanently enable SAVE Index: StatusWindow.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/StatusWindow.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** StatusWindow.java 13 Dec 2009 16:39:47 -0000 1.30 --- StatusWindow.java 1 Jan 2010 18:59:20 -0000 1.31 *************** *** 105,108 **** --- 105,109 ---- saveItem.addActionListener(this); saveItem.setEnabled(true); + saveItem.setPossibleAction(new GameAction(GameAction.SAVE)); fileMenu.add(saveItem); *************** *** 289,295 **** for (GameAction na : gameActions) { switch (na.getMode()) { ! case GameAction.SAVE: ! saveItem.setPossibleAction(na); ! break; case GameAction.UNDO: undoItem.setEnabled(true); --- 290,297 ---- for (GameAction na : gameActions) { switch (na.getMode()) { ! // SAVE is now enabled by default ! //case GameAction.SAVE: ! // saveItem.setPossibleAction(na); ! // break; case GameAction.UNDO: undoItem.setEnabled(true); |
From: Erik V. <ev...@us...> - 2010-01-01 18:58:04
|
Update of /cvsroot/rails/18xx/rails/game/action In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv20157/rails/game/action Modified Files: PossibleActions.java Log Message: Always allow SAVE Index: PossibleActions.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/action/PossibleActions.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** PossibleActions.java 25 Sep 2009 19:13:01 -0000 1.14 --- PossibleActions.java 1 Jan 2010 18:57:56 -0000 1.15 *************** *** 87,90 **** --- 87,97 ---- public boolean validate(PossibleAction checkedAction) { + // Save is always allowed + if (checkedAction instanceof GameAction + && ((GameAction)checkedAction).getMode() == GameAction.SAVE) { + return true; + } + + // Check if action accurs in the list of possible actions for (PossibleAction action : possibleActions) { if (action.equals(checkedAction)) { |
From: Erik V. <ev...@us...> - 2010-01-01 16:40:57
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25483/rails/ui/swing Modified Files: GameStatus.java Log Message: Fix row visibility Index: GameStatus.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/GameStatus.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** GameStatus.java 1 Jan 2010 14:03:32 -0000 1.32 --- GameStatus.java 1 Jan 2010 16:40:42 -0000 1.33 *************** *** 15,19 **** import rails.game.action.*; import rails.game.model.ModelObject; - import rails.game.model.ViewUpdate; import rails.game.state.BooleanState; import rails.ui.swing.elements.*; --- 15,18 ---- *************** *** 259,317 **** addField(new Caption(LocalText.getText("COMPANY")), 0, 0, 1, 2, ! WIDE_RIGHT + WIDE_BOTTOM); addField(new Caption(LocalText.getText("PLAYERS")), ! certPerPlayerXOffset, 0, np, 1, 0); for (int i = 0; i < np; i++) { playerIndex.put(players[i], new Integer(i)); f = upperPlayerCaption[i] = new Caption(players[i].getNameAndPriority()); ! addField(f, certPerPlayerXOffset + i, 1, 1, 1, WIDE_BOTTOM); } addField(new Caption(LocalText.getText("BANK_SHARES")), ! certInIPOXOffset, 0, 2, 1, WIDE_LEFT + WIDE_RIGHT); addField(new Caption(LocalText.getText("IPO")), certInIPOXOffset, 1, 1, ! 1, WIDE_LEFT + WIDE_BOTTOM); addField(new Caption(LocalText.getText("POOL")), certInPoolXOffset, 1, ! 1, 1, WIDE_RIGHT + WIDE_BOTTOM); if (compCanHoldOwnShares) { addField(treasurySharesCaption = new Caption(LocalText.getText("TREASURY_SHARES")), ! certInTreasuryXOffset, 0, 1, 2, WIDE_RIGHT + WIDE_BOTTOM); } if (this.hasParPrices) { addField(new Caption(LocalText.getText("PRICES")), parPriceXOffset, ! 0, 2, 1, WIDE_RIGHT); addField(new Caption(LocalText.getText("PAR")), parPriceXOffset, 1, ! 1, 1, WIDE_BOTTOM); addField(new Caption(LocalText.getText("CURRENT")), ! currPriceXOffset, 1, 1, 1, WIDE_RIGHT + WIDE_BOTTOM); } else { addField(new Caption(LocalText.getText("CURRENT_PRICE")), ! currPriceXOffset, 0, 1, 2, WIDE_RIGHT + WIDE_BOTTOM); } addField(new Caption(LocalText.getText("COMPANY_DETAILS")), compCashXOffset, 0, 4 + (compCanBuyPrivates ? 1 : 0) ! + (hasCompanyLoans ? 1 : 0), 1, 0); addField(new Caption(LocalText.getText("CASH")), compCashXOffset, 1, 1, ! 1, WIDE_BOTTOM); addField(new Caption(LocalText.getText("REVENUE")), compRevenueXOffset, ! 1, 1, 1, WIDE_BOTTOM); addField(new Caption(LocalText.getText("TRAINS")), compTrainsXOffset, ! 1, 1, 1, WIDE_BOTTOM); addField(new Caption(LocalText.getText("TOKENS")), compTokensXOffset, ! 1, 1, 1, WIDE_BOTTOM); if (compCanBuyPrivates) { addField(new Caption(LocalText.getText("PRIVATES")), ! compPrivatesXOffset, 1, 1, 1, WIDE_BOTTOM); } if (hasCompanyLoans) { addField (new Caption (LocalText.getText("LOANS")), ! compLoansXOffset, 1, 1, 1, WIDE_BOTTOM); } addField(new Caption(LocalText.getText("COMPANY")), ! rightCompCaptionXOffset, 0, 1, 2, WIDE_LEFT + WIDE_BOTTOM); for (int i = 0; i < nc; i++) { --- 258,316 ---- addField(new Caption(LocalText.getText("COMPANY")), 0, 0, 1, 2, ! WIDE_RIGHT + WIDE_BOTTOM, true); addField(new Caption(LocalText.getText("PLAYERS")), ! certPerPlayerXOffset, 0, np, 1, 0, true); for (int i = 0; i < np; i++) { playerIndex.put(players[i], new Integer(i)); f = upperPlayerCaption[i] = new Caption(players[i].getNameAndPriority()); ! addField(f, certPerPlayerXOffset + i, 1, 1, 1, WIDE_BOTTOM, true); } addField(new Caption(LocalText.getText("BANK_SHARES")), ! certInIPOXOffset, 0, 2, 1, WIDE_LEFT + WIDE_RIGHT, true); addField(new Caption(LocalText.getText("IPO")), certInIPOXOffset, 1, 1, ! 1, WIDE_LEFT + WIDE_BOTTOM, true); addField(new Caption(LocalText.getText("POOL")), certInPoolXOffset, 1, ! 1, 1, WIDE_RIGHT + WIDE_BOTTOM, true); if (compCanHoldOwnShares) { addField(treasurySharesCaption = new Caption(LocalText.getText("TREASURY_SHARES")), ! certInTreasuryXOffset, 0, 1, 2, WIDE_RIGHT + WIDE_BOTTOM, true); } if (this.hasParPrices) { addField(new Caption(LocalText.getText("PRICES")), parPriceXOffset, ! 0, 2, 1, WIDE_RIGHT, true); addField(new Caption(LocalText.getText("PAR")), parPriceXOffset, 1, ! 1, 1, WIDE_BOTTOM, true); addField(new Caption(LocalText.getText("CURRENT")), ! currPriceXOffset, 1, 1, 1, WIDE_RIGHT + WIDE_BOTTOM, true); } else { addField(new Caption(LocalText.getText("CURRENT_PRICE")), ! currPriceXOffset, 0, 1, 2, WIDE_RIGHT + WIDE_BOTTOM, true); } addField(new Caption(LocalText.getText("COMPANY_DETAILS")), compCashXOffset, 0, 4 + (compCanBuyPrivates ? 1 : 0) ! + (hasCompanyLoans ? 1 : 0), 1, 0, true); addField(new Caption(LocalText.getText("CASH")), compCashXOffset, 1, 1, ! 1, WIDE_BOTTOM, true); addField(new Caption(LocalText.getText("REVENUE")), compRevenueXOffset, ! 1, 1, 1, WIDE_BOTTOM, true); addField(new Caption(LocalText.getText("TRAINS")), compTrainsXOffset, ! 1, 1, 1, WIDE_BOTTOM, true); addField(new Caption(LocalText.getText("TOKENS")), compTokensXOffset, ! 1, 1, 1, WIDE_BOTTOM, true); if (compCanBuyPrivates) { addField(new Caption(LocalText.getText("PRIVATES")), ! compPrivatesXOffset, 1, 1, 1, WIDE_BOTTOM, true); } if (hasCompanyLoans) { addField (new Caption (LocalText.getText("LOANS")), ! compLoansXOffset, 1, 1, 1, WIDE_BOTTOM, true); } addField(new Caption(LocalText.getText("COMPANY")), ! rightCompCaptionXOffset, 0, 1, 2, WIDE_LEFT + WIDE_BOTTOM, true); for (int i = 0; i < nc; i++) { *************** *** 320,328 **** rowVisibilityObservers[i] = new RowVisibility (certPerPlayerYOffset + i, c.getClosedModel()); f = new Caption(c.getName()); f.setForeground(c.getFgColour()); f.setBackground(c.getBgColour()); ! addField(f, 0, certPerPlayerYOffset + i, 1, 1, WIDE_RIGHT); for (int j = 0; j < np; j++) { --- 319,328 ---- rowVisibilityObservers[i] = new RowVisibility (certPerPlayerYOffset + i, c.getClosedModel()); + boolean visible = !c.isClosed(); f = new Caption(c.getName()); f.setForeground(c.getFgColour()); f.setBackground(c.getBgColour()); ! addField(f, 0, certPerPlayerYOffset + i, 1, 1, WIDE_RIGHT, visible); for (int j = 0; j < np; j++) { *************** *** 333,337 **** c)); addField(f, certPerPlayerXOffset + j, certPerPlayerYOffset + i, ! 1, 1, 0); f = certPerPlayerButton[i][j] = --- 333,337 ---- c)); addField(f, certPerPlayerXOffset + j, certPerPlayerYOffset + i, ! 1, 1, 0, visible); f = certPerPlayerButton[i][j] = *************** *** 340,347 **** this, buySellGroup); addField(f, certPerPlayerXOffset + j, certPerPlayerYOffset + i, ! 1, 1, 0); } f = certInIPO[i] = new Field(ipo.getShareModel(c)); ! addField(f, certInIPOXOffset, certInIPOYOffset + i, 1, 1, WIDE_LEFT); f = certInIPOButton[i] = --- 340,347 ---- this, buySellGroup); addField(f, certPerPlayerXOffset + j, certPerPlayerYOffset + i, ! 1, 1, 0, false); } f = certInIPO[i] = new Field(ipo.getShareModel(c)); ! addField(f, certInIPOXOffset, certInIPOYOffset + i, 1, 1, WIDE_LEFT, visible); f = certInIPOButton[i] = *************** *** 351,361 **** LocalText.getText("ClickToSelectForBuying"), this, buySellGroup); ! f.setVisible(false); ! addField(f, certInIPOXOffset, certInIPOYOffset + i, 1, 1, WIDE_LEFT); certInIPO[i].setPreferredSize(certInIPOButton[i].getPreferredSize()); f = certInPool[i] = new Field(pool.getShareModel(c)); addField(f, certInPoolXOffset, certInPoolYOffset + i, 1, 1, ! WIDE_RIGHT); f = certInPoolButton[i] = --- 351,360 ---- LocalText.getText("ClickToSelectForBuying"), this, buySellGroup); ! addField(f, certInIPOXOffset, certInIPOYOffset + i, 1, 1, WIDE_LEFT, false); certInIPO[i].setPreferredSize(certInIPOButton[i].getPreferredSize()); f = certInPool[i] = new Field(pool.getShareModel(c)); addField(f, certInPoolXOffset, certInPoolYOffset + i, 1, 1, ! WIDE_RIGHT, visible); f = certInPoolButton[i] = *************** *** 365,371 **** LocalText.getText("ClickToSelectForBuying"), this, buySellGroup); - f.setVisible(false); addField(f, certInPoolXOffset, certInPoolYOffset + i, 1, 1, ! WIDE_RIGHT); certInPool[i].setPreferredSize(certInIPOButton[i].getPreferredSize());/* sic */ --- 364,369 ---- LocalText.getText("ClickToSelectForBuying"), this, buySellGroup); addField(f, certInPoolXOffset, certInPoolYOffset + i, 1, 1, ! WIDE_RIGHT, false); certInPool[i].setPreferredSize(certInIPOButton[i].getPreferredSize());/* sic */ *************** *** 375,379 **** new Field(c.getPortfolio().getShareModel(c)); addField(f, certInTreasuryXOffset, certInTreasuryYOffset + i, ! 1, 1, WIDE_RIGHT); f = certInTreasuryButton[i] = --- 373,377 ---- new Field(c.getPortfolio().getShareModel(c)); addField(f, certInTreasuryXOffset, certInTreasuryYOffset + i, ! 1, 1, WIDE_RIGHT, visible); f = certInTreasuryButton[i] = *************** *** 383,389 **** LocalText.getText("ClickToSelectForBuying"), this, buySellGroup); - f.setVisible(false); addField(f, certInTreasuryXOffset, certInTreasuryYOffset + i, ! 1, 1, WIDE_RIGHT); certInTreasury[i].setPreferredSize(certInTreasuryButton[i].getPreferredSize());/* sic */ } --- 381,386 ---- LocalText.getText("ClickToSelectForBuying"), this, buySellGroup); addField(f, certInTreasuryXOffset, certInTreasuryYOffset + i, ! 1, 1, WIDE_RIGHT, false); certInTreasury[i].setPreferredSize(certInTreasuryButton[i].getPreferredSize());/* sic */ } *************** *** 391,412 **** if (this.hasParPrices) { f = parPrice[i] = new Field(c.getParPriceModel()); ! addField(f, parPriceXOffset, parPriceYOffset + i, 1, 1, 0); } f = currPrice[i] = new Field(c.getCurrentPriceModel()); addField(f, currPriceXOffset, currPriceYOffset + i, 1, 1, ! WIDE_RIGHT); f = compCash[i] = new Field(c.getCashModel()); ! addField(f, compCashXOffset, compCashYOffset + i, 1, 1, 0); f = compRevenue[i] = new Field(c.getLastRevenueModel()); ! addField(f, compRevenueXOffset, compRevenueYOffset + i, 1, 1, 0); f = compTrains[i] = new Field(c.getPortfolio().getTrainsModel()); ! addField(f, compTrainsXOffset, compTrainsYOffset + i, 1, 1, 0); f = compTokens[i] = new Field(c.getBaseTokensModel()); ! addField(f, compTokensXOffset, compTokensYOffset + i, 1, 1, 0); if (this.compCanBuyPrivates) { --- 388,409 ---- if (this.hasParPrices) { f = parPrice[i] = new Field(c.getParPriceModel()); ! addField(f, parPriceXOffset, parPriceYOffset + i, 1, 1, 0, visible); } f = currPrice[i] = new Field(c.getCurrentPriceModel()); addField(f, currPriceXOffset, currPriceYOffset + i, 1, 1, ! WIDE_RIGHT, visible); f = compCash[i] = new Field(c.getCashModel()); ! addField(f, compCashXOffset, compCashYOffset + i, 1, 1, 0, visible); f = compRevenue[i] = new Field(c.getLastRevenueModel()); ! addField(f, compRevenueXOffset, compRevenueYOffset + i, 1, 1, 0, visible); f = compTrains[i] = new Field(c.getPortfolio().getTrainsModel()); ! addField(f, compTrainsXOffset, compTrainsYOffset + i, 1, 1, 0, visible); f = compTokens[i] = new Field(c.getBaseTokensModel()); ! addField(f, compTokensXOffset, compTokensYOffset + i, 1, 1, 0, visible); if (this.compCanBuyPrivates) { *************** *** 416,420 **** c.getPortfolio().getPrivatesOwnedModel()); addField(f, compPrivatesXOffset, compPrivatesYOffset + i, 1, 1, ! 0); } if (hasCompanyLoans) { --- 413,417 ---- c.getPortfolio().getPrivatesOwnedModel()); addField(f, compPrivatesXOffset, compPrivatesYOffset + i, 1, 1, ! 0, visible); } if (hasCompanyLoans) { *************** *** 424,428 **** f = compLoans[i] = new Field (""); } ! addField (f, compLoansXOffset, compLoansYOffset+i, 1, 1, 0); } --- 421,425 ---- f = compLoans[i] = new Field (""); } ! addField (f, compLoansXOffset, compLoansYOffset+i, 1, 1, 0, visible); } *************** *** 431,448 **** f.setBackground(c.getBgColour()); addField(f, rightCompCaptionXOffset, certPerPlayerYOffset + i, 1, ! 1, WIDE_LEFT); } // Player possessions addField(new Caption(LocalText.getText("CASH")), 0, playerCashYOffset, ! 1, 1, WIDE_TOP + WIDE_RIGHT); for (int i = 0; i < np; i++) { f = playerCash[i] = new Field(players[i].getCashModel()); addField(f, playerCashXOffset + i, playerCashYOffset, 1, 1, ! WIDE_TOP); } addField(new Caption("Privates"), 0, playerPrivatesYOffset, 1, 1, ! WIDE_RIGHT); for (int i = 0; i < np; i++) { f = --- 428,445 ---- f.setBackground(c.getBgColour()); addField(f, rightCompCaptionXOffset, certPerPlayerYOffset + i, 1, ! 1, WIDE_LEFT, visible); } // Player possessions addField(new Caption(LocalText.getText("CASH")), 0, playerCashYOffset, ! 1, 1, WIDE_TOP + WIDE_RIGHT, true); for (int i = 0; i < np; i++) { f = playerCash[i] = new Field(players[i].getCashModel()); addField(f, playerCashXOffset + i, playerCashYOffset, 1, 1, ! WIDE_TOP, true); } addField(new Caption("Privates"), 0, playerPrivatesYOffset, 1, 1, ! WIDE_RIGHT, true); for (int i = 0; i < np; i++) { f = *************** *** 451,469 **** players[i].getPortfolio().getPrivatesOwnedModel()); addField(f, playerPrivatesXOffset + i, playerPrivatesYOffset, 1, 1, ! 0); } addField(new Caption(LocalText.getText("WORTH")), 0, ! playerWorthYOffset, 1, 1, WIDE_RIGHT); for (int i = 0; i < np; i++) { ! f = playerWorth[i] = new Field(players[i].getWorthModel()/* ! * , ! * true ! */); ! addField(f, playerWorthXOffset + i, playerWorthYOffset, 1, 1, 0); } addField(new Caption("Certs"), 0, playerCertCountYOffset, 1, 1, ! WIDE_RIGHT + WIDE_TOP); for (int i = 0; i < np; i++) { f = --- 448,463 ---- players[i].getPortfolio().getPrivatesOwnedModel()); addField(f, playerPrivatesXOffset + i, playerPrivatesYOffset, 1, 1, ! 0, true); } addField(new Caption(LocalText.getText("WORTH")), 0, ! playerWorthYOffset, 1, 1, WIDE_RIGHT, true); for (int i = 0; i < np; i++) { ! f = playerWorth[i] = new Field(players[i].getWorthModel()); ! addField(f, playerWorthXOffset + i, playerWorthYOffset, 1, 1, 0, true); } addField(new Caption("Certs"), 0, playerCertCountYOffset, 1, 1, ! WIDE_RIGHT + WIDE_TOP, true); for (int i = 0; i < np; i++) { f = *************** *** 471,511 **** new Field(players[i].getCertCountModel(), true); addField(f, playerCertCountXOffset + i, playerCertCountYOffset, 1, ! 1, WIDE_TOP); } for (int i = 0; i < np; i++) { f = lowerPlayerCaption[i] = new Caption(players[i].getName()); ! addField(f, i + 1, playerCertCountYOffset + 1, 1, 1, WIDE_TOP); } // Certificate Limit addField(new Caption(LocalText.getText("LIMIT")), certLimitXOffset - 1, ! certLimitYOffset, 1, 1, WIDE_TOP + WIDE_LEFT); addField(new Field(gameUIManager.getGameManager().getPlayerCertificateLimitModel()), certLimitXOffset, ! certLimitYOffset, 1, 1, WIDE_TOP); // Bank addField(new Caption(LocalText.getText("BANK")), bankCashXOffset - 1, ! bankCashYOffset - 1, 1, 2, WIDE_TOP + WIDE_LEFT); addField(new Caption(LocalText.getText("CASH")), bankCashXOffset, ! bankCashYOffset - 1, 1, 1, WIDE_TOP); bankCash = new Field(bank.getCashModel()); ! addField(bankCash, bankCashXOffset, bankCashYOffset, 1, 1, 0); // Trains addField(new Caption(LocalText.getText("TRAINS")), poolTrainsXOffset - 1, poolTrainsYOffset - 1, 1, 2, WIDE_TOP ! + WIDE_LEFT); addField(new Caption(LocalText.getText("USED")), poolTrainsXOffset, ! poolTrainsYOffset - 1, 1, 1, WIDE_TOP); poolTrains = new Field(pool.getTrainsModel()); ! addField(poolTrains, poolTrainsXOffset, poolTrainsYOffset, 1, 1, 0); // New trains addField(new Caption(LocalText.getText("NEW")), newTrainsXOffset, ! newTrainsYOffset - 1, 1, 1, WIDE_TOP); newTrains = new Field(ipo.getTrainsModel()); ! addField(newTrains, newTrainsXOffset, newTrainsYOffset, 1, 1, 0); dummyButton = new ClickField("", "", "", this, buySellGroup); --- 465,505 ---- new Field(players[i].getCertCountModel(), true); addField(f, playerCertCountXOffset + i, playerCertCountYOffset, 1, ! 1, WIDE_TOP, true); } for (int i = 0; i < np; i++) { f = lowerPlayerCaption[i] = new Caption(players[i].getName()); ! addField(f, i + 1, playerCertCountYOffset + 1, 1, 1, WIDE_TOP, true); } // Certificate Limit addField(new Caption(LocalText.getText("LIMIT")), certLimitXOffset - 1, ! certLimitYOffset, 1, 1, WIDE_TOP + WIDE_LEFT, true); addField(new Field(gameUIManager.getGameManager().getPlayerCertificateLimitModel()), certLimitXOffset, ! certLimitYOffset, 1, 1, WIDE_TOP, true); // Bank addField(new Caption(LocalText.getText("BANK")), bankCashXOffset - 1, ! bankCashYOffset - 1, 1, 2, WIDE_TOP + WIDE_LEFT, true); addField(new Caption(LocalText.getText("CASH")), bankCashXOffset, ! bankCashYOffset - 1, 1, 1, WIDE_TOP, true); bankCash = new Field(bank.getCashModel()); ! addField(bankCash, bankCashXOffset, bankCashYOffset, 1, 1, 0, true); // Trains addField(new Caption(LocalText.getText("TRAINS")), poolTrainsXOffset - 1, poolTrainsYOffset - 1, 1, 2, WIDE_TOP ! + WIDE_LEFT, true); addField(new Caption(LocalText.getText("USED")), poolTrainsXOffset, ! poolTrainsYOffset - 1, 1, 1, WIDE_TOP, true); poolTrains = new Field(pool.getTrainsModel()); ! addField(poolTrains, poolTrainsXOffset, poolTrainsYOffset, 1, 1, 0, true); // New trains addField(new Caption(LocalText.getText("NEW")), newTrainsXOffset, ! newTrainsYOffset - 1, 1, 1, WIDE_TOP, true); newTrains = new Field(ipo.getTrainsModel()); ! addField(newTrains, newTrainsXOffset, newTrainsYOffset, 1, 1, 0, true); dummyButton = new ClickField("", "", "", this, buySellGroup); *************** *** 513,525 **** // Future trains addField(new Caption(LocalText.getText("Future")), futureTrainsXOffset, ! futureTrainsYOffset - 1, futureTrainsWidth, 1, WIDE_TOP); futureTrains = new Field(bank.getUnavailable().getTrainsModel()); addField(futureTrains, futureTrainsXOffset, futureTrainsYOffset, ! futureTrainsWidth, 1, 0); // Train cost overview String text = gameUIManager.getGameManager().getTrainManager().getTrainCostOverview(); addField (new Caption(text), poolTrainsXOffset, newTrainsYOffset + 1, ! futureTrainsWidth + 2, 1, 0); dummyButton = new ClickField("", "", "", this, buySellGroup); --- 507,519 ---- // Future trains addField(new Caption(LocalText.getText("Future")), futureTrainsXOffset, ! futureTrainsYOffset - 1, futureTrainsWidth, 1, WIDE_TOP, true); futureTrains = new Field(bank.getUnavailable().getTrainsModel()); addField(futureTrains, futureTrainsXOffset, futureTrainsYOffset, ! futureTrainsWidth, 1, 0, true); // Train cost overview String text = gameUIManager.getGameManager().getTrainManager().getTrainCostOverview(); addField (new Caption(text), poolTrainsXOffset, newTrainsYOffset + 1, ! futureTrainsWidth + 2, 1, 0, true); dummyButton = new ClickField("", "", "", this, buySellGroup); *************** *** 528,532 **** private void addField(JComponent comp, int x, int y, int width, int height, ! int wideGapPositions) { int padTop, padLeft, padBottom, padRight; --- 522,526 ---- private void addField(JComponent comp, int x, int y, int width, int height, ! int wideGapPositions, boolean visible) { int padTop, padLeft, padBottom, padRight; *************** *** 547,550 **** --- 541,545 ---- if (fields[x][y] == null) fields[x][y] = comp; + comp.setVisible(visible); } *************** *** 766,772 **** lowerPlayerCaption[j].setHighlight(false); for (i = 0; i < nc; i++) { ! if (rowVisibilityObservers[i].lastValue()) { ! setPlayerCertButton(i, j, false); ! } } } else if (j == -1 && compCanHoldOwnShares) { --- 761,765 ---- lowerPlayerCaption[j].setHighlight(false); for (i = 0; i < nc; i++) { ! setPlayerCertButton(i, j, false); } } else if (j == -1 && compCanHoldOwnShares) { *************** *** 774,783 **** } for (i = 0; i < nc; i++) { ! if (rowVisibilityObservers[i].lastValue) { ! setIPOCertButton(i, false); ! setPoolCertButton(i, false); ! setPlayerCertButton (i, actorIndex, false); ! if (compCanHoldOwnShares) setTreasuryCertButton(i, false); ! } } --- 767,774 ---- } for (i = 0; i < nc; i++) { ! setIPOCertButton(i, false); ! setPoolCertButton(i, false); ! setPlayerCertButton (i, actorIndex, false); ! if (compCanHoldOwnShares) setTreasuryCertButton(i, false); } *************** *** 876,879 **** --- 867,872 ---- protected void setPlayerCertButton(int i, int j, boolean clickable) { if (j < 0) return; + boolean visible = rowVisibilityObservers[i].lastValue(); + if (clickable) { certPerPlayerButton[i][j].setText(certPerPlayer[i][j].getText()); *************** *** 881,886 **** certPerPlayerButton[i][j].clearPossibleActions(); } ! certPerPlayer[i][j].setVisible(!clickable); ! certPerPlayerButton[i][j].setVisible(clickable); } --- 874,879 ---- certPerPlayerButton[i][j].clearPossibleActions(); } ! certPerPlayer[i][j].setVisible(visible && !clickable); ! certPerPlayerButton[i][j].setVisible(visible && clickable); } *************** *** 895,898 **** --- 888,892 ---- private void setIPOCertButton(int i, boolean clickable) { + boolean visible = rowVisibilityObservers[i].lastValue(); if (clickable) { certInIPOButton[i].setText(certInIPO[i].getText()); *************** *** 900,905 **** certInIPOButton[i].clearPossibleActions(); } ! certInIPO[i].setVisible(!clickable); ! certInIPOButton[i].setVisible(clickable); } --- 894,899 ---- certInIPOButton[i].clearPossibleActions(); } ! certInIPO[i].setVisible(visible && !clickable); ! certInIPOButton[i].setVisible(visible && clickable); } *************** *** 914,917 **** --- 908,912 ---- private void setPoolCertButton(int i, boolean clickable) { + boolean visible = rowVisibilityObservers[i].lastValue(); if (clickable) { certInPoolButton[i].setText(certInPool[i].getText()); *************** *** 919,924 **** certInPoolButton[i].clearPossibleActions(); } ! certInPool[i].setVisible(!clickable); ! certInPoolButton[i].setVisible(clickable); } --- 914,919 ---- certInPoolButton[i].clearPossibleActions(); } ! certInPool[i].setVisible(visible && !clickable); ! certInPoolButton[i].setVisible(visible && clickable); } *************** *** 933,936 **** --- 928,932 ---- private void setTreasuryCertButton(int i, boolean clickable) { + boolean visible = rowVisibilityObservers[i].lastValue(); if (clickable) { certInTreasuryButton[i].setText(certInTreasury[i].getText()); *************** *** 938,942 **** certInTreasuryButton[i].clearPossibleActions(); } ! certInTreasury[i].setVisible(!clickable); certInTreasuryButton[i].setVisible(clickable); } --- 934,938 ---- certInTreasuryButton[i].clearPossibleActions(); } ! certInTreasury[i].setVisible(visible && !clickable); certInTreasuryButton[i].setVisible(clickable); } |
From: Erik V. <ev...@us...> - 2010-01-01 15:24:00
|
Update of /cvsroot/rails/18xx/rails/game/state In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv10857/rails/game/state Modified Files: State.java Log Message: Removed unnecessary update() call Index: State.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/state/State.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** State.java 1 Jan 2010 14:04:19 -0000 1.13 --- State.java 1 Jan 2010 14:34:54 -0000 1.14 *************** *** 50,54 **** new Exception("")); } - update(); } --- 50,53 ---- |