Ignore:
Timestamp:
2016-07-06T17:16:53+02:00 (8 years ago)
Author:
floscher
Message:

[mapillary] Some minor style fixes

Location:
applications/editors/josm/plugins/mapillary
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryAbstractImage.java

    r32383 r32593  
    130130
    131131  /**
    132  * Returns the direction towards the image has been taken.
    133  *
    134  * @return The direction of the image (0 means north and goes clockwise).
    135  */
    136 public double getMovingCa() {
    137   return this.movingCa;
    138 }
     132   * Returns the direction towards the image has been taken.
     133   *
     134   * @return The direction of the image (0 means north and goes clockwise).
     135   */
     136  public double getMovingCa() {
     137    return this.movingCa;
     138  }
    139139
    140140  /**
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLocationChangeset.java

    r32574 r32593  
     1// License: GPL. For details, see LICENSE file.
    12package org.openstreetmap.josm.plugins.mapillary;
    23
     
    78
    89public class MapillaryLocationChangeset extends HashSet<MapillaryImage> {
     10  private static final long serialVersionUID = 2461033584553885626L;
    911  private final Set<MapillaryChangesetListener> listeners = new HashSet<>();
    1012
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryPlugin.java

    r32577 r32593  
    255255    }
    256256    if (!SwingUtilities.isEventDispatchThread()) {
    257       SwingUtilities.invokeLater( new Runnable() {
     257      SwingUtilities.invokeLater(new Runnable() {
    258258        @Override
    259259        public void run() {
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportIntoSequenceAction.java

    r32034 r32593  
    102102   *
    103103   */
    104   public class MapillaryEpochComparator implements
     104  public static class MapillaryEpochComparator implements
    105105      Comparator<MapillaryAbstractImage> {
    106106
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/WalkThread.java

    r31987 r32593  
    7171            final BufferedImage displayImage = MapillaryMainDialog.getInstance().mapillaryImageDisplay.getImage();
    7272            if (this.waitForFullQuality && image instanceof MapillaryImage) {
    73               while ( displayImage == this.lastImage || displayImage == null || displayImage.getWidth() < 2048) {
     73              while (displayImage == this.lastImage || displayImage == null || displayImage.getWidth() < 2048) {
    7474                wait(100);
    7575              }
    76             }
    77             // Waits for thumbnail.
    78             else {
     76            } else { // Waits for thumbnail.
    7977              while (displayImage == this.lastImage || displayImage == null || displayImage.getWidth() < 320) {
    8078                wait(100);
     
    114112   * @param type the quality of the image (full or thumbnail)
    115113   */
    116   private void preDownloadImages(MapillaryImage startImage, int n, CacheUtils.PICTURE type) {
     114  private static void preDownloadImages(MapillaryImage startImage, int n, CacheUtils.PICTURE type) {
    117115    if (n >= 1 && startImage != null) {
    118116      CacheUtils.downloadPicture(startImage, type);
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/FinishedUploadDialog.java

    r31972 r32593  
    3838    this.add(text);
    3939    JButton web = new JButton(tr("Approve upload on the website"));
     40    text.setLabelFor(web);
    4041    web.addActionListener(new WebAction());
    4142    web.setAlignmentX(Component.CENTER_ALIGNMENT);
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/UploadUtils.java

    r32383 r32593  
    5555 * @author nokutu
    5656 */
    57 public class UploadUtils {
     57public final class UploadUtils {
    5858  /**
    5959   * Required keys for POST
     
    7575  }
    7676
    77   private static class SequenceUploadThread extends Thread {
     77  private static final class SequenceUploadThread extends Thread {
    7878    private final Set<MapillaryAbstractImage> images;
    7979    private final UUID uuid;
     
    117117  }
    118118
    119   private static class SingleUploadThread extends Thread {
     119  private static final class SingleUploadThread extends Thread {
    120120
    121121    private final MapillaryImportedImage image;
     
    215215   */
    216216  public static void upload(MapillaryImportedImage image, UUID uuid) {
    217     String key = MapillaryUser.getUsername() + "/" + uuid.toString() + "/"
    218             + image.getMovingLatLon().lat() + "_" + image.getMovingLatLon().lon() + "_"
    219             + image.getMovingCa() + "_" + image.getCapturedAt() + ".jpg";
     217    String key = new StringBuilder(MapillaryUser.getUsername())
     218      .append('/').append(uuid)
     219      .append('/').append(image.getMovingLatLon().lat()) // TODO: Make sure, that the double values are not appended as something like "10e-4", "Infinity" or "NaN" (all possible values of Double.toString(double))
     220      .append('_').append(image.getMovingLatLon().lon())
     221      .append('_').append(image.getMovingCa())
     222      .append('_').append(image.getCapturedAt())
     223      .append(".jpg")
     224      .toString();
    220225
    221226    String policy;
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryColorScheme.java

    r32403 r32593  
    1212import javax.swing.JComponent;
    1313
    14 public class MapillaryColorScheme {
     14public final class MapillaryColorScheme {
    1515  public static final Color MAPILLARY_GREEN = new Color(0x35af6d);
    1616  public static final Color TOOLBAR_DARK_GREY = new Color(0x242528);
     
    3333  }
    3434
    35   public final static class MapillaryButton extends JButton {
     35  public static final class MapillaryButton extends JButton {
     36    private static final long serialVersionUID = 3824559897922944415L;
    3637    public MapillaryButton(final String text, final Action action) {
    3738      super(action);
    3839      setText(text);
    3940      setForeground(Color.WHITE);
    40       setBorder(BorderFactory.createEmptyBorder(7,10,7,10));
     41      setBorder(BorderFactory.createEmptyBorder(7, 10, 7, 10));
    4142    }
     43
    4244    @Override
    4345    protected void paintComponent(final Graphics g) {
     
    5355      super.paintComponent(g);
    5456    }
     57
    5558    @Override
    5659    public boolean isContentAreaFilled() {
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryUtils.java

    r32575 r32593  
    203203  public static void showPictures(final Set<MapillaryAbstractImage> images, final boolean select) {
    204204    if (!SwingUtilities.isEventDispatchThread()) {
    205       SwingUtilities.invokeLater( new Runnable() {
     205      SwingUtilities.invokeLater(new Runnable() {
    206206        @Override
    207207        public void run() {
    208208          showPictures(images, select);
    209209        }
    210       } );
     210      });
    211211    } else {
    212212      Bounds zoomBounds;
  • applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/utils/ImageUtilsTest.java

    r32383 r32593  
     1// License: GPL. For details, see LICENSE file.
    12package org.openstreetmap.josm.plugins.mapillary.utils;
    23
  • applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryURLTest.java

    r32069 r32593  
     1// License: GPL. For details, see LICENSE file.
    12package org.openstreetmap.josm.plugins.mapillary.utils;
    23
     
    2627  }
    2728
    28   @Test(expected=IllegalArgumentException.class)
     29  @Test(expected = IllegalArgumentException.class)
    2930  public void testIllegalBrowseEditURL() {
    3031    MapillaryURL.browseEditURL(null);
    3132  }
    3233
    33   @Test(expected=IllegalArgumentException.class)
     34  @Test(expected = IllegalArgumentException.class)
    3435  public void testIllegalBrowseEditURL2() {
    3536    MapillaryURL.browseEditURL("123456789012345678901");
    3637  }
    3738
    38   @Test(expected=IllegalArgumentException.class)
     39  @Test(expected = IllegalArgumentException.class)
    3940  public void testIllegalBrowseEditURL3() {
    4041    MapillaryURL.browseEditURL("12345678901234567890123");
    4142  }
    4243
    43   @Test(expected=IllegalArgumentException.class)
     44  @Test(expected = IllegalArgumentException.class)
    4445  public void testIllegalBrowseEditURL4() {
    4546    MapillaryURL.browseEditURL("123456789012345678901+");
     
    5455  }
    5556
    56   @Test(expected=IllegalArgumentException.class)
     57  @Test(expected = IllegalArgumentException.class)
    5758  public void testIllegalBrowseImageURL() {
    5859    MapillaryURL.browseImageURL(null);
    5960  }
    6061
    61   @Test(expected=IllegalArgumentException.class)
     62  @Test(expected = IllegalArgumentException.class)
    6263  public void testIllegalBrowseImageURL2() {
    6364    MapillaryURL.browseImageURL("123456789012345678901");
    6465  }
    6566
    66   @Test(expected=IllegalArgumentException.class)
     67  @Test(expected = IllegalArgumentException.class)
    6768  public void testIllegalBrowseImageURL3() {
    6869    MapillaryURL.browseImageURL("12345678901234567890123");
    6970  }
    7071
    71   @Test(expected=IllegalArgumentException.class)
     72  @Test(expected = IllegalArgumentException.class)
    7273  public void testIllegalBrowseImageURL4() {
    7374    MapillaryURL.browseImageURL("123456789012345678901+");
     
    212213      }
    213214      assertTrue(
    214           expectedParams[exIndex] + " was expected in the query string of " + actualUrl.toString() + " but wasn't there." ,
     215          expectedParams[exIndex] + " was expected in the query string of " + actualUrl.toString() + " but wasn't there.",
    215216          parameterIsPresent
    216217      );
  • applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryUtilsTest.java

    r31799 r32593  
     1// License: GPL. For details, see LICENSE file.
    12package org.openstreetmap.josm.plugins.mapillary.utils;
    23
  • applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/utils/PluginStateTest.java

    r31972 r32593  
     1// License: GPL. For details, see LICENSE file.
    12package org.openstreetmap.josm.plugins.mapillary.utils;
    23
  • applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/utils/TestUtil.java

    r32374 r32593  
     1// License: GPL. For details, see LICENSE file.
    12package org.openstreetmap.josm.plugins.mapillary.utils;
    23
Note: See TracChangeset for help on using the changeset viewer.