Changeset 34577 in osm for applications
- Timestamp:
- 2018-08-18T22:24:00+02:00 (6 years ago)
- 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 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <projectDescription> 3 <name> MicrosoftStreetside</name>3 <name>JOSM-MicrosoftStreetside</name> 4 4 <comment>Allows the user to work with pictures hosted at mapillary.com</comment> 5 5 <projects> -
applications/editors/josm/plugins/MicrosoftStreetside/build.xml
r34428 r34577 12 12 <property name="commit.message" value="Commit message" /> 13 13 <!-- 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" /> 18 17 <property name="plugin.class" value="org.openstreetmap.josm.plugins.streetside.StreetsidePlugin" /> 19 18 <property name="plugin.description" value="View high resolution Microsoft Streetside 360 degree imagery in JOSM." /> … … 33 32 <import file="../build-common.xml"/> 34 33 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" /> 36 35 <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path" /> 37 36 … … 57 56 <target name="fetch_dependencies" depends="clean_ivy"> 58 57 <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" /> 60 60 </target> 61 61 -
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"> 2 2 <info organisation="org.openstreetmap.josm.plugins" module="MicrosoftStreetside" revision="0.0.1" /> 3 3 <configurations defaultconf="default" defaultconfmapping="default->default"> -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/StreetsideAbstractImage.java
r34432 r34577 5 5 6 6 /** 7 * Abstract superclass for all image objects. At the moment there are 3,8 * {@link StreetsideIm portedImage}, {@link StreetsideImage}, {@link StreetsideCubemap}.7 * Abstract superclass for all image objects. At the moment there are 2, 8 * {@link StreetsideImage}, {@link StreetsideCubemap}. 9 9 * 10 10 * @author nokutu … … 276 276 * Turns the image direction. 277 277 * 278 * @param ca278 * @param he 279 279 * The angle the image is moving. 280 280 */ -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/StreetsideData.java
r34429 r34577 12 12 13 13 import org.apache.commons.jcs.access.CacheAccess; 14 import org.openstreetmap.josm.Main;15 14 import org.openstreetmap.josm.data.Bounds; 16 15 import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry; … … 64 63 // Adds the basic set of listeners. 65 64 Arrays.stream(StreetsidePlugin.getStreetsideDataListeners()).forEach(this::addListener); 66 if (Main.main != null) {67 65 addListener(StreetsideViewerDialog.getInstance().getStreetsideViewerPanel()); 68 66 addListener(StreetsideMainDialog.getInstance()); 69 67 addListener(ImageInfoPanel.getInstance()); 70 }71 68 } 72 69 -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/StreetsideLayer.java
r34432 r34577 22 22 23 23 import org.apache.log4j.Logger; 24 import org.openstreetmap.josm.Main;25 24 import org.openstreetmap.josm.data.Bounds; 26 25 import org.openstreetmap.josm.data.osm.DataSet; … … 115 114 } 116 115 // Does not execute when in headless mode 117 if ( Main.main != null &&!StreetsideMainDialog.getInstance().isShowing()) {116 if (!StreetsideMainDialog.getInstance().isShowing()) { 118 117 StreetsideMainDialog.getInstance().showDialog(); 119 118 } -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/StreetsidePlugin.java
r34432 r34577 2 2 package org.openstreetmap.josm.plugins.streetside; 3 3 4 import org.openstreetmap.josm.Main;5 4 import org.openstreetmap.josm.gui.MainApplication; 6 5 import org.openstreetmap.josm.gui.MainMenu; … … 38 37 39 38 static { 40 if (Main.main != null) {41 39 MainMenu.add(MainApplication.getMenu().fileMenu, new StreetsideExportAction(), false, 14); 42 40 MainMenu.add(MainApplication.getMenu().imagerySubMenu, new StreetsideDownloadAction(), false); … … 44 42 MainMenu.add(MainApplication.getMenu().fileMenu, new StreetsideDownloadViewAction(), false, 14); 45 43 MainMenu.add(MainApplication.getMenu().moreToolsMenu, WALK_ACTION, false); 46 }47 44 } 48 45 -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/actions/StreetsideExportAction.java
r34429 r34577 15 15 16 16 import org.apache.log4j.Logger; 17 import org.openstreetmap.josm.Main;18 17 import org.openstreetmap.josm.actions.JosmAction; 19 18 import org.openstreetmap.josm.gui.MainApplication; … … 66 65 pane.setOptions(new JButton[] {ok, cancel}); 67 66 68 JDialog dlg = pane.createDialog(Main .parent, tr("Export Streetside images"));67 JDialog dlg = pane.createDialog(MainApplication.getMainFrame(), tr("Export Streetside images")); 69 68 dlg.setMinimumSize(new Dimension(400, 150)); 70 69 dlg.setVisible(true); -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/actions/StreetsideWalkAction.java
r34349 r34577 12 12 import javax.swing.JOptionPane; 13 13 14 import org.openstreetmap.josm.Main;15 14 import org.openstreetmap.josm.actions.JosmAction; 15 import org.openstreetmap.josm.gui.MainApplication; 16 16 import org.openstreetmap.josm.plugins.streetside.StreetsideAbstractImage; 17 17 import org.openstreetmap.josm.plugins.streetside.StreetsideDataListener; … … 50 50 JOptionPane pane = new JOptionPane(dialog, JOptionPane.PLAIN_MESSAGE, 51 51 JOptionPane.OK_CANCEL_OPTION); 52 JDialog dlg = pane.createDialog(Main .parent, tr("Walk mode"));52 JDialog dlg = pane.createDialog(MainApplication.getMainFrame(), tr("Walk mode")); 53 53 dlg.setMinimumSize(new Dimension(400, 150)); 54 54 dlg.setVisible(true); -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/cache/Caches.java
r34365 r34577 11 11 import org.apache.commons.jcs.engine.behavior.IElementAttributes; 12 12 import org.apache.log4j.Logger; 13 import org.openstreetmap.josm. Main;13 import org.openstreetmap.josm.data.Preferences; 14 14 import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry; 15 15 import org.openstreetmap.josm.data.cache.JCSCacheManager; … … 26 26 27 27 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"); 29 29 if (!f.exists()) { 30 30 f.mkdirs(); -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/gui/imageinfo/AddTagToPrimitiveAction.java
r34416 r34577 7 7 import javax.swing.JOptionPane; 8 8 9 import org.openstreetmap.josm.Main;10 9 import org.openstreetmap.josm.data.osm.AbstractPrimitive; 11 10 import org.openstreetmap.josm.data.osm.Tag; 11 import org.openstreetmap.josm.gui.MainApplication; 12 12 import org.openstreetmap.josm.tools.I18n; 13 13 import org.openstreetmap.josm.tools.ImageProvider; … … 45 45 if (target.hasKey(tag.getKey()) && !target.hasTag(tag.getKey(), tag.getValue())) { 46 46 conflictResolution = JOptionPane.showConfirmDialog( 47 Main .parent,47 MainApplication.getMainFrame(), 48 48 "<html>" + 49 49 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 44 44 super(new BorderLayout()); 45 45 46 SwingUtilities.invokeLater(new Runnable() { 47 @SuppressWarnings("synthetic-access") 48 @Override 49 public void run() { 50 initializeAndStartGUI(); 51 } 52 }); 46 SwingUtilities.invokeLater(() -> initializeAndStartGUI()); 53 47 54 48 selectedImageChanged(null, null); -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/oauth/OAuthPortListener.java
r34393 r34577 15 15 16 16 import org.apache.log4j.Logger; 17 import org.openstreetmap.josm.Main;18 17 import org.openstreetmap.josm.plugins.streetside.utils.StreetsideProperties; 19 18 import org.openstreetmap.josm.tools.I18n; … … 71 70 // Saves the access token in preferences. 72 71 StreetsideUser.setTokenValid(true); 73 if (Main.main != null) {74 72 StreetsideProperties.ACCESS_TOKEN.put(accessToken); 75 73 String username = StreetsideUser.getUsername(); … … 78 76 callback.onLogin(username); 79 77 } 80 }81 78 } catch (BindException e) { 82 79 logger.warn(e); -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/utils/GraphicsUtils.java
r34433 r34577 25 25 26 26 public static javafx.scene.image.Image convertBufferedImage2JavaFXImage(BufferedImage bf) { 27 //Image res = SwingFXUtils.toFXImage(bf, null);28 long startTime = System.currentTimeMillis();29 27 WritableImage res = null; 30 28 if (bf != null) { -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/utils/PluginState.java
r34393 r34577 7 7 8 8 import org.apache.log4j.Logger; 9 import org.openstreetmap.josm. Main;9 import org.openstreetmap.josm.gui.MainApplication; 10 10 import org.openstreetmap.josm.tools.I18n; 11 11 … … 101 101 public static void imageUploaded() { 102 102 imagesUploaded++; 103 if (imagesToUpload == imagesUploaded && Main.main != null) {103 if (imagesToUpload == imagesUploaded) { 104 104 finishedUploadDialog(imagesUploaded); 105 105 } … … 108 108 private static void finishedUploadDialog(int numImages) { 109 109 JOptionPane.showMessageDialog( 110 Main .parent,110 MainApplication.getMainFrame(), 111 111 tr("You have successfully uploaded {0} images to Bing.com", numImages), 112 112 tr("Finished upload"), … … 116 116 117 117 public static void notLoggedInToMapillaryDialog() { 118 if (Main.main == null) {119 return;120 }121 118 JOptionPane.showMessageDialog( 122 Main .parent,119 MainApplication.getMainFrame(), 123 120 tr("You are not logged in, please log in to Streetside in the preferences"), 124 121 tr("Not Logged in to Streetside"), … … 126 123 ); 127 124 } 128 129 130 125 131 126 /** -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/utils/StreetsideSequenceIdGenerator.java
r34428 r34577 9 9 * handle sequences of contiguous imagery, but Streetside only has implicit 10 10 * sequences defined by the "pre" and "ne" attributes. 11 * <p/>12 * @See StreetsideSequence11 * 12 * See {@link org.openstreetmap.josm.plugins.streetside.StreetsideSequence} 13 13 */ 14 14 public class StreetsideSequenceIdGenerator { … … 17 17 // private constructor to avoid instantiation 18 18 } 19 19 20 public static String generateId() { 20 21 21 return UUID.randomUUID().toString(); 22 23 22 } 24 25 23 } -
applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/io/download/SequenceDownloadRunnableTest.java
r34432 r34577 23 23 24 24 @Rule 25 public JOSMTestRules rules = new StreetsideTestRules() .platform();25 public JOSMTestRules rules = new StreetsideTestRules(); 26 26 27 27 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 5 5 6 6 import org.junit.Test; 7 8 import org.openstreetmap.josm.Main;9 7 10 8 /** … … 37 35 @Test 38 36 public void uploadTest() { 39 Main.main = null;40 37 assertEquals(false, PluginState.isUploading()); 41 38 PluginState.addImagesToUpload(2);
Note:
See TracChangeset
for help on using the changeset viewer.