Changeset 31482 in osm for applications/editors/josm
- Timestamp:
- 2015-08-11T15:43:11+02:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/mapillary
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/build.xml
r31480 r31482 5 5 <property name="plugin.main.version" value="8433"/> 6 6 <property name="plugin.canloadatruntime" value="true"/> 7 <property name="plugin.version" value="0.9. 1"/>7 <property name="plugin.version" value="0.9.2"/> 8 8 <property name="plugin.author" value="nokutu <nokutu@openmailbox.org>"/> 9 9 <property name="plugin.class" value="org.openstreetmap.josm.plugins.mapillary.MapillaryPlugin"/> -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/UploadUtils.java
r31475 r31482 176 176 } 177 177 this.ex.shutdown(); 178 PluginState.finishUpload();179 178 } 180 179 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/PluginState.java
r31474 r31482 18 18 private static int runningDownloads = 0; 19 19 /** Images that have to be uploaded. */ 20 p ublicstatic int imagesToUpload = 0;20 protected static int imagesToUpload = 0; 21 21 /** Images that have been uploaded. */ 22 22 public static int imagesUploaded = 0; … … 33 33 */ 34 34 public static void finishDownload() { 35 if (runningDownloads == 0) 36 throw new IllegalStateException( 37 "The amount of running downlaods is less or equals to 0"); 35 38 runningDownloads--; 36 39 } … … 43 46 public static boolean isDownloading() { 44 47 return runningDownloads > 0; 45 }46 47 /**48 * Called when an upload is finished.49 */50 public static void finishUpload() {51 if (imagesUploaded >= imagesToUpload) {52 imagesUploaded = 0;53 imagesToUpload = 0;54 }55 48 } 56 49 … … 71 64 */ 72 65 public static void imagesToUpload(int amount) { 66 if (imagesToUpload <= imagesUploaded) { 67 imagesToUpload = 0; 68 imagesUploaded = 0; 69 } 73 70 imagesToUpload += amount; 74 71 } … … 80 77 imagesUploaded++; 81 78 if (imagesToUpload == imagesUploaded) { 82 finishedUploadDialog(); 79 if (Main.main != null) 80 finishedUploadDialog(); 83 81 } 84 82 } -
applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/commands/MapillaryRecordTest.java
r31476 r31482 41 41 @Test 42 42 public void commandTest() { 43 MapillaryCommand cmd1 = new CommandMoveImage(43 MapillaryCommand cmd12 = new CommandMoveImage( 44 44 Arrays.asList(new MapillaryAbstractImage[] { this.img1, this.img2 }), 45 45 0.1, 0.1); 46 MapillaryCommand cmd2 = new CommandMoveImage(46 MapillaryCommand cmd23 = new CommandMoveImage( 47 47 Arrays.asList(new MapillaryAbstractImage[] { this.img2, this.img3 }), 48 48 0.1, 0.1); 49 MapillaryCommand cmd 3 = new CommandMoveImage(49 MapillaryCommand cmd13 = new CommandMoveImage( 50 50 Arrays.asList(new MapillaryAbstractImage[] { this.img1, this.img3 }), 51 0.1, 0.1); 52 MapillaryCommand cmd1 = new CommandMoveImage( 53 Arrays.asList(new MapillaryAbstractImage[] { this.img1 }), 51 54 0.1, 0.1); 52 55 MapillaryCommand cmd31 = new CommandMoveImage( 53 56 Arrays.asList(new MapillaryAbstractImage[] { this.img3, this.img1 }), 54 57 0.2, 0.2); 55 this.record.addCommand(cmd1 );56 this.record.addCommand(cmd2 );58 this.record.addCommand(cmd12); 59 this.record.addCommand(cmd23); 57 60 58 61 assertEquals(1, this.record.position); … … 64 67 assertEquals(2, this.record.commandList.size()); 65 68 66 this.record.addCommand(cmd 3);69 this.record.addCommand(cmd1); 67 70 68 71 assertEquals(1, this.record.position); 69 assertEquals(2, this.record.commandList.size()); 72 73 this.record.addCommand(cmd13); 74 75 assertEquals(2, this.record.position); 76 assertEquals(3, this.record.commandList.size()); 70 77 71 78 this.record.undo(); 72 79 this.record.redo(); 73 80 74 assertEquals( 1, this.record.position);75 assertEquals( 2, this.record.commandList.size());81 assertEquals(2, this.record.position); 82 assertEquals(3, this.record.commandList.size()); 76 83 77 84 this.record.addCommand(cmd31); 78 85 79 assertEquals(1, this.record.position); 80 assertEquals(2, this.record.commandList.size()); 86 assertEquals(2, this.record.position); 87 assertEquals(3, this.record.commandList.size()); 88 89 this.record.addCommand(cmd1); 90 91 assertEquals(3, this.record.position); 92 assertEquals(4, this.record.commandList.size()); 81 93 } 82 94
Note:
See TracChangeset
for help on using the changeset viewer.