- Timestamp:
- 2015-01-23T01:21:21+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
r7954 r7983 37 37 import java.util.concurrent.ExecutorService; 38 38 import java.util.concurrent.Executors; 39 import java.util.concurrent.ThreadFactory; 39 40 40 41 import javax.swing.Action; … … 66 67 import org.openstreetmap.josm.gui.layer.JumpToMarkerActions.JumpToPreviousMarker; 67 68 import org.openstreetmap.josm.gui.layer.Layer; 69 import org.openstreetmap.josm.gui.util.GuiHelper; 68 70 import org.openstreetmap.josm.tools.ExifReader; 69 71 import org.openstreetmap.josm.tools.ImageProvider; … … 77 79 import com.drew.metadata.exif.ExifIFD0Directory; 78 80 import com.drew.metadata.exif.GpsDirectory; 79 import java.util.concurrent.ThreadFactory;80 81 81 82 /** … … 388 389 l.stopLoadThumbs(); 389 390 390 ImageEntry selected = null; 391 if (l.currentPhoto >= 0) { 392 selected = l.data.get(l.currentPhoto); 393 } 391 final ImageEntry selected = l.currentPhoto >= 0 ? l.data.get(l.currentPhoto) : null; 394 392 395 393 data.addAll(l.data); … … 410 408 } 411 409 412 if (selected != null) { 413 for (int i = 0; i < data.size() ; i++) { 414 if (data.get(i) == selected) { 415 currentPhoto = i; 416 ImageViewerDialog.showImage(GeoImageLayer.this, data.get(i)); 417 break; 418 } 419 } 410 if (selected != null && !data.isEmpty()) { 411 GuiHelper.runInEDTAndWait(new Runnable() { 412 @Override 413 public void run() { 414 for (int i = 0; i < data.size() ; i++) { 415 if (selected.equals(data.get(i))) { 416 currentPhoto = i; 417 ImageViewerDialog.showImage(GeoImageLayer.this, data.get(i)); 418 break; 419 } 420 } 421 } 422 }); 420 423 } 421 424 … … 1044 1047 /** 1045 1048 * Stop to load thumbnails. 1046 * 1049 * 1047 1050 * Can be called at any time to make sure that the 1048 1051 * thumbnail loader is stopped. … … 1057 1060 /** 1058 1061 * Called to signal that the loading of thumbnails has finished. 1059 * 1062 * 1060 1063 * Usually called from {@link ThumbsLoader} in another thread. 1061 1064 */
Note:
See TracChangeset
for help on using the changeset viewer.