Changeset 12574 in josm for trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java
- Timestamp:
- 2017-08-06T20:13:06+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java
r12523 r12574 20 20 import java.util.ArrayList; 21 21 import java.util.List; 22 import java.util.Optional; 22 23 23 24 import javax.swing.AbstractAction; … … 458 459 459 460 /** 460 * Replies the currently selected download area. 461 * @return the currently selected download area. May be {@code null}, if no download area is selected yet. 462 */ 463 public Bounds getSelectedDownloadArea() { 464 return currentBounds; 461 * Returns an {@link Optional} of the currently selected download area. 462 * @return An {@link Optional} of the currently selected download area. 463 * @since 12574 Return type changed to optional 464 */ 465 public Optional<Bounds> getSelectedDownloadArea() { 466 return Optional.ofNullable(currentBounds); 465 467 } 466 468 … … 525 527 526 528 public void run() { 527 if (currentBounds == null) { 528 JOptionPane.showMessageDialog( 529 DownloadDialog.this, 530 tr("Please select a download area first."), 531 tr("Error"), 532 JOptionPane.ERROR_MESSAGE 533 ); 534 return; 535 } 529 /* 530 * Checks if the user selected the type of data to download. At least one the following 531 * must be chosen : raw osm data, gpx data, notes. 532 * If none of those are selected, then the corresponding dialog is shown to inform the user. 533 */ 536 534 if (!isDownloadOsmData() && !isDownloadGpxData() && !isDownloadNotes()) { 537 535 JOptionPane.showMessageDialog( 538 536 DownloadDialog.this, 539 537 tr("<html>Neither <strong>{0}</strong> nor <strong>{1}</strong> nor <strong>{2}</strong> is enabled.<br>" 540 + "Please choose to either download OSM data, or GPX data, or Notes, or all.</html>",538 + "Please choose to either download OSM data, or GPX data, or Notes, or all.</html>", 541 539 cbDownloadOsmData.getText(), 542 540 cbDownloadGpxData.getText(), … … 548 546 return; 549 547 } 548 550 549 setCanceled(false); 551 550 setVisible(false);
Note:
See TracChangeset
for help on using the changeset viewer.