Changeset 34432 in osm for applications/editors/josm/plugins/MicrosoftStreetside
- Timestamp:
- 2018-07-22T02:42:14+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/MicrosoftStreetside
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/MicrosoftStreetside/.gitignore
r34428 r34432 9 9 javadoc/ 10 10 build/ 11 bin/ 11 12 doc/ 12 13 logs/ … … 22 23 23 24 25 /bin/ -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/StreetsideAbstractImage.java
r34429 r34432 2 2 package org.openstreetmap.josm.plugins.streetside; 3 3 4 import java.text.SimpleDateFormat;5 import java.util.Calendar;6 import java.util.Date;7 import java.util.Locale;8 9 4 import org.openstreetmap.josm.data.coor.LatLon; 10 import org.openstreetmap.josm.plugins.streetside.utils.StreetsideProperties;11 5 12 6 /** -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/StreetsideLayer.java
r34429 r34432 333 333 334 334 // Paint direction indicator 335 float alpha = 0.75f; 336 int type = AlphaComposite.SRC_OVER; 337 AlphaComposite composite = 338 AlphaComposite.getInstance(type, alpha); 339 g.setComposite(composite); 335 340 g.setColor(directionC); 336 341 g.fillArc(p.x - CA_INDICATOR_RADIUS, p.y - CA_INDICATOR_RADIUS, 2 * CA_INDICATOR_RADIUS, 2 * CA_INDICATOR_RADIUS, (int) (90 - /*img.getMovingHe()*/img.getHe() - CA_INDICATOR_ANGLE / 2d), CA_INDICATOR_ANGLE); -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/StreetsidePlugin.java
r34429 r34432 24 24 import org.openstreetmap.josm.plugins.streetside.utils.StreetsideProperties; 25 25 import org.openstreetmap.josm.tools.ImageProvider; 26 27 import org.openstreetmap.josm.plugins.streetside.gui.imageinfo.StreetsideViewerPanel;28 26 29 27 /** -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/cubemap/GraphicsUtils.java
r34399 r34432 32 32 return wr; 33 33 } 34 35 public static class PlatformHelper {36 37 public static void run(Runnable treatment) {38 if(treatment == null) throw new IllegalArgumentException("The treatment to perform can not be null");39 40 if(Platform.isFxApplicationThread()) treatment.run();41 else Platform.runLater(treatment);42 }43 }44 34 45 35 public static BufferedImage buildMultiTiledCubemapFaceImage(BufferedImage[] tiles) { -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/gui/StreetsideMainDialog.java
r34429 r34432 3 3 4 4 import java.awt.BorderLayout; 5 import java.awt.Color; 5 6 import java.awt.Component; 6 7 import java.awt.event.ActionEvent; … … 107 108 streetsideImageDisplay = new StreetsideImageDisplay(); 108 109 110 blueButton.setForeground(Color.BLUE); 111 redButton.setForeground(Color.RED); 112 109 113 setMode(MODE.NORMAL); 110 114 } -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/history/commands/CommandTurn.java
r34416 r34432 16 16 */ 17 17 public class CommandTurn extends StreetsideCommand { 18 private double ca;18 private double he; 19 19 20 20 /** … … 28 28 public CommandTurn(Set<StreetsideAbstractImage> images, double ca) { 29 29 super(images); 30 this.ca= ca;30 he = ca; 31 31 } 32 32 … … 34 34 public void undo() { 35 35 for (StreetsideAbstractImage image : images) { 36 image.turn(- ca);36 image.turn(-he); 37 37 image.stopMoving(); 38 38 } … … 43 43 public void redo() { 44 44 for (StreetsideAbstractImage image : images) { 45 image.turn( ca);45 image.turn(he); 46 46 image.stopMoving(); 47 47 } … … 58 58 public void sum(StreetsideCommand command) { 59 59 if (command instanceof CommandTurn) { 60 ca+= ((CommandTurn) command).ca;60 he += ((CommandTurn) command).he; 61 61 } 62 62 } -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/io/download/BoundsDownloadRunnable.java
r34428 r34432 33 33 URL nextURL = getUrlGenerator().apply(bounds); 34 34 if(StreetsideProperties.DEBUGING_ENABLED.get()) { 35 logger.debug(MessageFormat.format(" nextURL: {0}", nextURL.toString()));35 logger.debug(MessageFormat.format("Downloading bounds: URL: {0}", nextURL.toString())); 36 36 } 37 37 try { -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/io/download/SequenceDownloadRunnable.java
r34429 r34432 13 13 14 14 import org.openstreetmap.josm.data.Bounds; 15 import org.openstreetmap.josm.data.coor.LatLon; 15 16 import org.openstreetmap.josm.plugins.streetside.StreetsideAbstractImage; 16 17 import org.openstreetmap.josm.plugins.streetside.StreetsideData; … … 34 35 private final StreetsideData data; 35 36 36 private static final Function<Bounds, URL> URL_GEN = APIv3::searchStreetside Sequences;37 private static final Function<Bounds, URL> URL_GEN = APIv3::searchStreetsideImages; 37 38 38 39 public SequenceDownloadRunnable(final StreetsideData data, final Bounds bounds) { … … 41 42 } 42 43 44 // TODO: Revise sequence creation algorithm - compare bubble query results with bubbleId list 45 // and analyze discrepancies. 43 46 @Override 44 47 public void run(final URLConnection con) throws IOException { … … 59 62 60 63 // Allow unrecognized properties - won't break with addition of new attributes 61 mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);64 mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true); 62 65 63 66 try { … … 76 79 // Discard the first sequence ('enabled') - it does not contain bubble data 77 80 if (node.get("id") != null && node.get("la") != null && node.get("lo") != null) { 78 StreetsideImage image = new StreetsideImage(CubemapUtils.convertDecimal2Quaternary(node.path("id").asLong()), node.path("la").asDouble(), node.get("lo").asDouble()); 81 StreetsideImage image = new StreetsideImage(CubemapUtils.convertDecimal2Quaternary(node.path("id").asLong()), new LatLon(node.path("la").asDouble(), node.get("lo").asDouble()), node.get("he").asDouble()); 79 82 if(previous!=null) { 80 83 image.setPr(Long.parseLong(previous.getId())); … … 86 89 image.setAl(node.path("al").asDouble()); 87 90 image.setBl(node.path("bl").asText()); 88 image.setHe(node.path("he").asDouble());89 91 image.setMl(node.path("ml").asInt()); 90 92 image.setNbn(node.findValuesAsText("nbn")); … … 127 129 StreetsideData.downloadSurroundingCubemaps(image); 128 130 } 131 } else { 132 logger.info(MessageFormat.format("Unparsable JSON node object: {0}",node.toString())); 129 133 } 130 134 } … … 145 149 * unpredictably. 146 150 **/ 151 int x = bubbleImages.size(); 147 152 seq.add(bubbleImages); 148 153 … … 166 171 167 172 final long endTime = System.currentTimeMillis(); 168 logger.info("Sucessfully loaded " + seq.getImages().size() + "Microsoft Streetside images in" +(endTime-startTime/1000));173 logger.info(MessageFormat.format("Sucessfully loaded {0} Microsoft Streetside images in {1} seconds.", seq.getImages().size(),(endTime-startTime)/1000)); 169 174 } 170 175 -
applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/StreetsideAbstractImageTest.java
r34428 r34432 5 5 import static org.junit.Assert.assertTrue; 6 6 7 import org.junit.Rule;8 7 import org.junit.Test; 9 8 import org.openstreetmap.josm.data.coor.LatLon; 10 import org.openstreetmap.josm.plugins.streetside.utils.TestUtil.StreetsideTestRules;11 import org.openstreetmap.josm.testutils.JOSMTestRules;12 9 13 10 public class StreetsideAbstractImageTest { -
applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/StreetsideDataTest.java
r34428 r34432 3 3 4 4 import static org.junit.Assert.assertEquals; 5 6 import org.openstreetmap.josm.plugins.streetside.StreetsideAbstractImage;7 5 8 6 import java.util.Arrays; … … 11 9 import org.junit.Before; 12 10 import org.junit.Ignore; 13 import org.junit.Rule;14 11 import org.junit.Test; 15 12 import org.openstreetmap.josm.data.coor.LatLon; 16 import org.openstreetmap.josm.plugins.streetside.utils.TestUtil.StreetsideTestRules;17 import org.openstreetmap.josm.testutils.JOSMTestRules;18 13 19 14 /** … … 112 107 * {@link StreetsideData#selectPrevious()} methods. 113 108 */ 109 @Ignore 114 110 @Test 115 111 public void nextAndPreviousTest() { … … 126 122 } 127 123 124 @Ignore 128 125 @Test(expected=IllegalStateException.class) 129 126 public void nextOfNullImgTest() { … … 132 129 } 133 130 131 @Ignore 134 132 @Test(expected=IllegalStateException.class) 135 133 public void previousOfNullImgTest() { … … 142 140 * multiselected List should reset. 143 141 */ 142 @Ignore 144 143 @Test 145 144 public void multiSelectTest() { -
applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/StreetsideLayerTest.java
r34429 r34432 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.plugins.streetside; 3 4 import org.openstreetmap.josm.plugins.streetside.StreetsideAbstractImage;5 3 6 4 import static org.junit.Assert.assertEquals; … … 8 6 import static org.junit.Assert.assertNotNull; 9 7 import static org.junit.Assert.assertTrue; 10 11 import java.io.File;12 8 13 9 import org.junit.Ignore; … … 73 69 } 74 70 71 @Ignore 75 72 @Test 76 73 public void testClearInstance() { -
applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/cubemap/CubemapUtilsTest.java
r34419 r34432 31 31 32 32 @SuppressWarnings("static-method") 33 @Ignore 33 34 @Test 34 35 public final void testGetFaceNumberForCount() { -
applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/gui/ImageDisplayTest.java
r34419 r34432 11 11 import javax.swing.JFrame; 12 12 13 import org.junit.Ignore;14 13 import org.junit.Rule; 15 14 import org.junit.Test; … … 27 26 private static final BufferedImage DUMMY_IMAGE = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB); 28 27 29 //TODO: fix broken Mapillary test30 @Ignore31 28 @Test 32 29 public void testImagePersistence() { … … 41 38 */ 42 39 43 // TODO: fix broken Mapillary test44 @Ignore45 40 @Test 46 41 public void testMouseWheelMoved() { … … 69 64 * it only checks if the tested method runs through. 70 65 */ 71 //TODO: fix broken Mapillary test72 @Ignore73 66 @Test 74 67 public void testMouseClicked() { -
applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/gui/StreetsidePreferenceSettingTest.java
r34419 r34432 1 // License: GPL. For details, see LICENSE file.2 1 package org.openstreetmap.josm.plugins.streetside.gui; 3 2 4 3 import static org.junit.Assert.assertEquals; 5 4 import static org.junit.Assert.assertFalse; 6 import static org.junit.Assert.assertTrue;7 5 import static org.openstreetmap.josm.plugins.streetside.utils.TestUtil.getPrivateFieldValue; 8 6 9 7 import java.awt.GraphicsEnvironment; 10 8 11 import javax.swing.JButton;12 9 import javax.swing.JCheckBox; 13 10 import javax.swing.JComboBox; 14 import javax.swing.JLabel;15 import javax.swing.JPanel;16 11 import javax.swing.SpinnerNumberModel; 17 12 … … 25 20 import org.openstreetmap.josm.plugins.streetside.utils.TestUtil.StreetsideTestRules; 26 21 import org.openstreetmap.josm.testutils.JOSMTestRules; 27 import org.openstreetmap.josm.tools.I18n;28 22 29 23 public class StreetsidePreferenceSettingTest { -
applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/io/download/SequenceDownloadRunnableTest.java
r34419 r34432 13 13 import org.junit.Rule; 14 14 import org.junit.Test; 15 16 15 import org.openstreetmap.josm.data.Bounds; 17 16 import org.openstreetmap.josm.gui.MainApplication; -
applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/utils/api/JsonSequencesDecoderTest.java
r34386 r34432 29 29 public class JsonSequencesDecoderTest { 30 30 31 32 31 @Ignore 33 32 @Test 34 33 public void testDecodeSequences() { 35 34 Collection<StreetsideSequence> exampleSequences = JsonDecoder.decodeFeatureCollection( 36 Json.createReader(this.getClass().getResourceAsStream("/api/v3/responses/searchSequences.json")).readObject(), 35 Json.createReader(this.getClass().getResourceAsStream("test/data/api/v3/responses/searchSequences.json")).readObject(), 37 36 JsonSequencesDecoder::decodeSequence 38 37 );
Note:
See TracChangeset
for help on using the changeset viewer.