Changeset 10829 in osm for applications/editors/josm/plugins/utilsplugin/src
- Timestamp:
- 2008-09-22T10:17:55+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/utilsplugin/src/UtilsPlugin/SimplifyWayAction.java
r10823 r10829 40 40 OsmDataLayer dataLayer = Main.main.editLayer(); 41 41 for (DataSource ds : dataLayer.data.dataSources) { 42 bounds.add(ds.bounds); 42 if (ds.bounds != null) 43 bounds.add(ds.bounds); 43 44 } 44 45 for (OsmPrimitive prim : selection) { 45 46 if (prim instanceof Way) { 46 Way way = (Way) prim; 47 // We check if each node of each way is at least in one download 48 // bounding box. Otherwise nodes may get deleted that are necessary by 49 // unloaded ways (see Ticket #1594) 50 for (Node node : way.nodes) { 51 boolean isInsideOneBoundingBox = false; 52 for (Bounds b : bounds) { 53 if (b.contains(node.coor)) { 54 isInsideOneBoundingBox = true; 47 if (bounds.size() > 0) { 48 Way way = (Way) prim; 49 // We check if each node of each way is at least in one download 50 // bounding box. Otherwise nodes may get deleted that are necessary by 51 // unloaded ways (see Ticket #1594) 52 for (Node node : way.nodes) { 53 boolean isInsideOneBoundingBox = false; 54 for (Bounds b : bounds) { 55 if (b.contains(node.coor)) { 56 isInsideOneBoundingBox = true; 57 break; 58 } 59 } 60 if (!isInsideOneBoundingBox) { 61 int option = JOptionPane.showConfirmDialog(Main.parent, 62 tr("The selected way(s) have nodes outside of the downloaded data region." 63 + "This can lead to nodes beeing deleted accidentially.\n" 64 + "Are you really sure to continue?"), 65 tr("Plase abort if you are not sure"), JOptionPane.YES_NO_CANCEL_OPTION, 66 JOptionPane.WARNING_MESSAGE); 67 68 if (option != JOptionPane.YES_OPTION) 69 return; 55 70 break; 56 71 } 57 }58 if (!isInsideOneBoundingBox) {59 int option = JOptionPane.showConfirmDialog(Main.parent,60 tr("The selected way(s) have nodes outside of the downloaded data region."61 + "This can lead to nodes beeing deleted accidentially.\n"62 + "Are you really sure to continue?"), tr("Plase abort if you are not sure"),63 JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);64 65 if (option != JOptionPane.YES_OPTION)66 return;67 break;68 72 } 69 73 }
Note:
See TracChangeset
for help on using the changeset viewer.