Changeset 32977 in osm
- Timestamp:
- 2016-09-11T13:47:49+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillarySign.java
r32974 r32977 32 32 try ( 33 33 BufferedReader br = new BufferedReader(new InputStreamReader( 34 MapillarySign.class.getResourceAsStream("/data/signs/" + country + ".cson") 34 MapillarySign.class.getResourceAsStream("/data/signs/" + country + ".cson"), "UTF-8" 35 35 )); 36 36 ) { -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/WalkThread.java
r32690 r32977 18 18 * 19 19 * @author nokutu 20 *21 20 */ 22 21 public class WalkThread extends Thread implements MapillaryDataListener { … … 33 32 * Main constructor. 34 33 * 35 * @param interval 36 * How often the images switch. 37 * @param waitForPicture 38 * If it must wait for the full resolution picture or just the 39 * thumbnail. 40 * @param followSelected 41 * Zoom to each image that is selected. 42 * @param goForward 43 * true to go forward; false to go backwards. 34 * @param interval How often the images switch. 35 * @param waitForPicture If it must wait for the full resolution picture or just the 36 * thumbnail. 37 * @param followSelected Zoom to each image that is selected. 38 * @param goForward true to go forward; false to go backwards. 44 39 */ 45 40 public WalkThread(int interval, boolean waitForPicture, 46 boolean followSelected, boolean goForward) {41 boolean followSelected, boolean goForward) { 47 42 this.interval = interval; 48 43 this.waitForFullQuality = waitForPicture; … … 67 62 } 68 63 try { 69 synchronized (this) { 70 // Waits for full quality picture. 71 final BufferedImage displayImage = MapillaryMainDialog.getInstance().mapillaryImageDisplay.getImage(); 72 if (this.waitForFullQuality && image instanceof MapillaryImage) { 73 while (displayImage == this.lastImage || displayImage == null || displayImage.getWidth() < 2048) { 74 wait(100); 75 } 76 } else { // Waits for thumbnail. 77 while (displayImage == this.lastImage || displayImage == null || displayImage.getWidth() < 320) { 78 wait(100); 79 } 64 // Waits for full quality picture. 65 final BufferedImage displayImage = MapillaryMainDialog.getInstance().mapillaryImageDisplay.getImage(); 66 if (this.waitForFullQuality && image instanceof MapillaryImage) { 67 while (displayImage == this.lastImage || displayImage == null || displayImage.getWidth() < 2048) { 68 Thread.sleep(100); 80 69 } 81 while (this.paused) { 82 wait(100); 83 } 84 wait(this.interval); 85 while (this.paused) { 86 wait(100); 70 } else { // Waits for thumbnail. 71 while (displayImage == this.lastImage || displayImage == null || displayImage.getWidth() < 320) { 72 Thread.sleep(100); 87 73 } 88 74 } 75 while (this.paused) { 76 Thread.sleep(100); 77 } 78 wait(this.interval); 79 while (this.paused) { 80 Thread.sleep(100); 81 } 89 82 this.lastImage = MapillaryMainDialog.getInstance().mapillaryImageDisplay.getImage(); 90 synchronized (this) { 91 if (this.goForward) { 92 this.data.selectNext(this.followSelected); 93 } else { 94 this.data.selectPrevious(this.followSelected); 95 } 83 if (this.goForward) { 84 this.data.selectNext(this.followSelected); 85 } else { 86 this.data.selectPrevious(this.followSelected); 96 87 } 97 88 } catch (InterruptedException e) { … … 108 99 /** 109 100 * Downloads n images into the cache beginning from the supplied start-image (including the start-image itself). 101 * 110 102 * @param startImage the image to start with (this and the next n-1 images in the same sequence are downloaded) 111 103 * @param n the number of images to download -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryImageDisplay.java
r32653 r32977 41 41 42 42 /** The image currently displayed */ 43 private transientBufferedImage image;43 private volatile BufferedImage image; 44 44 45 45 /** … … 47 47 * rectangle is calculated each time the zoom is modified 48 48 */ 49 private Rectangle visibleRect;49 private volatile Rectangle visibleRect; 50 50 51 51 /**
Note:
See TracChangeset
for help on using the changeset viewer.