Changeset 31833 in osm for applications/editors/josm/plugins/mapillary/src
- Timestamp:
- 2015-12-15T21:47:02+01:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java
r31826 r31833 31 31 private final CopyOnWriteArrayList<MapillaryDataListener> listeners = new CopyOnWriteArrayList<>(); 32 32 /** The bounds of the areas for which the pictures have been downloaded. */ 33 public CopyOnWriteArrayList<Bounds> bounds;33 public List<Bounds> bounds; 34 34 35 35 /** -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/FinishedUploadDialog.java
r31828 r31833 8 8 import java.awt.event.ActionListener; 9 9 import java.io.IOException; 10 import java.net.URL;11 10 12 11 import javax.swing.BoxLayout; -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryMainDialog.java
r31828 r31833 2 2 package org.openstreetmap.josm.plugins.mapillary.gui; 3 3 4 import static org.openstreetmap.josm.tools.I18n.marktr; 4 5 import static org.openstreetmap.josm.tools.I18n.tr; 5 import static org.openstreetmap.josm.tools.I18n.marktr;6 6 7 7 import java.awt.BorderLayout; … … 15 15 import java.io.ByteArrayInputStream; 16 16 import java.io.IOException; 17 import java.net.MalformedURLException;18 17 import java.util.Arrays; 19 18 import java.util.List; -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryPreferenceSetting.java
r31828 r31833 3 3 4 4 import java.awt.FlowLayout; 5 import java.awt.GridBagConstraints; 5 6 import java.awt.GridBagLayout; 6 7 import java.awt.event.ActionEvent; 7 8 import java.io.IOException; 8 import java.net.URL;9 9 10 10 import javax.swing.AbstractAction; … … 92 92 onLogout(); 93 93 panel.add(loginPanel, GBC.eol()); 94 panel.add(Box.createVerticalGlue(), GBC.eol().fill(G BC.BOTH));94 panel.add(Box.createVerticalGlue(), GBC.eol().fill(GridBagConstraints.BOTH)); 95 95 96 96 gui.getDisplayPreference().addSubTab(this, "Mapillary", new JScrollPane(panel)); -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryDownloader.java
r31828 r31833 6 6 import java.util.ArrayList; 7 7 import java.util.concurrent.ArrayBlockingQueue; 8 import java.util.concurrent.ConcurrentHashMap;9 8 import java.util.concurrent.ThreadPoolExecutor; 10 9 import java.util.concurrent.TimeUnit; … … 39 38 40 39 /** Executor that will run the petitions. */ 41 private static ThreadPoolExecutor EXECUTOR = new ThreadPoolExecutor(3, 5, 42 100, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(100));; 40 private static ThreadPoolExecutor executor = new ThreadPoolExecutor(3, 5, 100, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(100)); 43 41 44 42 /** … … 52 50 */ 53 51 public static void getImages(LatLon minLatLon, LatLon maxLatLon) { 54 if (m axLatLon == null || maxLatLon == null) {52 if (minLatLon == null || maxLatLon == null) { 55 53 throw new IllegalArgumentException(); 56 54 } … … 90 88 private static void run(Thread t) { 91 89 threads.add(t); 92 EXECUTOR.execute(t);90 executor.execute(t); 93 91 } 94 92 … … 214 212 } 215 213 threads.clear(); 216 EXECUTOR.shutdownNow();214 executor.shutdownNow(); 217 215 try { 218 EXECUTOR.awaitTermination(30, TimeUnit.SECONDS);216 executor.awaitTermination(30, TimeUnit.SECONDS); 219 217 } catch (InterruptedException e) { 220 218 Main.error(e); 221 219 } 222 EXECUTOR= new ThreadPoolExecutor(3, 5, 100, TimeUnit.SECONDS,220 executor = new ThreadPoolExecutor(3, 5, 100, TimeUnit.SECONDS, 223 221 new ArrayBlockingQueue<Runnable>(100)); 224 222 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/OAuthPortListener.java
r31827 r31833 37 37 @Override 38 38 public void run() { 39 try { 40 ServerSocket serverSocket = new ServerSocket(PORT); 41 Socket clientSocket = serverSocket.accept(); 42 PrintWriter out = new PrintWriter(new OutputStreamWriter( 43 clientSocket.getOutputStream(), "UTF-8"), true); 44 Scanner in = new Scanner(new InputStreamReader( 45 clientSocket.getInputStream(), "UTF-8")); 39 try ( 40 ServerSocket serverSocket = new ServerSocket(PORT); 41 Socket clientSocket = serverSocket.accept(); 42 PrintWriter out = new PrintWriter(new OutputStreamWriter(clientSocket.getOutputStream(), "UTF-8"), true); 43 Scanner in = new Scanner(new InputStreamReader(clientSocket.getInputStream(), "UTF-8")); 44 ) { 46 45 String s; 47 46 String accessToken = null;
Note:
See TracChangeset
for help on using the changeset viewer.