public abstract class AbstractModifiableLayer extends Layer implements DownloadFromServer, UploadToServer, SaveToFile, Lockable
Layer.LayerAction, Layer.LayerGpxExportAction, Layer.LayerSaveAction, Layer.LayerSaveAsAction, Layer.MultiLayerAction, Layer.SeparatorLayerAction
AbstractMapViewPaintable.CompatibilityModeLayerPainter
MapViewPaintable.LayerPainter, MapViewPaintable.MapViewEvent, MapViewPaintable.PaintableInvalidationEvent, MapViewPaintable.PaintableInvalidationListener
FILTER_STATE_PROP, NAME_PROP, OPACITY_PROP, propertyChangeSupport, VISIBLE_PROP
Constructor and Description |
---|
AbstractModifiableLayer(java.lang.String name)
Constructs a new
ModifiableLayer . |
Modifier and Type | Method and Description |
---|---|
AbstractIOTask |
createUploadTask(ProgressMonitor monitor)
Creates a new
AbstractIOTask for uploading data. |
AbstractUploadDialog |
getUploadDialog()
Returns the upload dialog for this layer.
|
boolean |
isDownloadable()
Determines if the layer is able to download data and implements the
DownloadFromServer interface. |
boolean |
isLocked()
Determines if this is read-only/locked (thus it cannot be modified).
|
abstract boolean |
isModified()
Determines if data managed by this layer has been modified.
|
boolean |
isUploadable()
Determines if the layer is able to upload data and implements the
UploadToServer interface. |
boolean |
isUploadDiscouraged()
Determines if upload of data managed by this layer is discouraged.
|
boolean |
isUploadInProgress()
Determines if upload of data managed by this layer is currently in progress.
|
void |
lock()
Enables the read-only/locked mode.
|
void |
onPostSaveToFile()
Initializes the layer after a successful save of data to a file.
|
void |
onPostUploadToServer()
Initializes the layer after a successful upload to the server.
|
boolean |
requiresSaveToFile()
Determines if the data managed by this layer needs to be saved to
a file.
|
boolean |
requiresUploadToServer()
Determines if the data managed by this layer needs to be uploaded to
the server because it contains modified data.
|
void |
unlock()
Disables the read-only/locked mode.
|
addPropertyChangeListener, checkSaveConditions, createAndOpenSaveFileChooser, destroy, fireFilterStateChanged, fireOpacityChanged, fireVisibleChanged, getAssociatedFile, getBaseColorProperty, getChangesetSourceTag, getColorProperty, getDefaultLayerPosition, getIcon, getInfoComponent, getMenuEntries, getName, getOpacity, getToolTipText, getViewProjectionBounds, hookUpMapView, isBackgroundLayer, isInfoResizable, isMergable, isProjectionSupported, isRenamed, isSavable, isVisible, mergeFrom, nameSupportedProjections, onPostLoadFromFile, projectionChanged, removePropertyChangeListener, rename, setAssociatedFile, setBackgroundLayer, setFilterStateChanged, setName, setOpacity, setVisible, toggleVisible, toString, visitBoundingBox
addInvalidationListener, attachToMapView, createMapViewPainter, invalidate, removeInvalidationListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isSavable
paint
public AbstractModifiableLayer(java.lang.String name)
ModifiableLayer
.name
- Layer namepublic boolean isDownloadable()
DownloadFromServer
DownloadFromServer
interface. A layer that implements the
DownloadFromServer
interface must return true
.isDownloadable
in interface DownloadFromServer
true
if the layer is able to download data; false
, otherwisepublic boolean isUploadable()
UploadToServer
UploadToServer
interface. A layer that implements the
UploadToServer
interface must return true
.isUploadable
in interface UploadToServer
true
if the layer is able to upload data; false
, otherwisepublic boolean requiresUploadToServer()
UploadToServer
requiresUploadToServer
in interface UploadToServer
true
if the data managed by this layer needs to be
uploaded to the server because it contains modified data;
false
, otherwisepublic boolean requiresSaveToFile()
SaveToFile
requiresSaveToFile
in interface SaveToFile
true
if the data managed by this layer needs to be saved to a file; false
, otherwisepublic boolean isUploadDiscouraged()
UploadToServer
isUploadDiscouraged
in interface UploadToServer
true
if upload is discouraged for this layer; false
, otherwisepublic abstract boolean isModified()
public void onPostSaveToFile()
SaveToFile
onPostSaveToFile
in interface SaveToFile
public void onPostUploadToServer()
onPostUploadToServer
in interface UploadToServer
public AbstractIOTask createUploadTask(ProgressMonitor monitor)
UploadToServer
AbstractIOTask
for uploading data.createUploadTask
in interface UploadToServer
monitor
- The progress monitorAbstractIOTask
for uploading data, or null
if not applicablepublic AbstractUploadDialog getUploadDialog()
UploadToServer
getUploadDialog
in interface UploadToServer
null
if not applicablepublic boolean isUploadInProgress()
UploadToServer
isUploadInProgress
in interface UploadToServer
true
if upload is in progresspublic void lock()
Lockable
public void unlock()
Lockable