Changeset 31424 in osm for applications


Ignore:
Timestamp:
2015-07-31T15:52:49+02:00 (9 years ago)
Author:
nokutu
Message:

Fixed ImageProvider errors when in Windows because of the routes separator.

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

Legend:

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

    r31422 r31424  
    3434  /** Plugin's directory */
    3535  public static String directory;
     36  /** OS route separator */
     37  public static final String SEPARATOR = System.getProperty("file.separator");
    3638  /** 24x24 icon. */
    3739  public static ImageIcon ICON24;
     
    8688    super(info);
    8789
    88     directory = new File("").getAbsolutePath() + "/";
    89     ICON24 = new ImageProvider(directory + "images/icon24.png").get();
    90     ICON16 = new ImageProvider(directory + "images/icon16.png").get();
    91     MAP_ICON = new ImageProvider(directory + "images/mapicon.png").get();
     90
     91    directory = new File("").getAbsolutePath() + SEPARATOR;
     92    ICON24 = new ImageProvider(directory + "images" + SEPARATOR + "icon24.png").get();
     93    ICON16 = new ImageProvider(directory + "images" + SEPARATOR + "icon16.png").get();
     94    MAP_ICON = new ImageProvider(directory + "images" + SEPARATOR + "mapicon.png").get();
    9295    MAP_ICON_SELECTED = new ImageProvider(directory
    93         + "images/mapiconselected.png").get();
     96        + "images" + SEPARATOR + "mapiconselected.png").get();
    9497    MAP_ICON_IMPORTED = new ImageProvider(directory
    9598        + "images/mapiconimported.png").get();
    96     MAP_SIGN = new ImageProvider(directory + "images/sign.png").get();
     99    MAP_SIGN = new ImageProvider(directory + "images" + SEPARATOR + "sign.png").get();
    97100
    98101    downloadAction = new MapillaryDownloadAction();
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryDownloadAction.java

    r31417 r31424  
    3131   */
    3232  public MapillaryDownloadAction() {
    33     super(tr("Mapillary"), new ImageProvider(MapillaryPlugin.directory + "images/icon24.png"),
     33    super(tr("Mapillary"), new ImageProvider(MapillaryPlugin.directory
     34        + "images" + MapillaryPlugin.SEPARATOR + "icon24.png"),
    3435        tr("Create Mapillary layer"), Shortcut.registerShortcut("Mapillary",
    3536            tr("Start Mapillary layer"), KeyEvent.VK_COMMA, Shortcut.SHIFT),
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryDownloadViewAction.java

    r31422 r31424  
    2727  public MapillaryDownloadViewAction() {
    2828    super(tr("Download Mapillary images in current view"), new ImageProvider(
    29         MapillaryPlugin.directory + "images/icon24.png"), tr("Download Mapillary images in current view"),
     29        MapillaryPlugin.directory + "images" + MapillaryPlugin.SEPARATOR + "icon24.png"), tr("Download Mapillary images in current view"),
    3030        Shortcut.registerShortcut("Mapillary area",
    3131            tr("Download Mapillary images in current view"),
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryExportAction.java

    r31417 r31424  
    4343   */
    4444  public MapillaryExportAction() {
    45     super(tr("Export pictures"), new ImageProvider(MapillaryPlugin.directory + "images/icon24.png"),
     45    super(tr("Export pictures"), new ImageProvider(MapillaryPlugin.directory
     46        + "images" + MapillaryPlugin.SEPARATOR + "icon24.png"),
    4647        tr("Export pictures"), Shortcut.registerShortcut("Export Mapillary",
    4748            tr("Export Mapillary pictures"), KeyEvent.CHAR_UNDEFINED,
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportAction.java

    r31418 r31424  
    5151  public MapillaryImportAction() {
    5252    super(tr("Import pictures"), new ImageProvider(MapillaryPlugin.directory
    53         + "images/icon24.png"), tr("Import local pictures"), Shortcut
    54         .registerShortcut("Import Mapillary",
    55             tr("Import pictures into Mapillary layer"),
     53        + "images" + MapillaryPlugin.SEPARATOR + "icon24.png"),
     54        tr("Import local pictures"), Shortcut.registerShortcut(
     55            "Import Mapillary", tr("Import pictures into Mapillary layer"),
    5656            KeyEvent.CHAR_UNDEFINED, Shortcut.NONE), false, "mapillaryImport",
    5757        false);
     
    267267    }
    268268
    269     result = 360*((result+180)/360 - Math.floor((result+180)/360)) - 180;
     269    result = 360 * ((result + 180) / 360 - Math.floor((result + 180) / 360)) - 180;
    270270    return result;
    271271  }
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportIntoSequenceAction.java

    r31417 r31424  
    5151   */
    5252  public MapillaryImportIntoSequenceAction() {
    53     super(tr("Import pictures into sequence"), new ImageProvider(MapillaryPlugin.directory + "images/icon24.png"),
     53    super(tr("Import pictures into sequence"), new ImageProvider(
     54        MapillaryPlugin.directory
     55            + "images" + MapillaryPlugin.SEPARATOR + "icon24.png"),
    5456        tr("Import local pictures"), Shortcut.registerShortcut(
    5557            "Import Mapillary Sequence",
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryJoinAction.java

    r31417 r31424  
    2828   */
    2929  public MapillaryJoinAction() {
    30     super(tr("Join mode"), new ImageProvider(MapillaryPlugin.directory + "images/icon24.png"),
     30    super(tr("Join mode"), new ImageProvider(MapillaryPlugin.directory
     31        + "images" + MapillaryPlugin.SEPARATOR + "icon24.png"),
    3132        tr("Join/unjoin pictures"), Shortcut.registerShortcut("Mapillary join",
    3233            tr("Join Mapillary pictures"), KeyEvent.CHAR_UNDEFINED,
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryWalkAction.java

    r31417 r31424  
    4040  public MapillaryWalkAction() {
    4141    super(tr("Walk mode"), new ImageProvider(MapillaryPlugin.directory
    42         + "images/icon24.png"), tr("Walk mode"), Shortcut.registerShortcut(
    43         "Mapillary walk", tr("Start walk mode"), KeyEvent.CHAR_UNDEFINED,
    44         Shortcut.NONE), false, "mapillaryWalk", false);
     42        + "images" + MapillaryPlugin.SEPARATOR + "icon24.png"), tr("Walk mode"),
     43        Shortcut.registerShortcut("Mapillary walk", tr("Start walk mode"),
     44            KeyEvent.CHAR_UNDEFINED, Shortcut.NONE), false, "mapillaryWalk",
     45        false);
    4546    this.setEnabled(false);
    4647  }
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryZoomAction.java

    r31417 r31424  
    3030   */
    3131  public MapillaryZoomAction() {
    32     super(tr("Zoom to selected image"), new ImageProvider(MapillaryPlugin.directory + "images/icon24.png"),
     32    super(tr("Zoom to selected image"), new ImageProvider(
     33        MapillaryPlugin.directory
     34            + "images" + MapillaryPlugin.SEPARATOR + "icon24.png"),
    3335        tr("Zoom to selected image"), Shortcut.registerShortcut(
    3436            "Zoom Mapillary",
  • applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/ImportTest.java

    r31421 r31424  
    1111import org.apache.commons.imaging.common.RationalNumber;
    1212import org.apache.commons.imaging.formats.tiff.constants.GpsTagConstants;
    13 import org.openstreetmap.josm.Main;
    1413import org.openstreetmap.josm.data.coor.LatLon;
    1514import org.openstreetmap.josm.plugins.mapillary.actions.MapillaryImportAction;
Note: See TracChangeset for help on using the changeset viewer.