Changeset 31254 in osm for applications/editors/josm/plugins/mapillary/src
- Timestamp:
- 2015-06-09T10:06:21+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImportedImage.java
r31252 r31254 16 16 } 17 17 18 public BufferedImage getImage() { 19 try { 20 return ImageIO.read(file); 21 } catch (IOException e) { 22 // TODO Auto-generated catch block 23 e.printStackTrace(); 24 } 25 return null; 18 public BufferedImage getImage() throws IOException { 19 return ImageIO.read(file); 26 20 } 27 21 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java
r31252 r31254 115 115 private Point start; 116 116 private int lastButton; 117 private Mapillary Image closest;118 private Mapillary Image lastClicked;117 private MapillaryAbstractImage closest; 118 private MapillaryAbstractImage lastClicked; 119 119 120 120 @Override … … 127 127 return; 128 128 MapillaryAbstractImage closestTemp = getClosest(e.getPoint()); 129 if (closestTemp instanceof MapillaryImage || closestTemp == null) { 129 if (closestTemp instanceof MapillaryImage 130 || closestTemp == null) { 130 131 MapillaryImage closest = (MapillaryImage) closestTemp; 131 132 if (e.getClickCount() == 2 … … 146 147 && closest != null) 147 148 mapillaryData.addMultiSelectedImage(closest); 148 else if (e.getModifiers() == (MouseEvent.BUTTON1_MASK | MouseEvent.SHIFT_MASK)) { 149 else if (e.getModifiers() == (MouseEvent.BUTTON1_MASK | MouseEvent.SHIFT_MASK) 150 && this.closest instanceof MapillaryImage 151 && this.lastClicked instanceof MapillaryImage) { 149 152 if (this.closest != null 150 153 && this.lastClicked != null 151 && this.closest.getSequence() == this.lastClicked154 && ((MapillaryImage) this.closest).getSequence() == ((MapillaryImage) this.lastClicked) 152 155 .getSequence()) { 153 int i = this.closest.getSequence().getImages()156 int i = ((MapillaryImage) this.closest).getSequence().getImages() 154 157 .indexOf(this.closest); 155 int j = this.lastClicked.getSequence().getImages()158 int j = ((MapillaryImage) this.lastClicked).getSequence().getImages() 156 159 .indexOf(this.lastClicked); 157 160 if (i < j) 158 161 mapillaryData 159 162 .addMultiSelectedImage(new ArrayList<MapillaryAbstractImage>( 160 this.closest.getSequence()163 ((MapillaryImage) this.closest).getSequence() 161 164 .getImages() 162 165 .subList(i, j + 1))); … … 164 167 mapillaryData 165 168 .addMultiSelectedImage(new ArrayList<MapillaryAbstractImage>( 166 this.closest.getSequence()169 ((MapillaryImage) this.closest).getSequence() 167 170 .getImages() 168 171 .subList(j, i + 1))); 169 172 } 170 173 } else 174 mapillaryData.setSelectedImage(closest); 175 } else if (closestTemp instanceof MapillaryImportedImage) { 176 MapillaryImportedImage closest = (MapillaryImportedImage) closestTemp; 177 this.start = e.getPoint(); 178 this.lastClicked = this.closest; 179 this.closest = closest; 180 if (mapillaryData.getMultiSelectedImages() 181 .contains(closest)) 182 return; 183 if (e.getModifiers() == (MouseEvent.BUTTON1_MASK | MouseEvent.CTRL_MASK) 184 && closest != null) 185 mapillaryData.addMultiSelectedImage(closest); 186 else 171 187 mapillaryData.setSelectedImage(closest); 172 188 } … … 443 459 LatLon selectedCoords = mapillaryData.getSelectedImage().getLatLon(); 444 460 for (MapillaryAbstractImage imagePrev : mapillaryData.getImages()) { 445 if (!(imagePrev instanceof MapillaryIm age))461 if (!(imagePrev instanceof MapillaryImportedImage)) 446 462 continue; 447 463 MapillaryImage image = (MapillaryImage) imagePrev; … … 522 538 MapillaryLayer.getInstance().download(); 523 539 } 524 525 540 } 526 541
Note:
See TracChangeset
for help on using the changeset viewer.