Package org.openstreetmap.josm.gui.layer
Class OsmDataLayer
- All Implemented Interfaces:
DataSelectionListener,DataSetListenerAdapter.Listener,HighlightUpdateListener,Lockable,ProjectionChangeListener,DownloadFromServer,MapViewPaintable,SaveToFile,UploadToServer,PrimitiveHoverListener,Destroyable
- Direct Known Subclasses:
AdvancedPreference.UnclearableOsmDataLayer,CorrelationSupportLayer
public class OsmDataLayer
extends AbstractOsmDataLayer
implements DataSetListenerAdapter.Listener, DataSelectionListener, HighlightUpdateListener, PrimitiveHoverListener
A layer that holds OSM data from a specific dataset.
The data can be fully edited.
- Since:
- 17
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classclassAction that converts this OSM layer to a GPX layer.static final classA listener that counts the number of primitives it encountersstatic interfaceListener called when a state of this layer has changed.Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.layer.Layer
Layer.LayerAction, Layer.LayerGpxExportAction, Layer.LayerSaveAction, Layer.LayerSaveAsAction, Layer.MultiLayerAction, Layer.SeparatorLayerActionNested classes/interfaces inherited from class org.openstreetmap.josm.gui.layer.AbstractMapViewPaintable
AbstractMapViewPaintable.CompatibilityModeLayerPainterNested classes/interfaces inherited from interface org.openstreetmap.josm.data.osm.DataSelectionListener
DataSelectionListener.AbstractSelectionEvent, DataSelectionListener.SelectionAddEvent, DataSelectionListener.SelectionChangeEvent, DataSelectionListener.SelectionRemoveEvent, DataSelectionListener.SelectionReplaceEvent, DataSelectionListener.SelectionToggleEventNested classes/interfaces inherited from interface org.openstreetmap.josm.data.osm.HighlightUpdateListener
HighlightUpdateListener.HighlightUpdateEventNested classes/interfaces inherited from interface org.openstreetmap.josm.gui.layer.MapViewPaintable
MapViewPaintable.LayerPainter, MapViewPaintable.MapViewEvent, MapViewPaintable.PaintableInvalidationEvent, MapViewPaintable.PaintableInvalidationListenerNested classes/interfaces inherited from interface org.openstreetmap.josm.gui.PrimitiveHoverListener
PrimitiveHoverListener.PrimitiveHoverEvent -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.apache.commons.jcs3.access.CacheAccess<TileZXY,ImageCache> A cache used for paintingfinal DataSetThe data behind this layer.private static final AtomicIntegerthe global counter for created data layersprivate final DataSetListenerAdapterstatic final intThe default number of relations in the recent relations cache.private static BufferedImagea texture for non-downloaded areaprivate static final intprivate booleanprivate static final Stringprivate final AtomicBooleanFlag used to know if the layer is being uploadedprivate intThe map paint index that was painted (used to invalidatecache)private intThe last zoom level (we invalidate all tiles when switching layers)private final CopyOnWriteArrayList<OsmDataLayer.LayerStateChangeListener>private static final intprivate static final intprivate static final NamedColorPropertystatic final BooleanPropertyProperty to determine if labels must be hidden while dragging the map.private static final NamedColorPropertystatic final IntegerPropertyThe number of relations to use in the recent relations cache.static final StringPropertyThe extension that should be used when saving the OSM file.List of recent relationsstatic final StringProperty used to know if this layer has to be uploadedprivate booleanprivate booleanList of validation errors in this layer.Fields inherited from class org.openstreetmap.josm.gui.layer.AbstractModifiableLayer
IS_DIRTY_SYMBOL, REQUIRES_SAVE_TO_DISK_PROPFields inherited from class org.openstreetmap.josm.gui.layer.Layer
FILTER_STATE_PROP, NAME_PROP, OPACITY_PROP, propertyChangeSupport, VISIBLE_PROP -
Constructor Summary
ConstructorsConstructorDescriptionOsmDataLayer(DataSet data, String name, File associatedFile) Construct a newOsmDataLayer. -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidaddConditionalInformation(JPanel p, String text, boolean condition) private static voidaddDoubleIfPresent(WayPoint wpt, OsmPrimitive p, String gpxPrefix, String gpxKey, String osmKey) private static voidaddIntegerIfPresent(WayPoint wpt, OsmPrimitive p, String gpxPrefix, String gpxKey, String osmKey) voidAdds a layer state change listenerprivate static voidaddStringIfPresent(WayPoint wpt, OsmPrimitive p, String gpxPrefix, String gpxKey, String osmKey, String osmKey2) booleanPerform the autosave action for the layerbooleanChecks whether it is ok to launch a save (whether we have data, there is no conflict etc.)voidcleanupAfterUpload(Collection<? extends IPrimitive> processed) Clean out the data behind the layer.private static booleancontainsOnlyGpxTags(Tagged t, String gpxPrefix) booleancontainsPoint(LatLon coor) Determines if this layer contains data at the given coordinate.private static StringcounterText(String text, int deleted, int incomplete) Creates a new "Save" dialog for this layer and makes it visible.static voidInitialize the hatch pattern used to paint the non-downloaded area(package private) static StringcreateLayerName(Object arg) static StringReplies a new unique name for a data layercreateUploadTask(ProgressMonitor monitor) Creates a newAbstractIOTaskfor uploading data.voiddestroy()Called, when the layer is removed from the mapview and is going to be destroyed.private voiddirtyAll()Duplicates this layer with a new name and a copy of this layer dataset.protected static voidfillGpxData(GpxData gpxData, DataSet data, File file, String gpxPrefix) static ColorReplies background color for downloaded areas.protected ImageProviderReturn the image provider to get the base iconGet the source for the layerReplies the set of conflicts currently managed in this layer.getData()Get the data for the modifiable layerReturns theDataSetbehind this layer.getIcon()Return a representative small image for this layer.Gets the layer information to display to the user.private BBoxgetInvalidatedBBox(INode first, INode second) getLabel()Replies a label for this layer useful for UI elements.Action[]Returns list of actions.static ColorReplies background color for non-downloaded areas.Returns list of recently closed relations or null if none.Returns a small tooltip hint about some statistics for this layer.Returns the upload dialog for this layer.Gets theProjectionBoundsfor this layer to be visible to the user.private static intgetZoom(NavigatableComponent navigatableComponent) Get the zoom for aNavigatableComponentprivate static StringgpxVal(OsmPrimitive prim, String gpxPrefix, String key) Reads the Gpx key from the givenOsmPrimitive, with or without "gpx:" prefixvoidCalled whenever the highlighting of way segments in the dataset changed.private booleanCheck the data set if it would be empty on save.booleanDetermines if the layer is able to download data and implements theDownloadFromServerinterface.booleanisMergable(Layer other) Determines if the other layer can be merged into this layer.final booleanDetermines if data managed by this layer has been modified.booleanReplies the savable state of this layer (i.e., if it can be saved through a "File → Save" dialog).booleanDetermines if the layer is able to upload data and implements theUploadToServerinterface.final booleanDetermines if upload of data managed by this layer is discouraged.booleanDetermines if upload of data managed by this layer is currently in progress.voidmerges the primitives in datasetfrominto the dataset of this layervoidmergeFrom(DataSet from, ProgressMonitor progressMonitor) merges the primitives in datasetfrominto the dataset of this layervoidMerges the given layer into this layer.private static voidnodesToGpxData(Collection<Node> nodes, GpxData gpxData, Set<Node> doneNodes, String gpxPrefix) static WayPointnodeToWayPoint(Node n, long time) Converts a node to a waypoint with defaultGpxConstants.GPX_PREFIXfor tags.static WayPointnodeToWayPoint(Node n, long time, String gpxPrefix) Converts a node to a waypoint with a configurable GPX prefix for tags.voidActions run after data has been downloaded to this layer.voidInitializes the layer after a successful load of data from a filevoidInitializes the layer after a successful save of data to a file.voidInitializes the layer after a successful upload to the server.voidpaint(Graphics2D g, MapView mv, Bounds box) Draw all primitives in this layer but do not draw modified ones (they are drawn by the edit layer).private voidpaintData(Graphics2D g, MapView mv, Bounds box, boolean inactive, boolean virtual) private voidpaintHatch(Graphics2D g, MapView mv, boolean active) voidMethod called when the primitive under the mouse pointer changes.voidCalled when notified about any type of dataset change event.voidprojectionChanged(Projection oldValue, Projection newValue) protected static voidvoidRemoves a layer state change listenervoidremoveRecentRelation(Relation relation) Remove relation from list of recent relations.booleanDetermines if the data managed by this layer needs to be saved to a file.booleanDetermines if the data managed by this layer needs to be uploaded to the server because it contains modified data.private voidresetBounds(double minLat, double minLon, double maxLat, double maxLon) private voidresetBounds(IBounds bbox) private voidresetTiles(Collection<? extends IPrimitive> primitives) private voidvoidCalled whenever the selection is changed.voidSets the name of the layervoidsetRecentRelation(Relation relation) Adds recently closed relation.protected voidsetRequiresSaveToFile(boolean newValue) protected voidsetRequiresUploadToServer(boolean newValue) final voidsetUploadDiscouraged(boolean uploadDiscouraged) Sets the "discouraged upload" flag.voidSets the "upload in progress" flag, which will result in displaying a new icon and forbid to remove the layer.Converts OSM data behind this layer to GPX data.static GpxDataConverts given OSM dataset to GPX data.voidUnsets the "upload in progress" flag, which will result in displaying the standard icon and allow to remove the layer.voidVisits the content bounds of this layer.private static voidwaysToGpxData(Collection<Way> ways, GpxData gpxData, Set<Node> doneNodes, String gpxPrefix) Methods inherited from class org.openstreetmap.josm.gui.layer.AbstractOsmDataLayer
clear, isLocked, lock, unlockMethods inherited from class org.openstreetmap.josm.gui.layer.AbstractModifiableLayer
isDirtyMethods inherited from class org.openstreetmap.josm.gui.layer.Layer
addPropertyChangeListener, fireFilterStateChanged, fireOpacityChanged, fireVisibleChanged, getAssociatedFile, getColor, getDefaultLayerPosition, getName, getOpacity, hasColor, hookUpMapView, isBackgroundLayer, isInfoResizable, isProjectionSupported, isRenamed, isVisible, nameSupportedProjections, removePropertyChangeListener, rename, setAssociatedFile, setBackgroundLayer, setColor, setFilterStateChanged, setOpacity, setVisible, toggleVisible, toStringMethods inherited from class org.openstreetmap.josm.gui.layer.AbstractMapViewPaintable
addInvalidationListener, attachToMapView, createMapViewPainter, invalidate, removeInvalidationListener
-
Field Details
-
MAX_ZOOM
- See Also:
-
OVER_ZOOM
- See Also:
-
HATCHED_SIZE
- See Also:
-
IS_EMPTY_SYMBOL
- See Also:
-
REQUIRES_UPLOAD_TO_SERVER_PROP
Property used to know if this layer has to be uploaded -
requiresSaveToFile
-
requiresUploadToServer
-
isUploadInProgress
Flag used to know if the layer is being uploaded -
cache
A cache used for painting -
lastDataIdx
The map paint index that was painted (used to invalidatecache) -
lastZoom
The last zoom level (we invalidate all tiles when switching layers) -
hoverListenerAdded
-
validationErrors
List of validation errors in this layer.- Since:
- 3669
-
DEFAULT_RECENT_RELATIONS_NUMBER
The default number of relations in the recent relations cache.- See Also:
-
PROPERTY_RECENT_RELATIONS_NUMBER
The number of relations to use in the recent relations cache.- See Also:
-
PROPERTY_SAVE_EXTENSION
The extension that should be used when saving the OSM file. -
PROPERTY_HIDE_LABELS_WHILE_DRAGGING
Property to determine if labels must be hidden while dragging the map. -
PROPERTY_BACKGROUND_COLOR
-
PROPERTY_OUTSIDE_COLOR
-
recentRelations
List of recent relations -
dataLayerCounter
the global counter for created data layers -
layerStateChangeListeners
-
data
The data behind this layer. -
dataSetListenerAdapter
-
hatched
a texture for non-downloaded area
-
-
Constructor Details
-
OsmDataLayer
Construct a newOsmDataLayer.- Parameters:
data- OSM dataname- Layer nameassociatedFile- Associated .osm file (can be null)
-
-
Method Details
-
getRecentRelations
Returns list of recently closed relations or null if none.- Returns:
- list of recently closed relations or
nullif none - Since:
- 12291 (signature), 9668
-
setRecentRelation
Adds recently closed relation.- Parameters:
relation- new entry for the list of recently closed relations- Since:
- 9668
- See Also:
-
removeRecentRelation
Remove relation from list of recent relations.- Parameters:
relation- relation to remove- Since:
- 9668
-
setRequiresSaveToFile
-
setRequiresUploadToServer
-
createNewName
Replies a new unique name for a data layer- Returns:
- a new unique name for a data layer
-
createLayerName
-
addLayerStateChangeListener
Adds a layer state change listener- Parameters:
listener- the listener. Ignored if null or already registered.- Since:
- 5519
-
removeLayerStateChangeListener
Removes a layer state change listener- Parameters:
listener- the listener. Ignored if null or already registered.- Since:
- 10340
-
getBackgroundColor
Replies background color for downloaded areas.- Returns:
- background color for downloaded areas. Black by default
-
getOutsideColor
Replies background color for non-downloaded areas.- Returns:
- background color for non-downloaded areas. Yellow by default
-
createHatchTexture
Initialize the hatch pattern used to paint the non-downloaded area -
getDataSet
Returns theDataSetbehind this layer.- Specified by:
getDataSetin classAbstractOsmDataLayer- Returns:
- the
DataSetbehind this layer. - Since:
- 13558
-
getBaseIconProvider
Return the image provider to get the base icon- Returns:
- image provider class which can be modified
- Since:
- 8323
-
getIcon
Description copied from class:LayerReturn a representative small image for this layer. The image must not be larger than 64 pixel in any dimension. -
paint
Draw all primitives in this layer but do not draw modified ones (they are drawn by the edit layer). Draw nodes last to overlap the ways they belong to.- Specified by:
paintin interfaceMapViewPaintable- Parameters:
g- Graphicsmv- The object that can translate GeoPoints to screen coordinates.box- Bounding box
-
paintHatch
-
paintData
-
getToolTipText
Description copied from class:LayerReturns a small tooltip hint about some statistics for this layer.- Specified by:
getToolTipTextin classLayer- Returns:
- A small tooltip hint about some statistics for this layer.
-
mergeFrom
Description copied from class:LayerMerges the given layer into this layer. Throws if the layer types are incompatible. -
mergeFrom
merges the primitives in datasetfrominto the dataset of this layer- Parameters:
from- the source data set
-
mergeFrom
merges the primitives in datasetfrominto the dataset of this layer- Parameters:
from- the source data setprogressMonitor- the progress monitor, can benull
-
isMergable
Description copied from class:LayerDetermines if the other layer can be merged into this layer.- Specified by:
isMergablein classLayer- Parameters:
other- The other layer that is tested to be mergable with this.- Returns:
- Whether the other layer can be merged into this layer.
-
visitBoundingBox
Description copied from class:LayerVisits the content bounds of this layer. The behavior of this method depends on the layer, but each implementation should attempt to cover the relevant content of the layer in this method.- Specified by:
visitBoundingBoxin classLayer- Parameters:
v- The visitor that gets notified about the contents of this layer.
-
cleanupAfterUpload
Clean out the data behind the layer. This means clearing the redo/undo lists, really deleting all deleted objects and reset the modified flags. This should be done after an upload, even after a partial upload.- Parameters:
processed- A list of all objects that were actually uploaded. May benull, which means nothing has been uploaded
-
counterText
-
getInfoComponent
Description copied from class:LayerGets the layer information to display to the user. This is used if the user requests information about this layer. It should display a description of the layer content.- Specified by:
getInfoComponentin classLayer- Returns:
- Either a String or a
Componentdescribing the layer.
-
addConditionalInformation
-
getMenuEntries
Description copied from class:LayerReturns list of actions. Action can implement LayerAction interface when it needs to be represented by other menu component than JMenuItem or when it supports multiple layers. Actions that support multiple layers should also have correct equals implementation.Use
Layer.SeparatorLayerAction.INSTANCEinstead of new JSeparator- Specified by:
getMenuEntriesin classLayer- Returns:
- menu actions for this layer
-
toGpxData
Converts given OSM dataset to GPX data.- Parameters:
data- OSM datasetfile- output .gpx file- Returns:
- GPX data
-
fillGpxData
-
waysToGpxData
private static void waysToGpxData(Collection<Way> ways, GpxData gpxData, Set<Node> doneNodes, String gpxPrefix) -
containsOnlyGpxTags
-
gpxVal
Reads the Gpx key from the givenOsmPrimitive, with or without "gpx:" prefix- Parameters:
prim- OSM primitivegpxPrefix- the GPX prefixkey- GPX key without prefix- Returns:
- the value or
nullif not present
-
nodeToWayPoint
Converts a node to a waypoint with defaultGpxConstants.GPX_PREFIXfor tags.- Parameters:
n- theNodeto converttime- a timestamp value in milliseconds from the epoch.- Returns:
WayPointobject- Since:
- 13210
-
nodeToWayPoint
Converts a node to a waypoint with a configurable GPX prefix for tags.- Parameters:
n- theNodeto converttime- a timestamp value in milliseconds from the epoch.gpxPrefix- the GPX prefix for tags- Returns:
WayPointobject- Since:
- 18078
-
nodesToGpxData
private static void nodesToGpxData(Collection<Node> nodes, GpxData gpxData, Set<Node> doneNodes, String gpxPrefix) -
addIntegerIfPresent
private static void addIntegerIfPresent(WayPoint wpt, OsmPrimitive p, String gpxPrefix, String gpxKey, String osmKey) -
addDoubleIfPresent
private static void addDoubleIfPresent(WayPoint wpt, OsmPrimitive p, String gpxPrefix, String gpxKey, String osmKey) -
addStringIfPresent
private static void addStringIfPresent(WayPoint wpt, OsmPrimitive p, String gpxPrefix, String gpxKey, String osmKey, String osmKey2) -
toGpxData
Converts OSM data behind this layer to GPX data.- Returns:
- GPX data
-
containsPoint
Determines if this layer contains data at the given coordinate.- Parameters:
coor- the coordinate- Returns:
trueif data sources bounding boxes containcoor
-
getConflicts
Replies the set of conflicts currently managed in this layer.- Returns:
- the set of conflicts currently managed in this layer
-
isDownloadable
Description copied from interface:DownloadFromServerDetermines if the layer is able to download data and implements theDownloadFromServerinterface. A layer that implements theDownloadFromServerinterface must returntrue.- Specified by:
isDownloadablein interfaceDownloadFromServer- Overrides:
isDownloadablein classAbstractModifiableLayer- Returns:
trueif the layer is able to download data;false, otherwise
-
isUploadable
Description copied from interface:UploadToServerDetermines if the layer is able to upload data and implements theUploadToServerinterface. A layer that implements theUploadToServerinterface must returntrue.- Specified by:
isUploadablein interfaceUploadToServer- Overrides:
isUploadablein classAbstractModifiableLayer- Returns:
trueif the layer is able to upload data;false, otherwise
-
requiresUploadToServer
Description copied from interface:UploadToServerDetermines if the data managed by this layer needs to be uploaded to the server because it contains modified data.- Specified by:
requiresUploadToServerin interfaceUploadToServer- Overrides:
requiresUploadToServerin classAbstractModifiableLayer- Returns:
trueif the data managed by this layer needs to be uploaded to the server because it contains modified data;false, otherwise
-
requiresSaveToFile
Description copied from interface:SaveToFileDetermines 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:
requiresSaveToFilein interfaceSaveToFile- Overrides:
requiresSaveToFilein classAbstractModifiableLayer- Returns:
trueif the data managed by this layer needs to be saved to a file;false, otherwise
-
getLabel
Description copied from class:LayerReplies a label for this layer useful for UI elements. Defaults to the layer name -
onPostLoadFromFile
Description copied from class:LayerInitializes the layer after a successful load of data from a file- Overrides:
onPostLoadFromFilein classLayer
-
onPostDownloadFromServer
Actions run after data has been downloaded to this layer. -
onPostSaveToFile
Description copied from interface:SaveToFileInitializes the layer after a successful save of data to a file.- Specified by:
onPostSaveToFilein interfaceSaveToFile- Overrides:
onPostSaveToFilein classAbstractModifiableLayer
-
onPostUploadToServer
Description copied from class:AbstractModifiableLayerInitializes the layer after a successful upload to the server.- Specified by:
onPostUploadToServerin interfaceUploadToServer- Overrides:
onPostUploadToServerin classAbstractModifiableLayer
-
destroy
Description copied from class:LayerCalled, when the layer is removed from the mapview and is going to be destroyed.This is because the Layer constructor cannot add itself safely as a listener to the layerlist dialog, because there may be no such dialog yet (loaded via command line parameter).
- Specified by:
destroyin interfaceDestroyable- Overrides:
destroyin classLayer
-
removeClipboardDataFor
-
processDatasetEvent
Description copied from interface:DataSetListenerAdapter.ListenerCalled when notified about any type of dataset change event.- Specified by:
processDatasetEventin interfaceDataSetListenerAdapter.Listener- Parameters:
event- dataset change event
-
selectionChanged
Description copied from interface:DataSelectionListenerCalled whenever the selection is changed. You get notified about the new selection, the elements that were added and removed and the layer that triggered the event.- Specified by:
selectionChangedin interfaceDataSelectionListener- Parameters:
event- The selection change event.- See Also:
-
resetTiles
-
resetTiles
-
getInvalidatedBBox
-
resetBounds
-
resetBounds
-
dirtyAll
-
projectionChanged
- Specified by:
projectionChangedin interfaceProjectionChangeListener- Overrides:
projectionChangedin classLayer
-
isUploadDiscouraged
Description copied from interface:UploadToServerDetermines if upload of data managed by this layer is discouraged. This feature allows to use "private" data layers.- Specified by:
isUploadDiscouragedin interfaceUploadToServer- Overrides:
isUploadDiscouragedin classAbstractModifiableLayer- Returns:
trueif upload is discouraged for this layer;false, otherwise
-
setUploadDiscouraged
Sets the "discouraged upload" flag.- Parameters:
uploadDiscouraged-trueif upload of data managed by this layer is discouraged. This feature allows to use "private" data layers.
-
isModified
Description copied from class:AbstractModifiableLayerDetermines if data managed by this layer has been modified.- Specified by:
isModifiedin classAbstractModifiableLayer- Returns:
- true if data has been modified; false, otherwise
-
isSavable
Description copied from class:LayerReplies the savable state of this layer (i.e., if it can be saved through a "File → Save" dialog).- Specified by:
isSavablein interfaceSaveToFile- Overrides:
isSavablein classLayer- Returns:
- true if this layer can be saved to a file
-
checkSaveConditions
Description copied from class:LayerChecks whether it is ok to launch a save (whether we have data, there is no conflict etc.)- Overrides:
checkSaveConditionsin classLayer- Returns:
true, if it is safe to save.
-
isDataSetEmpty
Check the data set if it would be empty on save. It is empty, if it contains no objects (after all objects that are created and deleted without being transferred to the server have been removed).- Returns:
true, if a save result in an empty data set.
-
createAndOpenSaveFileChooser
Description copied from class:LayerCreates a new "Save" dialog for this layer and makes it visible.When the user has chosen a file, checks the file extension, and confirms overwriting if needed.
- Overrides:
createAndOpenSaveFileChooserin classLayer- Returns:
- The output
File - See Also:
-
createUploadTask
Description copied from interface:UploadToServerCreates a newAbstractIOTaskfor uploading data.- Specified by:
createUploadTaskin interfaceUploadToServer- Overrides:
createUploadTaskin classAbstractModifiableLayer- Parameters:
monitor- The progress monitor- Returns:
- a new
AbstractIOTaskfor uploading data, ornullif not applicable
-
getChangesetSourceTag
Description copied from class:LayerGet the source for the layer- Overrides:
getChangesetSourceTagin classLayer- Returns:
- The string for the changeset source tag or
null
-
getUploadDialog
Description copied from interface:UploadToServerReturns the upload dialog for this layer.- Specified by:
getUploadDialogin interfaceUploadToServer- Overrides:
getUploadDialogin classAbstractModifiableLayer- Returns:
- the upload dialog for this layer, or
nullif not applicable
-
getViewProjectionBounds
Description copied from class:LayerGets theProjectionBoundsfor this layer to be visible to the user. This can be the exact bounds, the UI handles padding. Returnnullif you cannot provide this information. The default implementation uses the bounds fromLayer.visitBoundingBox(BoundingXYVisitor).- Overrides:
getViewProjectionBoundsin classLayer- Returns:
- The bounds for this layer.
-
highlightUpdated
Description copied from interface:HighlightUpdateListenerCalled whenever the highlighting of way segments in the dataset changed.- Specified by:
highlightUpdatedin interfaceHighlightUpdateListener- Parameters:
e- The dataset highlight event.
-
primitiveHovered
Description copied from interface:PrimitiveHoverListenerMethod called when the primitive under the mouse pointer changes.- Specified by:
primitiveHoveredin interfacePrimitiveHoverListener- Parameters:
e- Event object describing the hovered primitive and related information
-
setName
Description copied from class:LayerSets the name of the layer -
setUploadInProgress
Sets the "upload in progress" flag, which will result in displaying a new icon and forbid to remove the layer.- Since:
- 13434
-
unsetUploadInProgress
Unsets the "upload in progress" flag, which will result in displaying the standard icon and allow to remove the layer.- Since:
- 13434
-
isUploadInProgress
Description copied from interface:UploadToServerDetermines if upload of data managed by this layer is currently in progress.- Specified by:
isUploadInProgressin interfaceUploadToServer- Overrides:
isUploadInProgressin classAbstractModifiableLayer- Returns:
trueif upload is in progress
-
getData
Description copied from class:AbstractModifiableLayerGet the data for the modifiable layer- Overrides:
getDatain classAbstractModifiableLayer- Returns:
- The data object
-
autosave
Description copied from class:AbstractModifiableLayerPerform the autosave action for the layer- Overrides:
autosavein classAbstractModifiableLayer- Parameters:
file- The file to save to- Returns:
trueif the layer was successfully saved- Throws:
IOException- If there was an IO exception from saving
-
duplicate
Duplicates this layer with a new name and a copy of this layer dataset.- Parameters:
newName- name of new layer- Returns:
- A copy of this layer
- Since:
- 18233
-