Changeset 31275 in osm for applications/editors/josm/plugins
- Timestamp:
- 2015-06-17T18:48:32+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/mapillary
- Files:
-
- 4 added
- 4 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImage.java
r31270 r31275 21 21 private long capturedAt; 22 22 private String user; 23 private List<String> sign als;23 private List<String> signs; 24 24 private String location; 25 25 … … 47 47 super(lat, lon, ca); 48 48 this.key = key; 49 this.sign als = new ArrayList<>();49 this.signs = new ArrayList<>(); 50 50 } 51 51 … … 59 59 } 60 60 61 public void addSign al(String signal) {62 sign als.add(signal);61 public void addSign(String sign) { 62 signs.add(sign); 63 63 } 64 64 65 public List<String> getSign als() {66 return sign als;65 public List<String> getSigns() { 66 return signs; 67 67 } 68 68 -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java
r31273 r31275 112 112 } 113 113 MapillaryPlugin.setMenuEnabled(MapillaryPlugin.EXPORT_MENU, true); 114 MapillaryPlugin.setMenuEnabled(MapillaryPlugin.SIGN AL_MENU, true);114 MapillaryPlugin.setMenuEnabled(MapillaryPlugin.SIGN_MENU, true); 115 115 Main.map.mapView.setActiveLayer(this); 116 116 Main.map.repaint(); … … 161 161 MapillaryData.INSTANCE = null; 162 162 MapillaryPlugin.setMenuEnabled(MapillaryPlugin.EXPORT_MENU, false); 163 MapillaryPlugin.setMenuEnabled(MapillaryPlugin.SIGN AL_MENU, false);163 MapillaryPlugin.setMenuEnabled(MapillaryPlugin.SIGN_MENU, false); 164 164 MapillaryPlugin.setMenuEnabled(MapillaryPlugin.ZOOM_MENU, false); 165 165 Main.map.mapView.removeMouseListener(mouseAdapter); … … 234 234 icon = MapillaryPlugin.MAP_ICON_SELECTED; 235 235 draw(g, image, icon, p); 236 if (!image.getSign als().isEmpty()) {237 g.drawImage(MapillaryPlugin.MAP_SIGN AL.getImage(), p.x236 if (!image.getSigns().isEmpty()) { 237 g.drawImage(MapillaryPlugin.MAP_SIGN.getImage(), p.x 238 238 + icon.getIconWidth() / 2, 239 239 p.y - icon.getIconHeight() / 2, -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryPlugin.java
r31273 r31275 41 41 public static final ImageIcon MAP_ICON_IMPORTED = new ImageProvider( 42 42 "mapiconimported.png").get(); 43 public static final ImageIcon MAP_SIGN AL = new ImageProvider("signal.png")43 public static final ImageIcon MAP_SIGN = new ImageProvider("sign.png") 44 44 .get(); 45 45 public static final int ICON_SIZE = 24; … … 50 50 private final MapillaryExportAction exportAction; 51 51 private final MapillaryImportAction importAction; 52 private final MapillarySign alAction signalAction;52 private final MapillarySignAction signAction; 53 53 private final MapillaryZoomAction zoomAction; 54 54 … … 56 56 public static JMenuItem EXPORT_MENU; 57 57 public static JMenuItem IMPORT_MENU; 58 public static JMenuItem SIGN AL_MENU;58 public static JMenuItem SIGN_MENU; 59 59 public static JMenuItem ZOOM_MENU; 60 60 … … 64 64 exportAction = new MapillaryExportAction(); 65 65 importAction = new MapillaryImportAction(); 66 sign alAction = new MapillarySignalAction();66 signAction = new MapillarySignAction(); 67 67 zoomAction = new MapillaryZoomAction(); 68 68 … … 73 73 IMPORT_MENU = MainMenu.add(Main.main.menu.fileMenu, importAction, 74 74 false, 14); 75 SIGN AL_MENU = MainMenu76 .add(Main.main.menu.dataMenu, sign alAction, false);75 SIGN_MENU = MainMenu 76 .add(Main.main.menu.dataMenu, signAction, false); 77 77 ZOOM_MENU = MainMenu 78 78 .add(Main.main.menu.viewMenu, zoomAction, false, 15); … … 81 81 DOWNLOAD_MENU.setEnabled(false); 82 82 IMPORT_MENU.setEnabled(false); 83 SIGN AL_MENU.setEnabled(false);83 SIGN_MENU.setEnabled(false); 84 84 ZOOM_MENU.setEnabled(false); 85 85 -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySquareDownloadManagerThread.java
r31261 r31275 24 24 private final String urlImages; 25 25 private final String urlSequences; 26 private final String urlSign als;26 private final String urlSigns; 27 27 private final Bounds bounds; 28 28 29 29 public MapillarySquareDownloadManagerThread(String urlImages, 30 String urlSequences, String urlSign als, Bounds bounds) {30 String urlSequences, String urlSigns, Bounds bounds) { 31 31 this.urlImages = urlImages; 32 32 this.urlSequences = urlSequences; 33 this.urlSign als = urlSignals;33 this.urlSigns = urlSigns; 34 34 this.bounds = bounds; 35 35 } … … 40 40 downloadSequences(); 41 41 completeImages(); 42 Main.map.statusLine.setHelpText("Downloading sign als information");43 downloadSign als();42 Main.map.statusLine.setHelpText("Downloading signs information"); 43 downloadSigns(); 44 44 } catch (InterruptedException e) { 45 45 Main.error(e); … … 82 82 } 83 83 84 private void downloadSign als() throws InterruptedException {84 private void downloadSigns() throws InterruptedException { 85 85 ThreadPoolExecutor ex = new ThreadPoolExecutor(3, 5, 25, 86 86 TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(5)); 87 87 int page = 0; 88 88 while (!ex.isShutdown()) { 89 ex.execute(new MapillarySign alDownloaderThread(ex, urlSignals89 ex.execute(new MapillarySignDownloaderThread(ex, urlSigns 90 90 + "&page=" + page + "&limit=20")); 91 91 while (ex.getQueue().remainingCapacity() == 0) -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryToggleDialog.java
r31273 r31275 46 46 47 47 public final static int NORMAL_MODE = 0; 48 public final static int SIGN AL_MODE = 1;48 public final static int SIGN_MODE = 1; 49 49 50 50 public final static String BASE_TITLE = "Mapillary picture"; … … 61 61 private List<SideButton> normalMode; 62 62 63 public final SideButton nextSign alButton = new SideButton(64 new NextSign alAction());65 public final SideButton previousSign alButton = new SideButton(66 new PreviousSign alAction());67 private List<SideButton> sign alMode;63 public final SideButton nextSignButton = new SideButton( 64 new NextSignAction()); 65 public final SideButton previousSignButton = new SideButton( 66 new PreviousSignAction()); 67 private List<SideButton> signMode; 68 68 69 69 private int mode; … … 90 90 normalMode = Arrays.asList(new SideButton[] { blueButton, 91 91 previousButton, nextButton, redButton }); 92 sign alMode = Arrays.asList(new SideButton[] { previousSignalButton,93 nextSign alButton });92 signMode = Arrays.asList(new SideButton[] { previousSignButton, 93 nextSignButton }); 94 94 95 95 mode = NORMAL_MODE; 96 /* 97 * this.setLayout(new BorderLayout()); top = new JPanel(); 98 * top.setLayout(new BorderLayout()); top.add(titleBar, 99 * BorderLayout.NORTH); 100 */ 96 101 97 createLayout(mapillaryImageDisplay, normalMode, 102 98 Main.pref.getBoolean("mapillary.reverse-buttons")); … … 121 117 List<SideButton> list = null; 122 118 if (mode == NORMAL_MODE) { 123 list = sign alMode;124 mode = SIGN AL_MODE;125 } else if (mode == SIGN AL_MODE) {119 list = signMode; 120 mode = SIGN_MODE; 121 } else if (mode == SIGN_MODE) { 126 122 list = normalMode; 127 123 mode = NORMAL_MODE; … … 172 168 if (mapillaryImage.previous() == null) 173 169 this.previousButton.setEnabled(false); 174 } else if (mode == SIGN AL_MODE) {175 previousSign alButton.setEnabled(true);176 nextSign alButton.setEnabled(true);170 } else if (mode == SIGN_MODE) { 171 previousSignButton.setEnabled(true); 172 nextSignButton.setEnabled(true); 177 173 int i = MapillaryData 178 174 .getInstance() … … 187 183 .getInstance().getImages()) { 188 184 if (img instanceof MapillaryImage) 189 if (!((MapillaryImage) img).getSign als().isEmpty()) {185 if (!((MapillaryImage) img).getSigns().isEmpty()) { 190 186 if (first == -1) 191 187 first = c; … … 195 191 } 196 192 if (first >= i) 197 previousSign alButton.setEnabled(false);193 previousSignButton.setEnabled(false); 198 194 if (last <= i) 199 nextSign alButton.setEnabled(false);195 nextSignButton.setEnabled(false); 200 196 } 201 197 … … 235 231 blueButton.setEnabled(false); 236 232 redButton.setEnabled(false); 237 nextSign alButton.setEnabled(false);238 previousSign alButton.setEnabled(false);233 nextSignButton.setEnabled(false); 234 previousSignButton.setEnabled(false); 239 235 mapillaryImageDisplay.hyperlink.setVisible(false); 240 236 } … … 418 414 419 415 /** 420 * Action class to jump to the next picture containing a sign al.416 * Action class to jump to the next picture containing a sign. 421 417 * 422 418 * @author nokutu 423 419 * 424 420 */ 425 class NextSign alAction extends AbstractAction {426 public NextSign alAction() {427 putValue(NAME, tr("Next Sign al"));421 class NextSignAction extends AbstractAction { 422 public NextSignAction() { 423 putValue(NAME, tr("Next Sign")); 428 424 putValue(SHORT_DESCRIPTION, 429 tr("Jumps to the next picture that contains a sign al"));425 tr("Jumps to the next picture that contains a sign")); 430 426 } 431 427 … … 442 438 .getImages().get(j); 443 439 if (img instanceof MapillaryImage) 444 if (!((MapillaryImage) img).getSign als().isEmpty()) {440 if (!((MapillaryImage) img).getSigns().isEmpty()) { 445 441 MapillaryData.getInstance().setSelectedImage(img, 446 442 true); … … 453 449 454 450 /** 455 * Action class to jump to the previous picture containing a sign al.451 * Action class to jump to the previous picture containing a sign. 456 452 * 457 453 * @author nokutu 458 454 * 459 455 */ 460 class PreviousSign alAction extends AbstractAction {461 public PreviousSign alAction() {462 putValue(NAME, tr("Previous Sign al"));456 class PreviousSignAction extends AbstractAction { 457 public PreviousSignAction() { 458 putValue(NAME, tr("Previous Sign")); 463 459 putValue(SHORT_DESCRIPTION, 464 tr("Jumps to the previous picture that contains a sign al"));460 tr("Jumps to the previous picture that contains a sign")); 465 461 } 466 462 … … 476 472 .getImages().get(j); 477 473 if (img instanceof MapillaryImage) 478 if (!((MapillaryImage) img).getSign als().isEmpty()) {474 if (!((MapillaryImage) img).getSigns().isEmpty()) { 479 475 MapillaryData.getInstance().setSelectedImage(img, 480 476 true);
Note:
See TracChangeset
for help on using the changeset viewer.