Changeset 34432 in osm for applications/editors/josm/plugins/MicrosoftStreetside/src
- Timestamp:
- 2018-07-22T02:42:14+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.