Ignore:
Timestamp:
2018-07-22T02:42:14+02:00 (7 years ago)
Author:
renerr18
Message:

Numerous changes based on post-release requests from client.

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  
    22package org.openstreetmap.josm.plugins.streetside;
    33
    4 import java.text.SimpleDateFormat;
    5 import java.util.Calendar;
    6 import java.util.Date;
    7 import java.util.Locale;
    8 
    94import org.openstreetmap.josm.data.coor.LatLon;
    10 import org.openstreetmap.josm.plugins.streetside.utils.StreetsideProperties;
    115
    126/**
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/StreetsideLayer.java

    r34429 r34432  
    333333
    334334    // 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);
    335340    g.setColor(directionC);
    336341    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  
    2424import org.openstreetmap.josm.plugins.streetside.utils.StreetsideProperties;
    2525import org.openstreetmap.josm.tools.ImageProvider;
    26 
    27 import org.openstreetmap.josm.plugins.streetside.gui.imageinfo.StreetsideViewerPanel;
    2826
    2927/**
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/cubemap/GraphicsUtils.java

    r34399 r34432  
    3232                return wr;
    3333        }
    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     }
    4434
    4535        public static BufferedImage buildMultiTiledCubemapFaceImage(BufferedImage[] tiles) {
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/gui/StreetsideMainDialog.java

    r34429 r34432  
    33
    44import java.awt.BorderLayout;
     5import java.awt.Color;
    56import java.awt.Component;
    67import java.awt.event.ActionEvent;
     
    107108                streetsideImageDisplay = new StreetsideImageDisplay();
    108109
     110                blueButton.setForeground(Color.BLUE);
     111    redButton.setForeground(Color.RED);
     112
    109113                setMode(MODE.NORMAL);
    110114        }
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/history/commands/CommandTurn.java

    r34416 r34432  
    1616 */
    1717public class CommandTurn extends StreetsideCommand {
    18   private double ca;
     18  private double he;
    1919
    2020  /**
     
    2828  public CommandTurn(Set<StreetsideAbstractImage> images, double ca) {
    2929    super(images);
    30     this.ca = ca;
     30    he = ca;
    3131  }
    3232
     
    3434  public void undo() {
    3535    for (StreetsideAbstractImage image : images) {
    36       image.turn(-ca);
     36      image.turn(-he);
    3737      image.stopMoving();
    3838    }
     
    4343  public void redo() {
    4444    for (StreetsideAbstractImage image : images) {
    45       image.turn(ca);
     45      image.turn(he);
    4646      image.stopMoving();
    4747    }
     
    5858  public void sum(StreetsideCommand command) {
    5959    if (command instanceof CommandTurn) {
    60       ca += ((CommandTurn) command).ca;
     60      he += ((CommandTurn) command).he;
    6161    }
    6262  }
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/io/download/BoundsDownloadRunnable.java

    r34428 r34432  
    3333    URL nextURL = getUrlGenerator().apply(bounds);
    3434    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()));
    3636    }
    3737    try {
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/io/download/SequenceDownloadRunnable.java

    r34429 r34432  
    1313
    1414import org.openstreetmap.josm.data.Bounds;
     15import org.openstreetmap.josm.data.coor.LatLon;
    1516import org.openstreetmap.josm.plugins.streetside.StreetsideAbstractImage;
    1617import org.openstreetmap.josm.plugins.streetside.StreetsideData;
     
    3435        private final StreetsideData data;
    3536
    36   private static final Function<Bounds, URL> URL_GEN = APIv3::searchStreetsideSequences;
     37  private static final Function<Bounds, URL> URL_GEN = APIv3::searchStreetsideImages;
    3738
    3839  public SequenceDownloadRunnable(final StreetsideData data, final Bounds bounds) {
     
    4142  }
    4243
     44  // TODO: Revise sequence creation algorithm - compare bubble query results with bubbleId list
     45  // and analyze discrepancies.
    4346  @Override
    4447  public void run(final URLConnection con) throws IOException {
     
    5962
    6063    // 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);
    6265
    6366    try {
     
    7679        // Discard the first sequence ('enabled') - it does not contain bubble data
    7780        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());
    7982          if(previous!=null) {
    8083            image.setPr(Long.parseLong(previous.getId()));
     
    8689          image.setAl(node.path("al").asDouble());
    8790          image.setBl(node.path("bl").asText());
    88           image.setHe(node.path("he").asDouble());
    8991          image.setMl(node.path("ml").asInt());
    9092          image.setNbn(node.findValuesAsText("nbn"));
     
    127129            StreetsideData.downloadSurroundingCubemaps(image);
    128130          }
     131        } else {
     132          logger.info(MessageFormat.format("Unparsable JSON node object: {0}",node.toString()));
    129133        }
    130134      }
     
    145149     *  unpredictably.
    146150     **/
     151    int x = bubbleImages.size();
    147152    seq.add(bubbleImages);
    148153
     
    166171
    167172    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));
    169174  }
    170175
Note: See TracChangeset for help on using the changeset viewer.