Class DownloadSettings
- java.lang.Object
-
- org.openstreetmap.josm.gui.download.DownloadSettings
-
public final class DownloadSettings extends java.lang.Object
The global settings ofDownloadDialog
.This class is immutable
- Since:
- 12652
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
downloadAsNewLayer
private Bounds
downloadBounds
private Bounds
slippyMapBounds
private boolean
zoomToDownloadedData
-
Constructor Summary
Constructors Constructor Description DownloadSettings(Bounds bbox, Bounds slippyMapBounds, boolean downloadAsNewLayer, boolean zoomToDownloadedData)
Initializes a new instance ofDownloadSettings
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
asNewLayer()
Gets the flag defining if a new layer must be created for the downloaded data.java.util.Optional<Bounds>
getDownloadBounds()
Gets the download bounds that are requestedjava.util.Optional<Bounds>
getSlippyMapBounds()
Gets the slippy map boundsboolean
zoomToData()
Gets the flag defining if the map view must zoom to the downloaded data.
-
-
-
Field Detail
-
downloadBounds
private final Bounds downloadBounds
-
slippyMapBounds
private final Bounds slippyMapBounds
-
downloadAsNewLayer
private final boolean downloadAsNewLayer
-
zoomToDownloadedData
private final boolean zoomToDownloadedData
-
-
Constructor Detail
-
DownloadSettings
public DownloadSettings(Bounds bbox, Bounds slippyMapBounds, boolean downloadAsNewLayer, boolean zoomToDownloadedData)
Initializes a new instance ofDownloadSettings
.- Parameters:
bbox
- The bounding boxslippyMapBounds
- The bounds of theSlippyMapChooser
/SlippyMapBBoxChooser
downloadAsNewLayer
- The flag defining if a new layer must be created for the downloaded data.zoomToDownloadedData
- The flag defining if the map view, seeSlippyMapChooser
,
-
-
Method Detail
-
asNewLayer
public boolean asNewLayer()
Gets the flag defining if a new layer must be created for the downloaded data.- Returns:
true
if a new layer must be created,false
otherwise.
-
zoomToData
public boolean zoomToData()
Gets the flag defining if the map view must zoom to the downloaded data.- Returns:
true
if the view must zoom,false
otherwise.
-
getDownloadBounds
public java.util.Optional<Bounds> getDownloadBounds()
Gets the download bounds that are requested- Returns:
- The bounds or an empty
Optional
if no bounds are selected
-
getSlippyMapBounds
public java.util.Optional<Bounds> getSlippyMapBounds()
Gets the slippy map bounds- Returns:
- the slippy map bounds or an empty
Optional
if no slippy map was used to select the download bounds
-
-