Changeset 36065 in osm
- Timestamp:
- 2023-03-22T15:57:34+01:00 (20 months ago)
- Location:
- applications/editors/josm/plugins/MicrosoftStreetside
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/StreetsidePlugin.java
r34773 r36065 36 36 private static final StreetsideWalkAction WALK_ACTION = new StreetsideWalkAction(); 37 37 38 static {39 MainMenu.add(MainApplication.getMenu().fileMenu, new StreetsideExportAction(), false, 14);40 MainMenu.add(MainApplication.getMenu().imagerySubMenu, new StreetsideDownloadAction(), false);41 MainMenu.add(MainApplication.getMenu().viewMenu, ZOOM_ACTION, false, 15);42 MainMenu.add(MainApplication.getMenu().fileMenu, new StreetsideDownloadViewAction(), false, 14);43 MainMenu.add(MainApplication.getMenu().moreToolsMenu, WALK_ACTION, false);44 }45 46 38 /** 47 39 * Main constructor. … … 56 48 StreetsideUser.setTokenValid(false); 57 49 } 50 MainMenu.add(MainApplication.getMenu().fileMenu, new StreetsideExportAction(), false, 14); 51 MainMenu.add(MainApplication.getMenu().imagerySubMenu, new StreetsideDownloadAction(), false); 52 MainMenu.add(MainApplication.getMenu().viewMenu, ZOOM_ACTION, false, 15); 53 MainMenu.add(MainApplication.getMenu().fileMenu, new StreetsideDownloadViewAction(), false, 14); 54 MainMenu.add(MainApplication.getMenu().moreToolsMenu, WALK_ACTION, false); 58 55 } 59 56 -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/cubemap/CubemapBuilder.java
r34774 r36065 24 24 import org.openstreetmap.josm.plugins.streetside.gui.StreetsideViewerDialog; 25 25 import org.openstreetmap.josm.plugins.streetside.gui.imageinfo.StreetsideViewerPanel; 26 import org.openstreetmap.josm.plugins.streetside.gui.imageinfo.ThreeSixtyDegreeViewerPanel; 26 27 import org.openstreetmap.josm.plugins.streetside.utils.GraphicsUtils; 27 28 import org.openstreetmap.josm.plugins.streetside.utils.StreetsideProperties; … … 115 116 116 117 public void downloadCubemapImages(String imageId) { 117 if(StreetsideViewerPanel.getThreeSixtyDegreeViewerPanel().getScene() != StreetsideViewerPanel.getThreeSixtyDegreeViewerPanel().getLoadingScene()) { 118 StreetsideViewerPanel.getThreeSixtyDegreeViewerPanel().setScene( 119 StreetsideViewerPanel.getThreeSixtyDegreeViewerPanel().getLoadingScene() 120 ); 118 ThreeSixtyDegreeViewerPanel panel360 = StreetsideViewerPanel.getThreeSixtyDegreeViewerPanel(); 119 if (panel360 != null && panel360.getScene() != panel360.getLoadingScene()) { 120 panel360.setScene(panel360.getLoadingScene()); 121 121 } 122 122 -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/gui/imageinfo/StreetsideViewerPanel.java
r34577 r36065 3 3 4 4 import java.awt.BorderLayout; 5 import java.awt.GraphicsEnvironment; 5 6 import java.text.MessageFormat; 6 7 … … 55 56 threeSixtyDegreeViewerPanel = new ThreeSixtyDegreeViewerPanel(); 56 57 57 GraphicsUtils.PlatformHelper.run(() ->{58 threeSixtyDegreeViewerPanel.initialize();59 }); 58 if (!GraphicsEnvironment.isHeadless()) { 59 GraphicsUtils.PlatformHelper.run(threeSixtyDegreeViewerPanel::initialize); 60 } 60 61 61 62 add(threeSixtyDegreeViewerPanel, BorderLayout.CENTER); -
applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/StreetsideDataTest.java
r36064 r36065 11 11 12 12 import org.junit.jupiter.api.BeforeEach; 13 import org.junit.jupiter.api.Disabled; 13 14 import org.junit.jupiter.api.Test; 14 15 import org.junit.jupiter.api.condition.DisabledIf; 15 16 import org.openstreetmap.josm.data.coor.LatLon; 17 import org.openstreetmap.josm.testutils.annotations.Main; 16 18 17 19 /** … … 21 23 * @see StreetsideData 22 24 */ 23 @ DisabledIf(value = "org.openstreetmap.josm.plugins.streetside.utils.TestUtil#cannotLoadImages", disabledReason = "At JOSM maintainer request (flaky?)")25 @Main 24 26 class StreetsideDataTest { 25 27 … … 95 97 * Tests the selection of images. 96 98 */ 99 @Disabled("The imgs have non-int identifiers while the code expects the identifiers to be int in string form") 97 100 @Test 98 101 void testSelect() { … … 112 115 */ 113 116 @Test 117 @Disabled("The imgs have non-int identifiers while the code expects the identifiers to be int in string form") 114 118 void testNextAndPrevious() { 115 119 data.setSelectedImage(img1); … … 125 129 } 126 130 131 @Disabled("Someone decided to not throw an IllegalStateException. No clue why.") 127 132 @Test 128 133 void testNextOfNullImg() { … … 131 136 } 132 137 138 @Disabled("Someone decided to not throw an IllegalStateException. No clue why.") 133 139 @Test 134 140 void testPreviousOfNullImg() { … … 141 147 * multiselected List should reset. 142 148 */ 149 @Disabled("The imgs have non-int identifiers while the code expects the identifiers to be int in string form") 143 150 @Test 144 151 void testMultiSelect() { -
applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/StreetsideLayerTest.java
r36064 r36065 6 6 import static org.junit.jupiter.api.Assertions.assertThrows; 7 7 import static org.junit.jupiter.api.Assertions.assertTrue; 8 9 import java.awt.GraphicsEnvironment; 8 10 9 11 import org.junit.jupiter.api.Test; … … 22 24 @Main 23 25 @Projection 24 @DisabledIf(value = "org.openstreetmap.josm.plugins.streetside.utils.TestUtil#cannotLoadImages", disabledReason = "At JOSM maintainer request (flaky?)")25 26 class StreetsideLayerTest { 26 27 private static Layer getDummyLayer() { … … 72 73 } 73 74 75 @DisabledIf(value = "java.awt.GraphicsEnvironment#isHeadless", disabledReason = "Listener for destruction is only registered in non-headless environments") 74 76 @Test 75 77 void testClearInstance() { -
applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/utils/TestUtil.java
r36064 r36065 15 15 16 16 import org.junit.runners.model.InitializationError; 17 import org.openstreetmap.josm.plugins.streetside.StreetsidePlugin;18 import org.openstreetmap.josm.spi.preferences.Config;19 import org.openstreetmap.josm.spi.preferences.MemoryPreferences;20 17 import org.openstreetmap.josm.testutils.JOSMTestRules; 21 import org.openstreetmap.josm.tools.ImageProvider;22 18 import org.openstreetmap.josm.tools.Logging; 23 19 import org.openstreetmap.josm.tools.Utils; … … 30 26 private TestUtil() { 31 27 // Prevent instantiation 32 }33 34 /**35 * Check if we can load images36 * @return {@code true} if the {@link StreetsidePlugin#LOGO} could be loaded37 */38 public static boolean cannotLoadImages() {39 // The class-level @DisabledIf seems to be run prior to any possible setup code40 if (Config.getPref() == null) {41 Config.setPreferencesInstance(new MemoryPreferences());42 }43 return new ImageProvider("streetside-logo").setOptional(true).getResource() == null;44 28 } 45 29
Note:
See TracChangeset
for help on using the changeset viewer.