Changeset 31452 in osm


Ignore:
Timestamp:
2015-08-05T11:46:07+02:00 (9 years ago)
Author:
nokutu
Message:

Fix #11748

Location:
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
Files:
7 edited

Legend:

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

    r31450 r31452  
    33import org.openstreetmap.josm.Main;
    44import org.openstreetmap.josm.plugins.mapillary.cache.Utils;
     5import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryMainDialog;
    56
    67import java.util.ArrayList;
     
    3536
    3637    addListener(MapillaryPlugin.walkAction);
     38    addListener(MapillaryPlugin.zoomAction);
     39    addListener(MapillaryPlugin.uploadAction);
     40    addListener(MapillaryMainDialog.getInstance());
    3741  }
    3842
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryPlugin.java

    r31445 r31452  
    5353  /** Import action */
    5454  public static MapillaryImportAction importAction;
    55   private final MapillaryZoomAction zoomAction;
     55  /** Zoom action */
     56  public static MapillaryZoomAction zoomAction;
    5657  private final MapillaryDownloadViewAction downloadViewAction;
    5758  private final MapillaryImportIntoSequenceAction importIntoSequenceAction;
     
    5960  /** Walk action */
    6061  public static MapillaryWalkAction walkAction;
    61   private final MapillaryUploadAction uploadAction;
     62  /** Upload action */
     63  public static MapillaryUploadAction uploadAction;
    6264
    6365  /** Menu button for the {@link MapillaryDownloadAction} action. */
     
    100102    this.exportAction = new MapillaryExportAction();
    101103    importAction = new MapillaryImportAction();
    102     this.zoomAction = new MapillaryZoomAction();
     104    zoomAction = new MapillaryZoomAction();
    103105    this.downloadViewAction = new MapillaryDownloadViewAction();
    104106    this.importIntoSequenceAction = new MapillaryImportIntoSequenceAction();
    105107    this.joinAction = new MapillaryJoinAction();
    106     this.uploadAction = new MapillaryUploadAction();
     108    uploadAction = new MapillaryUploadAction();
    107109
    108110    if (Main.main != null) { // important for headless mode
     
    115117      IMPORT_MENU = MainMenu.add(Main.main.menu.fileMenu, importAction, false,
    116118          14);
    117       UPLOAD_MENU = MainMenu.add(Main.main.menu.fileMenu, this.uploadAction,
     119      UPLOAD_MENU = MainMenu.add(Main.main.menu.fileMenu, uploadAction,
    118120          false, 14);
    119       ZOOM_MENU = MainMenu.add(Main.main.menu.viewMenu, this.zoomAction, false,
     121      ZOOM_MENU = MainMenu.add(Main.main.menu.viewMenu, zoomAction, false,
    120122          15);
    121123      DOWNLOAD_VIEW_MENU = MainMenu.add(Main.main.menu.fileMenu,
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryUploadAction.java

    r31451 r31452  
    3838            Shortcut.NONE), false, "mapillaryUpload", false);
    3939    this.setEnabled(false);
    40     MapillaryLayer.getInstance().getData().addListener(this);
    4140  }
    4241
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryWalkAction.java

    r31445 r31452  
    6060      fireWalkStarted();
    6161      this.thread.start();
    62       MapillaryMainDialog.getInstance().setMode(MapillaryMainDialog.Mode.WALK);
     62      MapillaryMainDialog.getInstance().setMode(MapillaryMainDialog.MODE.WALK);
    6363    }
    6464  }
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryZoomAction.java

    r31451 r31452  
    3535            KeyEvent.CHAR_UNDEFINED, Shortcut.NONE), false, "mapillaryZoom",
    3636        false);
    37     MapillaryLayer.getInstance().getData().addListener(this);
    3837    this.setEnabled(false);
    3938  }
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/WalkThread.java

    r31451 r31452  
    196196      this.data.removeListener(this);
    197197      MapillaryMainDialog.getInstance()
    198           .setMode(MapillaryMainDialog.Mode.NORMAL);
     198          .setMode(MapillaryMainDialog.MODE.NORMAL);
    199199    }
    200200  }
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryMainDialog.java

    r31451 r31452  
    7676   *
    7777   */
    78   public static enum Mode {
     78  public static enum MODE {
    7979    /** Standard mode to view pictures. */
    8080    NORMAL,
     
    9696            tr("Open Mapillary main dialog"), KeyEvent.VK_M, Shortcut.NONE),
    9797        200, false, MapillaryPreferenceSetting.class);
    98     MapillaryLayer.getInstance().getData().addListener(this);
    9998    addShortcuts();
    10099    this.mapillaryImageDisplay = new MapillaryImageDisplay();
     
    148147   *          The mode to be set.
    149148   */
    150   public void setMode(Mode mode) {
     149  public void setMode(MODE mode) {
    151150    switch (mode) {
    152151      case NORMAL:
     
    166165    }
    167166    disableAllButtons();
     167    if (mode.equals(MODE.NORMAL))
     168      updateImage();
    168169
    169170  }
Note: See TracChangeset for help on using the changeset viewer.