Changeset 8510 in josm for trunk/src/org/openstreetmap/josm/command
- Timestamp:
- 2015-06-20T23:42:21+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/command
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/AddCommand.java
r8456 r8510 52 52 if (osm instanceof Way) { 53 53 // Fix #10557 - node icon not updated after undoing/redoing addition of a way 54 ((Way) osm).clearCachedNodeStyles();54 ((Way) osm).clearCachedNodeStyles(); 55 55 } 56 56 } -
trunk/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java
r8456 r8510 69 69 } 70 70 71 @Override public boolean executeCommand() { 71 @Override 72 public boolean executeCommand() { 72 73 Collection<OsmPrimitive> primitivesToSelect; 73 74 if (createdPrimitives == null) { // first time execution … … 94 95 95 96 // Then load ways and relations 96 for (int i =0; i<newPrimitives.size(); i++) {97 for (int i = 0; i < newPrimitives.size(); i++) { 97 98 if (!(newPrimitives.get(i) instanceof Node)) { 98 99 newPrimitives.get(i).load(data.get(i)); -
trunk/src/org/openstreetmap/josm/command/ChangeCommand.java
r8456 r8510 54 54 CheckParameterUtil.ensureParameterNotNull(osm, "osm"); 55 55 CheckParameterUtil.ensureParameterNotNull(newOsm, "newOsm"); 56 if (newOsm instanceof Way && ((Way) newOsm).getNodesCount() == 0) {56 if (newOsm instanceof Way && ((Way) newOsm).getNodesCount() == 0) { 57 57 // Do not allow to create empty ways (see #7465) 58 58 throw new IllegalArgumentException(tr("New way {0} has 0 nodes", newOsm)); -
trunk/src/org/openstreetmap/josm/command/ChangePropertyKeyCommand.java
r8456 r8510 88 88 text += " "+tr(v.className)+" "+v.name; 89 89 } else { 90 text += " "+objects.size()+" "+trn("object", "objects",objects.size());90 text += " "+objects.size()+" "+trn("object", "objects", objects.size()); 91 91 } 92 92 return text; … … 112 112 return v.name; 113 113 } 114 114 115 @Override 115 116 public Icon getDescriptionIcon() { 116 117 return v.icon; 117 118 } 119 118 120 @Override 119 121 public Collection<? extends OsmPrimitive> getParticipatingPrimitives() { -
trunk/src/org/openstreetmap/josm/command/Command.java
r8447 r8510 45 45 orig.put(n, n.save()); 46 46 } 47 47 48 @Override 48 49 public void visit(Way w) { 49 50 orig.put(w, w.save()); 50 51 } 52 51 53 @Override 52 54 public void visit(Relation e) { … … 68 70 * @param node The node whose state has to be remembered 69 71 */ 70 public OldNodeState(Node node) {72 public OldNodeState(Node node) { 71 73 latlon = node.getCoor(); 72 74 eastNorth = node.getEastNorth(); … … 280 282 JOptionPane.QUESTION_MESSAGE, 281 283 JOptionPane.YES_OPTION); 282 if (!answer)284 if (!answer) 283 285 return false; 284 286 } … … 294 296 JOptionPane.QUESTION_MESSAGE, 295 297 JOptionPane.YES_OPTION); 296 if (!answer)298 if (!answer) 297 299 return false; 298 300 } -
trunk/src/org/openstreetmap/josm/command/DeleteCommand.java
r8469 r8510 259 259 if (!silent && !checkAndConfirmOutlyingDelete(parents, null)) 260 260 return null; 261 return new DeleteCommand(layer, parents);261 return new DeleteCommand(layer, parents); 262 262 } 263 263 … … 405 405 Set<RelationToChildReference> references = RelationToChildReference.getRelationToChildReferences(primitivesToDelete); 406 406 Iterator<RelationToChildReference> it = references.iterator(); 407 while (it.hasNext()) {407 while (it.hasNext()) { 408 408 RelationToChildReference ref = it.next(); 409 409 if (ref.getParent().isDeleted()) { … … 431 431 // 432 432 if (!primitivesToDelete.isEmpty()) { 433 cmds.add(new DeleteCommand(layer, primitivesToDelete));433 cmds.add(new DeleteCommand(layer, primitivesToDelete)); 434 434 } 435 435 … … 473 473 chunks.add(n1); 474 474 chunks.add(n2); 475 return SplitWayAction.splitWay(layer, ws.way, chunks, Collections.<OsmPrimitive>emptyList()).getCommand();475 return SplitWayAction.splitWay(layer, ws.way, chunks, Collections.<OsmPrimitive>emptyList()).getCommand(); 476 476 } 477 477 } -
trunk/src/org/openstreetmap/josm/command/PurgeCommand.java
r8509 r8510 84 84 * Loop from back to front to keep referential integrity. 85 85 */ 86 for (int i =toPurge.size()-1; i>=0; --i) {86 for (int i = toPurge.size()-1; i >= 0; --i) { 87 87 OsmPrimitive osm = toPurge.get(i); 88 88 if (makeIncompleteDataByPrimId.containsKey(osm)) { … … 214 214 Integer i = numChilds.get(parent); 215 215 if (i != null) { 216 numChilds.put((Relation) parent, i+1);216 numChilds.put((Relation) parent, i+1); 217 217 } 218 218 } -
trunk/src/org/openstreetmap/josm/command/SequenceCommand.java
r8456 r8510 50 50 51 51 @Override public boolean executeCommand() { 52 for (int i =0; i < sequence.length; i++) {52 for (int i = 0; i < sequence.length; i++) { 53 53 boolean result = sequence[i].executeCommand(); 54 54 if (!result && !continueOnError) { -
trunk/src/org/openstreetmap/josm/command/TransformNodesCommand.java
r8456 r8510 130 130 */ 131 131 public EastNorth getNodesCenter() { 132 EastNorth sum = new EastNorth(0, 0);132 EastNorth sum = new EastNorth(0, 0); 133 133 134 134 for (Node n : nodes) { -
trunk/src/org/openstreetmap/josm/command/conflict/ConflictAddCommand.java
r8456 r8510 52 52 try { 53 53 getLayer().getConflicts().add(conflict); 54 } catch (IllegalStateException e) {54 } catch (IllegalStateException e) { 55 55 Main.error(e); 56 56 warnBecauseOfDoubleConflict(); -
trunk/src/org/openstreetmap/josm/command/conflict/ConflictResolveCommand.java
r8456 r8510 57 57 protected void reconstituteConflicts() { 58 58 OsmDataLayer editLayer = getLayer(); 59 for (Conflict<?> c : resolvedConflicts) {59 for (Conflict<?> c : resolvedConflicts) { 60 60 if (!editLayer.getConflicts().hasConflictForMy(c.getMy())) { 61 61 editLayer.getConflicts().add(c); -
trunk/src/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommand.java
r8456 r8510 49 49 @Override 50 50 public boolean executeCommand() { 51 // remember the current state of modified primitives, i.e. of 52 // OSM primitive 'my' 53 // 51 // remember the current state of modified primitives, i.e. of OSM primitive 'my' 54 52 super.executeCommand(); 55 53 … … 57 55 // do nothing 58 56 } else if (decision.equals(MergeDecisionType.KEEP_THEIR)) { 59 Node my = (Node) conflict.getMy();60 Node their = (Node) conflict.getTheir();57 Node my = (Node) conflict.getMy(); 58 Node their = (Node) conflict.getTheir(); 61 59 my.setCoor(their.getCoor()); 62 60 } else … … 65 63 66 64 // remember the layer this command was applied to 67 //68 65 rememberConflict(conflict); 69 66 -
trunk/src/org/openstreetmap/josm/command/conflict/ModifiedConflictResolveCommand.java
r8456 r8510 40 40 case RELATION: msg = marktr("Set the ''modified'' flag for relation {0}"); break; 41 41 } 42 return tr(msg, conflict.getMy().getId());42 return tr(msg, conflict.getMy().getId()); 43 43 } 44 44 -
trunk/src/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommand.java
r8456 r8510 92 92 // 93 93 if (!editLayer.getConflicts().hasConflictForMy(my)) { 94 editLayer.getConflicts().add(my, their);94 editLayer.getConflicts().add(my, their); 95 95 } 96 96 } -
trunk/src/org/openstreetmap/josm/command/conflict/VersionConflictResolveCommand.java
r8456 r8510 56 56 conflict.getMy().setOsmId( 57 57 conflict.getMy().getId(), 58 (int) Math.max(myVersion, theirVersion)58 (int) Math.max(myVersion, theirVersion) 59 59 ); 60 60 // update visiblity state
Note: See TracChangeset
for help on using the changeset viewer.