Changeset 12654 in josm
- Timestamp:
- 2017-08-26T00:08:24+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/download
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/download/AbstractDownloadSourcePanel.java
r12652 r12654 2 2 package org.openstreetmap.josm.gui.download; 3 3 4 import org.openstreetmap.josm.data.Bounds;4 import java.util.Objects; 5 5 6 6 import javax.swing.Icon; 7 7 import javax.swing.JPanel; 8 import java.util.Objects; 8 9 import org.openstreetmap.josm.data.Bounds; 9 10 10 11 /** … … 83 84 // override this if the panel must react on bbox changes 84 85 } 86 87 /** 88 * Tells the {@link DownloadSource} to start downloading 89 * @param currentBounds The bounds to download for 90 * @param downloadSettings The remaining download settings 91 */ 92 public void triggerDownload(Bounds currentBounds, DownloadSettings downloadSettings) { 93 getDownloadSource().doDownload(currentBounds, getData(), downloadSettings); 94 } 85 95 } -
trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java
r12653 r12654 84 84 } 85 85 86 protected final transient List<DownloadSource > downloadSources = new ArrayList<>();86 protected final transient List<DownloadSource<?>> downloadSources = new ArrayList<>(); 87 87 protected final transient List<DownloadSelection> downloadSelections = new ArrayList<>(); 88 88 protected final JTabbedPane tpDownloadAreaSelectors = new JTabbedPane(); … … 273 273 for (Component ds : downloadSourcesTab.getComponents()) { 274 274 if (ds instanceof AbstractDownloadSourcePanel) { 275 ((AbstractDownloadSourcePanel ) ds).boudingBoxChanged(b);275 ((AbstractDownloadSourcePanel<?>) ds).boudingBoxChanged(b); 276 276 } 277 277 } … … 379 379 tpDownloadAreaSelectors.setSelectedIndex(DOWNLOAD_TAB.get()); 380 380 } catch (IndexOutOfBoundsException e) { 381 Main.trace(e);381 Logging.trace(e); 382 382 tpDownloadAreaSelectors.setSelectedIndex(0); 383 383 } … … 386 386 downloadSourcesTab.setSelectedIndex(DOWNLOAD_SOURCE_TAB.get()); 387 387 } catch (IndexOutOfBoundsException e) { 388 Main.trace(e);388 Logging.trace(e); 389 389 downloadSourcesTab.setSelectedIndex(0); 390 390 } … … 485 485 * @return The index of the download source, or -1 if it not in the pane. 486 486 */ 487 protected int getDownloadSourceIndex(DownloadSource downloadSource) {487 protected int getDownloadSourceIndex(DownloadSource<?> downloadSource) { 488 488 return Arrays.stream(downloadSourcesTab.getComponents()) 489 489 .filter(it -> it instanceof AbstractDownloadSourcePanel) 490 .map(it -> (AbstractDownloadSourcePanel ) it)490 .map(it -> (AbstractDownloadSourcePanel<?>) it) 491 491 .filter(it -> it.getDownloadSource().equals(downloadSource)) 492 492 .findAny() … … 528 528 .mapToObj(downloadSourcesTab::getComponentAt) 529 529 .filter(it -> it instanceof AbstractDownloadSourcePanel) 530 .map(it -> (AbstractDownloadSourcePanel ) it)530 .map(it -> (AbstractDownloadSourcePanel<?>) it) 531 531 .filter(it -> it.getDownloadSource().onlyExpert()) 532 532 .forEach(downloadSourcesTab::remove); … … 552 552 @Override 553 553 public void actionPerformed(ActionEvent e) { 554 AbstractDownloadSourcePanel pnl = (AbstractDownloadSourcePanel) downloadSourcesTab.getSelectedComponent();554 AbstractDownloadSourcePanel<?> pnl = (AbstractDownloadSourcePanel<?>) downloadSourcesTab.getSelectedComponent(); 555 555 run(); 556 556 pnl.checkCancel(); … … 572 572 Component panel = downloadSourcesTab.getSelectedComponent(); 573 573 if (panel instanceof AbstractDownloadSourcePanel) { 574 AbstractDownloadSourcePanel pnl = (AbstractDownloadSourcePanel) panel;574 AbstractDownloadSourcePanel<?> pnl = (AbstractDownloadSourcePanel<?>) panel; 575 575 DownloadSettings downloadSettings = getDownloadSettings(); 576 576 if (pnl.checkDownload(currentBounds, downloadSettings)) { … … 578 578 setCanceled(false); 579 579 setVisible(false); 580 pnl. getDownloadSource().doDownload(currentBounds, pnl.getData(), downloadSettings);580 pnl.triggerDownload(currentBounds, downloadSettings); 581 581 } 582 582 }
Note:
See TracChangeset
for help on using the changeset viewer.