Changeset 31267 in osm for applications/editors/josm/plugins/mapillary/src
- Timestamp:
- 2015-06-15T14:13:09+02:00 (10 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/MapillaryImage.java
r31259 r31267 1 1 package org.openstreetmap.josm.plugins.mapillary; 2 2 3 import java.sql.Date; 4 import java.text.SimpleDateFormat; 3 5 import java.util.ArrayList; 4 6 import java.util.List; … … 17 19 private MapillarySequence sequence; 18 20 19 private intcapturedAt;21 private long capturedAt; 20 22 private String user; 21 23 private List<String> signals; … … 65 67 } 66 68 67 public void setCapturedAt( intcapturedAt) {69 public void setCapturedAt(long capturedAt) { 68 70 this.capturedAt = capturedAt; 69 71 } 70 72 71 public intgetCapturedAt() {73 public long getCapturedAt() { 72 74 return capturedAt; 73 75 } … … 128 130 return this.getSequence().previous(this); 129 131 } 132 133 public String getDate() { 134 Date date = new Date(getCapturedAt()); 135 136 SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy - hh:mm:ss"); 137 return formatter.format(date); 138 } 130 139 131 140 @Override -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryImageInfoDownloaderThread.java
r31264 r31267 52 52 .getString("user")); 53 53 ((MapillaryImage) image).setCapturedAt(data 54 .getJsonNumber("captured_at"). intValue());54 .getJsonNumber("captured_at").longValue()); 55 55 ((MapillaryImage) image).setLocation(data 56 56 .getString("location")); -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryToggleDialog.java
r31266 r31267 48 48 public final static int SIGNAL_MODE = 1; 49 49 50 public final static String BASE_TITLE = "Mapillary picture"; 51 50 52 public static MapillaryToggleDialog INSTANCE; 51 53 … … 76 78 77 79 public MapillaryToggleDialog() { 78 super(tr("Mapillary image"), "mapillary.png", 79 tr("Open Mapillary window"), Shortcut.registerShortcut( 80 tr("Mapillary dialog"), 80 super(tr(BASE_TITLE), "mapillary.png", tr("Open Mapillary window"), 81 Shortcut.registerShortcut(tr("Mapillary dialog"), 81 82 tr("Open Mapillary main dialog"), KeyEvent.VK_M, 82 83 Shortcut.NONE), 200); … … 130 131 createLayout(mapillaryImageDisplay, list, 131 132 Main.pref.getBoolean("mapillary.reverse-buttons")); 133 disableAllButtons(); 132 134 updateImage(); 133 135 } … … 149 151 return; 150 152 } 151 if (this.image == null) 153 if (this.image == null) { 154 mapillaryImageDisplay.setImage(null); 155 titleBar.setTitle(BASE_TITLE); 156 disableAllButtons(); 152 157 return; 158 } 153 159 if (image instanceof MapillaryImage) { 154 160 MapillaryImage mapillaryImage = (MapillaryImage) this.image; 161 String title = BASE_TITLE; 162 if (mapillaryImage.getUser() != null) 163 title += " -- " + mapillaryImage.getUser(); 164 if (mapillaryImage.getCapturedAt() != 0) 165 title += " -- " + mapillaryImage.getDate(); 166 titleBar.setTitle(title); 155 167 if (mode == NORMAL_MODE) { 156 168 this.nextButton.setEnabled(true); … … 215 227 } 216 228 229 private void disableAllButtons() { 230 nextButton.setEnabled(false); 231 previousButton.setEnabled(false); 232 blueButton.setEnabled(false); 233 redButton.setEnabled(false); 234 nextSignalButton.setEnabled(false); 235 previousSignalButton.setEnabled(false); 236 } 237 217 238 /** 218 239 * Sets a new MapillaryImage to be shown. … … 382 403 383 404 @Override 384 public void selectedImageChanged(MapillaryAbstractImage oldImage, MapillaryAbstractImage newImage) { 405 public void selectedImageChanged(MapillaryAbstractImage oldImage, 406 MapillaryAbstractImage newImage) { 385 407 setImage(MapillaryData.getInstance().getSelectedImage()); 386 408 updateImage();
Note:
See TracChangeset
for help on using the changeset viewer.