Changeset 12900 in josm for trunk/src/org/openstreetmap/josm
- Timestamp:
- 2017-09-26T01:19:15+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/download
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java
r12878 r12900 388 388 } 389 389 390 downloadSourcesTab.getAllPanels().forEach(AbstractDownloadSourcePanel::restoreSettings); 390 391 downloadSourcesTab.setSelected(DOWNLOAD_SOURCE_TAB.get()); 391 392 … … 486 487 */ 487 488 protected <T> void addNewDownloadSourceTab(DownloadSource<T> downloadSource) { 488 downloadSourcesTab.addPanel(downloadSource.createPanel( ));489 downloadSourcesTab.addPanel(downloadSource.createPanel(this)); 489 490 } 490 491 … … 586 587 * @since 12706 587 588 */ 588 private staticclass DownloadSourceTabs extends JTabbedPane implements DownloadSourceListener {589 private class DownloadSourceTabs extends JTabbedPane implements DownloadSourceListener { 589 590 private final List<AbstractDownloadSourcePanel<?>> allPanels = new ArrayList<>(); 590 591 … … 645 646 @Override 646 647 public void downloadSourceAdded(DownloadSource<?> source) { 647 addPanel(source.createPanel( ));648 addPanel(source.createPanel(DownloadDialog.this)); 648 649 } 649 650 } -
trunk/src/org/openstreetmap/josm/gui/download/DownloadSource.java
r12684 r12900 13 13 /** 14 14 * Creates a panel with GUI specific for the download source. 15 * @param dialog the parent download dialog, as {@code DownloadDialog.getInstance()} might not be initialized yet 15 16 * @return Returns {@link AbstractDownloadSourcePanel}. 17 * @since 12900 16 18 */ 17 AbstractDownloadSourcePanel<T> createPanel( );19 AbstractDownloadSourcePanel<T> createPanel(DownloadDialog dialog); 18 20 19 21 /** -
trunk/src/org/openstreetmap/josm/gui/download/OSMDownloadSource.java
r12846 r12900 49 49 50 50 @Override 51 public AbstractDownloadSourcePanel<OSMDownloadData> createPanel( ) {52 return new OSMDownloadSourcePanel(this );51 public AbstractDownloadSourcePanel<OSMDownloadData> createPanel(DownloadDialog dialog) { 52 return new OSMDownloadSourcePanel(this, dialog); 53 53 } 54 54 … … 145 145 /** 146 146 * Creates a new {@link OSMDownloadSourcePanel}. 147 * @param dialog the parent download dialog, as {@code DownloadDialog.getInstance()} might not be initialized yet 147 148 * @param ds The osm download source the panel is for. 149 * @since 12900 148 150 */ 149 public OSMDownloadSourcePanel(OSMDownloadSource ds ) {151 public OSMDownloadSourcePanel(OSMDownloadSource ds, DownloadDialog dialog) { 150 152 super(ds); 151 153 setLayout(new GridBagLayout()); … … 153 155 // size check depends on selected data source 154 156 final ChangeListener checkboxChangeListener = e -> 155 DownloadDialog.getInstance().getSelectedDownloadArea().ifPresent(this::updateSizeCheck);157 dialog.getSelectedDownloadArea().ifPresent(this::updateSizeCheck); 156 158 157 159 // adding the download tasks -
trunk/src/org/openstreetmap/josm/gui/download/OverpassDownloadSource.java
r12880 r12900 48 48 49 49 @Override 50 public AbstractDownloadSourcePanel<OverpassDownloadData> createPanel( ) {50 public AbstractDownloadSourcePanel<OverpassDownloadData> createPanel(DownloadDialog dialog) { 51 51 return new OverpassDownloadSourcePanel(this); 52 52 }
Note:
See TracChangeset
for help on using the changeset viewer.