Changeset 6639 in josm for trunk/src/org/openstreetmap/josm/command
- Timestamp:
- 2014-01-06T12:27:11+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/command
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/Command.java
r6538 r6639 191 191 * @param outsideDialogMessage the message text to be displayed when data is outside of the download area 192 192 * @param incompleteDialogMessage the message text to be displayed when data is incomplete 193 * @param area the area used to determine whether data is outlying194 193 * @param primitives the primitives to operate on 195 194 * @param ignore {@code null} or a primitive to be ignored … … 198 197 public static boolean checkAndConfirmOutlyingOperation(String operation, 199 198 String dialogTitle, String outsideDialogMessage, String incompleteDialogMessage, 200 Area area,Collection<? extends OsmPrimitive> primitives,199 Collection<? extends OsmPrimitive> primitives, 201 200 Collection<? extends OsmPrimitive> ignore) { 202 201 boolean outside = false; … … 205 204 if (osm.isIncomplete()) { 206 205 incomplete = true; 207 } else if ( area != null && isOutlying(osm, area)206 } else if (osm.isOutsideDownloadArea() 208 207 && (ignore == null || !ignore.contains(osm))) { 209 208 outside = true; … … 241 240 } 242 241 243 private static boolean isOutlying(OsmPrimitive osm, Area area) {244 if (osm instanceof Node && !osm.isNewOrUndeleted()) {245 return !((Node) osm).getCoor().isIn(area);246 } else if (osm instanceof Way) {247 for (Node n : ((Way) osm).getNodes()) {248 if (isOutlying(n, area)) {249 return true;250 }251 }252 return false;253 }254 return false;255 }256 242 } -
trunk/src/org/openstreetmap/josm/command/DeleteCommand.java
r6524 r6639 7 7 8 8 import java.awt.GridBagLayout; 9 import java.awt.geom.Area;10 9 import java.util.ArrayList; 11 10 import java.util.Collection; … … 253 252 if (parents.isEmpty()) 254 253 return null; 255 if (!silent && !checkAndConfirmOutlyingDelete( layer,parents, null))254 if (!silent && !checkAndConfirmOutlyingDelete(parents, null)) 256 255 return null; 257 256 return new DeleteCommand(layer,parents); … … 355 354 } 356 355 357 if (!silent && !checkAndConfirmOutlyingDelete( layer,356 if (!silent && !checkAndConfirmOutlyingDelete( 358 357 primitivesToDelete, Utils.filteredCollection(primitivesToDelete, Way.class))) 359 358 return null; … … 450 449 } 451 450 452 public static boolean checkAndConfirmOutlyingDelete(OsmDataLayer layer, Collection<? extends OsmPrimitive> primitives, Collection<? extends OsmPrimitive> ignore) { 453 return checkAndConfirmOutlyingDelete(layer.data.getDataSourceArea(), primitives, ignore); 454 } 455 456 public static boolean checkAndConfirmOutlyingDelete(Area area, Collection<? extends OsmPrimitive> primitives, Collection<? extends OsmPrimitive> ignore) { 451 public static boolean checkAndConfirmOutlyingDelete(Collection<? extends OsmPrimitive> primitives, Collection<? extends OsmPrimitive> ignore) { 457 452 return Command.checkAndConfirmOutlyingOperation("delete", 458 453 tr("Delete confirmation"), … … 466 461 + "This will cause problems because you don''t see the real object." 467 462 + "<br>" + "Do you really want to delete?"), 468 area,primitives, ignore);463 primitives, ignore); 469 464 } 470 465
Note:
See TracChangeset
for help on using the changeset viewer.