Changeset 31248 in osm for applications/editors/josm/plugins/mapillary/src
- Timestamp:
- 2015-06-08T12:38:41+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java
r31222 r31248 191 191 Main.map.mapView.repaint(); 192 192 } 193 194 public void addMultiSelectedImage(List<MapillaryImage> images) { 195 for (MapillaryImage image : images) 196 if (!this.multiSelectedImages.contains(image)) { 197 if (this.getSelectedImage() != null) 198 this.multiSelectedImages.add(image); 199 else 200 this.setSelectedImage(image); 201 } 202 Main.map.mapView.repaint(); 203 } 193 204 194 205 /** -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java
r31222 r31248 14 14 import org.openstreetmap.josm.gui.MapView; 15 15 import org.openstreetmap.josm.gui.MapView.EditLayerChangeListener; 16 import org.openstreetmap.josm.gui.MapView.LayerChangeListener; 16 17 import org.openstreetmap.josm.gui.layer.AbstractModifiableLayer; 17 18 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 51 52 52 53 public class MapillaryLayer extends AbstractModifiableLayer implements 53 DataSetListener, EditLayerChangeListener {54 DataSetListener, EditLayerChangeListener, LayerChangeListener { 54 55 55 56 public final static int SEQUENCE_MAX_JUMP_DISTANCE = 100; … … 92 93 Main.map.mapView.addLayer(this); 93 94 MapView.addEditLayerChangeListener(this, false); 95 MapView.addLayerChangeListener(this); 94 96 Main.map.mapView.getEditLayer().data.addDataSetListener(this); 95 97 if (tgd == null) { … … 112 114 private int lastButton; 113 115 private MapillaryImage closest; 116 private MapillaryImage lastClicked; 114 117 115 118 @Override … … 130 133 } 131 134 this.start = e.getPoint(); 135 this.lastClicked = this.closest; 132 136 this.closest = closest; 133 137 if (mapillaryData.getMultiSelectedImages().contains(closest)) … … 136 140 && closest != null) 137 141 mapillaryData.addMultiSelectedImage(closest); 138 else 142 else if (e.getModifiers() == (MouseEvent.BUTTON1_MASK | MouseEvent.SHIFT_MASK)) { 143 if (this.closest != null 144 && this.lastClicked != null 145 && this.closest.getSequence() == this.lastClicked 146 .getSequence()) { 147 int i = this.closest.getSequence().getImages() 148 .indexOf(this.closest); 149 int j = this.lastClicked.getSequence().getImages() 150 .indexOf(this.lastClicked); 151 if (i < j) 152 mapillaryData.addMultiSelectedImage(this.closest 153 .getSequence().getImages() 154 .subList(i, j + 1)); 155 else 156 mapillaryData.addMultiSelectedImage(this.closest 157 .getSequence().getImages() 158 .subList(j, i + 1)); 159 } 160 } else 139 161 mapillaryData.setSelectedImage(closest); 140 162 } … … 490 512 public void visitBoundingBox(BoundingXYVisitor v) { 491 513 } 514 515 @Override 516 public void activeLayerChange(Layer oldLayer, Layer newLayer) { 517 if (newLayer == this) 518 Main.map.statusLine.setHelpText("Total images: " 519 + MapillaryData.getInstance().getImages().size()); 520 } 521 522 @Override 523 public void layerAdded(Layer newLayer) { 524 } 525 526 @Override 527 public void layerRemoved(Layer oldLayer) { 528 } 492 529 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySquareDownloadManagerThread.java
r31246 r31248 7 7 import org.openstreetmap.josm.Main; 8 8 import org.openstreetmap.josm.data.Bounds; 9 import org.openstreetmap.josm.gui.PleaseWaitRunnable;10 9 import org.openstreetmap.josm.plugins.mapillary.MapillaryData; 11 10 … … 19 18 * @see MapillaryDownloader 20 19 */ 21 public class MapillarySquareDownloadManagerThread extends PleaseWaitRunnable {20 public class MapillarySquareDownloadManagerThread implements Runnable { 22 21 23 22 @SuppressWarnings("unused") … … 27 26 28 27 public MapillarySquareDownloadManagerThread(String urlImages, String urlSequences, Bounds bounds) { 29 super("Mapillary plugin");30 28 this.urlImages = urlImages; 31 29 this.urlSequences = urlSequences; … … 33 31 } 34 32 35 public void r ealRun() {36 this.getProgressMonitor().indeterminateSubTask("Downloading images");33 public void run() { 34 Main.map.statusLine.setHelpText("Downloading images from Mapillary"); 37 35 downloadSequences(); 36 Main.map.statusLine.setHelpText("Total images: " + MapillaryData.getInstance().getImages().size()); 38 37 } 39 38 … … 61 60 MapillaryData.getInstance().dataUpdated(); 62 61 } 63 64 @Override65 protected void cancel() {66 // TODO Auto-generated method stub67 68 }69 70 @Override71 protected void finish() {72 // TODO Auto-generated method stub73 74 }75 62 }
Note:
See TracChangeset
for help on using the changeset viewer.