Changeset 4458 in josm for trunk/src/org/openstreetmap/josm/data/validation
- Timestamp:
- 2011-09-24T12:09:32+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
r4043 r4458 24 24 import org.openstreetmap.josm.actions.MergeNodesAction; 25 25 import org.openstreetmap.josm.command.Command; 26 import org.openstreetmap.josm.command.DeleteCommand; 26 27 import org.openstreetmap.josm.data.coor.LatLon; 27 28 import org.openstreetmap.josm.data.osm.Hash; … … 390 391 } 391 392 392 if ( checkAndConfirmOutlyingDeletes(nodes, target))393 if (DeleteCommand.checkAndConfirmOutlyingDelete(Main.main.getCurrentDataSet().getDataSourceArea(), nodes, target)) 393 394 return MergeNodesAction.mergeNodes(Main.main.getEditLayer(), nodes, target); 394 395 … … 406 407 return true; 407 408 } 408 409 /**410 * Check whether user is about to delete data outside of the download area.411 * Request confirmation if he is.412 */413 private static boolean checkAndConfirmOutlyingDeletes(LinkedHashSet<Node> del, Node ignore) {414 Area a = Main.main.getCurrentDataSet().getDataSourceArea();415 if (a != null) {416 for (OsmPrimitive osm : del) {417 if (osm instanceof Node && !osm.isNew() && osm != ignore) {418 Node n = (Node) osm;419 if (!a.contains(n.getCoor())) {420 JPanel msg = new JPanel(new GridBagLayout());421 msg.add(new JLabel(422 "<html>" +423 // leave message in one tr() as there is a grammatical424 // connection.425 tr("You are about to delete nodes outside of the area you have downloaded."426 + "<br>"427 + "This can cause problems because other objects (that you do not see) might use them."428 + "<br>" + "Do you really want to delete?") + "</html>"));429 430 return ConditionalOptionPaneUtil.showConfirmationDialog(431 "delete_outside_nodes",432 Main.parent,433 msg,434 tr("Delete confirmation"),435 JOptionPane.YES_NO_OPTION,436 JOptionPane.QUESTION_MESSAGE,437 JOptionPane.YES_OPTION);438 }439 }440 }441 }442 return true;443 }444 409 }
Note:
See TracChangeset
for help on using the changeset viewer.