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 booleandownloadAsNewLayerprivate BoundsdownloadBoundsprivate BoundsslippyMapBoundsprivate booleanzoomToDownloadedData
-
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 booleanasNewLayer()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 boundsbooleanzoomToData()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/SlippyMapBBoxChooserdownloadAsNewLayer- 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:
trueif a new layer must be created,falseotherwise.
-
zoomToData
public boolean zoomToData()
Gets the flag defining if the map view must zoom to the downloaded data.- Returns:
trueif the view must zoom,falseotherwise.
-
getDownloadBounds
public java.util.Optional<Bounds> getDownloadBounds()
Gets the download bounds that are requested- Returns:
- The bounds or an empty
Optionalif no bounds are selected
-
getSlippyMapBounds
public java.util.Optional<Bounds> getSlippyMapBounds()
Gets the slippy map bounds- Returns:
- the slippy map bounds or an empty
Optionalif no slippy map was used to select the download bounds
-
-