org.openstreetmap.josm.data.osm
Class DataSet

java.lang.Object
  extended by org.openstreetmap.josm.data.osm.DataSet
All Implemented Interfaces:
java.lang.Cloneable, ProjectionChangeListener

public class DataSet
extends java.lang.Object
implements java.lang.Cloneable, ProjectionChangeListener

DataSet is the data behind the application. It can consists of only a few points up to the whole osm database. DataSet's can be merged together, saved, (up/down/disk)loaded etc. Note that DataSet is not an osm-primitive and so has no key association but a few members to store some information. Dataset is threadsafe - accessing Dataset simultaneously from different threads should never lead to data corruption or ConccurentModificationException. However when for example one thread removes primitive and other thread try to add another primitive reffering to the removed primitive, DataIntegrityException will occur. To prevent such situations, read/write lock is provided. While read lock is used, it's guaranteed that Dataset will not change. Sample usage: ds.getReadLock().lock(); try { // .. do something with dataset } finally { ds.getReadLock().unlock(); } Write lock should be used in case of bulk operations. In addition to ensuring that other threads can't use dataset in the middle of modifications it also stops sending of dataset events. That's good for performance reasons - GUI can be updated after all changes are done. Sample usage: ds.beginUpdate() try { // .. do modifications } finally { ds.endUpdate(); } Note that it is not necessary to call beginUpdate/endUpdate for every dataset modification - dataset will get locked automatically. Note that locks cannot be upgraded - if one threads use read lock and and then write lock, dead lock will occur - see #5814 for sample ticket


Nested Class Summary
private static class DataSet.IdHash
           
 
Field Summary
private  Storage<OsmPrimitive> allPrimitives
           
private  AutoCompletionManager autocomplete
          Maintain a list of used tags for autocompletion
private  java.util.List<AbstractDatasetChangedEvent> cachedEvents
           
private  java.util.Map<java.lang.String,java.lang.String> changeSetTags
           
 java.util.Collection<DataSource> dataSources
          All data sources of this DataSet.
private  java.util.Collection<WaySegment> highlightedVirtualNodes
           
private  java.util.Collection<WaySegment> highlightedWaySegments
           
private  int highlightUpdateCount
           
private  java.util.concurrent.CopyOnWriteArrayList<DataSetListener> listeners
           
private  java.util.concurrent.locks.ReadWriteLock lock
           
private static int MAX_EVENTS
          Maximum number of events to kept between beginUpdate/endUpdate.
private static int MAX_SINGLE_EVENTS
          Maximum number of events that can be fired between beginUpdate/endUpdate to be send as single events (ie without DatasetChangedEvent)
private  QuadBuckets<Node> nodes
          All nodes goes here, even when included in other data (ways etc).
private  java.util.Map<PrimitiveId,OsmPrimitive> primitivesMap
           
private  java.util.Collection<Relation> relations
          All relations/relationships
private  java.util.LinkedHashSet<OsmPrimitive> selectedPrimitives
           
private  java.util.LinkedList<java.util.Collection<? extends OsmPrimitive>> selectionHistory
          History of selections - shared by plugins and SelectionListDialog
private  java.lang.Object selectionLock
           
private  java.util.Collection<OsmPrimitive> selectionSnapshot
           
private static java.util.Collection<SelectionChangedListener> selListeners
          A list of listeners to selection changed events.
private  int updateCount
           
private  boolean uploadDiscouraged
           
private  java.lang.String version
          The API version that created this data set, if any.
private  QuadBuckets<Way> ways
          All ways (Streets etc.) in the DataSet.
 
Constructor Summary
DataSet()
           
 
Method Summary
private  boolean __toggleSelected(PrimitiveId primitiveId)
           
 void addChangeSetTag(java.lang.String k, java.lang.String v)
           
 void addDataSetListener(DataSetListener dsl)
           
 void addPrimitive(OsmPrimitive primitive)
          Adds a primitive to the dataset
 void addSelected(java.util.Collection<? extends PrimitiveId> selection)
          Adds the primitives in selection to the current selection and notifies all SelectionChangedListener.
private  boolean addSelected(java.util.Collection<? extends PrimitiveId> selection, boolean fireSelectionChangeEvent)
          Adds the primitives in selection to the current selection.
 void addSelected(PrimitiveId... osm)
           
static void addSelectionListener(SelectionChangedListener listener)
           
 java.util.Collection<OsmPrimitive> allModifiedPrimitives()
           
 java.util.Collection<OsmPrimitive> allNonDeletedCompletePrimitives()
           
 java.util.Collection<OsmPrimitive> allNonDeletedPhysicalPrimitives()
           
 java.util.Collection<OsmPrimitive> allNonDeletedPrimitives()
           
 java.util.Collection<OsmPrimitive> allPrimitives()
           
 void beginUpdate()
          Can be called before bigger changes on dataset.
private  boolean cleanupDeleted(java.util.Iterator<? extends OsmPrimitive> it)
           
 void cleanupDeletedPrimitives()
           
 void clear()
          Removes all primitives from the dataset and resets the currently selected primitives to the empty collection.
 void clearHighlightedVirtualNodes()
          clear all highlights of virtual nodes
 void clearHighlightedWaySegments()
          clear all highlights of way segments
 void clearSelection()
           
 void clearSelection(java.util.Collection<? extends PrimitiveId> list)
           
 void clearSelection(PrimitiveId... osm)
          Remove the selection from every value in the collection.
 void clearSelectionHistory()
          Clears selection history list
 DataSet clone()
           
 void deleteInvisible()
          Marks all "invisible" objects as deleted.
private  void deleteWay(Way way)
           
 void endUpdate()
           
(package private)  void fireChangesetIdChanged(OsmPrimitive primitive, int oldChangesetId, int newChangesetId)
           
private  void fireEvent(AbstractDatasetChangedEvent event)
           
private  void fireEventToListeners(AbstractDatasetChangedEvent event)
           
(package private)  void fireHighlightingChanged(OsmPrimitive primitive)
           
(package private)  void fireNodeMoved(Node node, LatLon newCoor, EastNorth eastNorth)
           
(package private)  void firePrimitivesAdded(java.util.Collection<? extends OsmPrimitive> added, boolean wasIncomplete)
           
(package private)  void firePrimitivesRemoved(java.util.Collection<? extends OsmPrimitive> removed, boolean wasComplete)
           
(package private)  void fireRelationMembersChanged(Relation r)
           
 void fireSelectionChanged()
          Notifies all registered SelectionChangedListener about the current selection in this dataset.
(package private)  void fireTagsChanged(OsmPrimitive prim, java.util.Map<java.lang.String,java.lang.String> originalKeys)
           
(package private)  void fireWayNodesChanged(Way way)
           
 java.util.Collection<OsmPrimitive> getAllSelected()
          Replies an unmodifiable collection of primitives currently selected in this dataset, including deleted ones.
 AutoCompletionManager getAutoCompletionManager()
           
 java.util.Map<java.lang.String,java.lang.String> getChangeSetTags()
           
 java.awt.geom.Area getDataSourceArea()
          Returns the total area of downloaded data (the "yellow rectangles").
 java.util.List<Bounds> getDataSourceBounds()
          Replies the list of data source bounds.
 java.util.Collection<WaySegment> getHighlightedVirtualNodes()
          returns an unmodifiable collection of *WaySegments* whose virtual nodes should be highlighted.
 java.util.Collection<WaySegment> getHighlightedWaySegments()
          returns an unmodifiable collection of WaySegments that should be highlighted.
 int getHighlightUpdateCount()
          This method can be used to detect changes in highlight state of primitives.
 java.util.Collection<Node> getNodes()
          Replies an unmodifiable collection of nodes in this dataset
 OsmPrimitive getPrimitiveById(long id, OsmPrimitiveType type)
          returns a primitive with a given id from the data set.
 OsmPrimitive getPrimitiveById(PrimitiveId primitiveId)
           
private  OsmPrimitive getPrimitiveByIdChecked(PrimitiveId primitiveId)
          Show message and stack trace in log in case primitive is not found
private
<T extends OsmPrimitive>
java.util.Collection<T>
getPrimitives(Predicate<OsmPrimitive> predicate)
           
 java.util.concurrent.locks.Lock getReadLock()
           
 java.util.Collection<Relation> getRelations()
          Replies an unmodifiable collection of relations in this dataset
 java.util.Collection<OsmPrimitive> getSelected()
          Replies an unmodifiable collection of primitives currently selected in this dataset, except deleted ones.
 java.util.Collection<Node> getSelectedNodes()
          Return selected nodes.
 java.util.Collection<OsmPrimitive> getSelectedNodesAndWays()
           
 java.util.Collection<Relation> getSelectedRelations()
          Return selected relations.
 java.util.Collection<Way> getSelectedWays()
          Return selected ways.
 java.util.LinkedList<java.util.Collection<? extends OsmPrimitive>> getSelectionHistory()
          Replies the history of JOSM selections
 java.lang.String getVersion()
          Replies the API version this dataset was created from.
 java.util.Collection<Way> getWays()
          Replies an unmodifiable collection of ways in this dataset
 void invalidateEastNorthCache()
          Invalidates the internal cache of projected east/north coordinates.
 boolean isModified()
          Replies true if there is at least one primitive in this dataset with AbstractPrimitive.isModified() == true.
 boolean isSelected(OsmPrimitive osm)
           
 boolean isUploadDiscouraged()
           
 void mergeFrom(DataSet from)
          Moves all primitives and datasources from DataSet "from" to this DataSet
 void mergeFrom(DataSet from, ProgressMonitor progressMonitor)
          Moves all primitives and datasources from DataSet "from" to this DataSet
 void projectionChanged(Projection oldValue, Projection newValue)
           
private  void reindexNode(Node node, LatLon newCoor, EastNorth eastNorth)
           
private  void reindexRelation(Relation relation)
           
private  void reindexWay(Way way)
           
 void removeDataSetListener(DataSetListener dsl)
           
 void removePrimitive(PrimitiveId primitiveId)
          Removes a primitive from the dataset.
static void removeSelectionListener(SelectionChangedListener listener)
           
 java.util.List<Node> searchNodes(BBox bbox)
           
 java.util.List<Relation> searchRelations(BBox bbox)
           
 java.util.List<Way> searchWays(BBox bbox)
           
 boolean selectionEmpty()
           
 void setHighlightedVirtualNodes(java.util.Collection<WaySegment> waySegments)
          set what virtual nodes should be highlighted.
 void setHighlightedWaySegments(java.util.Collection<WaySegment> waySegments)
          set what virtual ways should be highlighted.
 void setSelected(java.util.Collection<? extends PrimitiveId> selection)
          Sets the current selection to the primitives in selection and notifies all SelectionChangedListener.
 void setSelected(java.util.Collection<? extends PrimitiveId> selection, boolean fireSelectionChangeEvent)
          Sets the current selection to the primitives in selection.
 void setSelected(PrimitiveId... osm)
           
 void setUploadDiscouraged(boolean uploadDiscouraged)
           
 void setVersion(java.lang.String version)
          Sets the API version this dataset was created from.
 void toggleSelected(java.util.Collection<? extends PrimitiveId> osm)
           
 void toggleSelected(PrimitiveId... osm)
           
 void unlinkNodeFromWays(Node node)
          removes all references from ways in this dataset to a particular node
 void unlinkPrimitiveFromRelations(OsmPrimitive primitive)
          removes all references from relations in this dataset to this primitive
 void unlinkReferencesToPrimitive(OsmPrimitive referencedPrimitive)
          removes all references from other primitives to the referenced primitive
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_SINGLE_EVENTS

private static final int MAX_SINGLE_EVENTS
Maximum number of events that can be fired between beginUpdate/endUpdate to be send as single events (ie without DatasetChangedEvent)

See Also:
Constant Field Values

MAX_EVENTS

private static final int MAX_EVENTS
Maximum number of events to kept between beginUpdate/endUpdate. When more events are created, that simple DatasetChangedEvent is sent)

See Also:
Constant Field Values

allPrimitives

private Storage<OsmPrimitive> allPrimitives

primitivesMap

private java.util.Map<PrimitiveId,OsmPrimitive> primitivesMap

listeners

private java.util.concurrent.CopyOnWriteArrayList<DataSetListener> listeners

highlightedVirtualNodes

private java.util.Collection<WaySegment> highlightedVirtualNodes

highlightedWaySegments

private java.util.Collection<WaySegment> highlightedWaySegments

updateCount

private int updateCount

cachedEvents

private final java.util.List<AbstractDatasetChangedEvent> cachedEvents

highlightUpdateCount

private int highlightUpdateCount

uploadDiscouraged

private boolean uploadDiscouraged

lock

private final java.util.concurrent.locks.ReadWriteLock lock

selectionLock

private final java.lang.Object selectionLock

selectionHistory

private final java.util.LinkedList<java.util.Collection<? extends OsmPrimitive>> selectionHistory
History of selections - shared by plugins and SelectionListDialog


autocomplete

private AutoCompletionManager autocomplete
Maintain a list of used tags for autocompletion


version

private java.lang.String version
The API version that created this data set, if any.


changeSetTags

private java.util.Map<java.lang.String,java.lang.String> changeSetTags

nodes

private QuadBuckets<Node> nodes
All nodes goes here, even when included in other data (ways etc). This enables the instant conversion of the whole DataSet by iterating over this data structure.


ways

private QuadBuckets<Way> ways
All ways (Streets etc.) in the DataSet. The way nodes are stored only in the way list.


relations

private java.util.Collection<Relation> relations
All relations/relationships


dataSources

public final java.util.Collection<DataSource> dataSources
All data sources of this DataSet.


selListeners

private static final java.util.Collection<SelectionChangedListener> selListeners
A list of listeners to selection changed events. The list is static, as listeners register themselves for any dataset selection changes that occur, regardless of the current active dataset. (However, the selection does only change in the active layer)


selectedPrimitives

private java.util.LinkedHashSet<OsmPrimitive> selectedPrimitives

selectionSnapshot

private java.util.Collection<OsmPrimitive> selectionSnapshot
Constructor Detail

DataSet

public DataSet()
Method Detail

getReadLock

public java.util.concurrent.locks.Lock getReadLock()

getHighlightUpdateCount

public int getHighlightUpdateCount()
This method can be used to detect changes in highlight state of primitives. If highlighting was changed then the method will return different number.

Returns:

getSelectionHistory

public java.util.LinkedList<java.util.Collection<? extends OsmPrimitive>> getSelectionHistory()
Replies the history of JOSM selections

Returns:

clearSelectionHistory

public void clearSelectionHistory()
Clears selection history list


getAutoCompletionManager

public AutoCompletionManager getAutoCompletionManager()

getVersion

public java.lang.String getVersion()
Replies the API version this dataset was created from. May be null.

Returns:
the API version this dataset was created from. May be null.

setVersion

public void setVersion(java.lang.String version)
Sets the API version this dataset was created from.

Parameters:
version - the API version, i.e. "0.5" or "0.6"

isUploadDiscouraged

public final boolean isUploadDiscouraged()

setUploadDiscouraged

public final void setUploadDiscouraged(boolean uploadDiscouraged)

getChangeSetTags

public java.util.Map<java.lang.String,java.lang.String> getChangeSetTags()

addChangeSetTag

public void addChangeSetTag(java.lang.String k,
                            java.lang.String v)

getPrimitives

private <T extends OsmPrimitive> java.util.Collection<T> getPrimitives(Predicate<OsmPrimitive> predicate)

getNodes

public java.util.Collection<Node> getNodes()
Replies an unmodifiable collection of nodes in this dataset

Returns:
an unmodifiable collection of nodes in this dataset

searchNodes

public java.util.List<Node> searchNodes(BBox bbox)

getWays

public java.util.Collection<Way> getWays()
Replies an unmodifiable collection of ways in this dataset

Returns:
an unmodifiable collection of ways in this dataset

searchWays

public java.util.List<Way> searchWays(BBox bbox)

getRelations

public java.util.Collection<Relation> getRelations()
Replies an unmodifiable collection of relations in this dataset

Returns:
an unmodifiable collection of relations in this dataset

searchRelations

public java.util.List<Relation> searchRelations(BBox bbox)

allPrimitives

public java.util.Collection<OsmPrimitive> allPrimitives()
Returns:
A collection containing all primitives of the dataset. Data are not ordered

allNonDeletedPrimitives

public java.util.Collection<OsmPrimitive> allNonDeletedPrimitives()
Returns:
A collection containing all not-deleted primitives (except keys).

allNonDeletedCompletePrimitives

public java.util.Collection<OsmPrimitive> allNonDeletedCompletePrimitives()

allNonDeletedPhysicalPrimitives

public java.util.Collection<OsmPrimitive> allNonDeletedPhysicalPrimitives()

allModifiedPrimitives

public java.util.Collection<OsmPrimitive> allModifiedPrimitives()

addPrimitive

public void addPrimitive(OsmPrimitive primitive)
Adds a primitive to the dataset

Parameters:
primitive - the primitive.

removePrimitive

public void removePrimitive(PrimitiveId primitiveId)
Removes a primitive from the dataset. This method only removes the primitive form the respective collection of primitives managed by this dataset, i.e. from nodes, ways, or relations. References from other primitives to this primitive are left unchanged.

Parameters:
primitive - the primitive

addSelectionListener

public static void addSelectionListener(SelectionChangedListener listener)

removeSelectionListener

public static void removeSelectionListener(SelectionChangedListener listener)

fireSelectionChanged

public void fireSelectionChanged()
Notifies all registered SelectionChangedListener about the current selection in this dataset.


getSelectedNodesAndWays

public java.util.Collection<OsmPrimitive> getSelectedNodesAndWays()

getHighlightedVirtualNodes

public java.util.Collection<WaySegment> getHighlightedVirtualNodes()
returns an unmodifiable collection of *WaySegments* whose virtual nodes should be highlighted. WaySegments are used to avoid having to create a VirtualNode class that wouldn't have much purpose otherwise.

Returns:
unmodifiable collection of WaySegments

getHighlightedWaySegments

public java.util.Collection<WaySegment> getHighlightedWaySegments()
returns an unmodifiable collection of WaySegments that should be highlighted.

Returns:
unmodifiable collection of WaySegments

getSelected

public java.util.Collection<OsmPrimitive> getSelected()
Replies an unmodifiable collection of primitives currently selected in this dataset, except deleted ones. May be empty, but not null.

Returns:
unmodifiable collection of primitives

getAllSelected

public java.util.Collection<OsmPrimitive> getAllSelected()
Replies an unmodifiable collection of primitives currently selected in this dataset, including deleted ones. May be empty, but not null.

Returns:
unmodifiable collection of primitives

getSelectedNodes

public java.util.Collection<Node> getSelectedNodes()
Return selected nodes.


getSelectedWays

public java.util.Collection<Way> getSelectedWays()
Return selected ways.


getSelectedRelations

public java.util.Collection<Relation> getSelectedRelations()
Return selected relations.


selectionEmpty

public boolean selectionEmpty()
Returns:
whether the selection is empty or not

isSelected

public boolean isSelected(OsmPrimitive osm)

toggleSelected

public void toggleSelected(java.util.Collection<? extends PrimitiveId> osm)

toggleSelected

public void toggleSelected(PrimitiveId... osm)

__toggleSelected

private boolean __toggleSelected(PrimitiveId primitiveId)

setHighlightedVirtualNodes

public void setHighlightedVirtualNodes(java.util.Collection<WaySegment> waySegments)
set what virtual nodes should be highlighted. Requires a Collection of *WaySegments* to avoid a VirtualNode class that wouldn't have much use otherwise.

Parameters:
Collection - of waySegments

setHighlightedWaySegments

public void setHighlightedWaySegments(java.util.Collection<WaySegment> waySegments)
set what virtual ways should be highlighted.

Parameters:
Collection - of waySegments

setSelected

public void setSelected(java.util.Collection<? extends PrimitiveId> selection,
                        boolean fireSelectionChangeEvent)
Sets the current selection to the primitives in selection. Notifies all SelectionChangedListener if fireSelectionChangeEvent is true.

Parameters:
selection - the selection
fireSelectionChangeEvent - true, if the selection change listeners are to be notified; false, otherwise

setSelected

public void setSelected(java.util.Collection<? extends PrimitiveId> selection)
Sets the current selection to the primitives in selection and notifies all SelectionChangedListener.

Parameters:
selection - the selection

setSelected

public void setSelected(PrimitiveId... osm)

addSelected

public void addSelected(java.util.Collection<? extends PrimitiveId> selection)
Adds the primitives in selection to the current selection and notifies all SelectionChangedListener.

Parameters:
selection - the selection

addSelected

public void addSelected(PrimitiveId... osm)

addSelected

private boolean addSelected(java.util.Collection<? extends PrimitiveId> selection,
                            boolean fireSelectionChangeEvent)
Adds the primitives in selection to the current selection. Notifies all SelectionChangedListener if fireSelectionChangeEvent is true.

Parameters:
selection - the selection
fireSelectionChangeEvent - true, if the selection change listeners are to be notified; false, otherwise
Returns:
if the selection was changed in the process

clearHighlightedVirtualNodes

public void clearHighlightedVirtualNodes()
clear all highlights of virtual nodes


clearHighlightedWaySegments

public void clearHighlightedWaySegments()
clear all highlights of way segments


clearSelection

public void clearSelection(PrimitiveId... osm)
Remove the selection from every value in the collection.

Parameters:
list - The collection to remove the selection from.

clearSelection

public void clearSelection(java.util.Collection<? extends PrimitiveId> list)

clearSelection

public void clearSelection()

clone

public DataSet clone()
Overrides:
clone in class java.lang.Object

getDataSourceArea

public java.awt.geom.Area getDataSourceArea()
Returns the total area of downloaded data (the "yellow rectangles").

Returns:
Area object encompassing downloaded data.

getPrimitiveById

public OsmPrimitive getPrimitiveById(long id,
                                     OsmPrimitiveType type)
returns a primitive with a given id from the data set. null, if no such primitive exists

Parameters:
id - uniqueId of the primitive. Might be < 0 for newly created primitives
type - the type of the primitive. Must not be null.
Returns:
the primitive
Throws:
java.lang.NullPointerException - thrown, if type is null

getPrimitiveById

public OsmPrimitive getPrimitiveById(PrimitiveId primitiveId)

getPrimitiveByIdChecked

private OsmPrimitive getPrimitiveByIdChecked(PrimitiveId primitiveId)
Show message and stack trace in log in case primitive is not found

Parameters:
primitiveId -
Returns:
Primitive by id.

deleteWay

private void deleteWay(Way way)

unlinkNodeFromWays

public void unlinkNodeFromWays(Node node)
removes all references from ways in this dataset to a particular node

Parameters:
node - the node

unlinkPrimitiveFromRelations

public void unlinkPrimitiveFromRelations(OsmPrimitive primitive)
removes all references from relations in this dataset to this primitive

Parameters:
primitive - the primitive

unlinkReferencesToPrimitive

public void unlinkReferencesToPrimitive(OsmPrimitive referencedPrimitive)
removes all references from other primitives to the referenced primitive

Parameters:
referencedPrimitive - the referenced primitive

isModified

public boolean isModified()
Replies true if there is at least one primitive in this dataset with AbstractPrimitive.isModified() == true.

Returns:
true if there is at least one primitive in this dataset with AbstractPrimitive.isModified() == true.

reindexNode

private void reindexNode(Node node,
                         LatLon newCoor,
                         EastNorth eastNorth)

reindexWay

private void reindexWay(Way way)

reindexRelation

private void reindexRelation(Relation relation)

addDataSetListener

public void addDataSetListener(DataSetListener dsl)

removeDataSetListener

public void removeDataSetListener(DataSetListener dsl)

beginUpdate

public void beginUpdate()
Can be called before bigger changes on dataset. Events are disabled until endUpdate(). DataSetListener#dataChanged() event is triggered after end of changes
Typical usecase should look like this:
 ds.beginUpdate();
 try {
   ...
 } finally {
   ds.endUpdate();
 }
 


endUpdate

public void endUpdate()
See Also:
beginUpdate()

fireEventToListeners

private void fireEventToListeners(AbstractDatasetChangedEvent event)

fireEvent

private void fireEvent(AbstractDatasetChangedEvent event)

firePrimitivesAdded

void firePrimitivesAdded(java.util.Collection<? extends OsmPrimitive> added,
                         boolean wasIncomplete)

firePrimitivesRemoved

void firePrimitivesRemoved(java.util.Collection<? extends OsmPrimitive> removed,
                           boolean wasComplete)

fireTagsChanged

void fireTagsChanged(OsmPrimitive prim,
                     java.util.Map<java.lang.String,java.lang.String> originalKeys)

fireRelationMembersChanged

void fireRelationMembersChanged(Relation r)

fireNodeMoved

void fireNodeMoved(Node node,
                   LatLon newCoor,
                   EastNorth eastNorth)

fireWayNodesChanged

void fireWayNodesChanged(Way way)

fireChangesetIdChanged

void fireChangesetIdChanged(OsmPrimitive primitive,
                            int oldChangesetId,
                            int newChangesetId)

fireHighlightingChanged

void fireHighlightingChanged(OsmPrimitive primitive)

invalidateEastNorthCache

public void invalidateEastNorthCache()
Invalidates the internal cache of projected east/north coordinates. This method can be invoked after the globally configured projection method changed. In contrast to DataSet#reproject() it only invalidates the cache and doesn't reproject the coordinates.


cleanupDeletedPrimitives

public void cleanupDeletedPrimitives()

cleanupDeleted

private boolean cleanupDeleted(java.util.Iterator<? extends OsmPrimitive> it)

clear

public void clear()
Removes all primitives from the dataset and resets the currently selected primitives to the empty collection. Also notifies selection change listeners if necessary.


deleteInvisible

public void deleteInvisible()
Marks all "invisible" objects as deleted. These objects should be always marked as deleted when downloaded from the server. They can be undeleted later if necessary.


getDataSourceBounds

public java.util.List<Bounds> getDataSourceBounds()

Replies the list of data source bounds.

Dataset maintains a list of data sources which have been merged into the data set. Each of these sources can optionally declare a bounding box of the data it supplied to the dataset.

This method replies the list of defined (non null) bounding boxes.

Returns:
the list of data source bounds. An empty list, if no non-null data source bounds are defined.

mergeFrom

public void mergeFrom(DataSet from)
Moves all primitives and datasources from DataSet "from" to this DataSet

Parameters:
from - The source DataSet

mergeFrom

public void mergeFrom(DataSet from,
                      ProgressMonitor progressMonitor)
Moves all primitives and datasources from DataSet "from" to this DataSet

Parameters:
from - The source DataSet

projectionChanged

public void projectionChanged(Projection oldValue,
                              Projection newValue)
Specified by:
projectionChanged in interface ProjectionChangeListener


JOSM