[12652] | 1 | // License: GPL. For details, see LICENSE file.
|
---|
| 2 | package org.openstreetmap.josm.gui.download;
|
---|
| 3 |
|
---|
| 4 | /**
|
---|
| 5 | * The global settings of {@link DownloadDialog}.
|
---|
| 6 | */
|
---|
| 7 | public final class DownloadSettings {
|
---|
| 8 |
|
---|
| 9 | private boolean downloadAsNewLayer;
|
---|
| 10 | private boolean zoomToDownloadedData;
|
---|
| 11 |
|
---|
| 12 | /**
|
---|
| 13 | * Initializes a new instance of {@code DownloadSettings}.
|
---|
| 14 | * @param downloadAsNewLayer The flag defining if a new layer must be created for the downloaded data.
|
---|
| 15 | * @param zoomToDownloadedData The flag defining if the map view, see {@link SlippyMapChooser},
|
---|
| 16 | * must zoom to the downloaded data.
|
---|
| 17 | */
|
---|
| 18 | public DownloadSettings(boolean downloadAsNewLayer, boolean zoomToDownloadedData) {
|
---|
| 19 | this.downloadAsNewLayer = downloadAsNewLayer;
|
---|
| 20 | this.zoomToDownloadedData = zoomToDownloadedData;
|
---|
| 21 | }
|
---|
| 22 |
|
---|
| 23 | /**
|
---|
| 24 | * Gets the flag defining if a new layer must be created for the downloaded data.
|
---|
| 25 | * @return {@code true} if a new layer must be created, {@code false} otherwise.
|
---|
| 26 | */
|
---|
| 27 | public boolean asNewLayer() {
|
---|
| 28 | return this.downloadAsNewLayer;
|
---|
| 29 | }
|
---|
| 30 |
|
---|
| 31 | /**
|
---|
| 32 | * Gets the flag defining if the map view must zoom to the downloaded data.
|
---|
| 33 | * @return {@code true} if the view must zoom, {@code false} otherwise.
|
---|
| 34 | */
|
---|
| 35 | public boolean zoomToData() {
|
---|
| 36 | return this.zoomToDownloadedData;
|
---|
| 37 | }
|
---|
| 38 | }
|
---|