Changeset 2898 in josm
- Timestamp:
- 2010-01-27T21:58:17+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java
r2836 r2898 9 9 import java.awt.GridBagLayout; 10 10 import java.awt.GridLayout; 11 import java.awt.Insets;12 11 import java.awt.event.ActionEvent; 13 12 import java.awt.event.MouseAdapter; … … 82 81 public String thirdcol; 83 82 public String fourthcol; 83 @Override 84 84 public String toString() { 85 85 return name; … … 103 103 String s = Main.pref.get("namefinder.server", servers[0].name); 104 104 for(int i = 0; i < servers.length; ++i) { 105 if(servers[i].name.equals(s)) 105 if(servers[i].name.equals(s)) { 106 106 server.setSelectedIndex(i); 107 } 107 108 } 108 109 lpanel.add(new JLabel(tr("Enter a place name to search for:"))); … … 210 211 currentResult.name = atts.getValue("name"); 211 212 currentResult.info = atts.getValue("info"); 212 if(currentResult.info != null) 213 if(currentResult.info != null) { 213 214 currentResult.info = tr(currentResult.info); 215 } 214 216 currentResult.lat = Double.parseDouble(atts.getValue("lat")); 215 217 currentResult.lon = Double.parseDouble(atts.getValue("lon")); … … 234 236 String[] bbox = atts.getValue("boundingbox").split(","); 235 237 currentResult.bounds = new Bounds( 236 new LatLon(Double.parseDouble(bbox[0]), Double.parseDouble(bbox[2])),237 new LatLon(Double.parseDouble(bbox[1]), Double.parseDouble(bbox[3])));238 new LatLon(Double.parseDouble(bbox[0]), Double.parseDouble(bbox[2])), 239 new LatLon(Double.parseDouble(bbox[1]), Double.parseDouble(bbox[3]))); 238 240 data.add(currentResult); 239 241 } … … 464 466 class ListSelectionHandler implements ListSelectionListener { 465 467 public void valueChanged(ListSelectionEvent lse) { 466 SearchResult r = null; 467 try { 468 r = (SearchResult) model.getValueAt(lse.getFirstIndex(), 0); 469 } catch (Exception x) { 470 // Ignore 471 } 468 SearchResult r = model.getSelectedSearchResult(); 472 469 if (r != null) { 473 470 parent.boundingBoxChanged(r.getDownloadArea(), PlaceSelection.this); … … 538 535 break; 539 536 case 3: 540 if(sr.bounds != null) 537 if(sr.bounds != null) { 541 538 setText(sr.bounds.toShortString(new DecimalFormat("0.000"))); 542 else539 } else { 543 540 setText(sr.zoom != 0 ? Integer.toString(sr.zoom) : tr("unknown")); 541 } 544 542 break; 545 543 }
Note:
See TracChangeset
for help on using the changeset viewer.