Changeset 31460 in osm for applications/editors/josm/plugins/mapillary/src/org
- Timestamp:
- 2015-08-06T16:55:15+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryAbstractImage.java ¶
r31445 r31460 21 21 22 22 /** 23 * Lock that locks next() and previous() methods. Used when downloading images 24 * to prevent concurrency problems. 23 * Lock that locks {@link MapillaryAbstractImage#next()} and 24 * {@link MapillaryAbstractImage#previous()} methods. Used when downloading 25 * images to prevent concurrency problems. 25 26 */ 26 27 public static Lock LOCK = new ReentrantLock(); … … 213 214 * Returns the date the picture was taken in the given format. 214 215 * 215 * @param format Format of the date. See {@link SimpleDateFormat}. 216 * @param format 217 * Format of the date. See {@link SimpleDateFormat}. 216 218 * @return A String containing the date the picture was taken using the given 217 219 * format. -
TabularUnified applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java ¶
r31459 r31460 117 117 * @return The image under the mouse cursor. 118 118 */ 119 public MapillaryAbstractImage getHighlighted() { 119 public MapillaryAbstractImage getHighlightedImage() { 120 120 return this.highlightedImage; 121 121 } … … 239 239 public void selectPrevious(boolean moveToPicture) { 240 240 if (getSelectedImage() == null) 241 return;241 throw new IllegalStateException(); 242 242 if (getSelectedImage().getSequence() == null) 243 243 throw new IllegalStateException(); … … 277 277 this.multiSelectedImages.clear(); 278 278 this.multiSelectedImages.add(image); 279 if (image != null) { 279 if (image != null && Main.main != null) { 280 280 if (image instanceof MapillaryImage) { 281 281 MapillaryImage mapillaryImage = (MapillaryImage) image; … … 284 284 CacheUtils.downloadPicture((MapillaryImage) mapillaryImage.next()); 285 285 if (mapillaryImage.next().next() != null) 286 CacheUtils 287 . downloadPicture((MapillaryImage) mapillaryImage.next().next());286 CacheUtils.downloadPicture((MapillaryImage) mapillaryImage.next() 287 .next()); 288 288 } 289 289 if (mapillaryImage.previous() != null) { 290 CacheUtils.downloadPicture((MapillaryImage) mapillaryImage.previous()); 290 CacheUtils 291 .downloadPicture((MapillaryImage) mapillaryImage.previous()); 291 292 if (mapillaryImage.previous().previous() != null) 292 CacheUtils.downloadPicture((MapillaryImage) mapillaryImage .previous()293 .previous()); 293 CacheUtils.downloadPicture((MapillaryImage) mapillaryImage 294 .previous().previous()); 294 295 } 295 296 } 296 297 } 297 if (zoom) 298 if (zoom && Main.main != null) 298 299 Main.map.mapView.zoomTo(getSelectedImage().getLatLon()); 299 300 if (Main.main != null) … … 325 326 this.setSelectedImage(image); 326 327 } 327 Main.map.mapView.repaint(); 328 if (Main.main != null) 329 Main.map.mapView.repaint(); 328 330 } 329 331 -
TabularUnified applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java ¶
r31459 r31460 415 415 g.drawImage(op.filter(bi, null), p.x - (width / 2), p.y - (height / 2), 416 416 Main.map.mapView); 417 if (this.data.getHighlighted() == image) { 417 if (this.data.getHighlightedImage() == image) { 418 418 drawPointHighlight(g, p, 16); 419 419 } -
TabularUnified applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillarySequence.java ¶
r31457 r31460 139 139 return this.images.get(i - 1); 140 140 } 141 142 /**143 * Returns the difference of index between two {@link MapillaryAbstractImage}144 * objects belonging to the same {@link MapillarySequence}.145 *146 * @param image1147 * The first image.148 * @param image2149 * The second image.150 * @return The distance between two {@link MapillaryAbstractImage} objects151 * belonging to the same {@link MapillarySequence}.152 */153 public int getDistance(MapillaryAbstractImage image1,154 MapillaryAbstractImage image2) {155 if (!this.images.contains(image1) || !this.images.contains(image2))156 throw new IllegalArgumentException();157 return Math.abs(this.images.indexOf(image1) - this.images.indexOf(image2));158 }159 141 } -
TabularUnified applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/WalkThread.java ¶
r31457 r31460 22 22 */ 23 23 public class WalkThread extends Thread implements MapillaryDataListener { 24 private int interval; 25 private MapillaryData data; 26 private Lock lock = new ReentrantLock();24 private final int interval; 25 private final MapillaryData data; 26 private final Lock lock; 27 27 private boolean end = false; 28 28 private final boolean waitForFullQuality; … … 53 53 this.data = MapillaryLayer.getInstance().getData(); 54 54 this.data.addListener(this); 55 this.lock = new ReentrantLock(); 55 56 } 56 57 -
TabularUnified applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryDownloader.java ¶
r31459 r31460 45 45 public final static String CLIENT_ID = "T1Fzd20xZjdtR0s1VDk5OFNIOXpYdzoxNDYyOGRkYzUyYTFiMzgz"; 46 46 /** Executor that will run the petitions. */ 47 private static ThreadPoolExecutor EXECUTOR = new ThreadPoolExecutor(3, 5, 48 100, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(50)); 47 private static ThreadPoolExecutor EXECUTOR; 49 48 50 49 /** … … 63 62 queryStringParts.put("max_lat", maxLatLon.lat()); 64 63 queryStringParts.put("max_lon", maxLatLon.lon()); 64 EXECUTOR = new ThreadPoolExecutor(3, 5, 100, TimeUnit.SECONDS, 65 new ArrayBlockingQueue<Runnable>(50)); 65 66 run(new MapillarySquareDownloadManagerThread(queryStringParts)); 66 67 } -
TabularUnified applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryExportDialog.java ¶
r31451 r31460 33 33 protected JOptionPane optionPane; 34 34 /** Button to export all downloaded images. */ 35 public JRadioButton all; 35 public final JRadioButton all; 36 36 /** 37 37 * Button to export all images in the sequence of the selected MapillaryImage. 38 38 */ 39 public JRadioButton sequence; 39 public final JRadioButton sequence; 40 40 /** 41 41 * Button to export all images belonging to the selected 42 42 * {@link MapillaryImage} objects. 43 43 */ 44 public JRadioButton selected; 44 public final JRadioButton selected; 45 45 /** Button to rewrite all imported images. */ 46 public JRadioButton rewrite; 46 public final JRadioButton rewrite; 47 47 /** Group of button containing all the options. */ 48 public ButtonGroup group; 49 private JButton choose; 50 private JLabel path; 48 public final ButtonGroup group; 49 private final JButton choose; 50 private final JLabel path; 51 51 /** File chooser. */ 52 52 public JFileChooser chooser; 53 53 protected String exportDirectory; 54 private JButton ok; 54 private final JButton ok; 55 55 56 56 /** -
TabularUnified applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryImageDisplay.java ¶
r31445 r31460 57 57 private Rectangle selectedRect = null; 58 58 59 /** HyperlinkLabel shown in the bottom right corner. */ 59 60 protected HyperlinkLabel hyperlink; 60 61 -
TabularUnified applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/JoinMode.java ¶
r31445 r31460 37 37 @Override 38 38 public void mousePressed(MouseEvent e) { 39 if (this.data.getHighlighted() == null) 39 if (this.data.getHighlightedImage() == null) 40 40 return; 41 41 if (this.lastClick == null 42 && this.data.getHighlighted() instanceof MapillaryImportedImage) { 43 this.lastClick = (MapillaryImportedImage) this.data.getHighlighted(); 42 && this.data.getHighlightedImage() instanceof MapillaryImportedImage) { 43 this.lastClick = (MapillaryImportedImage) this.data.getHighlightedImage(); 44 44 } else if (this.lastClick != null 45 && this.data.getHighlighted() instanceof MapillaryImportedImage) { 46 if (((this.data.getHighlighted().previous() == null && this.lastClick.next() == null) || (this.data 47 .getHighlighted().next() == null && this.lastClick.previous() == null)) 48 && (this.data.getHighlighted().getSequence() != this.lastClick.getSequence() || this.lastClick 45 && this.data.getHighlightedImage() instanceof MapillaryImportedImage) { 46 if (((this.data.getHighlightedImage().previous() == null && this.lastClick.next() == null) || (this.data 47 .getHighlightedImage().next() == null && this.lastClick.previous() == null)) 48 && (this.data.getHighlightedImage().getSequence() != this.lastClick.getSequence() || this.lastClick 49 49 .getSequence() == null)) { 50 join(this.lastClick, (MapillaryImportedImage) this.data.getHighlighted()); 51 } else if (this.lastClick.next() == this.data.getHighlighted() 52 || this.lastClick.previous() == this.data.getHighlighted()) 53 unjoin(this.lastClick, (MapillaryImportedImage) this.data.getHighlighted()); 50 join(this.lastClick, (MapillaryImportedImage) this.data.getHighlightedImage()); 51 } else if (this.lastClick.next() == this.data.getHighlightedImage() 52 || this.lastClick.previous() == this.data.getHighlightedImage()) 53 unjoin(this.lastClick, (MapillaryImportedImage) this.data.getHighlightedImage()); 54 54 this.lastClick = null; 55 55 } -
TabularUnified applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/SelectMode.java ¶
r31445 r31460 182 182 } 183 183 184 if (this.data.getHighlighted() != closestTemp && closestTemp != null) { 184 if (this.data.getHighlightedImage() != closestTemp && closestTemp != null) { 185 185 this.data.setHighlightedImage(closestTemp); 186 186 MapillaryMainDialog.getInstance().setImage(closestTemp); 187 187 MapillaryMainDialog.getInstance().updateImage(false); 188 } else if (this.data.getHighlighted() != closestTemp && closestTemp == null) { 188 } else if (this.data.getHighlightedImage() != closestTemp && closestTemp == null) { 189 189 this.data.setHighlightedImage(null); 190 190 MapillaryMainDialog.getInstance().setImage(this.data.getSelectedImage());
Note:
See TracChangeset
for help on using the changeset viewer.