From: Dan B. <dan...@us...> - 2008-12-29 08:01:38
|
Update of /cvsroot/jmri/jmri/jmrit/operations/rollingstock In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24345/src/jmri/jmrit/operations/rollingstock Modified Files: RollingStock.java Log Message: Parameterize to eliminate java 1.5 warnings and some clean up Index: RollingStock.java =================================================================== RCS file: /cvsroot/jmri/jmri/jmrit/operations/rollingstock/RollingStock.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** RollingStock.java 28 Dec 2008 21:34:54 -0000 1.7 --- RollingStock.java 29 Dec 2008 08:01:34 -0000 1.8 *************** *** 160,172 **** if (!_weightTons.equals("")) return _weightTons; ! else { ! double weight = 0; ! try{ ! weight = Double.parseDouble(getWeight()); ! }catch (Exception e){ ! // log.debug("Weight not set for rolling stock ("+getId()+")"); ! } ! return Integer.toString((int)(weight*Setup.getScaleTonRatio())); } } --- 160,171 ---- if (!_weightTons.equals("")) return _weightTons; ! ! double weight = 0; ! try{ ! weight = Double.parseDouble(getWeight()); ! }catch (Exception e){ ! // log.debug("Weight not set for rolling stock ("+getId()+")"); } + return Integer.toString((int)(weight*Setup.getScaleTonRatio())); } *************** *** 193,198 **** if (_location != null) return _location.getName(); ! else ! return ""; } --- 192,196 ---- if (_location != null) return _location.getName(); ! return ""; } *************** *** 204,209 **** if (_location != null) return _location.getId(); ! else ! return ""; } --- 202,206 ---- if (_location != null) return _location.getId(); ! return ""; } *************** *** 219,224 **** if (_trackLocation != null) return _trackLocation.getName(); ! else ! return ""; } --- 216,220 ---- if (_trackLocation != null) return _trackLocation.getName(); ! return ""; } *************** *** 230,235 **** if (_trackLocation != null) return _trackLocation.getId(); ! else ! return ""; } --- 226,230 ---- if (_trackLocation != null) return _trackLocation.getId(); ! return ""; } *************** *** 420,425 **** if (_destination != null) return _destination.getName(); ! else ! return ""; } --- 415,419 ---- if (_destination != null) return _destination.getName(); ! return ""; } *************** *** 427,432 **** if (_destination != null) return _destination.getId(); ! else ! return ""; } --- 421,425 ---- if (_destination != null) return _destination.getId(); ! return ""; } *************** *** 438,443 **** if (_trackDestination != null) return _trackDestination.getName(); ! else ! return ""; } --- 431,435 ---- if (_trackDestination != null) return _trackDestination.getName(); ! return ""; } *************** *** 445,450 **** if (_trackDestination != null) return _trackDestination.getId(); ! else ! return ""; } --- 437,441 ---- if (_trackDestination != null) return _trackDestination.getId(); ! return ""; } *************** *** 492,497 **** if(_routeLocation != null) return _routeLocation.getId(); ! else ! return ""; } --- 483,487 ---- if(_routeLocation != null) return _routeLocation.getId(); ! return ""; } *************** *** 517,522 **** if(_routeDestination != null) return _routeDestination.getId(); ! else ! return ""; } --- 507,511 ---- if(_routeDestination != null) return _routeDestination.getId(); ! return ""; } |