Changeset 4667 in osm for applications
- Timestamp:
- 2007-09-24T00:31:27+02:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/core_0.5/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
r4466 r4667 169 169 if (ways.size() > 1) 170 170 return tr("Used by more than one way."); 171 Way w = ways.get(0); 171 172 if (ways.size() == 1) { 173 // node in way 174 Way w = ways.get(0); 172 175 173 int i = w.nodes.indexOf(n);174 if (w.nodes.lastIndexOf(n) != i)175 return tr("Occurs more than once in the same way.");176 if (i == 0 || i == w.nodes.size() - 1)177 return tr("Is at the end of a way");176 int i = w.nodes.indexOf(n); 177 if (w.nodes.lastIndexOf(n) != i) 178 return tr("Occurs more than once in the same way."); 179 if (i == 0 || i == w.nodes.size() - 1) 180 return tr("Is at the end of a way"); 178 181 179 Way wnew = new Way(w);180 wnew.nodes.remove(i);182 Way wnew = new Way(w); 183 wnew.nodes.remove(i); 181 184 182 Collection<Command> cmds = new LinkedList<Command>(); 183 cmds.add(new ChangeCommand(w, wnew)); 184 cmds.add(new DeleteCommand(Collections.singleton(n))); 185 Main.main.undoRedo.add(new SequenceCommand(tr("Delete Node"), cmds)); 185 Collection<Command> cmds = new LinkedList<Command>(); 186 cmds.add(new ChangeCommand(w, wnew)); 187 cmds.add(new DeleteCommand(Collections.singleton(n))); 188 Main.main.undoRedo.add(new SequenceCommand(tr("Delete Node"), cmds)); 189 } else { 190 // unwayed node 191 Main.main.undoRedo.add(new DeleteCommand(Collections.singleton(n))); 192 } 186 193 return null; 187 194 }
Note:
See TracChangeset
for help on using the changeset viewer.