class SaveLayerInfo extends java.lang.Object implements java.lang.Comparable<SaveLayerInfo>
Modifier and Type | Field and Description |
---|---|
private boolean |
doCheckSaveConditions |
private boolean |
doSaveToFile |
private boolean |
doUploadToServer |
private java.io.File |
file |
private OsmDataLayer |
layer
the osm data layer
|
private UploadOrSaveState |
saveState |
private UploadOrSaveState |
uploadState |
Constructor and Description |
---|
SaveLayerInfo(OsmDataLayer layer)
Constructs a new
SaveLayerInfo . |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(SaveLayerInfo o) |
java.io.File |
getFile()
Replies the file this layer should be saved to, if
isDoSaveToFile() is true |
OsmDataLayer |
getLayer()
Replies the layer this info objects holds information for
|
java.lang.String |
getName()
Replies the name of the layer
|
UploadOrSaveState |
getSaveState()
Replies the save state of
getLayer() . |
UploadOrSaveState |
getUploadState()
Replies the upload state of
getLayer() . |
boolean |
isDoCheckSaveConditions()
Replies true if preconditions should be checked before saving; false, otherwise
|
boolean |
isDoSaveAndUpload()
Replies true if this layer should be uploaded to the server and saved to file.
|
boolean |
isDoSaveToFile()
Replies true if this layer should be saved to a file; false, otherwise
|
boolean |
isDoUploadToServer()
Replies true if this layer should be uploaded to the server; false, otherwise
|
void |
resetUploadAndSaveState()
Resets the upload and save state
|
void |
setDoCheckSaveConditions(boolean doCheckSaveConditions)
Sets whether preconditions should be checked before saving
|
void |
setDoSaveToFile(boolean doSaveToFile)
Sets whether this layer should be saved to a file
|
void |
setDoUploadToServer(boolean doUploadToServer)
Sets whether this layer should be uploaded to a file
|
void |
setFile(java.io.File file)
Sets the file this layer should be saved to, if
isDoSaveToFile() is true |
void |
setSaveState(UploadOrSaveState saveState)
Sets the save state for
getLayer() |
void |
setUploadState(UploadOrSaveState uploadState)
Sets the upload state for
getLayer() |
private OsmDataLayer layer
private boolean doCheckSaveConditions
private boolean doSaveToFile
private boolean doUploadToServer
private java.io.File file
private UploadOrSaveState uploadState
private UploadOrSaveState saveState
public SaveLayerInfo(OsmDataLayer layer)
SaveLayerInfo
.layer
- the layer. Must not be null.java.lang.IllegalArgumentException
- thrown if layer is nullpublic OsmDataLayer getLayer()
public boolean isDoCheckSaveConditions()
public void setDoCheckSaveConditions(boolean doCheckSaveConditions)
doCheckSaveConditions
- true to check save preconditions; false, to skip checkingpublic boolean isDoSaveToFile()
public void setDoSaveToFile(boolean doSaveToFile)
doSaveToFile
- true to save; false, to skip savingpublic boolean isDoUploadToServer()
true
if this layer should be uploaded to the server; false
, otherwisepublic void setDoUploadToServer(boolean doUploadToServer)
doUploadToServer
- true
to upload; false
, to skip uploadingpublic boolean isDoSaveAndUpload()
public java.lang.String getName()
public java.io.File getFile()
isDoSaveToFile()
is trueisDoSaveToFile()
is truepublic void setFile(java.io.File file)
isDoSaveToFile()
is truefile
- the filepublic int compareTo(SaveLayerInfo o)
compareTo
in interface java.lang.Comparable<SaveLayerInfo>
public UploadOrSaveState getUploadState()
getLayer()
.
UploadOrSaveState.OK
if getLayer()
was successfully uploadedUploadOrSaveState.CANCELED
if uploading getLayer()
was canceledUploadOrSaveState.FAILED
if uploading getLayer()
has failedpublic void setUploadState(UploadOrSaveState uploadState)
getLayer()
uploadState
- the upload statepublic UploadOrSaveState getSaveState()
getLayer()
.
UploadOrSaveState.OK
if getLayer()
was successfully saved to fileUploadOrSaveState.CANCELED
if saving getLayer()
was canceledUploadOrSaveState.FAILED
if saving getLayer()
has failedpublic void setSaveState(UploadOrSaveState saveState)
getLayer()
saveState
- save the upload statepublic void resetUploadAndSaveState()