Changeset 4461 in josm for trunk/src/org/openstreetmap/josm/command
- Timestamp:
- 2011-09-24T22:09:19+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/Command.java
r4458 r4461 183 183 * Request confirmation if he is. 184 184 * 185 * @param layer the layer in whose context data is deleted 185 * @param operation the operation name which is used for setting some preferences 186 * @param dialogTitle the title of the dialog being displayed 187 * @param outsideDialogMessage the message text to be displayed when data is outside of the download area 188 * @param incompleteDialogMessage the message text to be displayed when data is incomplete 189 * @param area the area used to determine whether data is outlying 186 190 * @param primitives the primitives to operate on 187 * @return true, if deleting outlying primitives is OK; false, otherwise 191 * @param ignore {@code null} or a primitive to be ignored 192 * @return true, if operating on outlying primitives is OK; false, otherwise 188 193 */ 189 194 public static boolean checkAndConfirmOutlyingOperation(String operation, … … 196 201 if (osm.isIncomplete()) { 197 202 incomplete = true; 198 } else if (osm instanceof Node && !osm.isNewOrUndeleted() 199 && !area.contains(((Node) osm).getCoor()) 203 } else if (isOutlying(osm, area) 200 204 && (ignore == null || !ignore.equals(osm))) { 201 205 outside = true; … … 240 244 } 241 245 246 private static boolean isOutlying(OsmPrimitive osm, Area area) { 247 if (osm instanceof Node) { 248 return !osm.isNewOrUndeleted() && !area.contains(((Node) osm).getCoor()); 249 } else if (osm instanceof Way) { 250 for (Node n : ((Way) osm).getNodes()) { 251 if (isOutlying(n, area)) { 252 return true; 253 } 254 } 255 return false; 256 } 257 return false; 258 } 242 259 }
Note:
See TracChangeset
for help on using the changeset viewer.