Class OSMDownloadSource
- java.lang.Object
-
- org.openstreetmap.josm.gui.download.OSMDownloadSource
-
- All Implemented Interfaces:
DownloadSource<List<IDownloadSourceType>>
public class OSMDownloadSource extends Object implements DownloadSource<List<IDownloadSourceType>>
Class defines the way data is fetched from the OSM server.- Since:
- 12652
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
OSMDownloadSource.GpsDataDownloadType
private static class
OSMDownloadSource.NotesDataDownloadType
private static class
OSMDownloadSource.OsmDataDownloadType
(package private) static class
OSMDownloadSource.OSMDownloadData
Encapsulates data that is required to download from the OSM server.static class
OSMDownloadSource.OSMDownloadSourcePanel
The GUI representation of the OSM download source.
-
Field Summary
Fields Modifier and Type Field Description (package private) static List<IDownloadSourceType>
DOWNLOAD_SOURCES
The possible methods to get datastatic String
SIMPLE_NAME
The simple name for theOSMDownloadSource.OSMDownloadSourcePanel
-
Constructor Summary
Constructors Constructor Description OSMDownloadSource()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
addDownloadType(IDownloadSourceType type)
Add a download type to the default JOSM download windowAbstractDownloadSourcePanel<List<IDownloadSourceType>>
createPanel(DownloadDialog dialog)
Creates a panel with GUI specific for the download source.void
doDownload(List<IDownloadSourceType> data, DownloadSettings settings)
Downloads the data.static <T extends IDownloadSourceType>
TgetDownloadType(Class<T> typeClazz)
Get the instance of a data download typestatic List<IDownloadSourceType>
getDownloadTypes()
Returns the possible downloads that JOSM can make in the default Download screen.String
getLabel()
Returns a string representation of this download source.boolean
onlyExpert()
Defines whether this download source should be visible only in the expert mode.static boolean
removeDownloadType(IDownloadSourceType type)
Removes a download source type.
-
-
-
Field Detail
-
SIMPLE_NAME
public static final String SIMPLE_NAME
The simple name for theOSMDownloadSource.OSMDownloadSourcePanel
- Since:
- 12706
- See Also:
- Constant Field Values
-
DOWNLOAD_SOURCES
static final List<IDownloadSourceType> DOWNLOAD_SOURCES
The possible methods to get data
-
-
Constructor Detail
-
OSMDownloadSource
public OSMDownloadSource()
-
-
Method Detail
-
createPanel
public AbstractDownloadSourcePanel<List<IDownloadSourceType>> createPanel(DownloadDialog dialog)
Description copied from interface:DownloadSource
Creates a panel with GUI specific for the download source.- Specified by:
createPanel
in interfaceDownloadSource<List<IDownloadSourceType>>
- Parameters:
dialog
- the parent download dialog, asDownloadDialog.getInstance()
might not be initialized yet- Returns:
- Returns
AbstractDownloadSourcePanel
.
-
doDownload
public void doDownload(List<IDownloadSourceType> data, DownloadSettings settings)
Description copied from interface:DownloadSource
Downloads the data.- Specified by:
doDownload
in interfaceDownloadSource<List<IDownloadSourceType>>
- Parameters:
data
- The required data for the download source.settings
- The global settings of the download dialog, seeDownloadDialog
.
-
getLabel
public String getLabel()
Description copied from interface:DownloadSource
Returns a string representation of this download source.- Specified by:
getLabel
in interfaceDownloadSource<List<IDownloadSourceType>>
- Returns:
- A string representation of this download source.
-
onlyExpert
public boolean onlyExpert()
Description copied from interface:DownloadSource
Defines whether this download source should be visible only in the expert mode.- Specified by:
onlyExpert
in interfaceDownloadSource<List<IDownloadSourceType>>
- Returns:
- Returns
true
if the download source should be visible only in the expert mode,false
otherwise.
-
getDownloadTypes
public static List<IDownloadSourceType> getDownloadTypes()
Returns the possible downloads that JOSM can make in the default Download screen.- Returns:
- The possible downloads that JOSM can make in the default Download screen
- Since:
- 16503
-
getDownloadType
public static <T extends IDownloadSourceType> T getDownloadType(Class<T> typeClazz)
Get the instance of a data download type- Type Parameters:
T
- The type to get- Parameters:
typeClazz
- The class of the type- Returns:
- The type instance
- Since:
- 16503
-
removeDownloadType
public static boolean removeDownloadType(IDownloadSourceType type)
Removes a download source type.- Parameters:
type
- The IDownloadSourceType object to remove- Returns:
true
if this download types contained the specified object- Since:
- 16503
-
addDownloadType
public static boolean addDownloadType(IDownloadSourceType type)
Add a download type to the default JOSM download window- Parameters:
type
- The initialized type to download- Returns:
true
(as specified byCollection.add(E)
), but it also returns false if the class already has an instance in the list- Since:
- 16503
-
-