Ignore:
Timestamp:
2018-07-10T02:34:45+02:00 (6 years ago)
Author:
renerr18
Message:

Fixed bugs - Export images and Browse image.

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  
    2020import org.openstreetmap.josm.plugins.streetside.gui.StreetsidePreferenceSetting;
    2121import org.openstreetmap.josm.plugins.streetside.gui.StreetsideViewerDialog;
    22 import org.openstreetmap.josm.plugins.streetside.gui.imageinfo.ImageInfoHelpPopup;
    2322import org.openstreetmap.josm.plugins.streetside.gui.imageinfo.ImageInfoPanel;
    2423import org.openstreetmap.josm.plugins.streetside.oauth.StreetsideUser;
    2524import org.openstreetmap.josm.plugins.streetside.utils.StreetsideProperties;
    2625import org.openstreetmap.josm.tools.ImageProvider;
     26
     27import org.openstreetmap.josm.plugins.streetside.gui.imageinfo.ImageInfoHelpPopup;
    2728
    2829/**
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/cache/StreetsideCache.java

    r34399 r34412  
    3030                FULL_IMAGE,
    3131                /** 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
    4233        }
    4334
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/cubemap/CubemapBuilder.java

    r34400 r34412  
    3535        protected boolean cancelled;
    3636        private long startTime;
    37   private Map<String, BufferedImage> tileImages = new HashMap<String,BufferedImage>();
     37  private Map<String, BufferedImage> tileImages = new HashMap<>();
    3838
    3939  /**
     
    8383        public void reload(String imageId) {
    8484                if (cubemap != null && imageId.equals(cubemap.getId())) {
    85                         tileImages = new HashMap<String,BufferedImage>();
     85                        tileImages = new HashMap<>();
    8686                  downloadCubemapImages(imageId);
    8787                }
     
    9696                int fails = 0;
    9797
     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
    98104                long startTime = System.currentTimeMillis();
    99105
     
    101107
    102108                        ExecutorService pool = Executors.newFixedThreadPool(maxThreadCount);
    103                         List<Callable<String>> tasks = new ArrayList<Callable<String>>(maxThreadCount);
     109                        List<Callable<String>> tasks = new ArrayList<>(maxThreadCount);
    104110
    105111                        // launch 4-tiled (low-res) downloading tasks . . .
     
    111117
    112118                                                        String tileId = String.valueOf(imageId + CubemapUtils.getFaceNumberForCount(i)
    113                                                                         + Integer.valueOf(tileNr++).toString());// + Integer.valueOf(k).toString()));
     119                                                                        + Integer.valueOf(tileNr++).toString());
    114120                                                        tasks.add(new TileDownloadingTask(tileId));
    115121                                                }
     
    220226                                // rotate top cubeface 180 degrees - misalignment workaround
    221227                                if (i == 4) {
    222                                   final long start = System.nanoTime();
    223                                         finalImg = GraphicsUtils.rotateImage(finalImg);
     228                                  finalImg = GraphicsUtils.rotateImage(finalImg);
    224229                                }
    225230                                finalImages[i] = GraphicsUtils.convertBufferedImage2JavaFXImage(finalImg);
     
    267272    long endTime = System.currentTimeMillis();
    268273    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
    269278    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);
    274280    }
     281
    275282    CubemapBuilder.getInstance().resetTileImages();
    276283        }
    277284
    278285        private void resetTileImages() {
    279     tileImages = new HashMap<String,BufferedImage>();
     286    tileImages = new HashMap<>();
    280287  }
    281288
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/gui/imageinfo/ImageInfoHelpPopup.java

    r34399 r34412  
    4444    mainText.setContentType("text/html");
    4545    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>");
    5351    add(mainText, BorderLayout.CENTER);
    5452
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/gui/imageinfo/StreetsideViewerHelpPopup.java

    r34385 r34412  
    77import java.awt.IllegalComponentStateException;
    88import java.awt.event.ActionEvent;
     9import java.text.MessageFormat;
    910
    1011import javax.swing.AbstractAction;
     
    1415import javax.swing.JTextPane;
    1516
     17import org.apache.log4j.Logger;
    1618import org.openstreetmap.josm.plugins.streetside.gui.boilerplate.SelectableLabel;
    1719import org.openstreetmap.josm.plugins.streetside.gui.boilerplate.StreetsideButton;
     
    2022import org.openstreetmap.josm.tools.I18n;
    2123import org.openstreetmap.josm.tools.ImageProvider;
    22 import org.openstreetmap.josm.tools.Logging;
     24
    2325
    2426public class StreetsideViewerHelpPopup extends JPopupMenu {
    2527
    2628        private static final long serialVersionUID = -7840242522398163839L;
     29
     30        final static Logger logger = Logger.getLogger(StreetsideViewerHelpPopup.class);
    2731
    2832        private final Component invokerComp;
     
    4347                mainText.setContentType("text/html");
    4448                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."
    4751                                + "<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."
    5054                                + "</div></html>");
    5155                add(mainText, BorderLayout.CENTER);
     
    8387     return true;
    8488   } 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()));
    8690   }
    8791 }
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/io/download/SequenceDownloadRunnable.java

    r34399 r34412  
    7878          if(previous!=null) {
    7979                  // Analyze sequence behaviour
    80                   //previous.setNext(image.)
     80                  //previous.setNext(image.getId());
    8181          }
     82          previous = image;
    8283          image.setAd(node.path("ad").asInt());
    8384          image.setAl(node.path("al").asDouble());
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/io/download/StreetsideSquareDownloadRunnable.java

    r34399 r34412  
    88import org.openstreetmap.josm.plugins.streetside.utils.PluginState;
    99import org.openstreetmap.josm.plugins.streetside.utils.StreetsideUtils;
    10 import org.openstreetmap.josm.tools.I18n;
    1110
    1211public class StreetsideSquareDownloadRunnable implements Runnable {
     
    3837    }
    3938
    40     Thread imgDetailsThread = new Thread(new ImageDetailsDownloadRunnable(StreetsideLayer.getInstance().getData(), bounds));
    41     imgDetailsThread.start();
    42 
    4339    // Image detections are not currently supported for Streetside (Mapillary code removed)
    4440
    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();
    5342
    5443    StreetsideUtils.updateHelpText();
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/io/export/StreetsideExportDownloadThread.java

    r34365 r34412  
    5858  @Override
    5959  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);
    6162  }
    6263
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/utils/StreetsideURL.java

    r34399 r34412  
    174174                                throw new IllegalArgumentException("The image id may not be null!");
    175175                        }
    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));
    177177                }
    178178
Note: See TracChangeset for help on using the changeset viewer.