Changeset 2444 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2009-11-13T11:34:34+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/UpdateSelectionAction.java
r2433 r2444 2 2 package org.openstreetmap.josm.actions; 3 3 4 import static org.openstreetmap.josm.gui.help.HelpUtil.ht; 4 5 import static org.openstreetmap.josm.tools.I18n.tr; 5 import static org.openstreetmap.josm.gui.help.HelpUtil.ht;6 6 7 7 import java.awt.event.ActionEvent; … … 67 67 68 68 /** 69 * Updates the data for forthe {@see OsmPrimitive}s with id <code>id</code>69 * Updates the data for the {@see OsmPrimitive}s with id <code>id</code> 70 70 * with the data currently kept on the server. 71 71 * 72 * @param id the id of a primitive in the {@see DataSet} of the current edit lay ser72 * @param id the id of a primitive in the {@see DataSet} of the current edit layer 73 73 * @exception IllegalStateException thrown if there is no primitive with <code>id</code> in 74 74 * the current dataset … … 89 89 */ 90 90 public UpdateSelectionAction() { 91 super(tr("Update selection s"),91 super(tr("Update selection"), 92 92 "updateselection", 93 93 tr("Updates the currently selected objects from the server (re-downloads data)"), … … 124 124 JOptionPane.showMessageDialog( 125 125 Main.parent, 126 tr("There are no selected primitives to update."),126 tr("There are no selected objects to update."), 127 127 tr("Selection empty"), 128 128 JOptionPane.INFORMATION_MESSAGE … … 145 145 146 146 public UpdatePrimitivesTask(Collection<? extends OsmPrimitive> toUpdate) { 147 super( "Update primitives", false /* don't ignore exception*/);147 super(tr("Update objects"), false /* don't ignore exception*/); 148 148 canceled = false; 149 149 this.toUpdate = toUpdate; … … 168 168 if (ds != null) { 169 169 Main.map.mapView.getEditLayer().mergeFrom(ds); 170 Main.map.mapView.getEditLayer().onPostDownloadFromServer(); 170 171 } 171 172 } … … 215 216 DataSetMerger merger = new DataSetMerger(ds, theirDataSet); 216 217 merger.merge(); 217 // a way sloaded with MultiFetch may be incomplete because at least one of its218 // a way loaded with MultiFetch may be incomplete because at least one of its 218 219 // nodes isn't present in the local data set. We therefore fully load all 219 220 // incomplete ways. -
trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java
r2443 r2444 135 135 } 136 136 137 protected OsmPrimitive getMergeTarget(OsmPrimitive mergeSource) {137 protected OsmPrimitive getMergeTarget(OsmPrimitive mergeSource) throws IllegalStateException{ 138 138 Long targetId = mergedMap.get(mergeSource.getUniqueId()); 139 139 if (targetId == null) 140 throw new RuntimeException(tr("Missing merge target for way with id {0}", mergeSource.getUniqueId()));140 return null; 141 141 return targetDataSet.getPrimitiveById(targetId, mergeSource.getType()); 142 142 } … … 306 306 childrenToMerge.add(source.getUniqueId()); 307 307 } else if (target.isModified() && ! source.isModified() && target.getVersion() == source.getVersion()) { 308 // my is same as other but mineis modified309 // => keep mine308 // target is same as source but target is modified 309 // => keep target 310 310 } else if (! target.hasEqualSemanticAttributes(source)) { 311 // my is modified and is not semantically equal with other. Can't automatically311 // target is modified and is not semantically equal with source. Can't automatically 312 312 // resolve the differences 313 313 // => create a conflict -
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r2410 r2444 23 23 import org.openstreetmap.josm.data.osm.Node; 24 24 import org.openstreetmap.josm.data.osm.OsmPrimitive; 25 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 25 26 import org.openstreetmap.josm.data.osm.Relation; 26 27 import org.openstreetmap.josm.data.osm.RelationMember; … … 428 429 ) 429 430 ); 430 n = new Node(id); 431 n.incomplete = true; 431 // create an incomplete node if necessary 432 // 433 n = (Node)ds.getPrimitiveById(id,OsmPrimitiveType.NODE); 434 if (n == null) { 435 n = new Node(id); 436 n.incomplete = true; 437 ds.addPrimitive(n); 438 } 432 439 incomplete = true; 433 440 }
Note:
See TracChangeset
for help on using the changeset viewer.