Changeset 31843 in osm for applications/editors/josm/plugins/mapillary
- Timestamp:
- 2015-12-17T16:48:24+01:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportAction.java
r31840 r31843 56 56 57 57 @Override 58 public void actionPerformed(ActionEvent e ) {58 public void actionPerformed(ActionEvent event) { 59 59 JFileChooser chooser = new JFileChooser(); 60 60 File startDirectory = new File(Main.pref.get("mapillary.start-directory", -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryMainDialog.java
r31838 r31843 60 60 private volatile MapillaryAbstractImage image; 61 61 62 private final SideButton nextButton = new SideButton(new nextPictureAction());62 private final SideButton nextButton = new SideButton(new NextPictureAction()); 63 63 private final SideButton previousButton = new SideButton( 64 64 new PreviousPictureAction()); … … 118 118 this.nextButton.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put( 119 119 KeyStroke.getKeyStroke("PAGE_DOWN"), "next"); 120 this.nextButton.getActionMap().put("next", new nextPictureAction());120 this.nextButton.getActionMap().put("next", new NextPictureAction()); 121 121 this.previousButton.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put( 122 122 KeyStroke.getKeyStroke("PAGE_UP"), "previous"); … … 173 173 * Destroys the unique instance of the class. 174 174 */ 175 public static void destroyInstance() {175 public static synchronized void destroyInstance() { 176 176 instance = null; 177 177 } … … 340 340 * 341 341 */ 342 private class nextPictureAction extends AbstractAction {342 private static class NextPictureAction extends AbstractAction { 343 343 344 344 private static final long serialVersionUID = 3023827221453154340L; 345 345 346 public nextPictureAction() { 346 /** 347 * Constructs a normal NextPictureAction 348 */ 349 public NextPictureAction() { 347 350 putValue(NAME, tr("Next picture")); 348 351 putValue(SHORT_DESCRIPTION, tr("Shows the next picture in the sequence")); … … 365 368 private static final long serialVersionUID = -6420511632957956012L; 366 369 370 /** 371 * Constructs a normal PreviousPictureAction 372 */ 367 373 public PreviousPictureAction() { 368 374 putValue(NAME, tr("Previous picture")); … … 387 393 private static final long serialVersionUID = -6480229431481386376L; 388 394 395 /** 396 * Constructs a normal RedAction 397 */ 389 398 public RedAction() { 390 399 putValue(NAME, tr("Jump to red")); … … 412 421 private static final long serialVersionUID = 6250690644594703314L; 413 422 423 /** 424 * Constructs a normal BlueAction 425 */ 414 426 public BlueAction() { 415 427 putValue(NAME, tr("Jump to blue")); … … 433 445 private WalkThread thread; 434 446 447 /** 448 * Constructs a normal StopAction 449 */ 435 450 public StopAction() { 436 451 putValue(NAME, tr("Stop")); … … 457 472 private transient WalkThread thread; 458 473 474 /** 475 * Constructs a normal PlayAction 476 */ 459 477 public PlayAction() { 460 478 putValue(NAME, tr("Play")); … … 483 501 private WalkThread thread; 484 502 503 /** 504 * Constructs a normal PauseAction 505 */ 485 506 public PauseAction() { 486 507 putValue(NAME, tr("Pause")); … … 521 542 return; 522 543 } 523 if (this.mapillaryImageDisplay.getImage() == null) { 524 this.mapillaryImageDisplay.setImage(img); 525 } else if (img.getHeight() > this.mapillaryImageDisplay.getImage().getHeight()) { 544 if ( 545 this.mapillaryImageDisplay.getImage() == null 546 || img.getHeight() > this.mapillaryImageDisplay.getImage().getHeight() 547 ) { 526 548 this.mapillaryImageDisplay.setImage(img); 527 549 } … … 568 590 569 591 @Override 570 public void selectedImageChanged(MapillaryAbstractImage oldImage, 571 MapillaryAbstractImage newImage) { 592 public void selectedImageChanged(MapillaryAbstractImage oldImage, MapillaryAbstractImage newImage) { 572 593 setImage(newImage); 573 594 updateImage(); … … 576 597 @Override 577 598 public void imagesAdded() { 599 // This method is enforced by MapillaryDataListener, but only selectedImageChanged() is needed 578 600 } 579 601 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryUploadDialog.java
r31839 r31843 36 36 public MapillaryUploadDialog() { 37 37 setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS)); 38 if (MapillaryUser.getUsername() != null) { 38 if (MapillaryUser.getUsername() == null) { 39 this.add(new JLabel(tr("Go to setting and log in to Mapillary before uploading."))); 40 } else { 39 41 ButtonGroup group = new ButtonGroup(); 40 42 this.sequence = new JRadioButton(tr("Upload selected sequence")); … … 48 50 this.delete.setSelected(Main.pref.getBoolean("mapillary.delete-after-upload", true)); 49 51 add(this.delete); 50 } else {51 this.add(new JLabel(tr("Go to setting and log in to Mapillary before uploading.")));52 52 } 53 53 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryImageInfoDownloadThread.java
r31828 r31843 33 33 * Main constructor. 34 34 * 35 * @param ex 36 * {@link ExecutorService} object that is executing this thread. 37 * @param queryString 38 * A String containing the parameters for the download. 35 * @param ex {@link ExecutorService} object that is executing this thread. 36 * @param bounds the bounds inside which the image info should be downloaded 37 * @param page the pagenumber of the results that should be retrieved 39 38 */ 40 39 public MapillaryImageInfoDownloadThread(ExecutorService ex, Bounds bounds, int page) { -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillarySequenceDownloadThread.java
r31837 r31843 38 38 * Main constructor. 39 39 * 40 * @param ex 41 * {@link ExecutorService} executing this thread. 42 * @param queryString 43 * String containing the parameters for the download. 40 * @param ex {@link ExecutorService} executing this thread. 41 * @param bounds The bounds inside which the sequences should be downloaded 42 * @param page the pagenumber of the results that should be retrieved 44 43 */ 45 44 public MapillarySequenceDownloadThread(ExecutorService ex, Bounds bounds, int page) { -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillarySquareDownloadManagerThread.java
r31828 r31843 40 40 * Main constructor. 41 41 * 42 * @param queryStringParts 43 * The query data. 42 * @param bounds the bounds of the area that should be downloaded 44 43 * 45 44 */ … … 71 70 * Downloads the sequence positions, directions and keys. 72 71 * 73 * @throws InterruptedException 74 * if the thread is interrupted while running this method. 72 * @throws InterruptedException if the thread is interrupted while running this method. 75 73 */ 76 74 private void downloadSequences() throws InterruptedException { -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryTrafficSignDownloadThread.java
r31828 r31843 35 35 * @param ex {@link ExecutorService} object that is executing this thread. 36 36 * @param bounds the bounds in which the traffic signs should be downloaded 37 * @pa gepage the pagenumber of the results page that should be retrieved37 * @param page the pagenumber of the results page that should be retrieved 38 38 */ 39 39 public MapillaryTrafficSignDownloadThread(ExecutorService ex, Bounds bounds, int page) { -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/MapillaryUser.java
r31828 r31843 30 30 * @return The username of the logged in user. 31 31 */ 32 public static String getUsername() {32 public static synchronized String getUsername() { 33 33 if (!isTokenValid) { 34 34 return null; … … 51 51 * strings. 52 52 */ 53 public static Map<String, String> getSecrets() {53 public static synchronized Map<String, String> getSecrets() { 54 54 if (!isTokenValid) 55 55 return null;
Note:
See TracChangeset
for help on using the changeset viewer.