Changeset 32078 in osm


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
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapillary/.settings/org.eclipse.jdt.core.prefs

    r31971 r32078  
    7373org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
    7474org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
    75 org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
     75org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=ignore
    7676org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
    7777org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
  • applications/editors/josm/plugins/mapillary/build.gradle

    r32070 r32078  
    141141
    142142task activatePlugin(type: Copy) {
    143   from "gradle/josm-preferences.xml"
    144   into "$buildDir/.josm"
    145   rename 'josm-preferences.xml', 'preferences.xml'
     143  if (!new File("$buildDir/.josm/preferences.xml").exists()) {
     144    from "gradle/josm-preferences.xml"
     145    into "$buildDir/.josm"
     146    rename 'josm-preferences.xml', 'preferences.xml'
     147  }
    146148}
    147149
  • 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    }
  • applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryPreferenceSettingTest.java

    r31909 r32078  
    4747    assertEquals(I18n.tr("You are currently not logged in."), ((JLabel) getPrivateField(setting, "loginLabel")).getText());
    4848    assertFalse(((JPanel) getPrivateField(setting, "loginPanel")).isAncestorOf(((JButton) getPrivateField(setting, "logoutButton"))));
     49    assertTrue(((JPanel) getPrivateField(setting, "loginPanel")).isAncestorOf(((JButton) getPrivateField(setting, "loginButton"))));
    4950
    5051    String username = "TheMapillaryUsername";
    5152    setting.onLogin(username);
    5253
    53     assertEquals(I18n.tr("Re-Login"), ((JButton) getPrivateField(setting, "loginButton")).getText());
     54    assertEquals(I18n.tr("Login"), ((JButton) getPrivateField(setting, "loginButton")).getText());
    5455    assertEquals(I18n.tr("You are logged in as ''{0}''.", username), ((JLabel) getPrivateField(setting, "loginLabel")).getText());
    5556    assertTrue(((JPanel) getPrivateField(setting, "loginPanel")).isAncestorOf(((JButton) getPrivateField(setting, "logoutButton"))));
     57    assertFalse(((JPanel) getPrivateField(setting, "loginPanel")).isAncestorOf(((JButton) getPrivateField(setting, "loginButton"))));
    5658  }
    5759
Note: See TracChangeset for help on using the changeset viewer.