Changeset 8215 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2015-04-18T11:08:07+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java
r8126 r8215 31 31 import javax.swing.JTabbedPane; 32 32 import javax.swing.KeyStroke; 33 import javax.swing.event.ChangeEvent; 34 import javax.swing.event.ChangeListener; 33 35 34 36 import org.openstreetmap.josm.Main; … … 92 94 pnl.setLayout(new GridBagLayout()); 93 95 96 final ChangeListener checkboxChangeListener = new ChangeListener() { 97 @Override 98 public void stateChanged(ChangeEvent e) { 99 // size check depends on selected data source 100 updateSizeCheck(); 101 } 102 }; 103 94 104 // adding the download tasks 95 105 pnl.add(new JLabel(tr("Data Sources and Types:")), GBC.std().insets(5,5,1,5)); 96 106 cbDownloadOsmData = new JCheckBox(tr("OpenStreetMap data"), true); 97 107 cbDownloadOsmData.setToolTipText(tr("Select to download OSM data in the selected download area.")); 98 pnl.add(cbDownloadOsmData, GBC.std().insets(1,5,1,5)); 108 cbDownloadOsmData.getModel().addChangeListener(checkboxChangeListener); 109 pnl.add(cbDownloadOsmData, GBC.std().insets(1, 5, 1, 5)); 99 110 cbDownloadGpxData = new JCheckBox(tr("Raw GPS data")); 100 111 cbDownloadGpxData.setToolTipText(tr("Select to download GPS traces in the selected download area.")); 101 pnl.add(cbDownloadGpxData, GBC.std().insets(5,5,1,5)); 112 cbDownloadGpxData.getModel().addChangeListener(checkboxChangeListener); 113 pnl.add(cbDownloadGpxData, GBC.std().insets(5, 5, 1, 5)); 102 114 cbDownloadNotes = new JCheckBox(tr("Notes")); 103 115 cbDownloadNotes.setToolTipText(tr("Select to download notes in the selected download area.")); 116 cbDownloadNotes.getModel().addChangeListener(checkboxChangeListener); 104 117 pnl.add(cbDownloadNotes, GBC.eol().insets(50, 5, 1, 5)); 105 118 … … 231 244 232 245 private void updateSizeCheck() { 246 boolean isAreaTooLarge = false; 233 247 if (currentBounds == null) { 234 248 sizeCheck.setText(tr("No area selected yet")); 235 249 sizeCheck.setForeground(Color.darkGray); 236 } else if (currentBounds.getArea() > Main.pref.getDouble("osm-server.max-request-area", 0.25)) { 250 } else if (isDownloadNotes() && !isDownloadOsmData() && !isDownloadGpxData()) { 251 // see max_note_request_area in https://github.com/openstreetmap/openstreetmap-website/blob/master/config/example.application.yml 252 isAreaTooLarge = currentBounds.getArea() > Main.pref.getDouble("osm-server.max-request-area-notes", 25); 253 } else { 254 // see max_request_area in https://github.com/openstreetmap/openstreetmap-website/blob/master/config/example.application.yml 255 isAreaTooLarge = currentBounds.getArea() > Main.pref.getDouble("osm-server.max-request-area", 0.25); 256 } 257 if (isAreaTooLarge) { 237 258 sizeCheck.setText(tr("Download area too large; will probably be rejected by server")); 238 259 sizeCheck.setForeground(Color.red);
Note:
See TracChangeset
for help on using the changeset viewer.