Changeset 31385 in osm for applications/editors/josm/plugins/mapillary/src
- Timestamp:
- 2015-07-16T13:56:01+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryMainDialog.java
r31377 r31385 40 40 /** 41 41 * Toggle dialog that shows an image and some buttons. 42 * 42 * 43 43 * @author nokutu 44 44 * … … 116 116 117 117 /** 118 * Downloads the image of the selected MapillaryImage and sets in the 118 * Downloads the full quality picture of the selected MapillaryImage and sets 119 * in the MapillaryImageDisplay object. 120 */ 121 public synchronized void updateImage() { 122 updateImage(true); 123 } 124 125 /** 126 * Downloads the picture of the selected MapillaryImage and sets in the 119 127 * MapillaryImageDisplay object. 120 */ 121 public synchronized void updateImage() { 128 * 129 * @param fullQuality 130 * If the full quality picture must be downloaded or just the 131 * thumbnail. 132 */ 133 public synchronized void updateImage(boolean fullQuality) { 122 134 if (!SwingUtilities.isEventDispatchThread()) { 123 135 SwingUtilities.invokeLater(new Runnable() { … … 173 185 174 186 // Downloads the full resolution image. 175 if (imageCache != null) 176 imageCache.cancelOutstandingTasks(); 177 imageCache = new MapillaryCache(mapillaryImage.getKey(), 178 MapillaryCache.Type.FULL_IMAGE); 179 imageCache.submit(this, false); 187 if (fullQuality) { 188 if (imageCache != null) 189 imageCache.cancelOutstandingTasks(); 190 imageCache = new MapillaryCache(mapillaryImage.getKey(), 191 MapillaryCache.Type.FULL_IMAGE); 192 imageCache.submit(this, false); 193 } 180 194 } else if (image instanceof MapillaryImportedImage) { 181 195 mapillaryImageDisplay.hyperlink.setVisible(false); … … 190 204 updateTitle(); 191 205 } 206 192 207 } 193 208 … … 202 217 /** 203 218 * Sets a new MapillaryImage to be shown. 204 * 219 * 205 220 * @param image 206 221 */ … … 244 259 /** 245 260 * Returns the MapillaryImage objects which is being shown. 246 * 261 * 247 262 * @return 248 263 */ … … 253 268 /** 254 269 * Action class form the next image button. 255 * 270 * 256 271 * @author Jorge 257 272 * … … 271 286 /** 272 287 * Action class for the previous image button. 273 * 288 * 274 289 * @author Jorge 275 290 * … … 290 305 /** 291 306 * Action class to jump to the image following the red line. 292 * 307 * 293 308 * @author nokutu 294 309 * … … 311 326 /** 312 327 * Action class to jump to the image following the blue line. 313 * 328 * 314 329 * @author nokutu 315 330 * … … 364 379 /** 365 380 * Creates the layout of the dialog. 366 * 381 * 367 382 * @param data 368 383 * The content of the dialog -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/SelectMode.java
r31375 r31385 39 39 40 40 public SelectMode() { 41 data = MapillaryData.getInstance();42 41 record = MapillaryRecord.getInstance(); 43 42 } … … 49 48 return; 50 49 MapillaryAbstractImage closest = getClosest(e.getPoint()); 51 if (Main.map.mapView.getActiveLayer() instanceof OsmDataLayer 52 && closest != null &&Main.map.mapMode == Main.map.mapModeSelect) {50 if (Main.map.mapView.getActiveLayer() instanceof OsmDataLayer && closestTemp != null 51 && Main.map.mapMode == Main.map.mapModeSelect) { 53 52 this.lastClicked = this.closest; 54 MapillaryData.getInstance().setSelectedImage(closest);53 data.setSelectedImage(closest); 55 54 return; 56 55 } else if (Main.map.mapView.getActiveLayer() != MapillaryLayer … … 99 98 100 99 if (!Main.pref.getBoolean("mapillary.developer")) 101 for (MapillaryAbstractImage img : MapillaryData.getInstance() 102 .getMultiSelectedImages()) { 100 for (MapillaryAbstractImage img : data.getMultiSelectedImages()) { 103 101 if (img instanceof MapillaryImage) 104 102 return; 105 103 } 106 if ( MapillaryData.getInstance().getSelectedImage() != null) {104 if (data.getSelectedImage() != null) { 107 105 if (lastButton == MouseEvent.BUTTON1 && !e.isShiftDown()) { 108 106 LatLon to = Main.map.mapView.getLatLon(e.getX(), e.getY()); 109 107 LatLon from = Main.map.mapView.getLatLon(start.getX(), start.getY()); 110 for (MapillaryAbstractImage img : MapillaryData.getInstance() 111 .getMultiSelectedImages()) { 108 for (MapillaryAbstractImage img : data.getMultiSelectedImages()) { 112 109 113 110 img.move(to.getX() - from.getX(), to.getY() - from.getY()); … … 115 112 Main.map.repaint(); 116 113 } else if (lastButton == MouseEvent.BUTTON1 && e.isShiftDown()) { 117 this.closest.turn(Math.toDegrees(Math.atan2((e.getX() - start.x), 118 -(e.getY() - start.y))) 119 - closest.getTempCa()); 120 for (MapillaryAbstractImage img : MapillaryData.getInstance() 121 .getMultiSelectedImages()) { 122 img.turn(Math.toDegrees(Math.atan2((e.getX() - start.x), 123 -(e.getY() - start.y))) - closest.getTempCa()); 114 this.closest 115 .turn(Math.toDegrees(Math.atan2((e.getX() - start.x), -(e.getY() - start.y))) - closest.getTempCa()); 116 for (MapillaryAbstractImage img : data.getMultiSelectedImages()) { 117 img.turn(Math.toDegrees(Math.atan2((e.getX() - start.x), -(e.getY() - start.y))) - closest.getTempCa()); 124 118 } 125 119 Main.map.repaint(); … … 184 178 } 185 179 186 if (MapillaryData.getInstance().getHighlighted() != closestTemp 187 && closestTemp != null) { 188 MapillaryData.getInstance().setHighlightedImage(closestTemp); 180 if (data.getHighlighted() != closestTemp && closestTemp != null) { 181 data.setHighlightedImage(closestTemp); 189 182 MapillaryMainDialog.getInstance().setImage(closestTemp); 183 MapillaryMainDialog.getInstance().updateImage(false); 184 } else if (data.getHighlighted() != closestTemp && closestTemp == null) { 185 data.setHighlightedImage(null); 186 MapillaryMainDialog.getInstance().setImage(data.getSelectedImage()); 190 187 MapillaryMainDialog.getInstance().updateImage(); 191 } else if (MapillaryData.getInstance().getHighlighted() != closestTemp 192 && closestTemp == null) { 193 MapillaryData.getInstance().setHighlightedImage(null); 194 MapillaryMainDialog.getInstance().setImage( 195 MapillaryData.getInstance().getSelectedImage()); 196 MapillaryMainDialog.getInstance().updateImage(); 197 } 198 MapillaryData.getInstance().dataUpdated(); 188 } 189 data.dataUpdated(); 199 190 } 200 191
Note:
See TracChangeset
for help on using the changeset viewer.