Changeset 15352 in josm for trunk/src/org
- Timestamp:
- 2019-09-15T23:54:42+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/ImageData.java
r15348 r15352 247 247 */ 248 248 public void removeSelectedImage() { 249 List<ImageEntry> selected = getSelectedImages();250 if (selected .size() > 1) {249 List<ImageEntry> selectedImages = getSelectedImages(); 250 if (selectedImages.size() > 1) { 251 251 throw new IllegalStateException(tr("Multiple images have been selected")); 252 252 } 253 if (selected.isEmpty()) { 253 removeImages(selectedImages); 254 } 255 256 /** 257 * Remove the current selected image from the list 258 * @since 15348 259 */ 260 public void removeSelectedImages() { 261 List<ImageEntry> selectedImages = getSelectedImages(); 262 removeImages(selectedImages); 263 } 264 265 private void removeImages(List<ImageEntry> selectedImages) { 266 if (selectedImages.isEmpty()) { 254 267 return; 255 268 } 256 data.remove(getSelectedImages().get(0)); 269 for (ImageEntry img: getSelectedImages()) { 270 data.remove(img); 271 } 257 272 if (selectedImagesIndex.get(0) == data.size()) { 258 273 setSelectedImageIndex(data.size() - 1); … … 263 278 264 279 /** 265 * Remove the current selected image from the list266 * @since 15348267 */268 public void removeSelectedImages() {269 List<ImageEntry> selected = getSelectedImages();270 if (selected.isEmpty()) {271 return;272 }273 for (ImageEntry img: getSelectedImages()) {274 data.remove(img);275 }276 setSelectedImageIndex(-1, true);277 }278 279 /**280 280 * Determines if the image is selected 281 281 * @param image the {@link ImageEntry} image
Note:
See TracChangeset
for help on using the changeset viewer.