Changeset 31985 in osm for applications/editors/josm/plugins
- Timestamp:
- 2016-01-13T17:26:34+01:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java
r31983 r31985 14 14 import java.awt.Rectangle; 15 15 import java.awt.RenderingHints; 16 import java.awt.Shape;17 16 import java.awt.TexturePaint; 18 17 import java.awt.event.ActionEvent; … … 327 326 if (imageAbs.isVisible()) { 328 327 final Point p = mv.getPoint(imageAbs.getLatLon()); 328 ImageIcon icon = MapillaryPlugin.MAP_ICON; 329 329 if (getData().getMultiSelectedImages().contains(imageAbs)) { 330 draw(g, imageAbs, MapillaryPlugin.MAP_ICON_SELECTED, p);331 } else {332 draw(g, imageAbs, imageAbs instanceof MapillaryImage ? MapillaryPlugin.MAP_ICON : MapillaryPlugin.MAP_ICON_IMPORTED, p);330 icon = MapillaryPlugin.MAP_ICON_SELECTED; 331 } else if (imageAbs instanceof MapillaryImportedImage) { 332 icon = MapillaryPlugin.MAP_ICON_IMPORTED; 333 333 } 334 draw(g, imageAbs, icon, p); 334 335 if (imageAbs instanceof MapillaryImage && !((MapillaryImage) imageAbs).getSigns().isEmpty()) { 335 336 g.drawImage( -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportIntoSequenceAction.java
r31918 r31985 15 15 16 16 import javax.swing.JFileChooser; 17 import javax.swing.filechooser.FileNameExtensionFilter;18 17 19 import org.apache.commons.imaging.ImageReadException;20 18 import org.openstreetmap.josm.Main; 21 19 import org.openstreetmap.josm.actions.JosmAction; 22 20 import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage; 23 import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer;24 21 import org.openstreetmap.josm.plugins.mapillary.MapillaryPlugin; 25 22 import org.openstreetmap.josm.plugins.mapillary.MapillarySequence; -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/UploadUtils.java
r31983 r31985 40 40 import org.apache.http.entity.mime.content.FileBody; 41 41 import org.apache.http.entity.mime.content.StringBody; 42 import org.apache.http.impl.client.CloseableHttpClient; 42 43 import org.apache.http.impl.client.HttpClientBuilder; 43 44 import org.openstreetmap.josm.Main; … … 246 247 public static void uploadFile(File file, Map<String, String> hash) throws IOException { 247 248 HttpClientBuilder builder = HttpClientBuilder.create(); 248 HttpClient httpClient = builder.build();249 249 HttpPost httpPost = new HttpPost(UPLOAD_URL); 250 250 251 MultipartEntityBuilder entityBuilder = MultipartEntityBuilder.create(); 252 for (String key : keys) { 253 if (hash.get(key) == null) 254 throw new IllegalArgumentException(); 255 entityBuilder.addPart(key, new StringBody(hash.get(key), 256 ContentType.TEXT_PLAIN)); 257 } 258 entityBuilder.addPart("file", new FileBody(file)); 259 HttpEntity entity = entityBuilder.build(); 260 httpPost.setEntity(entity); 261 HttpResponse response = httpClient.execute(httpPost); 262 if (response.getStatusLine().toString().contains("204")) { 263 PluginState.imageUploaded(); 264 Main.info(PluginState.getUploadString() + " (Mapillary)"); 265 } else 266 Main.info("Upload error"); 251 try (CloseableHttpClient httpClient = builder.build()) { 252 MultipartEntityBuilder entityBuilder = MultipartEntityBuilder.create(); 253 for (String key : keys) { 254 if (hash.get(key) == null) 255 throw new IllegalArgumentException(); 256 entityBuilder.addPart(key, new StringBody(hash.get(key), 257 ContentType.TEXT_PLAIN)); 258 } 259 entityBuilder.addPart("file", new FileBody(file)); 260 HttpEntity entity = entityBuilder.build(); 261 httpPost.setEntity(entity); 262 HttpResponse response = httpClient.execute(httpPost); 263 264 if (response.getStatusLine().toString().contains("204")) { 265 PluginState.imageUploaded(); 266 Main.info(PluginState.getUploadString() + " (Mapillary)"); 267 } else { 268 Main.info("Upload error"); 269 } 270 } 267 271 file.delete(); 268 272 MapillaryUtils.updateHelpText(); -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/MapViewGeometryUtil.java
r31983 r31985 1 // License: GPL. For details, see LICENSE file. 1 2 package org.openstreetmap.josm.plugins.mapillary.utils; 2 3 … … 43 44 a.subtract(new Area(r)); 44 45 } 45 Shape s = null;46 46 return a; 47 47 }
Note:
See TracChangeset
for help on using the changeset viewer.