Changeset 2419 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2009-11-09T08:21:13+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r2412 r2419 756 756 * Reindex all nodes and ways after their coordinates were changed. This is a temporary solution, reindexing should 757 757 * be automatic in the future 758 */ 758 * @deprecated Reindexing should be automatic 759 */ 760 @Deprecated 759 761 public void reindexAll() { 760 762 List<Node> ntmp = new ArrayList<Node>(nodes); … … 764 766 ways.clear(); 765 767 ways.addAll(wtmp); 768 } 769 770 void reindexNode(Node node) { 771 nodes.remove(node); 772 nodes.add(node); 773 for (Way way:OsmPrimitive.getFilteredList(node.getReferrers(), Way.class)) { 774 ways.remove(way); 775 ways.add(way); 776 } 777 } 778 779 void reindexWay(Way way) { 780 ways.remove(way); 781 ways.add(way); 766 782 } 767 783 -
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r2417 r2419 23 23 this.coor.setCoor(coor); 24 24 } 25 if (getDataSet() != null) { 26 getDataSet().reindexNode(this); 27 } 25 28 } 26 29 } … … 37 40 } else { 38 41 coor = new CachedLatLon(eastNorth); 42 } 43 if (getDataSet() != null) { 44 getDataSet().reindexNode(this); 39 45 } 40 46 } -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r2417 r2419 59 59 60 60 clearCached(); 61 reindex(); 61 62 } 62 63 … … 287 288 newNodes[nodes.length] = n; 288 289 nodes = newNodes; 290 reindex(); 289 291 } 290 292 … … 309 311 newNodes[offs] = n; 310 312 nodes = newNodes; 313 reindex(); 311 314 } 312 315 … … 320 323 } 321 324 } 325 reindex(); 322 326 super.setDeleted(deleted); 323 327 } … … 352 356 return OsmPrimitiveType.WAY; 353 357 } 358 359 private void reindex() { 360 if (getDataSet() != null) { 361 getDataSet().reindexWay(this); 362 } 363 } 354 364 }
Note:
See TracChangeset
for help on using the changeset viewer.