Ignore:
Timestamp:
2016-02-19T23:36:27+01:00 (9 years ago)
Author:
floscher
Message:

[mapillary] Highlight the sequence that the selected image is contained in

  • this also fixes one unit test that failed since the last commit
  • and the JOSM-preferences are no longer overwritten everytime you run ./gradlew runJosm, only when you ./gradlew clean
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/MapillaryAbstractImage.java

    r32064 r32078  
    1717 *
    1818 */
    19 public class MapillaryAbstractImage implements Comparable<MapillaryAbstractImage>{
     19public class MapillaryAbstractImage implements Comparable<MapillaryAbstractImage> {
    2020  /**
    2121   * If two values for field ca differ by less than EPSILON both values are considered equal.
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java

    r32064 r32078  
    318318    }
    319319    // Draw sequence line
    320     g.setColor(Color.WHITE);
    321     g.setStroke(new BasicStroke(this == Main.map.mapView.getActiveLayer() ? 3 : 1));
     320    final MapillaryAbstractImage selectedImage = MapillaryLayer.getInstance().getData().getSelectedImage();
     321    String selectedImageKey = null; // Intentionally not null to avoid null-check before .equals()
     322    if (selectedImage != null && selectedImage.getSequence() != null) {
     323      selectedImageKey = selectedImage.getSequence().getKey();
     324    }
     325    g.setStroke(new BasicStroke(this == Main.map.mapView.getActiveLayer() ? 3 : 2));
    322326    for (MapillarySequence seq : getData().getSequences()) {
     327      if (selectedImageKey != null && selectedImageKey.equals(seq.getKey())) {
     328        g.setColor(Color.MAGENTA.brighter());
     329      } else {
     330        g.setColor(Color.WHITE);
     331      }
    323332      g.draw(MapViewGeometryUtil.getSequencePath(mv, seq));
    324333    }
Note: See TracChangeset for help on using the changeset viewer.