- Timestamp:
- 2009-06-28T15:28:36+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r1640 r1712 17 17 import java.util.LinkedList; 18 18 import java.util.List; 19 import java.util.TreeSet; 19 20 20 21 import javax.swing.JOptionPane; … … 36 37 import org.openstreetmap.josm.data.osm.visitor.AllNodesVisitor; 37 38 import org.openstreetmap.josm.data.osm.visitor.SimplePaintVisitor; 39 import org.openstreetmap.josm.gui.ExtendedDialog; 38 40 import org.openstreetmap.josm.gui.MapFrame; 39 41 import org.openstreetmap.josm.gui.MapView; … … 417 419 } else { 418 420 Collection<OsmPrimitive> selection = Main.ds.getSelected(); 421 Collection<OsmPrimitive> s = new TreeSet<OsmPrimitive>(); 422 int max = Main.pref.getInteger("warn.move.maxelements", 20); 423 for (OsmPrimitive osm : selection) 424 { 425 if(osm instanceof Node) 426 s.add(osm); 427 else if(osm instanceof Way) 428 { 429 s.add(osm); 430 s.addAll(((Way)osm).nodes); 431 } 432 if(s.size() > max) 433 { 434 if(1 != new ExtendedDialog(Main.parent, tr("Move elements"), 435 tr("You did move more than {0} elements. " 436 + "Moving a large number of elements is often an error.\n" 437 + "Really move them?", max), 438 new String[] {tr("Move them"), tr("Undo move")}, 439 new String[] {"reorder.png", "cancel.png"}).getValue()) 440 { 441 Main.main.undoRedo.undo(); 442 } 443 break; 444 } 445 } 419 446 if (ctrl) { 420 447 Collection<Node> affectedNodes = AllNodesVisitor.getAllNodes(selection);
Note:
See TracChangeset
for help on using the changeset viewer.