Changeset 34577 in osm for applications/editors


Ignore:
Timestamp:
2018-08-18T22:24:00+02:00 (6 years ago)
Author:
donvip
Message:

update to JOSM 14153

Location:
applications/editors/josm/plugins/MicrosoftStreetside
Files:
2 added
1 deleted
18 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/MicrosoftStreetside/.project

    r34321 r34577  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<projectDescription>
    3         <name>MicrosoftStreetside</name>
     3        <name>JOSM-MicrosoftStreetside</name>
    44        <comment>Allows the user to work with pictures hosted at mapillary.com</comment>
    55        <projects>
  • applications/editors/josm/plugins/MicrosoftStreetside/build.xml

    r34428 r34577  
    1212        <property name="commit.message" value="Commit message" />
    1313        <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    14         <property name="plugin.main.version" value="13860" />
    15         <property name="plugin.version" value="13860" />
    16        
    17   <property name="plugin.author" value="renerr18" />
     14        <property name="plugin.main.version" value="14153" />
     15
     16        <property name="plugin.author" value="renerr18" />
    1817        <property name="plugin.class" value="org.openstreetmap.josm.plugins.streetside.StreetsidePlugin" />
    1918        <property name="plugin.description" value="View high resolution Microsoft Streetside 360 degree imagery in JOSM." />
     
    3332        <import file="../build-common.xml"/>
    3433
    35         <path id="ivy.lib.path" path="ant/ivy-2.4.0.jar" />
     34        <path id="ivy.lib.path" path="ant/ivy-2.5.0-rc1.jar" />
    3635        <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path" />
    3736
     
    5756        <target name="fetch_dependencies" depends="clean_ivy">
    5857                <echo>fetching dependencies with ivy</echo>
    59                 <ivy:retrieve pattern="${plugin.lib.dir}/[artifact]-[type].[ext]" conf="default" />
     58                <ivy:settings file="ivy_settings.xml" />
     59                <ivy:retrieve pattern="${plugin.lib.dir}/[artifact]-[revision](-[classifier]).[ext]" conf="default" />
    6060        </target>
    6161
  • applications/editors/josm/plugins/MicrosoftStreetside/ivy.xml

    r34358 r34577  
    1 <ivy-module version="2.0">
     1<ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
    22        <info organisation="org.openstreetmap.josm.plugins" module="MicrosoftStreetside" revision="0.0.1" />
    33        <configurations defaultconf="default" defaultconfmapping="default->default">
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/StreetsideAbstractImage.java

    r34432 r34577  
    55
    66/**
    7  * Abstract superclass for all image objects. At the moment there are 3,
    8  * {@link StreetsideImportedImage}, {@link StreetsideImage}, {@link StreetsideCubemap}.
     7 * Abstract superclass for all image objects. At the moment there are 2,
     8 * {@link StreetsideImage}, {@link StreetsideCubemap}.
    99 *
    1010 * @author nokutu
     
    276276         * Turns the image direction.
    277277         *
    278          * @param ca
     278         * @param he
    279279         *            The angle the image is moving.
    280280         */
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/StreetsideData.java

    r34429 r34577  
    1212
    1313import org.apache.commons.jcs.access.CacheAccess;
    14 import org.openstreetmap.josm.Main;
    1514import org.openstreetmap.josm.data.Bounds;
    1615import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry;
     
    6463  // Adds the basic set of listeners.
    6564  Arrays.stream(StreetsidePlugin.getStreetsideDataListeners()).forEach(this::addListener);
    66     if (Main.main != null) {
    6765      addListener(StreetsideViewerDialog.getInstance().getStreetsideViewerPanel());
    6866      addListener(StreetsideMainDialog.getInstance());
    6967      addListener(ImageInfoPanel.getInstance());
    70     }
    7168  }
    7269
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/StreetsideLayer.java

    r34432 r34577  
    2222
    2323import org.apache.log4j.Logger;
    24 import org.openstreetmap.josm.Main;
    2524import org.openstreetmap.josm.data.Bounds;
    2625import org.openstreetmap.josm.data.osm.DataSet;
     
    115114    }
    116115    // Does not execute when in headless mode
    117     if (Main.main != null && !StreetsideMainDialog.getInstance().isShowing()) {
     116    if (!StreetsideMainDialog.getInstance().isShowing()) {
    118117      StreetsideMainDialog.getInstance().showDialog();
    119118    }
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/StreetsidePlugin.java

    r34432 r34577  
    22package org.openstreetmap.josm.plugins.streetside;
    33
    4 import org.openstreetmap.josm.Main;
    54import org.openstreetmap.josm.gui.MainApplication;
    65import org.openstreetmap.josm.gui.MainMenu;
     
    3837
    3938  static {
    40     if (Main.main != null) {
    4139      MainMenu.add(MainApplication.getMenu().fileMenu, new StreetsideExportAction(), false, 14);
    4240      MainMenu.add(MainApplication.getMenu().imagerySubMenu, new StreetsideDownloadAction(), false);
     
    4442      MainMenu.add(MainApplication.getMenu().fileMenu, new StreetsideDownloadViewAction(), false, 14);
    4543      MainMenu.add(MainApplication.getMenu().moreToolsMenu, WALK_ACTION, false);
    46     }
    4744  }
    4845
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/actions/StreetsideExportAction.java

    r34429 r34577  
    1515
    1616import org.apache.log4j.Logger;
    17 import org.openstreetmap.josm.Main;
    1817import org.openstreetmap.josm.actions.JosmAction;
    1918import org.openstreetmap.josm.gui.MainApplication;
     
    6665    pane.setOptions(new JButton[] {ok, cancel});
    6766
    68     JDialog dlg = pane.createDialog(Main.parent, tr("Export Streetside images"));
     67    JDialog dlg = pane.createDialog(MainApplication.getMainFrame(), tr("Export Streetside images"));
    6968    dlg.setMinimumSize(new Dimension(400, 150));
    7069    dlg.setVisible(true);
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/actions/StreetsideWalkAction.java

    r34349 r34577  
    1212import javax.swing.JOptionPane;
    1313
    14 import org.openstreetmap.josm.Main;
    1514import org.openstreetmap.josm.actions.JosmAction;
     15import org.openstreetmap.josm.gui.MainApplication;
    1616import org.openstreetmap.josm.plugins.streetside.StreetsideAbstractImage;
    1717import org.openstreetmap.josm.plugins.streetside.StreetsideDataListener;
     
    5050    JOptionPane pane = new JOptionPane(dialog, JOptionPane.PLAIN_MESSAGE,
    5151        JOptionPane.OK_CANCEL_OPTION);
    52     JDialog dlg = pane.createDialog(Main.parent, tr("Walk mode"));
     52    JDialog dlg = pane.createDialog(MainApplication.getMainFrame(), tr("Walk mode"));
    5353    dlg.setMinimumSize(new Dimension(400, 150));
    5454    dlg.setVisible(true);
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/cache/Caches.java

    r34365 r34577  
    1111import org.apache.commons.jcs.engine.behavior.IElementAttributes;
    1212import org.apache.log4j.Logger;
    13 import org.openstreetmap.josm.Main;
     13import org.openstreetmap.josm.data.Preferences;
    1414import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry;
    1515import org.openstreetmap.josm.data.cache.JCSCacheManager;
     
    2626
    2727        public static File getCacheDirectory() {
    28                 final File f = new File(Main.pref.getPluginsDirectory().getPath() + "/MicrosoftStreetside/cache");
     28                final File f = new File(Preferences.main().getPluginsDirectory().getPath() + "/MicrosoftStreetside/cache");
    2929                if (!f.exists()) {
    3030                        f.mkdirs();
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/gui/imageinfo/AddTagToPrimitiveAction.java

    r34416 r34577  
    77import javax.swing.JOptionPane;
    88
    9 import org.openstreetmap.josm.Main;
    109import org.openstreetmap.josm.data.osm.AbstractPrimitive;
    1110import org.openstreetmap.josm.data.osm.Tag;
     11import org.openstreetmap.josm.gui.MainApplication;
    1212import org.openstreetmap.josm.tools.I18n;
    1313import org.openstreetmap.josm.tools.ImageProvider;
     
    4545      if (target.hasKey(tag.getKey()) && !target.hasTag(tag.getKey(), tag.getValue())) {
    4646        conflictResolution = JOptionPane.showConfirmDialog(
    47           Main.parent,
     47          MainApplication.getMainFrame(),
    4848          "<html>" +
    4949            I18n.tr("A tag with key <i>{0}</i> is already present on the selected OSM object.", tag.getKey()) + "<br>" +
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/gui/imageinfo/StreetsideViewerPanel.java

    r34429 r34577  
    4444                super(new BorderLayout());
    4545
    46                 SwingUtilities.invokeLater(new Runnable() {
    47                      @SuppressWarnings("synthetic-access")
    48         @Override
    49                      public void run() {
    50                          initializeAndStartGUI();
    51                      }
    52                  });
     46                SwingUtilities.invokeLater(() -> initializeAndStartGUI());
    5347
    5448                selectedImageChanged(null, null);
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/oauth/OAuthPortListener.java

    r34393 r34577  
    1515
    1616import org.apache.log4j.Logger;
    17 import org.openstreetmap.josm.Main;
    1817import org.openstreetmap.josm.plugins.streetside.utils.StreetsideProperties;
    1918import org.openstreetmap.josm.tools.I18n;
     
    7170   // Saves the access token in preferences.
    7271   StreetsideUser.setTokenValid(true);
    73    if (Main.main != null) {
    7472     StreetsideProperties.ACCESS_TOKEN.put(accessToken);
    7573     String username = StreetsideUser.getUsername();
     
    7876       callback.onLogin(username);
    7977     }
    80    }
    8178 } catch (BindException e) {
    8279   logger.warn(e);
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/utils/GraphicsUtils.java

    r34433 r34577  
    2525
    2626        public static javafx.scene.image.Image convertBufferedImage2JavaFXImage(BufferedImage bf) {
    27           //Image res = SwingFXUtils.toFXImage(bf, null);
    28           long startTime = System.currentTimeMillis();
    2927                WritableImage res = null;
    3028                if (bf != null) {
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/utils/PluginState.java

    r34393 r34577  
    77
    88import org.apache.log4j.Logger;
    9 import org.openstreetmap.josm.Main;
     9import org.openstreetmap.josm.gui.MainApplication;
    1010import org.openstreetmap.josm.tools.I18n;
    1111
     
    101101  public static void imageUploaded() {
    102102    imagesUploaded++;
    103     if (imagesToUpload == imagesUploaded && Main.main != null) {
     103    if (imagesToUpload == imagesUploaded) {
    104104        finishedUploadDialog(imagesUploaded);
    105105    }
     
    108108  private static void finishedUploadDialog(int numImages) {
    109109    JOptionPane.showMessageDialog(
    110       Main.parent,
     110      MainApplication.getMainFrame(),
    111111      tr("You have successfully uploaded {0} images to Bing.com", numImages),
    112112      tr("Finished upload"),
     
    116116
    117117  public static void notLoggedInToMapillaryDialog() {
    118     if (Main.main == null) {
    119       return;
    120     }
    121118    JOptionPane.showMessageDialog(
    122         Main.parent,
     119        MainApplication.getMainFrame(),
    123120        tr("You are not logged in, please log in to Streetside in the preferences"),
    124121        tr("Not Logged in to Streetside"),
     
    126123    );
    127124  }
    128 
    129 
    130125
    131126  /**
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/utils/StreetsideSequenceIdGenerator.java

    r34428 r34577  
    99 * handle sequences of contiguous imagery, but Streetside only has implicit
    1010 * sequences defined by the "pre" and "ne" attributes.
    11  * <p/>
    12  * @See StreetsideSequence
     11 *
     12 * See {@link org.openstreetmap.josm.plugins.streetside.StreetsideSequence}
    1313 */
    1414public class StreetsideSequenceIdGenerator {
     
    1717    // private constructor to avoid instantiation
    1818  }
     19
    1920  public static String generateId() {
    20 
    2121    return UUID.randomUUID().toString();
    22 
    2322  }
    24 
    2523}
  • applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/io/download/SequenceDownloadRunnableTest.java

    r34432 r34577  
    2323
    2424  @Rule
    25   public JOSMTestRules rules = new StreetsideTestRules().platform();
     25  public JOSMTestRules rules = new StreetsideTestRules();
    2626
    2727  private static final Function<Bounds, URL> SEARCH_SEQUENCES_URL_GEN = b -> {
  • applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/utils/PluginStateTest.java

    r34386 r34577  
    55
    66import org.junit.Test;
    7 
    8 import org.openstreetmap.josm.Main;
    97
    108/**
     
    3735  @Test
    3836  public void uploadTest() {
    39     Main.main = null;
    4037    assertEquals(false, PluginState.isUploading());
    4138    PluginState.addImagesToUpload(2);
Note: See TracChangeset for help on using the changeset viewer.