From: Freek D. <mac...@us...> - 2010-01-31 22:23:08
|
Update of /cvsroot/rails/18xx/rails/game/model In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv382/rails/game/model Modified Files: BonusModel.java ModelObject.java PriceModel.java TrainsModel.java ViewUpdate.java Log Message: Fix indentation: Java files contain 4 spaces, not tabs Index: ViewUpdate.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/model/ViewUpdate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ViewUpdate.java 13 Dec 2009 16:39:48 -0000 1.1 --- ViewUpdate.java 31 Jan 2010 22:22:29 -0000 1.2 *************** *** 15,56 **** public class ViewUpdate implements Serializable { ! protected Map<String, Object> updates = new HashMap<String, Object>(4); ! public static final String TEXT = "TEXT"; ! public static final String BGCOLOUR = "BGCOLOUR"; public static final long serialVersionUID = 1L; public ViewUpdate (String key, Object value) { ! addObject (key, value); ! } ! public ViewUpdate (String text) { ! addObject (TEXT, text); ! } ! /** Add an object. ! * Return this ViewUpdate to enable chaining. ! */ ! public ViewUpdate addObject (String key, Object value) { ! updates.put(key, value); ! return this; ! } ! public Set<String> getKeys () { ! return updates.keySet(); ! } ! public boolean hasKey (String key) { ! return updates.containsKey(key); ! } ! public Object getValue(String key) { ! return updates.get(key); ! } ! public String getText () { ! return (String) updates.get(TEXT); ! } } --- 15,56 ---- public class ViewUpdate implements Serializable { ! protected Map<String, Object> updates = new HashMap<String, Object>(4); ! public static final String TEXT = "TEXT"; ! public static final String BGCOLOUR = "BGCOLOUR"; public static final long serialVersionUID = 1L; public ViewUpdate (String key, Object value) { ! addObject (key, value); ! } ! public ViewUpdate (String text) { ! addObject (TEXT, text); ! } ! /** Add an object. ! * Return this ViewUpdate to enable chaining. ! */ ! public ViewUpdate addObject (String key, Object value) { ! updates.put(key, value); ! return this; ! } ! public Set<String> getKeys () { ! return updates.keySet(); ! } ! public boolean hasKey (String key) { ! return updates.containsKey(key); ! } ! public Object getValue(String key) { ! return updates.get(key); ! } ! public String getText () { ! return (String) updates.get(TEXT); ! } } Index: PriceModel.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/model/PriceModel.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PriceModel.java 13 Dec 2009 16:39:48 -0000 1.8 --- PriceModel.java 31 Jan 2010 22:22:29 -0000 1.9 *************** *** 30,44 **** @Override ! public Object getUpdate() { ! if (stockPrice != null) { ! return new ViewUpdate(getText()) ! .addObject(ViewUpdate.BGCOLOUR, stockPrice.getColour()); ! } else { ! return getText(); ! } } @Override ! public String getText() { if (stockPrice != null) { return Bank.format(stockPrice.getPrice()) + " (" --- 30,44 ---- @Override ! public Object getUpdate() { ! if (stockPrice != null) { ! return new ViewUpdate(getText()) ! .addObject(ViewUpdate.BGCOLOUR, stockPrice.getColour()); ! } else { ! return getText(); ! } } @Override ! public String getText() { if (stockPrice != null) { return Bank.format(stockPrice.getPrice()) + " (" Index: ModelObject.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/model/ModelObject.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ModelObject.java 13 Dec 2009 16:39:48 -0000 1.8 --- ModelObject.java 31 Jan 2010 22:22:29 -0000 1.9 *************** *** 23,29 **** @Override ! public void addObserver (Observer o) { ! super.addObserver(o); ! notifyViewObjects(); } --- 23,29 ---- @Override ! public void addObserver (Observer o) { ! super.addObserver(o); ! notifyViewObjects(); } *************** *** 49,53 **** /** Default update is just text */ public Object getUpdate () { ! return getText(); } --- 49,53 ---- /** Default update is just text */ public Object getUpdate () { ! return getText(); } Index: BonusModel.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/model/BonusModel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BonusModel.java 26 Dec 2009 12:46:52 -0000 1.2 --- BonusModel.java 31 Jan 2010 22:22:29 -0000 1.3 *************** *** 16,20 **** } ! public void set(List<Bonus> bonuses) { this.bonuses = bonuses; --- 16,20 ---- } ! public void set(List<Bonus> bonuses) { this.bonuses = bonuses; *************** *** 23,40 **** @Override ! public String getText() { ! if (bonuses == null || bonuses.isEmpty()) return ""; ! StringBuffer b = new StringBuffer("<html><center>"); ! for (Bonus bonus : bonuses) { ! if (b.length() > 14) { ! b.append("<br>"); ! } ! b.append(bonus.getIdForView()).append("+").append(Bank.format(bonus.getValue())); ! } ! return b.toString(); } --- 23,40 ---- @Override ! public String getText() { ! if (bonuses == null || bonuses.isEmpty()) return ""; ! StringBuffer b = new StringBuffer("<html><center>"); ! for (Bonus bonus : bonuses) { ! if (b.length() > 14) { ! b.append("<br>"); ! } ! b.append(bonus.getIdForView()).append("+").append(Bank.format(bonus.getValue())); ! } ! return b.toString(); } Index: TrainsModel.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/model/TrainsModel.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TrainsModel.java 4 Nov 2009 20:33:22 -0000 1.7 --- TrainsModel.java 31 Jan 2010 22:22:29 -0000 1.8 *************** *** 16,20 **** @Override ! public String getText() { if (option == FULL_LIST) { return portfolio.makeFullListOfTrains(); --- 16,20 ---- @Override ! public String getText() { if (option == FULL_LIST) { return portfolio.makeFullListOfTrains(); |