Package org.openstreetmap.josm.gui.io
Class SaveLayerInfo
java.lang.Object
org.openstreetmap.josm.gui.io.SaveLayerInfo
- All Implemented Interfaces:
Comparable<SaveLayerInfo>
SaveLayerInfo represents the information, user preferences and save/upload states of
a layer which might be uploaded/saved.
- Since:
- 2025
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanprivate booleanprivate Fileprivate final AbstractModifiableLayerthe modifiable layerprivate UploadOrSaveStateprivate UploadOrSaveState -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newSaveLayerInfo. -
Method Summary
Modifier and TypeMethodDescriptionintgetFile()Replies the file this layer should be saved to, ifisDoSaveToFile()is truegetLayer()Replies the layer this info objects holds information forgetName()Replies the name of the layerReplies the save state ofgetLayer().Replies the upload state ofgetLayer().booleanReplies true if preconditions should be checked before saving; false, otherwisebooleanReplies true if this layer should be uploaded to the server and saved to file.booleanReplies true if this layer should be saved to a file; false, otherwisebooleanReplies true if this layer should be uploaded to the server; false, otherwisebooleanReplies true if the layer can be saved to a filebooleanReplies true if the layer can be uploaded to a servervoidResets the upload and save statevoidsetDoCheckSaveConditions(boolean doCheckSaveConditions) Sets whether preconditions should be checked before savingvoidsetDoSaveToFile(boolean doSaveToFile) Sets whether this layer should be saved to a filevoidsetDoUploadToServer(boolean doUploadToServer) Sets whether this layer should be uploaded to a servervoidSets the file this layer should be saved to, ifisDoSaveToFile()is truevoidsetSaveState(UploadOrSaveState saveState) Sets the save state forgetLayer()voidsetUploadState(UploadOrSaveState uploadState) Sets the upload state forgetLayer()
-
Field Details
-
layer
the modifiable layer -
doCheckSaveConditions
-
doSaveToFile
-
doUploadToServer
-
file
-
uploadState
-
saveState
-
-
Constructor Details
-
SaveLayerInfo
Constructs a newSaveLayerInfo.- Parameters:
layer- the layer. Must not be null.- Throws:
IllegalArgumentException- if layer is null
-
-
Method Details
-
getLayer
Replies the layer this info objects holds information for- Returns:
- the layer this info objects holds information for
-
isSavable
Replies true if the layer can be saved to a file- Returns:
trueif the layer can be saved to a file;falseotherwise
-
isUploadable
Replies true if the layer can be uploaded to a server- Returns:
trueif the layer can be uploaded to a server;falseotherwise
-
isDoCheckSaveConditions
Replies true if preconditions should be checked before saving; false, otherwise- Returns:
- true if preconditions should be checked before saving; false, otherwise
- Since:
- 7204
-
setDoCheckSaveConditions
Sets whether preconditions should be checked before saving- Parameters:
doCheckSaveConditions- true to check save preconditions; false, to skip checking- Since:
- 7204
-
isDoSaveToFile
Replies true if this layer should be saved to a file; false, otherwise- Returns:
- true if this layers should be saved to a file; false, otherwise
-
setDoSaveToFile
Sets whether this layer should be saved to a file- Parameters:
doSaveToFile- true to save; false, to skip saving
-
isDoUploadToServer
Replies true if this layer should be uploaded to the server; false, otherwise- Returns:
trueif this layer should be uploaded to the server;false, otherwise
-
setDoUploadToServer
Sets whether this layer should be uploaded to a server- Parameters:
doUploadToServer-trueto upload;false, to skip uploading
-
isDoSaveAndUpload
Replies true if this layer should be uploaded to the server and saved to file.- Returns:
- true if this layer should be uploaded to the server and saved to file
-
getName
Replies the name of the layer- Returns:
- the name of the layer
-
getFile
Replies the file this layer should be saved to, ifisDoSaveToFile()is true- Returns:
- the file this layer should be saved to, if
isDoSaveToFile()is true
-
setFile
Sets the file this layer should be saved to, ifisDoSaveToFile()is true- Parameters:
file- the file
-
compareTo
- Specified by:
compareToin interfaceComparable<SaveLayerInfo>
-
getUploadState
Replies the upload state ofgetLayer().UploadOrSaveState.OKifgetLayer()was successfully uploadedUploadOrSaveState.CANCELEDif uploadinggetLayer()was canceledUploadOrSaveState.FAILEDif uploadinggetLayer()has failed
- Returns:
- the upload state
-
setUploadState
Sets the upload state forgetLayer()- Parameters:
uploadState- the upload state
-
getSaveState
Replies the save state ofgetLayer().UploadOrSaveState.OKifgetLayer()was successfully saved to fileUploadOrSaveState.CANCELEDif savinggetLayer()was canceledUploadOrSaveState.FAILEDif savinggetLayer()has failed
- Returns:
- the save state
-
setSaveState
Sets the save state forgetLayer()- Parameters:
saveState- save the upload state
-
resetUploadAndSaveState
Resets the upload and save state
-