org.openstreetmap.josm.gui.io
Class SaveLayerInfo

java.lang.Object
  extended by org.openstreetmap.josm.gui.io.SaveLayerInfo
All Implemented Interfaces:
java.lang.Comparable<SaveLayerInfo>

 class SaveLayerInfo
extends java.lang.Object
implements java.lang.Comparable<SaveLayerInfo>

SaveLayerInfo represents the information, user preferences and save/upload states of a layer which might be uploaded/saved.


Field Summary
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 Summary
SaveLayerInfo(OsmDataLayer layer)
           
 
Method Summary
 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 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 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()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

layer

private OsmDataLayer layer
the osm data layer


doSaveToFile

private boolean doSaveToFile

doUploadToServer

private boolean doUploadToServer

file

private java.io.File file

uploadState

private UploadOrSaveState uploadState

saveState

private UploadOrSaveState saveState
Constructor Detail

SaveLayerInfo

public SaveLayerInfo(OsmDataLayer layer)
Parameters:
layer - the layer. Must not be null.
Throws:
java.lang.IllegalArgumentException - thrown if layer is null
Method Detail

getLayer

public OsmDataLayer getLayer()
Replies the layer this info objects holds information for

Returns:
the layer this info objects holds information for

isDoSaveToFile

public boolean 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

public void setDoSaveToFile(boolean doSaveToFile)
Sets whether this layer should be saved to a file

Parameters:
doSaveToFile - true to save; false, to skip saving

isDoUploadToServer

public boolean isDoUploadToServer()
Replies true if this layer should be uploaded to the server; false, otherwise

Returns:
true if this layer should be uploaded to the server; false, otherwise

setDoUploadToServer

public void setDoUploadToServer(boolean doUploadToServer)
Sets whether this layer should be uploaded to a file

Parameters:
doSaveToFile - true to upload; false, to skip uploading

isDoSaveAndUpload

public boolean 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

public java.lang.String getName()
Replies the name of the layer

Returns:
the name of the layer

getFile

public java.io.File getFile()
Replies the file this layer should be saved to, if isDoSaveToFile() is true

Returns:
the file this layer should be saved to, if isDoSaveToFile() is true

setFile

public void setFile(java.io.File file)
Sets the file this layer should be saved to, if isDoSaveToFile() is true

Parameters:
file - the file

compareTo

public int compareTo(SaveLayerInfo o)
Specified by:
compareTo in interface java.lang.Comparable<SaveLayerInfo>

getUploadState

public UploadOrSaveState getUploadState()
Replies the upload state of getLayer().

Returns:
the upload state

setUploadState

public void setUploadState(UploadOrSaveState uploadState)
Sets the upload state for getLayer()

Parameters:
uploadState - the upload state

getSaveState

public UploadOrSaveState getSaveState()
Replies the save state of getLayer().

Returns:
the save state

setSaveState

public void setSaveState(UploadOrSaveState saveState)
Sets the save state for getLayer()

Parameters:
saveState - save the upload state

resetUploadAndSaveState

public void resetUploadAndSaveState()
Resets the upload and save state

See Also:
setUploadState(UploadOrSaveState), setSaveState(UploadOrSaveState), getUploadState(), getSaveState()


JOSM