Ignore:
Timestamp:
2010-01-27T21:58:17+01:00 (14 years ago)
Author:
jttt
Message:

Fixed #4436 Changing bbox resets zoom after search

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java

    r2836 r2898  
    99import java.awt.GridBagLayout;
    1010import java.awt.GridLayout;
    11 import java.awt.Insets;
    1211import java.awt.event.ActionEvent;
    1312import java.awt.event.MouseAdapter;
     
    8281        public String thirdcol;
    8382        public String fourthcol;
     83        @Override
    8484        public String toString() {
    8585            return name;
     
    103103        String s = Main.pref.get("namefinder.server", servers[0].name);
    104104        for(int i = 0; i < servers.length; ++i) {
    105             if(servers[i].name.equals(s))
     105            if(servers[i].name.equals(s)) {
    106106                server.setSelectedIndex(i);
     107            }
    107108        }
    108109        lpanel.add(new JLabel(tr("Enter a place name to search for:")));
     
    210211                    currentResult.name = atts.getValue("name");
    211212                    currentResult.info = atts.getValue("info");
    212                     if(currentResult.info != null)
     213                    if(currentResult.info != null) {
    213214                        currentResult.info = tr(currentResult.info);
     215                    }
    214216                    currentResult.lat = Double.parseDouble(atts.getValue("lat"));
    215217                    currentResult.lon = Double.parseDouble(atts.getValue("lon"));
     
    234236                    String[] bbox = atts.getValue("boundingbox").split(",");
    235237                    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])));
    238240                    data.add(currentResult);
    239241                }
     
    464466    class ListSelectionHandler implements ListSelectionListener {
    465467        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();
    472469            if (r != null) {
    473470                parent.boundingBoxChanged(r.getDownloadArea(), PlaceSelection.this);
     
    538535                break;
    539536            case 3:
    540                 if(sr.bounds != null)
     537                if(sr.bounds != null) {
    541538                    setText(sr.bounds.toShortString(new DecimalFormat("0.000")));
    542                 else
     539                } else {
    543540                    setText(sr.zoom != 0 ? Integer.toString(sr.zoom) : tr("unknown"));
     541                }
    544542                break;
    545543            }
Note: See TracChangeset for help on using the changeset viewer.