Changeset 31401 in osm for applications


Ignore:
Timestamp:
2015-07-24T17:12:23+02:00 (9 years ago)
Author:
nokutu
Message:

Formatted code and extracted a few methods from MapillaryLayer to MapillaryDownloader.

Location:
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
Files:
30 edited
2 moved

Legend:

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

    r31400 r31401  
    5858   *
    5959   * @param images
    60    *        The set of images to be added.
     60   *          The set of images to be added.
    6161   */
    6262  public synchronized void add(List<MapillaryAbstractImage> images) {
     
    7070   *
    7171   * @param image
    72    *        The image to be added.
     72   *          The image to be added.
    7373   */
    7474  public synchronized void add(MapillaryAbstractImage image) {
     
    8383   * Adds a new listener.
    8484   *
    85    * @param lis Listener to be added.
     85   * @param lis
     86   *          Listener to be added.
    8687   */
    8788  public void addListener(MapillaryDataListener lis) {
     
    9293   * Removes a listener.
    9394   *
    94    * @param lis Listener to be removed.
     95   * @param lis
     96   *          Listener to be removed.
    9597   */
    9698  public void removeListener(MapillaryDataListener lis) {
     
    103105   *
    104106   * @param images
    105    *        The set of images to be added.
     107   *          The set of images to be added.
    106108   */
    107109  public synchronized void addWithoutUpdate(List<MapillaryAbstractImage> images) {
     
    115117   *
    116118   * @param image
    117    *        The image under the cursor.
     119   *          The image under the cursor.
    118120   */
    119121  public void setHighlightedImage(MapillaryAbstractImage image) {
     
    135137   *
    136138   * @param image
    137    *        The image to be added.
     139   *          The image to be added.
    138140   */
    139141  public synchronized void addWithoutUpdate(MapillaryAbstractImage image) {
     
    191193      tempImage = tempImage.next();
    192194      if (tempImage.isVisible()) {
    193         setSelectedImage(tempImage, Main.pref.getBoolean("mapillary.move-to-picture", true));
     195        setSelectedImage(tempImage,
     196            Main.pref.getBoolean("mapillary.move-to-picture", true));
    194197        break;
    195198      }
     
    211214      tempImage = tempImage.previous();
    212215      if (tempImage.isVisible()) {
    213         setSelectedImage(tempImage, Main.pref.getBoolean("mapillary.move-to-picture", true));
     216        setSelectedImage(tempImage,
     217            Main.pref.getBoolean("mapillary.move-to-picture", true));
    214218        break;
    215219      }
     
    221225   *
    222226   * @param image
    223    *        The MapillaryImage which is going to be selected
     227   *          The MapillaryImage which is going to be selected
    224228   */
    225229  public void setSelectedImage(MapillaryAbstractImage image) {
     
    228232
    229233  /**
    230    * Selects a new image.If the user does ctrl+click, this isn't triggered.
    231    * You can choose whether to center the view on the new image or not.
    232    *
    233    * @param image
    234    *        The {@link MapillaryImage} which is going to be selected.
     234   * Selects a new image.If the user does ctrl+click, this isn't triggered. You
     235   * can choose whether to center the view on the new image or not.
     236   *
     237   * @param image
     238   *          The {@link MapillaryImage} which is going to be selected.
    235239   * @param zoom
    236    *        True if the view must be centered on the image; false otherwise.
     240   *          True if the view must be centered on the image; false otherwise.
    237241   */
    238242  public void setSelectedImage(MapillaryAbstractImage image, boolean zoom) {
     
    251255        // Downloading thumbnails of surrounding pictures.
    252256        if (mapillaryImage.next() != null) {
    253           Utils.downloadPicture(mapillaryImage.next());
     257          Utils.downloadPicture((MapillaryImage) mapillaryImage.next());
    254258          if (mapillaryImage.next().next() != null)
    255             Utils.downloadPicture(mapillaryImage.next().next());
     259            Utils
     260                .downloadPicture((MapillaryImage) mapillaryImage.next().next());
    256261        }
    257262        if (mapillaryImage.previous() != null) {
    258           Utils.downloadPicture(mapillaryImage.previous());
     263          Utils.downloadPicture((MapillaryImage) mapillaryImage.previous());
    259264          if (mapillaryImage.previous().previous() != null)
    260             Utils.downloadPicture(mapillaryImage.previous().previous());
     265            Utils.downloadPicture((MapillaryImage) mapillaryImage.previous()
     266                .previous());
    261267        }
    262268      }
    263269    }
    264270    if (zoom)
    265       Main.map.mapView.zoomTo(MapillaryData.getInstance().getSelectedImage().getLatLon());
     271      Main.map.mapView.zoomTo(MapillaryData.getInstance().getSelectedImage()
     272          .getLatLon());
    266273    if (Main.map != null)
    267274      Main.map.mapView.repaint();
     
    269276  }
    270277
    271   private void fireSelectedImageChanged(MapillaryAbstractImage oldImage, MapillaryAbstractImage newImage) {
     278  private void fireSelectedImageChanged(MapillaryAbstractImage oldImage,
     279      MapillaryAbstractImage newImage) {
    272280    if (listeners.isEmpty())
    273281      return;
     
    281289   *
    282290   * @param image
    283    *        The MapillaryImage object to be added.
     291   *          The MapillaryImage object to be added.
    284292   */
    285293  public void addMultiSelectedImage(MapillaryAbstractImage image) {
     
    298306   *
    299307   * @param images
    300    *        A List object containing the set of images to be added.
     308   *          A List object containing the set of images to be added.
    301309   */
    302310  public void addMultiSelectedImage(List<MapillaryAbstractImage> images) {
     
    313321  /**
    314322   * Returns a List containing all {@code MapillaryAbstractImage} objects
    315    * selected with ctrl + click
     323   * selected with ctrl + click.
    316324   *
    317325   * @return A List object containing all the images selected.
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryDataListener.java

    r31386 r31401  
    1818   * manually clicking on the icon.
    1919   *
    20    * @param oldImage Old selected {@link MapillaryAbstractImage}
    21    * @param newImage New selected {@link MapillaryAbstractImage}
     20   * @param oldImage
     21   *          Old selected {@link MapillaryAbstractImage}
     22   * @param newImage
     23   *          New selected {@link MapillaryAbstractImage}
    2224   */
    2325  public void selectedImageChanged(MapillaryAbstractImage oldImage,
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImage.java

    r31386 r31401  
    9898   * Returns the username of the person who took the picture.
    9999   *
    100    * @return A String containing the username of the person who took the picture.
     100   * @return A String containing the username of the person who took the
     101   *         picture.
    101102   */
    102103  public String getUser() {
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java

    r31400 r31401  
    44import static org.openstreetmap.josm.tools.I18n.marktr;
    55
    6 import org.openstreetmap.josm.plugins.mapillary.actions.MapillaryDownloadViewAction;
    76import org.openstreetmap.josm.plugins.mapillary.cache.Utils;
    87import org.openstreetmap.josm.plugins.mapillary.downloads.MapillaryDownloader;
     
    5251import javax.swing.Action;
    5352import javax.swing.Icon;
    54 import javax.swing.JOptionPane;
    5553
    5654import java.util.List;
     
    7169      "mapillary.sequence-max-jump-distance", 100);
    7270
    73   /** If the download is in manual mode during the rest of the session */
     71  /** If the download is in semiautomatic during this object lifetime. */
    7472  public boolean TEMP_SEMIAUTOMATIC = false;
    7573
     
    8280
    8381  /** {@link MapillaryData} object that stores the database */
    84   public final MapillaryData data = MapillaryData.getInstance();
     82  public final MapillaryData data;
    8583
    8684  /** The bounds of the areas for which the pictures have been downloaded */
     
    9997  private MapillaryLayer() {
    10098    super(tr("Mapillary Images"));
     99    data = MapillaryData.getInstance();
    101100    bounds = new ArrayList<>();
    102101    init();
     
    158157
    159158  /**
    160    * Downloads all images of the area covered by the OSM data. This is only just
    161    * for automatic download.
    162    */
    163   public void download() {
    164     checkAreaTooBig();
    165     if (!Main.pref.get("mapillary.download-mode").equals(
    166         MapillaryDownloader.MODES[0])
    167         || TEMP_SEMIAUTOMATIC)
    168       return;
    169     for (Bounds bounds : Main.map.mapView.getEditLayer().data
    170         .getDataSourceBounds()) {
    171       if (!this.bounds.contains(bounds)) {
    172         this.bounds.add(bounds);
    173         MapillaryDownloader.getImages(bounds.getMin(), bounds.getMax());
    174       }
    175     }
    176   }
    177 
    178   /**
    179    * Checks if the area of the OSM data is too big. This means that probably
    180    * lots of Mapillary images are going to be downloaded, slowing down the
    181    * program too much. To solve this the automatic is stopped, an alert is shown
    182    * and you will have to download areas manually.
    183    */
    184   private void checkAreaTooBig() {
    185     double area = 0;
    186     for (Bounds bounds : Main.map.mapView.getEditLayer().data
    187         .getDataSourceBounds()) {
    188       area += bounds.getArea();
    189     }
    190     if (area > MapillaryDownloadViewAction.MAX_AREA) {
    191       TEMP_SEMIAUTOMATIC = true;
    192       MapillaryPlugin.setMenuEnabled(MapillaryPlugin.DOWNLOAD_VIEW_MENU, true);
    193       JOptionPane
    194           .showMessageDialog(
    195               Main.parent,
    196               tr("The downloaded OSM area is too big. Download mode has been changed to manual until the layer is restarted."));
    197     }
    198   }
    199 
    200   /**
    201159   * Returns the {@link MapillaryData} object, which acts as the database of the
    202160   * Layer.
     
    208166  }
    209167
    210   /**
    211    * Method invoked when the layer is destroyed.
    212    */
    213168  @Override
    214169  public void destroy() {
     
    566521        Main.error(e);
    567522      }
    568       MapillaryLayer.getInstance().download();
     523      MapillaryDownloader.automaticDownload();
    569524    }
    570525  }
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryTrafficSignLayer.java

    r31384 r31401  
    3333  /**
    3434   * Returns and when needed instantiates the Mapillary traffic sign layer.
     35   *
    3536   * @return the only instance of the traffic sign layer
    3637   */
    3738  public static MapillaryTrafficSignLayer getInstance() {
    38     return instance == null ? (instance = new MapillaryTrafficSignLayer()) : instance;
     39    return instance == null ? (instance = new MapillaryTrafficSignLayer())
     40        : instance;
    3941  }
    4042
     
    4850  /*
    4951   * (non-Javadoc)
     52   *
    5053   * @see org.openstreetmap.josm.gui.layer.AbstractModifiableLayer#isModified()
    5154   */
     
    5760  /*
    5861   * (non-Javadoc)
    59    * @see org.openstreetmap.josm.gui.layer.Layer#paint(java.awt.Graphics2D, org.openstreetmap.josm.gui.MapView,
    60    * org.openstreetmap.josm.data.Bounds)
     62   *
     63   * @see org.openstreetmap.josm.gui.layer.Layer#paint(java.awt.Graphics2D,
     64   * org.openstreetmap.josm.gui.MapView, org.openstreetmap.josm.data.Bounds)
    6165   */
    6266  @Override
    6367  public void paint(Graphics2D g, MapView mv, Bounds box) {
    64     g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
     68    g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
     69        RenderingHints.VALUE_ANTIALIAS_ON);
    6570    try {
    66       g.setFont(Font.createFont(Font.TRUETYPE_FONT, new File("data/fonts/traffico/traffico.ttf")).deriveFont(50.0f));
     71      g.setFont(Font.createFont(Font.TRUETYPE_FONT,
     72          new File("data/fonts/traffico/traffico.ttf")).deriveFont(50.0f));
    6773    } catch (FontFormatException e) {
    6874      e.printStackTrace();
     
    7682    points[2] = mv.getPoint(new LatLon(49.01038, 8.40636));
    7783
    78     TrafficoSignElement[][] signs = { TrafficoSign.getSign("europe", "mandatory_cycle_track"), TrafficoSign.getSign("de", "information_bus_stop"), TrafficoSign.getSign("europe", "information_pedestrian_crossing") };
     84    TrafficoSignElement[][] signs = {
     85        TrafficoSign.getSign("europe", "mandatory_cycle_track"),
     86        TrafficoSign.getSign("de", "information_bus_stop"),
     87        TrafficoSign.getSign("europe", "information_pedestrian_crossing") };
    7988
    8089    for (int i = 0; i < signs.length && i < points.length; i++) {
     
    8796    // Start iterating the images
    8897    g.setColor(Color.MAGENTA);
    89     for (MapillaryAbstractImage img : MapillaryLayer.getInstance().getMapillaryData().getImages()) {
     98    for (MapillaryAbstractImage img : MapillaryLayer.getInstance()
     99        .getMapillaryData().getImages()) {
    90100      if (img instanceof MapillaryImage) {
    91         g.fillOval(mv.getPoint(img.getLatLon()).x-3, mv.getPoint(img.getLatLon()).y-3, 6, 6);
     101        g.fillOval(mv.getPoint(img.getLatLon()).x - 3,
     102            mv.getPoint(img.getLatLon()).y - 3, 6, 6);
    92103        if (((MapillaryImage) img).getSigns().size() >= 1) {
    93104          Point imgLoc = mv.getPoint(img.getLatLon());
    94           for (TrafficoSignElement e : TrafficoSign.getSign("de", ((MapillaryImage) img).getSigns().get(0))) {
     105          for (TrafficoSignElement e : TrafficoSign.getSign("de",
     106              ((MapillaryImage) img).getSigns().get(0))) {
    95107            g.setColor(e.getColor());
    96108            g.drawString("" + e.getGlyph(), imgLoc.x, imgLoc.y);
     
    103115  /*
    104116   * (non-Javadoc)
     117   *
    105118   * @see org.openstreetmap.josm.gui.layer.Layer#getIcon()
    106119   */
     
    112125  /*
    113126   * (non-Javadoc)
     127   *
    114128   * @see org.openstreetmap.josm.gui.layer.Layer#getToolTipText()
    115129   */
     
    121135  /*
    122136   * (non-Javadoc)
    123    * @see org.openstreetmap.josm.gui.layer.Layer#mergeFrom(org.openstreetmap.josm.gui.layer.Layer)
     137   *
     138   * @see
     139   * org.openstreetmap.josm.gui.layer.Layer#mergeFrom(org.openstreetmap.josm
     140   * .gui.layer.Layer)
    124141   */
    125142  @Override
    126143  public void mergeFrom(Layer from) {
    127     // Does nothing as this layer is not mergeable (see method isMergable(Layer))
     144    // Does nothing as this layer is not mergeable (see method
     145    // isMergable(Layer))
    128146  }
    129147
    130148  /*
    131149   * (non-Javadoc)
    132    * @see org.openstreetmap.josm.gui.layer.Layer#isMergable(org.openstreetmap.josm.gui.layer.Layer)
     150   *
     151   * @see
     152   * org.openstreetmap.josm.gui.layer.Layer#isMergable(org.openstreetmap.josm
     153   * .gui.layer.Layer)
    133154   */
    134155  @Override
     
    139160  /*
    140161   * (non-Javadoc)
     162   *
    141163   * @see
    142    * org.openstreetmap.josm.gui.layer.Layer#visitBoundingBox(org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor)
     164   * org.openstreetmap.josm.gui.layer.Layer#visitBoundingBox(org.openstreetmap
     165   * .josm.data.osm.visitor.BoundingXYVisitor)
    143166   */
    144167  @Override
     
    150173  /*
    151174   * (non-Javadoc)
     175   *
    152176   * @see org.openstreetmap.josm.gui.layer.Layer#getInfoComponent()
    153177   */
     
    160184  /*
    161185   * (non-Javadoc)
     186   *
    162187   * @see org.openstreetmap.josm.gui.layer.Layer#getMenuEntries()
    163188   */
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryDownloadAction.java

    r31386 r31401  
    1212import org.openstreetmap.josm.actions.JosmAction;
    1313import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer;
     14import org.openstreetmap.josm.plugins.mapillary.downloads.MapillaryDownloader;
    1415import org.openstreetmap.josm.tools.ImageProvider;
    1516import org.openstreetmap.josm.tools.Shortcut;
     
    4142    if (MapillaryLayer.INSTANCE == null) {
    4243      if (Main.map.mapView.getEditLayer() != null)
    43         MapillaryLayer.getInstance().download();
     44        MapillaryDownloader.automaticDownload();
    4445    } else {
    4546      if (Main.map.mapView.getActiveLayer() != MapillaryLayer.getInstance())
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryExportAction.java

    r31386 r31401  
    5757    JButton cancel = new JButton(tr("Cancel"));
    5858    cancel.addActionListener(new CancelAction(pane));
    59 
    6059
    6160    dialog = new MapillaryExportDialog(ok);
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportAction.java

    r31387 r31401  
    153153      if (datetimeOriginal != null)
    154154        MapillaryData.getInstance().add(
    155             new MapillaryImportedImage(latValue, lonValue, caValue, file, datetimeOriginal.getStringValue()));
     155            new MapillaryImportedImage(latValue, lonValue, caValue, file,
     156                datetimeOriginal.getStringValue()));
    156157      else
    157158        MapillaryData.getInstance().add(
    158159            new MapillaryImportedImage(latValue, lonValue, caValue, file));
    159160    }
    160    
     161
    161162    MapillaryLayer.getInstance().showAllPictures();
    162163  }
     
    219220    }
    220221    switch (ref) {
    221     case GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF_VALUE_NORTH:
    222     case GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF_VALUE_SOUTH:
    223     case GpsTagConstants.GPS_TAG_GPS_LONGITUDE_REF_VALUE_EAST:
    224     case GpsTagConstants.GPS_TAG_GPS_LONGITUDE_REF_VALUE_WEST:
    225       break;
    226     default:
    227       throw new IllegalArgumentException();
     222      case GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF_VALUE_NORTH:
     223      case GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF_VALUE_SOUTH:
     224      case GpsTagConstants.GPS_TAG_GPS_LONGITUDE_REF_VALUE_EAST:
     225      case GpsTagConstants.GPS_TAG_GPS_LONGITUDE_REF_VALUE_WEST:
     226        break;
     227      default:
     228        throw new IllegalArgumentException();
    228229    }
    229230
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportIntoSequenceAction.java

    r31396 r31401  
    7373        "jpeg"));
    7474    chooser.setMultiSelectionEnabled(true);
    75    
     75
    7676    if (chooser.showOpenDialog(Main.parent) == JFileChooser.APPROVE_OPTION) {
    7777      for (int i = 0; i < chooser.getSelectedFiles().length; i++) {
     
    112112      joinImages();
    113113    }
    114    
     114
    115115    MapillaryLayer.getInstance().showAllPictures();
    116116  }
     
    140140      final TiffField datetimeOriginal = jpegMetadata
    141141          .findEXIFValueWithExactMatch(ExifTagConstants.EXIF_TAG_DATE_TIME_ORIGINAL);
    142       if (lat_ref == null || lat == null || lon == null || lon_ref == null || datetimeOriginal == null)
    143         throw new IllegalArgumentException("The picture has not correct EXIF tags");
     142      if (lat_ref == null || lat == null || lon == null || lon_ref == null
     143          || datetimeOriginal == null)
     144        throw new IllegalArgumentException(
     145            "The picture has not correct EXIF tags");
    144146
    145147      double latValue = 0;
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryWalkAction.java

    r31398 r31401  
    103103  }
    104104
    105 
    106105}
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/WalkListener.java

    r31398 r31401  
    11package org.openstreetmap.josm.plugins.mapillary.actions;
    2 
    32
    43/**
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/WalkThread.java

    r31398 r31401  
    4646      while (!end && data.getSelectedImage().next() != null) {
    4747        MapillaryAbstractImage image = data.getSelectedImage();
    48         for (int i = 0; i < 5; i++) {
    49           if (image.next() == null)
    50             break;
    51           image = image.next();
    52           Utils.downloadPicture(image);
     48        // Predownload next 5 pictures.
     49        if (image instanceof MapillaryImage) {
     50          for (int i = 0; i < 5; i++) {
     51            if (image.next() == null)
     52              break;
     53            image = image.next();
     54            Utils.downloadPicture((MapillaryImage) image);
     55          }
    5356        }
    5457        try {
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java

    r31387 r31401  
    3030    /** Full quality image */
    3131    FULL_IMAGE,
    32    
     32
    3333    /** Low quality image */
    3434    THUMBNAIL
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/cache/Utils.java

    r31400 r31401  
    44import org.openstreetmap.josm.data.cache.CacheEntryAttributes;
    55import org.openstreetmap.josm.data.cache.ICachedLoaderListener;
    6 import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
    76import org.openstreetmap.josm.plugins.mapillary.MapillaryImage;
    87
     
    1817
    1918  /**
    20    * Downloads the picture of the given image and does nothing when it is downloaded.
     19   * Downloads the picture of the given image and does nothing when it is
     20   * downloaded.
    2121   *
    2222   * @param img
    2323   */
    24   public static void downloadPicture(MapillaryAbstractImage img) {
    25     if (!(img instanceof MapillaryImage))
    26       throw new IllegalArgumentException();
    27     new MapillaryCache(((MapillaryImage) img).getKey(), MapillaryCache.Type.THUMBNAIL).submit(
     24  public static void downloadPicture(MapillaryImage img) {
     25    new MapillaryCache(img.getKey(), MapillaryCache.Type.THUMBNAIL).submit(
    2826        IGNORE_DOWNLOAD, false);
    29     new MapillaryCache(((MapillaryImage) img).getKey(), MapillaryCache.Type.FULL_IMAGE).submit(
     27    new MapillaryCache(img.getKey(), MapillaryCache.Type.FULL_IMAGE).submit(
    3028        IGNORE_DOWNLOAD, false);
    3129  }
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/CommandMoveImage.java

    r31387 r31401  
    2222   * Main constructor.
    2323   *
    24    * @param images Set of images that are going to be moved.
    25    * @param x How much the x coordinate increases.
    26    * @param y How much the y coordinate increases.
     24   * @param images
     25   *          Set of images that are going to be moved.
     26   * @param x
     27   *          How much the x coordinate increases.
     28   * @param y
     29   *          How much the y coordinate increases.
    2730   */
    28   public CommandMoveImage(List<MapillaryAbstractImage> images, double x, double y) {
     31  public CommandMoveImage(List<MapillaryAbstractImage> images, double x,
     32      double y) {
    2933    this.images = new ArrayList<>(images);
    3034    this.x = x;
     
    5458  @Override
    5559  public String toString() {
    56     return trn("Moved {0} image", "Moved {0} images", images.size(), images.size());
     60    return trn("Moved {0} image", "Moved {0} images", images.size(),
     61        images.size());
    5762  }
    5863
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/CommandTurnImage.java

    r31387 r31401  
    2121   * Main constructor.
    2222   *
    23    * @param images Set of images that is turned.
    24    * @param ca How much the images turn.
     23   * @param images
     24   *          Set of images that is turned.
     25   * @param ca
     26   *          How much the images turn.
    2527   */
    2628  public CommandTurnImage(List<MapillaryAbstractImage> images, double ca) {
     
    5153  @Override
    5254  public String toString() {
    53     return trn("Turned {0} image", "Turned {0} images", this.images.size(), this.images.size());
     55    return trn("Turned {0} image", "Turned {0} images", this.images.size(),
     56        this.images.size());
    5457  }
    5558
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/MapillaryRecord.java

    r31387 r31401  
    7272        if (!command.images.contains(img))
    7373          equalSets = false;
    74       if (equalSets && commandList.get(position).getClass() == command.getClass()) {
     74      if (equalSets
     75          && commandList.get(position).getClass() == command.getClass()) {
    7576        commandList.get(position).sum(command);
    7677        fireRecordChanged();
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryDownloader.java

    r31399 r31401  
    11package org.openstreetmap.josm.plugins.mapillary.downloads;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.util.concurrent.ConcurrentHashMap;
     
    57import java.util.concurrent.Executors;
    68
     9import javax.swing.JOptionPane;
     10
    711import org.openstreetmap.josm.Main;
    812import org.openstreetmap.josm.data.Bounds;
    913import org.openstreetmap.josm.data.coor.LatLon;
    1014import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer;
     15import org.openstreetmap.josm.plugins.mapillary.MapillaryPlugin;
    1116import org.openstreetmap.josm.plugins.mapillary.actions.MapillaryDownloadViewAction;
    1217
     
    2025public class MapillaryDownloader {
    2126
    22   /** Possible download modes.*/
    23   public static final String[] MODES = new String[] { "Automatic", "Semiautomatic",
    24   "Manual" };
     27  /** Possible download modes. */
     28  public static final String[] MODES = new String[] { "Automatic",
     29      "Semiautomatic", "Manual" };
    2530
    2631  /** Base URL of the Mapillary API. */
     
    8388    getImages(bounds.getMin(), bounds.getMax());
    8489  }
     90
     91  /**
     92   * Downloads all images of the area covered by the OSM data. This is only just
     93   * for automatic download.
     94   */
     95  public static void automaticDownload() {
     96    MapillaryLayer layer = MapillaryLayer.getInstance();
     97    checkAreaTooBig();
     98    if (!Main.pref.get("mapillary.download-mode").equals(
     99        MapillaryDownloader.MODES[0])
     100        || layer.TEMP_SEMIAUTOMATIC)
     101      return;
     102    for (Bounds bounds : Main.map.mapView.getEditLayer().data
     103        .getDataSourceBounds()) {
     104      if (!layer.bounds.contains(bounds)) {
     105        layer.bounds.add(bounds);
     106        MapillaryDownloader.getImages(bounds.getMin(), bounds.getMax());
     107      }
     108    }
     109  }
     110
     111  /**
     112   * Checks if the area of the OSM data is too big. This means that probably
     113   * lots of Mapillary images are going to be downloaded, slowing down the
     114   * program too much. To solve this the automatic is stopped, an alert is shown
     115   * and you will have to download areas manually.
     116   */
     117  private static void checkAreaTooBig() {
     118    double area = 0;
     119    for (Bounds bounds : Main.map.mapView.getEditLayer().data
     120        .getDataSourceBounds()) {
     121      area += bounds.getArea();
     122    }
     123    if (area > MapillaryDownloadViewAction.MAX_AREA) {
     124      MapillaryLayer.getInstance().TEMP_SEMIAUTOMATIC = true;
     125      MapillaryPlugin.setMenuEnabled(MapillaryPlugin.DOWNLOAD_VIEW_MENU, true);
     126      JOptionPane
     127          .showMessageDialog(
     128              Main.parent,
     129              tr("The downloaded OSM area is too big. Download mode has been changed to manual until the layer is restarted."));
     130    }
     131  }
    85132}
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryExportDownloadThread.java

    r31387 r31401  
    2525 * @see MapillaryExportWriterThread
    2626 */
    27 public class MapillaryExportDownloadThread extends Thread implements ICachedLoaderListener {
     27public class MapillaryExportDownloadThread extends Thread implements
     28    ICachedLoaderListener {
    2829
    2930  String url;
     
    3738   * Main constructor.
    3839   *
    39    * @param image Image to be downloaded.
    40    * @param queue Queue of {@link BufferedImage} objects for the {@link MapillaryExportWriterThread}.
    41    * @param queueImages Queue of {@link MapillaryAbstractImage} objects for the {@link MapillaryExportWriterThread}.
     40   * @param image
     41   *          Image to be downloaded.
     42   * @param queue
     43   *          Queue of {@link BufferedImage} objects for the
     44   *          {@link MapillaryExportWriterThread}.
     45   * @param queueImages
     46   *          Queue of {@link MapillaryAbstractImage} objects for the
     47   *          {@link MapillaryExportWriterThread}.
    4248   */
    43   public MapillaryExportDownloadThread(MapillaryImage image, ArrayBlockingQueue<BufferedImage> queue,
     49  public MapillaryExportDownloadThread(MapillaryImage image,
     50      ArrayBlockingQueue<BufferedImage> queue,
    4451      ArrayBlockingQueue<MapillaryAbstractImage> queueImages) {
    45     url = "https://d1cuyjsrcm0gby.cloudfront.net/" + image.getKey() + "/thumb-2048.jpg";
     52    url = "https://d1cuyjsrcm0gby.cloudfront.net/" + image.getKey()
     53        + "/thumb-2048.jpg";
    4654    this.queue = queue;
    4755    this.image = image;
     
    5159  @Override
    5260  public void run() {
    53     new MapillaryCache(image.getKey(), MapillaryCache.Type.FULL_IMAGE).submit(this, false);
     61    new MapillaryCache(image.getKey(), MapillaryCache.Type.FULL_IMAGE).submit(
     62        this, false);
    5463  }
    5564
    5665  @Override
    57   public void loadingFinished(CacheEntry data, CacheEntryAttributes attributes, LoadResult result) {
     66  public void loadingFinished(CacheEntry data, CacheEntryAttributes attributes,
     67      LoadResult result) {
    5868    try {
    5969      queue.put(ImageIO.read(new ByteArrayInputStream(data.getContent())));
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryExportManager.java

    r31387 r31401  
    2020
    2121/**
    22  * Export main thread. Exportation works by creating a {@link MapillaryExportWriterThread} and several
     22 * Export main thread. Exportation works by creating a
     23 * {@link MapillaryExportWriterThread} and several
    2324 * {@link MapillaryExportDownloadThread}. The second ones download every single
    24  * image that is going to be exported and stores them in an {@link ArrayBlockingQueue}. Then it is picked by the first
    25  * one and written on
     25 * image that is going to be exported and stores them in an
     26 * {@link ArrayBlockingQueue}. Then it is picked by the first one and written on
    2627 * the selected folder. Each image will be named by its key.
    2728 *
     
    4445   * Main constructor.
    4546   *
    46    * @param images Set of {@link MapillaryAbstractImage} objects to be exported.
    47    * @param path Export path.
     47   * @param images
     48   *          Set of {@link MapillaryAbstractImage} objects to be exported.
     49   * @param path
     50   *          Export path.
    4851   */
    4952  public MapillaryExportManager(List<MapillaryAbstractImage> images, String path) {
    50     super(tr("Downloading") + "...", new PleaseWaitProgressMonitor("Exporting Mapillary Images"), true);
     53    super(tr("Downloading") + "...", new PleaseWaitProgressMonitor(
     54        "Exporting Mapillary Images"), true);
    5155    queue = new ArrayBlockingQueue<>(10);
    5256    queueImages = new ArrayBlockingQueue<>(10);
     
    6367   * @throws IOException
    6468   */
    65   public MapillaryExportManager(List<MapillaryImportedImage> images) throws IOException {
    66     super(tr("Downloading") + "...", new PleaseWaitProgressMonitor("Exporting Mapillary Images"), true);
     69  public MapillaryExportManager(List<MapillaryImportedImage> images)
     70      throws IOException {
     71    super(tr("Downloading") + "...", new PleaseWaitProgressMonitor(
     72        "Exporting Mapillary Images"), true);
    6773    queue = new ArrayBlockingQueue<>(10);
    6874    queueImages = new ArrayBlockingQueue<>(10);
     
    8187
    8288  @Override
    83   protected void realRun() throws SAXException, IOException, OsmTransferException {
     89  protected void realRun() throws SAXException, IOException,
     90      OsmTransferException {
    8491    // Starts a writer thread in order to write the pictures on the disk.
    85     writer = new MapillaryExportWriterThread(path, queue, queueImages, amount, this.getProgressMonitor());
     92    writer = new MapillaryExportWriterThread(path, queue, queueImages, amount,
     93        this.getProgressMonitor());
    8694    writer.start();
    8795    if (path == null) {
     
    93101      return;
    94102    }
    95     ex = new ThreadPoolExecutor(20, 35, 25, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(10));
     103    ex = new ThreadPoolExecutor(20, 35, 25, TimeUnit.SECONDS,
     104        new ArrayBlockingQueue<Runnable>(10));
    96105    for (MapillaryAbstractImage image : images) {
    97106      if (image instanceof MapillaryImage) {
    98107        try {
    99           ex.execute(new MapillaryExportDownloadThread((MapillaryImage) image, queue, queueImages));
     108          ex.execute(new MapillaryExportDownloadThread((MapillaryImage) image,
     109              queue, queueImages));
    100110        } catch (Exception e) {
    101111          Main.error(e);
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryExportWriterThread.java

    r31387 r31401  
    4747   * Main constructor.
    4848   *
    49    * @param path Path to write the pictures.
    50    * @param queue Queue of {@link MapillaryAbstractImage} objects.
    51    * @param queueImages Queue of {@link BufferedImage} objects.
    52    * @param amount Amount of images that are going to be exported.
    53    * @param monitor Progress monitor.
     49   * @param path
     50   *          Path to write the pictures.
     51   * @param queue
     52   *          Queue of {@link MapillaryAbstractImage} objects.
     53   * @param queueImages
     54   *          Queue of {@link BufferedImage} objects.
     55   * @param amount
     56   *          Amount of images that are going to be exported.
     57   * @param monitor
     58   *          Progress monitor.
    5459   */
    5560  public MapillaryExportWriterThread(String path,
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryImageInfoDownloaderThread.java

    r31391 r31401  
    3232   * Main constructor.
    3333   *
    34    * @param ex {@link ExecutorService} object that is executing this thread.
    35    * @param queryString
    36    * @param layer
     34   * @param ex
     35   *          {@link ExecutorService} object that is executing this thread.
     36   * @param queryString
     37   * @param layer
    3738   */
    38   public MapillaryImageInfoDownloaderThread(ExecutorService ex, String queryString, MapillaryLayer layer) {
     39  public MapillaryImageInfoDownloaderThread(ExecutorService ex,
     40      String queryString, MapillaryLayer layer) {
    3941    this.ex = ex;
    4042    this.queryString = queryString;
     
    4547  public void run() {
    4648    try {
    47       BufferedReader br = new BufferedReader(new InputStreamReader(
    48           new URL(URL + queryString).openStream(), "UTF-8"));
     49      BufferedReader br = new BufferedReader(new InputStreamReader(new URL(URL
     50          + queryString).openStream(), "UTF-8"));
    4951      JsonObject jsonobj = Json.createReader(br).readObject();
    5052      if (!jsonobj.getBoolean("more"))
     
    5557        data = jsonarr.getJsonObject(i);
    5658        String key = data.getString("key");
    57         for (MapillaryAbstractImage image : layer.getMapillaryData().getImages()) {
     59        for (MapillaryAbstractImage image : layer.getMapillaryData()
     60            .getImages()) {
    5861          if (image instanceof MapillaryImage) {
    5962            if (((MapillaryImage) image).getKey().equals(key)
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySquareDownloadManagerThread.java

    r31399 r31401  
    7979        completeImages();
    8080        MapillaryMainDialog.getInstance().updateTitle();
    81         Main.map.statusLine.setHelpText(tr("Downloading signs"));
     81        Main.map.statusLine.setHelpText(tr("Downloading traffic signs"));
    8282        downloadSigns();
    8383      }
     
    125125    int page = 0;
    126126    while (!ex.isShutdown()) {
    127       ex.execute(new MapillarySignDownloaderThread(ex, signQueryString
     127      ex.execute(new MapillaryTrafficSignDownloaderThread(ex, signQueryString
    128128          + "&page=" + page + "&limit=20", layer));
    129129      while (ex.getQueue().remainingCapacity() == 0)
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryTrafficSignDownloaderThread.java

    r31400 r31401  
    2323 *
    2424 */
    25 public class MapillarySignDownloaderThread extends Thread {
     25public class MapillaryTrafficSignDownloaderThread extends Thread {
    2626  private static final String URL = MapillaryDownloader.BASE_URL
    2727      + "search/im/or/";
     
    3838   * @param layer
    3939   */
    40   public MapillarySignDownloaderThread(ExecutorService ex, String queryString,
    41       MapillaryLayer layer) {
     40  public MapillaryTrafficSignDownloaderThread(ExecutorService ex,
     41      String queryString, MapillaryLayer layer) {
    4242    this.ex = ex;
    4343    this.queryString = queryString;
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryExportDialog.java

    r31391 r31401  
    3434  /** Button to export all downloaded images. */
    3535  public JRadioButton all;
    36   /** Button to export all images in the sequence of the selected MapillaryImage. */
     36  /**
     37   * Button to export all images in the sequence of the selected MapillaryImage.
     38   */
    3739  public JRadioButton sequence;
    38   /** Button to export all images belonging to the selected {@link MapillaryImage} objects. */
     40  /**
     41   * Button to export all images belonging to the selected
     42   * {@link MapillaryImage} objects.
     43   */
    3944  public JRadioButton selected;
    4045  /** Button to rewrite all imported images. */
     
    5156  /**
    5257   * Main constructor.
    53    * @param ok
     58   *
     59   * @param ok
    5460   */
    5561  public MapillaryExportDialog(JButton ok) {
    5662    this.ok = ok;
    5763    ok.setEnabled(false);
    58    
     64
    5965    setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
    6066
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterDialog.java

    r31398 r31401  
    114114    downloaded.setSelected(true);
    115115
    116     JPanel col1 = new JPanel(new GridLayout(2,1));
     116    JPanel col1 = new JPanel(new GridLayout(2, 1));
    117117    col1.add(downloaded);
    118118    col1.add(fromPanel);
    119119    panel.add(col1);
    120     JPanel col2 = new JPanel(new GridLayout(2,1));
     120    JPanel col2 = new JPanel(new GridLayout(2, 1));
    121121    col2.add(imported);
    122122    col2.add(userSearchPanel);
    123123    panel.add(col2);
    124     JPanel col3 = new JPanel(new GridLayout(2,1));
     124    JPanel col3 = new JPanel(new GridLayout(2, 1));
    125125    col3.add(onlySigns);
    126126    col3.add(signChooserPanel);
     
    204204      Long currentTime = currentTime();
    205205      if (time.getSelectedItem() == TIME_LIST[1]) {
    206         if (img.getCapturedAt() < currentTime - ((Integer) spinner.getValue()).longValue()
    207             * 365 * 24 * 60 * 60 * 1000) {
     206        if (img.getCapturedAt() < currentTime
     207            - ((Integer) spinner.getValue()).longValue() * 365 * 24 * 60 * 60
     208            * 1000) {
    208209          img.setVisible(false);
    209210          continue;
     
    211212      }
    212213      if (time.getSelectedItem() == TIME_LIST[2]) {
    213         if (img.getCapturedAt() < currentTime - ((Integer) spinner.getValue()).longValue() * 30 * 24
    214             * 60 * 60 * 1000) {
     214        if (img.getCapturedAt() < currentTime
     215            - ((Integer) spinner.getValue()).longValue() * 30 * 24 * 60 * 60
     216            * 1000) {
    215217          img.setVisible(false);
    216218          continue;
     
    218220      }
    219221      if (time.getSelectedItem() == TIME_LIST[3]) {
    220         if (img.getCapturedAt() < currentTime - ((Integer) spinner.getValue()).longValue() * 60
    221             * 60 * 1000) {
     222        if (img.getCapturedAt() < currentTime
     223            - ((Integer) spinner.getValue()).longValue() * 60 * 60 * 1000) {
    222224          img.setVisible(false);
    223225          continue;
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryPreferenceSetting.java

    r31399 r31401  
    2323import org.openstreetmap.josm.plugins.mapillary.MapillaryPlugin;
    2424import org.openstreetmap.josm.plugins.mapillary.downloads.MapillaryDownloader;
    25 import org.openstreetmap.josm.plugins.mapillary.oauth.PortListener;
     25import org.openstreetmap.josm.plugins.mapillary.oauth.OAuthPortListener;
    2626
    2727/**
     
    6262    panel.add(reverseButtons);
    6363
     64    // Sets the value of the ComboBox.
     65    if (Main.pref.get("mapillary.download-mode").equals(
     66        MapillaryDownloader.MODES[0]))
     67      downloadMode.setSelectedItem(MapillaryDownloader.MODES[0]);
     68    if (Main.pref.get("mapillary.download-mode").equals(
     69        MapillaryDownloader.MODES[1]))
     70      downloadMode.setSelectedItem(MapillaryDownloader.MODES[1]);
     71    if (Main.pref.get("mapillary.download-mode").equals(
     72        MapillaryDownloader.MODES[2]))
     73      downloadMode.setSelectedItem(MapillaryDownloader.MODES[2]);
    6474    JPanel downloadModePanel = new JPanel();
    6575    downloadModePanel.add(new JLabel(tr("Download mode: ")));
     
    117127    @Override
    118128    public void actionPerformed(ActionEvent arg0) {
    119       PortListener portListener = new PortListener();
     129      OAuthPortListener portListener = new OAuthPortListener();
    120130      portListener.start();
    121131
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryWalkDialog.java

    r31396 r31401  
    1010/**
    1111 * Dialog to set the walk mode options.
     12 *
    1213 * @author nokutu
    1314 *
    1415 */
    1516public class MapillaryWalkDialog extends JPanel {
    16  
     17
    1718  private static final long serialVersionUID = -6258767312211941358L;
    18  
     19
    1920  /** Spin containing the interval value. */
    2021  public SpinnerModel spin;
     
    3132    interval.add(new JSpinner(spin));
    3233    add(interval);
    33    
     34
    3435    waitForPicture = new JCheckBox("Wait for the picture to be downloaded");
    3536    waitForPicture.setSelected(true);
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/AbstractMode.java

    r31399 r31401  
    1717
    1818/**
    19  * Superclass for all the mode of the {@link MapillaryLayer}
     19 * Superclass for all the mode of the {@link MapillaryLayer}.
    2020 *
    2121 * @author nokutu
     
    2828  protected MapillaryData data = MapillaryData.getInstance();
    2929
     30  /** If in semiautomatic mode, the last Epoch time when there was a download */
    3031  private long lastDownload;
    3132
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/SelectMode.java

    r31391 r31401  
    4949      return;
    5050    MapillaryAbstractImage closest = getClosest(e.getPoint());
    51     if (Main.map.mapView.getActiveLayer() instanceof OsmDataLayer && closest != null
    52         && Main.map.mapMode == Main.map.mapModeSelect) {
     51    if (Main.map.mapView.getActiveLayer() instanceof OsmDataLayer
     52        && closest != null && Main.map.mapMode == Main.map.mapModeSelect) {
    5353      this.lastClicked = this.closest;
    5454      data.setSelectedImage(closest);
     
    113113        Main.map.repaint();
    114114      } else if (lastButton == MouseEvent.BUTTON1 && e.isShiftDown()) {
    115         this.closest
    116             .turn(Math.toDegrees(Math.atan2((e.getX() - start.x), -(e.getY() - start.y))) - closest.getTempCa());
     115        this.closest.turn(Math.toDegrees(Math.atan2((e.getX() - start.x),
     116            -(e.getY() - start.y)))
     117            - closest.getTempCa());
    117118        for (MapillaryAbstractImage img : data.getMultiSelectedImages()) {
    118           img.turn(Math.toDegrees(Math.atan2((e.getX() - start.x), -(e.getY() - start.y))) - closest.getTempCa());
     119          img.turn(Math.toDegrees(Math.atan2((e.getX() - start.x),
     120              -(e.getY() - start.y))) - closest.getTempCa());
    119121        }
    120122        Main.map.repaint();
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/OAuthPortListener.java

    r31400 r31401  
    1212
    1313/**
     14 * Listens to the OAuth port in order to get the access token.
     15 *
    1416 * @author nokutu
    1517 *
    1618 */
    17 public class PortListener extends Thread {
     19public class OAuthPortListener extends Thread {
    1820
    1921  @Override
     
    2325      Socket clientSocket = serverSocket.accept();
    2426      PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true);
    25       Scanner in = new Scanner(new InputStreamReader(clientSocket.getInputStream()));
     27      Scanner in = new Scanner(new InputStreamReader(
     28          clientSocket.getInputStream()));
    2629      String s;
    2730      String accessToken = null;
     
    3235          for (int i = 0; i < ss.length; i++) {
    3336            if (ss[i].contains("access_token=")) {
    34               accessToken = ss[i].substring(ss[i].indexOf("access_token=") + 13, ss[i].length());
     37              accessToken = ss[i].substring(
     38                  ss[i].indexOf("access_token=") + 13, ss[i].length());
    3539              break;
    3640            }
     
    4246      writeContent(out);
    4347
    44       Main.info("Successful login with Mapillary, the access token is: " + accessToken);
     48      Main.info("Successful login with Mapillary, the access token is: "
     49          + accessToken);
    4550      Main.pref.put("mapillary.access-token", accessToken);
    4651
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/traffico/TrafficoSign.java

    r31391 r31401  
    5757            Color c;
    5858            switch (elements.getJsonObject(i).getString("color").toLowerCase()) {
    59             case "black":
    60               c = Color.BLACK;
    61               break;
    62             case "red":
    63               c = Color.RED;
    64               break;
    65             case "blue":
    66               c = Color.BLUE;
    67               break;
    68             case "white":
    69               c = Color.WHITE;
    70               break;
    71             case "green":
    72               c = Color.GREEN;
    73               break;
    74             case "yellow":
    75               c = Color.YELLOW;
    76               break;
    77             default:
    78               c = Color.MAGENTA;
     59              case "black":
     60                c = Color.BLACK;
     61                break;
     62              case "red":
     63                c = Color.RED;
     64                break;
     65              case "blue":
     66                c = Color.BLUE;
     67                break;
     68              case "white":
     69                c = Color.WHITE;
     70                break;
     71              case "green":
     72                c = Color.GREEN;
     73                break;
     74              case "yellow":
     75                c = Color.YELLOW;
     76                break;
     77              default:
     78                c = Color.MAGENTA;
    7979            }
    8080            layers.add(new TrafficoSignElement(glyph, c));
Note: See TracChangeset for help on using the changeset viewer.