Class OSMDownloadSource
- java.lang.Object
-
- org.openstreetmap.josm.gui.download.OSMDownloadSource
-
- All Implemented Interfaces:
DownloadSource<java.util.List<IDownloadSourceType>>
public class OSMDownloadSource extends java.lang.Object implements DownloadSource<java.util.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 classOSMDownloadSource.GpsDataDownloadTypeprivate static classOSMDownloadSource.NotesDataDownloadTypeprivate static classOSMDownloadSource.OsmDataDownloadTypestatic classOSMDownloadSource.OSMDownloadSourcePanelThe GUI representation of the OSM download source.
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.util.List<IDownloadSourceType>DOWNLOAD_SOURCESThe possible methods to get datastatic java.lang.StringSIMPLE_NAMEThe 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 booleanaddDownloadType(IDownloadSourceType type)Add a download type to the default JOSM download windowAbstractDownloadSourcePanel<java.util.List<IDownloadSourceType>>createPanel(DownloadDialog dialog)Creates a panel with GUI specific for the download source.voiddoDownload(java.util.List<IDownloadSourceType> data, DownloadSettings settings)Downloads the data.static <T extends IDownloadSourceType>
TgetDownloadType(java.lang.Class<T> typeClazz)Get the instance of a data download typestatic java.util.List<IDownloadSourceType>getDownloadTypes()Returns the possible downloads that JOSM can make in the default Download screen.java.lang.StringgetLabel()Returns a string representation of this download source.booleanonlyExpert()Defines whether this download source should be visible only in the expert mode.static booleanremoveDownloadType(IDownloadSourceType type)Removes a download source type.
-
-
-
Field Detail
-
SIMPLE_NAME
public static final java.lang.String SIMPLE_NAME
The simple name for theOSMDownloadSource.OSMDownloadSourcePanel- Since:
- 12706
- See Also:
- Constant Field Values
-
DOWNLOAD_SOURCES
static final java.util.List<IDownloadSourceType> DOWNLOAD_SOURCES
The possible methods to get data
-
-
Constructor Detail
-
OSMDownloadSource
public OSMDownloadSource()
-
-
Method Detail
-
createPanel
public AbstractDownloadSourcePanel<java.util.List<IDownloadSourceType>> createPanel(DownloadDialog dialog)
Description copied from interface:DownloadSourceCreates a panel with GUI specific for the download source.- Specified by:
createPanelin interfaceDownloadSource<java.util.List<IDownloadSourceType>>- Parameters:
dialog- the parent download dialog, asDownloadDialog.getInstance()might not be initialized yet- Returns:
- Returns
AbstractDownloadSourcePanel.
-
doDownload
public void doDownload(java.util.List<IDownloadSourceType> data, DownloadSettings settings)
Description copied from interface:DownloadSourceDownloads the data.- Specified by:
doDownloadin interfaceDownloadSource<java.util.List<IDownloadSourceType>>- Parameters:
data- The required data for the download source.settings- The global settings of the download dialog, seeDownloadDialog.
-
getLabel
public java.lang.String getLabel()
Description copied from interface:DownloadSourceReturns a string representation of this download source.- Specified by:
getLabelin interfaceDownloadSource<java.util.List<IDownloadSourceType>>- Returns:
- A string representation of this download source.
-
onlyExpert
public boolean onlyExpert()
Description copied from interface:DownloadSourceDefines whether this download source should be visible only in the expert mode.- Specified by:
onlyExpertin interfaceDownloadSource<java.util.List<IDownloadSourceType>>- Returns:
- Returns
trueif the download source should be visible only in the expert mode,falseotherwise.
-
getDownloadTypes
public static java.util.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(java.lang.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:
trueif 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
-
-