Changeset 31976 in osm for applications/editors/josm/plugins/mapillary
- Timestamp:
- 2016-01-11T23:12:52+01:00 (9 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/MapillaryPlugin.java
r31972 r31976 2 2 package org.openstreetmap.josm.plugins.mapillary; 3 3 4 import java.awt.Image; 4 5 import java.io.IOException; 5 6 … … 48 49 /** 16x16 icon. */ 49 50 public static final ImageIcon ICON16 = new ImageProvider("icon16.png").get(); 51 /** 12x12 icon. */ 52 public static final ImageIcon ICON12 = new ImageIcon(ICON24.getImage().getScaledInstance(12, 12, Image.SCALE_SMOOTH)); 50 53 /** Icon representing an image in the map. */ 51 54 public static final ImageIcon MAP_ICON = new ImageProvider("mapicon.png").get(); -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryPreferenceSetting.java
r31975 r31976 74 74 panel.add(this.reverseButtons, GBC.eol()); 75 75 // Sets the value of the ComboBox. 76 if (Main.pref.get("mapillary.download-mode").equals(MapillaryDownloader.MODES.Automatic.toString()) 77 || Main.pref.get("mapillary.download-mode").equals(MapillaryDownloader.MODES.Semiautomatic.toString()) 78 || Main.pref.get("mapillary.download-mode").equals(MapillaryDownloader.MODES.Manual.toString())) { 76 String downloadMode = Main.pref.get("mapillary.download-mode"); 77 if (MapillaryDownloader.MODES.Automatic.toString().equals(downloadMode) 78 || MapillaryDownloader.MODES.Semiautomatic.toString().equals(downloadMode) 79 || MapillaryDownloader.MODES.Manual.toString().equals(downloadMode)) { 79 80 this.downloadMode.setSelectedItem(Main.pref.get("mapillary.download-mode")); 80 81 } … … 94 95 panel.add(Box.createVerticalGlue(), GBC.eol().fill(GridBagConstraints.BOTH)); 95 96 96 gui.getDisplayPreference().addSubTab(this, "Mapillary", new JScrollPane(panel)); 97 synchronized (gui.getDisplayPreference().getTabPane()) { 98 gui.getDisplayPreference().addSubTab(this, "Mapillary", new JScrollPane(panel)); 99 gui.getDisplayPreference().getTabPane().setIconAt(gui.getDisplayPreference().getTabPane().getTabCount()-1, MapillaryPlugin.ICON12); 100 } 97 101 98 102 new Thread(new Runnable() { -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/OAuthPortListener.java
r31833 r31976 10 10 import java.net.Socket; 11 11 import java.util.Scanner; 12 import java.util.regex.Matcher; 13 import java.util.regex.Pattern; 12 14 13 15 import org.openstreetmap.josm.Main; … … 47 49 while (in.hasNextLine() && accessToken == null) { 48 50 s = in.nextLine(); 49 if (s.contains("access_token=")) { 50 String[] ss = s.split("&"); 51 for (int i = 0; i < ss.length && accessToken == null; i++) { 52 if (ss[i].startsWith("access_token=")) { 53 accessToken = ss[i].substring(ss[i].indexOf("access_token=") + 13, ss[i].length()); 54 } 55 } 51 Matcher tokenMatcher = Pattern.compile("^.*&access_token=([^&]+)&.*$").matcher('&'+s+'&'); 52 if (tokenMatcher.matches()) { 53 accessToken = tokenMatcher.group(1); 56 54 break; 57 55 } else if (s.contains("keep-alive")) { … … 61 59 62 60 writeContent(out); 63 64 out.close(); 65 in.close(); 66 serverSocket.close(); 61 out.flush(); 67 62 68 63 MapillaryUser.reset();
Note:
See TracChangeset
for help on using the changeset viewer.