Changeset 2327 in josm for trunk/src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java
- Timestamp:
- 2009-10-27T01:21:32+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java
r2142 r2327 9 9 import java.awt.event.FocusEvent; 10 10 import java.awt.event.FocusListener; 11 import java.awt.event.KeyEvent;12 import java.awt.event.KeyListener;13 11 14 12 import javax.swing.JLabel; … … 56 54 double maxlat = Double.parseDouble(latlon[2].getText()); 57 55 double maxlon = Double.parseDouble(latlon[3].getText()); 58 if (minlat != gui.minlat || minlon != gui.minlon || maxlat != gui.maxlat || maxlon != gui.maxlon) {59 gui.minlat = minlat; gui.minlon = minlon;60 gui.maxlat = maxlat; gui.maxlon = maxlon;61 gui.boundingBoxChanged( BoundingBoxSelection.this);56 Bounds b = new Bounds(minlat,minlon, maxlat,maxlon); 57 if (gui.getSelectedDownloadArea() == null) return; 58 if (gui.getSelectedDownloadArea() == null || !gui.getSelectedDownloadArea().equals(new Bounds(minlat,minlon, maxlat,maxlon))) { 59 gui.boundingBoxChanged(b, BoundingBoxSelection.this); 62 60 } 63 61 } catch (NumberFormatException x) { … … 119 117 }); 120 118 121 gui. tabpane.addTab(tr("Bounding Box"), dlg);119 gui.addDownloadAreaSelector(dlg, tr("Bounding Box")); 122 120 } 123 121 … … 132 130 private boolean parseURL(DownloadDialog gui) { 133 131 Bounds b = OsmUrlToBounds.parse(osmUrl.getText()); 134 if(b == null) return false; 135 gui.minlon = b.min.lon(); 136 gui.minlat = b.min.lat(); 137 gui.maxlon = b.max.lon(); 138 gui.maxlat = b.max.lat(); 139 gui.boundingBoxChanged(BoundingBoxSelection.this); 132 if(b == null) return false; 133 gui.boundingBoxChanged(b,BoundingBoxSelection.this); 140 134 updateBboxFields(gui); 141 135 updateUrl(gui); … … 144 138 145 139 private void updateBboxFields(DownloadDialog gui) { 146 latlon[0].setText(Double.toString(gui.minlat)); 147 latlon[1].setText(Double.toString(gui.minlon)); 148 latlon[2].setText(Double.toString(gui.maxlat)); 149 latlon[3].setText(Double.toString(gui.maxlon)); 140 Bounds b = gui.getSelectedDownloadArea(); 141 if (b == null) return; 142 latlon[0].setText(Double.toString(b.getMin().lat())); 143 latlon[1].setText(Double.toString(b.getMin().lon())); 144 latlon[2].setText(Double.toString(b.getMax().lat())); 145 latlon[3].setText(Double.toString(b.getMax().lon())); 150 146 for (JTextField f : latlon) { 151 147 f.setCaretPosition(0); … … 154 150 155 151 private void updateUrl(DownloadDialog gui) { 156 showUrl.setText(OsmUrlToBounds.getURL(new Bounds(157 new LatLon(gui.minlat, gui.minlon), new LatLon(gui.maxlat, gui.maxlon))));152 if (gui.getSelectedDownloadArea() == null) return; 153 showUrl.setText(OsmUrlToBounds.getURL(gui.getSelectedDownloadArea())); 158 154 } 159 155 }
Note:
See TracChangeset
for help on using the changeset viewer.