Changeset 34412 in osm for applications/editors/josm/plugins/MicrosoftStreetside/src/org
- Timestamp:
- 2018-07-10T02:34:45+02:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside
- Files:
-
- 2 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/StreetsidePlugin.java
r34399 r34412 20 20 import org.openstreetmap.josm.plugins.streetside.gui.StreetsidePreferenceSetting; 21 21 import org.openstreetmap.josm.plugins.streetside.gui.StreetsideViewerDialog; 22 import org.openstreetmap.josm.plugins.streetside.gui.imageinfo.ImageInfoHelpPopup;23 22 import org.openstreetmap.josm.plugins.streetside.gui.imageinfo.ImageInfoPanel; 24 23 import org.openstreetmap.josm.plugins.streetside.oauth.StreetsideUser; 25 24 import org.openstreetmap.josm.plugins.streetside.utils.StreetsideProperties; 26 25 import org.openstreetmap.josm.tools.ImageProvider; 26 27 import org.openstreetmap.josm.plugins.streetside.gui.imageinfo.ImageInfoHelpPopup; 27 28 28 29 /** -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/cache/StreetsideCache.java
r34399 r34412 30 30 FULL_IMAGE, 31 31 /** Low quality image */ 32 THUMBNAIL, 33 /** cubemap faces */ 34 // TODO: one class per cache/load required? really?! 35 CUBEMAP/*, 36 CUBEMAP_FRONT, 37 CUBEMAP_RIGHT, 38 CUBEMAP_BACK, 39 CUBEMAP_LEFT, 40 CUBEMAP_UP, 41 CUBEMAP_DOWN*/ 32 THUMBNAIL 42 33 } 43 34 -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/cubemap/CubemapBuilder.java
r34400 r34412 35 35 protected boolean cancelled; 36 36 private long startTime; 37 private Map<String, BufferedImage> tileImages = new HashMap< String,BufferedImage>();37 private Map<String, BufferedImage> tileImages = new HashMap<>(); 38 38 39 39 /** … … 83 83 public void reload(String imageId) { 84 84 if (cubemap != null && imageId.equals(cubemap.getId())) { 85 tileImages = new HashMap< String,BufferedImage>();85 tileImages = new HashMap<>(); 86 86 downloadCubemapImages(imageId); 87 87 } … … 96 96 int fails = 0; 97 97 98 int min = 0; int max = (StreetsideProperties.SHOW_HIGH_RES_STREETSIDE_IMAGERY.get()?96:24)*2; 99 100 String[] message = new String[2]; 101 message[0] = MessageFormat.format("Downloading Streetside imagery for {0}", imageId); 102 message[1] = "Wait for completion……."; 103 98 104 long startTime = System.currentTimeMillis(); 99 105 … … 101 107 102 108 ExecutorService pool = Executors.newFixedThreadPool(maxThreadCount); 103 List<Callable<String>> tasks = new ArrayList< Callable<String>>(maxThreadCount);109 List<Callable<String>> tasks = new ArrayList<>(maxThreadCount); 104 110 105 111 // launch 4-tiled (low-res) downloading tasks . . . … … 111 117 112 118 String tileId = String.valueOf(imageId + CubemapUtils.getFaceNumberForCount(i) 113 + Integer.valueOf(tileNr++).toString()); // + Integer.valueOf(k).toString()));119 + Integer.valueOf(tileNr++).toString()); 114 120 tasks.add(new TileDownloadingTask(tileId)); 115 121 } … … 220 226 // rotate top cubeface 180 degrees - misalignment workaround 221 227 if (i == 4) { 222 final long start = System.nanoTime(); 223 finalImg = GraphicsUtils.rotateImage(finalImg); 228 finalImg = GraphicsUtils.rotateImage(finalImg); 224 229 } 225 230 finalImages[i] = GraphicsUtils.convertBufferedImage2JavaFXImage(finalImg); … … 267 272 long endTime = System.currentTimeMillis(); 268 273 long runTime = (endTime - startTime) / 1000; 274 275 String message = MessageFormat.format("Completed downloading, assembling and setting cubemap imagery for cubemap {0} in {1} seconds.", cubemap.getId(), 276 runTime); 277 269 278 if (StreetsideProperties.DEBUGING_ENABLED.get()) { 270 logger.debug( 271 MessageFormat.format("Completed downloading, assembling and setting cubemap imagery for cubemap {0} in {1} seconds.", cubemap.getId(), 272 runTime) 273 ); 279 logger.debug(message); 274 280 } 281 275 282 CubemapBuilder.getInstance().resetTileImages(); 276 283 } 277 284 278 285 private void resetTileImages() { 279 tileImages = new HashMap< String,BufferedImage>();286 tileImages = new HashMap<>(); 280 287 } 281 288 -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/gui/imageinfo/ImageInfoHelpPopup.java
r34399 r34412 44 44 mainText.setContentType("text/html"); 45 45 mainText.setFont(SelectableLabel.DEFAULT_FONT); 46 mainText.setText( 47 "<html><div style='width:250px'>" + 48 "The Streetside plugin now uses a separate panel to display extra information (like the image key) and actions for the currently selected Streetside image (like viewing it in a browser)." + 49 "<br><br>" + 50 "It can be activated by clicking the left button at the bottom of this message or the button in the toolbar on the left, which uses the same icon." + 51 "</div></html>" 52 ); 46 mainText.setText("<html><div style='width:250px'>" + 47 "Welcome to the Microsoft Streetside JOSM Plugin. To view the vector bubbles for the 360 degree imagery, select Imagery->Streetside from the JOSM menu." 48 + "<br><br>" 49 + "Once the blue bubbles appear on the map, click on a vector bubble and undock/maximize the 360 viewer to view the imagery." 50 + "</div></html>"); 53 51 add(mainText, BorderLayout.CENTER); 54 52 -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/gui/imageinfo/StreetsideViewerHelpPopup.java
r34385 r34412 7 7 import java.awt.IllegalComponentStateException; 8 8 import java.awt.event.ActionEvent; 9 import java.text.MessageFormat; 9 10 10 11 import javax.swing.AbstractAction; … … 14 15 import javax.swing.JTextPane; 15 16 17 import org.apache.log4j.Logger; 16 18 import org.openstreetmap.josm.plugins.streetside.gui.boilerplate.SelectableLabel; 17 19 import org.openstreetmap.josm.plugins.streetside.gui.boilerplate.StreetsideButton; … … 20 22 import org.openstreetmap.josm.tools.I18n; 21 23 import org.openstreetmap.josm.tools.ImageProvider; 22 import org.openstreetmap.josm.tools.Logging; 24 23 25 24 26 public class StreetsideViewerHelpPopup extends JPopupMenu { 25 27 26 28 private static final long serialVersionUID = -7840242522398163839L; 29 30 final static Logger logger = Logger.getLogger(StreetsideViewerHelpPopup.class); 27 31 28 32 private final Component invokerComp; … … 43 47 mainText.setContentType("text/html"); 44 48 mainText.setFont(SelectableLabel.DEFAULT_FONT); 45 mainText.setText("<html><div style='width:250px'>" + I18n.tr(46 "Welcome to the Microsoft Streetside JOSM Plugin. To view the vector bubbles for the 360 degree imagery, select Imagery->Streetside from the JOSM menu." )49 mainText.setText("<html><div style='width:250px'>" + 50 "Welcome to the Microsoft Streetside JOSM Plugin. To view the vector bubbles for the 360 degree imagery, select Imagery->Streetside from the JOSM menu." 47 51 + "<br><br>" 48 + I18n.tr(49 "Once the blue bubbles appear on the map, click on a vector bubble and undock/maximize the 360 viewer to view the imagery." )52 + 53 "Once the blue bubbles appear on the map, click on a vector bubble and undock/maximize the 360 viewer to view the imagery." 50 54 + "</div></html>"); 51 55 add(mainText, BorderLayout.CENTER); … … 83 87 return true; 84 88 } catch (IllegalComponentStateException e) { 85 Logging.log(Logging.LEVEL_WARN, "Could not show ImageInfoHelpPopup, because probably the invoker component has disappeared from screen.", e);89 logger.error(MessageFormat.format("Could not show ImageInfoHelpPopup, because probably the invoker component has disappeared from screen. {0}", e.getMessage())); 86 90 } 87 91 } -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/io/download/SequenceDownloadRunnable.java
r34399 r34412 78 78 if(previous!=null) { 79 79 // Analyze sequence behaviour 80 //previous.setNext(image. )80 //previous.setNext(image.getId()); 81 81 } 82 previous = image; 82 83 image.setAd(node.path("ad").asInt()); 83 84 image.setAl(node.path("al").asDouble()); -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/io/download/StreetsideSquareDownloadRunnable.java
r34399 r34412 8 8 import org.openstreetmap.josm.plugins.streetside.utils.PluginState; 9 9 import org.openstreetmap.josm.plugins.streetside.utils.StreetsideUtils; 10 import org.openstreetmap.josm.tools.I18n;11 10 12 11 public class StreetsideSquareDownloadRunnable implements Runnable { … … 38 37 } 39 38 40 Thread imgDetailsThread = new Thread(new ImageDetailsDownloadRunnable(StreetsideLayer.getInstance().getData(), bounds));41 imgDetailsThread.start();42 43 39 // Image detections are not currently supported for Streetside (Mapillary code removed) 44 40 45 try { 46 imgDetailsThread.join(); 47 } catch (InterruptedException e) { 48 logger.warn(I18n.tr("Streetside download interrupted (probably because of closing the layer).", e)); 49 Thread.currentThread().interrupt(); 50 } finally { 51 PluginState.finishDownload(); 52 } 41 PluginState.finishDownload(); 53 42 54 43 StreetsideUtils.updateHelpText(); -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/io/export/StreetsideExportDownloadThread.java
r34365 r34412 58 58 @Override 59 59 public void run() { 60 CacheUtils.submit(image.getId(), StreetsideCache.Type.FULL_IMAGE, this); 60 //CacheUtils.submit(image.getId(), StreetsideCache.Type.FULL_IMAGE, this); 61 CacheUtils.submit(image.getId(), StreetsideCache.Type.THUMBNAIL, this); 61 62 } 62 63 -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/utils/StreetsideURL.java
r34399 r34412 174 174 throw new IllegalArgumentException("The image id may not be null!"); 175 175 } 176 return StreetsideURL.string2URL( VirtualEarth.BASE_URL_PREFIX + id + VirtualEarth.BASE_URL_SUFFIX);176 return StreetsideURL.string2URL(MessageFormat.format("{0}{1}{2}{3}{4}",VirtualEarth.BASE_URL_PREFIX, "0", id, "01", VirtualEarth.BASE_URL_SUFFIX)); 177 177 } 178 178
Note:
See TracChangeset
for help on using the changeset viewer.