Changeset 18827 in osm for applications/editors/josm/plugins/lakewalker/src
- Timestamp:
- 2009-11-27T21:45:13+01:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/DoubleConfigurer.java
r13497 r18827 14 14 * 15 15 * You should have received a copy of the GNU Library General Public 16 * License along with this library; if not, copies are available 16 * License along with this library; if not, copies are available 17 17 * at http://www.opensource.org. 18 18 */ … … 24 24 public class DoubleConfigurer extends StringConfigurer { 25 25 26 public DoubleConfigurer() {27 super();28 }26 public DoubleConfigurer() { 27 super(); 28 } 29 29 30 public DoubleConfigurer(String key, String name) {31 this(key, name, new Double(0));32 }30 public DoubleConfigurer(String key, String name) { 31 this(key, name, new Double(0)); 32 } 33 33 34 public DoubleConfigurer(String key, String name, Double val) {35 super(key, name, val == null ? null : val.toString());36 }34 public DoubleConfigurer(String key, String name, Double val) { 35 super(key, name, val == null ? null : val.toString()); 36 } 37 37 38 public void setValue(String s) { 39 Double d = null; 40 try { 41 d = Double.valueOf(s); 38 public void setValue(String s) { 39 Double d = null; 40 try { 41 d = Double.valueOf(s); 42 } 43 catch (NumberFormatException e) { 44 d = null; 45 } 46 if (d != null) 47 setValue(d); 42 48 } 43 catch (NumberFormatException e) { 44 d = null; 49 50 public void setValue(Object o) { 51 if (!noUpdate && nameField != null && o != null) { 52 nameField.setText(o.toString()); 53 } 54 super.setValue(o); 45 55 } 46 if (d != null) { 47 setValue(d); 48 if (!noUpdate && nameField != null) { 49 nameField.setText(d.toString()); 50 } 56 57 public String getValueString() { 58 if (value == null || value.equals("")) { 59 return null; 60 } 61 return value.toString(); 51 62 } 52 }53 54 public String getValueString() {55 if (value == null || value.equals("")) {56 return null;57 }58 return value.toString();59 }60 63 } -
applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/IntConfigurer.java
r13497 r18827 39 39 } 40 40 41 public void setValue(String s) {42 Integer i = null;43 try {44 i = Integer.valueOf(s);45 }46 catch (NumberFormatException e) {47 i = null;48 }49 if (i != null) {50 setValue(i);51 }52 }53 54 41 public int getIntValue(int defaultValue) { 55 42 if (getValue() instanceof Integer) { -
applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerPreferences.java
r13497 r18827 92 92 landsatResConfig.setValue(Main.pref.getInteger(PREF_LANDSAT_RES, 4000)); 93 93 landsatSizeConfig.setValue(Main.pref.getInteger(PREF_LANDSAT_SIZE, 2000)); 94 System.out.println("set"); 94 95 eastOffsetConfig.setValue(Main.pref.getDouble(PREF_EAST_OFFSET, 0.0)); 95 96 northOffsetConfig.setValue(Main.pref.getDouble(PREF_NORTH_OFFSET, 0.0));
Note:
See TracChangeset
for help on using the changeset viewer.