Changeset 670 in josm for trunk


Ignore:
Timestamp:
2008-06-30T20:16:11+02:00 (16 years ago)
Author:
framm
Message:
  • patch to fix the unnecessary refresh of download dialog values. fixes #969. patch submitted by Dirk Stoecker <openstreetmap@…>.
File:
1 edited

Legend:

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

    r659 r670  
    4141                        new JTextField(11) };
    4242        final JTextArea osmUrl = new JTextArea();
     43        String oldUrl;
    4344       
    4445        final JLabel sizeCheck = new JLabel();
     
    8283                        public void removeUpdate(DocumentEvent e) { dowork(); }
    8384                        private void dowork() {
    84                                 Bounds b = osmurl2bounds(osmUrl.getText());
    85                                 if (b != null) {
    86                                         gui.minlon = b.min.lon();
    87                                         gui.minlat = b.min.lat();
    88                                         gui.maxlon = b.max.lon();
    89                                         gui.maxlat = b.max.lat();
    90                                         gui.boundingBoxChanged(BoundingBoxSelection.this);
    91                                         updateBboxFields(gui);
    92                                         updateSizeCheck(gui);
     85                                if(!oldUrl.equals(osmUrl.getText()))
     86                                {
     87                                        Bounds b = osmurl2bounds(osmUrl.getText());
     88                                        if (b != null) {
     89                                                gui.minlon = b.min.lon();
     90                                                gui.minlat = b.min.lat();
     91                                                gui.maxlon = b.max.lon();
     92                                                gui.maxlat = b.max.lat();
     93                                                gui.boundingBoxChanged(BoundingBoxSelection.this);
     94                                                updateBboxFields(gui);
     95                                                updateSizeCheck(gui);
     96                                        }
    9397                                }
    9498                        }
     
    163167                        zoom++;
    164168                }
    165                 osmUrl.setText("http://www.openstreetmap.org/index.html?mlat="+lat+"&mlon="+lon+"&zoom="+zoom);
     169                // setting old URL prevents refresh based on this URL
     170                oldUrl = "http://www.openstreetmap.org/index.html?mlat="+lat+"&mlon="+lon+"&zoom="+zoom;
     171                osmUrl.setText(oldUrl);
    166172        }
    167173       
Note: See TracChangeset for help on using the changeset viewer.