source: josm/trunk/src/org/openstreetmap/josm/gui/download/DownloadSource.java@ 12652

Last change on this file since 12652 was 12652, checked in by michael2402, 7 years ago

Apply #15167: Merge OSM and overpass download dialog. Patch by bafonins

File size: 1.4 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.download;
3
4
5import org.openstreetmap.josm.data.Bounds;
6
7/**
8 * Defines an interface for different download sources.
9 * @param <T> The type of the data that a download source uses.
10 */
11public interface DownloadSource<T> {
12
13 /**
14 * Creates a panel with GUI specific for the download source.
15 * @return Returns {@link AbstractDownloadSourcePanel}.
16 */
17 AbstractDownloadSourcePanel<T> createPanel();
18
19 /**
20 * Downloads the data.
21 * @param bbox The bounding box. Can be null if no bounding box selected.
22 * @param data The required data for the download source.
23 * @param settings The global settings of the download dialog, see {@link DownloadDialog}.
24 */
25 void doDownload(Bounds bbox, T data, DownloadSettings settings);
26
27 /**
28 * Returns a string representation of this download source.
29 * @return A string representation of this download source.
30 */
31 String getLabel();
32
33 /**
34 * Add a download source to the dialog, see {@link DownloadDialog}.
35 * @param dialog The download dialog.
36 */
37 void addGui(DownloadDialog dialog);
38
39 /**
40 * Defines whether this download source should be visible only in the expert mode.
41 * @return Returns {@code true} if the download source should be visible only in the
42 * expert mode, {@code false} otherwise.
43 */
44 boolean onlyExpert();
45}
Note: See TracBrowser for help on using the repository browser.