Class AbstractModifiableLayer

All Implemented Interfaces:
Lockable, ProjectionChangeListener, DownloadFromServer, MapViewPaintable, SaveToFile, UploadToServer, Destroyable
Direct Known Subclasses:
AbstractOsmDataLayer, GeoImageLayer, GpxLayer, GpxRouteLayer, NoteLayer

A modifiable layer.
Since:
7358
  • Field Details

  • Constructor Details

  • Method Details

    • isDownloadable

      public boolean isDownloadable()
      Description copied from interface: DownloadFromServer
      Determines if the layer is able to download data and implements the DownloadFromServer interface. A layer that implements the DownloadFromServer interface must return true.
      Specified by:
      isDownloadable in interface DownloadFromServer
      Returns:
      true if the layer is able to download data; false, otherwise
    • isUploadable

      public boolean isUploadable()
      Description copied from interface: UploadToServer
      Determines if the layer is able to upload data and implements the UploadToServer interface. A layer that implements the UploadToServer interface must return true.
      Specified by:
      isUploadable in interface UploadToServer
      Returns:
      true if the layer is able to upload data; false, otherwise
    • requiresUploadToServer

      public boolean requiresUploadToServer()
      Description copied from interface: UploadToServer
      Determines if the data managed by this layer needs to be uploaded to the server because it contains modified data.
      Specified by:
      requiresUploadToServer in interface UploadToServer
      Returns:
      true if the data managed by this layer needs to be uploaded to the server because it contains modified data; false, otherwise
    • requiresSaveToFile

      public boolean requiresSaveToFile()
      Description copied from interface: SaveToFile
      Determines if the data managed by this layer needs to be saved to a file. Only replies true if a file is assigned to this layer and if the data managed by this layer has been modified since the last save operation to the file.
      Specified by:
      requiresSaveToFile in interface SaveToFile
      Returns:
      true if the data managed by this layer needs to be saved to a file; false, otherwise
    • isUploadDiscouraged

      public boolean isUploadDiscouraged()
      Description copied from interface: UploadToServer
      Determines if upload of data managed by this layer is discouraged. This feature allows to use "private" data layers.
      Specified by:
      isUploadDiscouraged in interface UploadToServer
      Returns:
      true if upload is discouraged for this layer; false, otherwise
    • isDirty

      public boolean isDirty()
      Determines if this layer is "dirty", i.e. requires save or upload
      Returns:
      if this layer is "dirty"
      Since:
      18287
    • isModified

      public abstract boolean isModified()
      Determines if data managed by this layer has been modified.
      Returns:
      true if data has been modified; false, otherwise
    • onPostSaveToFile

      public void onPostSaveToFile()
      Description copied from interface: SaveToFile
      Initializes the layer after a successful save of data to a file.
      Specified by:
      onPostSaveToFile in interface SaveToFile
    • onPostUploadToServer

      public void onPostUploadToServer()
      Initializes the layer after a successful upload to the server.
      Specified by:
      onPostUploadToServer in interface UploadToServer
    • createUploadTask

      Description copied from interface: UploadToServer
      Creates a new AbstractIOTask for uploading data.
      Specified by:
      createUploadTask in interface UploadToServer
      Parameters:
      monitor - The progress monitor
      Returns:
      a new AbstractIOTask for uploading data, or null if not applicable
    • getUploadDialog

      Description copied from interface: UploadToServer
      Returns the upload dialog for this layer.
      Specified by:
      getUploadDialog in interface UploadToServer
      Returns:
      the upload dialog for this layer, or null if not applicable
    • isUploadInProgress

      public boolean isUploadInProgress()
      Description copied from interface: UploadToServer
      Determines if upload of data managed by this layer is currently in progress.
      Specified by:
      isUploadInProgress in interface UploadToServer
      Returns:
      true if upload is in progress
    • lock

      public void lock()
      Description copied from interface: Lockable
      Enables the read-only/locked mode.
      Specified by:
      lock in interface Lockable
    • unlock

      public void unlock()
      Description copied from interface: Lockable
      Disables the read-only/locked mode.
      Specified by:
      unlock in interface Lockable
    • isLocked

      public boolean isLocked()
      Description copied from interface: Lockable
      Determines if this is read-only/locked (thus it cannot be modified).
      Specified by:
      isLocked in interface Lockable
      Returns:
      true if this is read-only/locked
    • autosave

      public boolean autosave(File file) throws IOException
      Perform the autosave action for the layer
      Parameters:
      file - The file to save to
      Returns:
      true if the layer was successfully saved
      Throws:
      IOException - If there was an IO exception from saving
      Since:
      16548
    • getData

      public Data getData()
      Get the data for the modifiable layer
      Returns:
      The data object
      Since:
      16548