Changeset 31306 in osm for applications
- Timestamp:
- 2015-06-24T22:29:34+02:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/mapillary
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImportedImage.java
r31284 r31306 19 19 super(lat, lon, ca); 20 20 this.file = file; 21 System.out.println(datetimeOriginal);22 21 this.datetimeOriginal = getEpoch(datetimeOriginal, "yyyy/MM/dd hh:mm:ss"); 23 22 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryMouseAdapter.java
r31299 r31306 125 125 double dist = clickPoint.distanceSq(imagePoint); 126 126 if (minDistance > dist 127 && clickPoint.distance(imagePoint) < snapDistance ) {127 && clickPoint.distance(imagePoint) < snapDistance && image.isVisible()) { 128 128 minDistance = dist; 129 129 closest = image; … … 208 208 Main.map.mapMode.putValue("active", Boolean.FALSE); 209 209 imageHighlighted = true; 210 System.out.println("1");211 210 212 211 } else if (closestTemp == null … … 215 214 nothingHighlighted = false; 216 215 Main.map.mapMode.putValue("active", Boolean.TRUE); 217 System.out.println("2");218 216 219 217 } else if (imageHighlighted && !nothingHighlighted … … 221 219 && Main.map.mapView.getEditLayer().data != null 222 220 && Main.map.mapView.getActiveLayer() instanceof OsmDataLayer) { 223 System.out.println("3");224 221 225 222 for (OsmPrimitive primivitive : Main.map.mapView.getEditLayer().data … … 231 228 } 232 229 233 // TODO check if it is possible to do this while the OSM data layer is234 // selected.235 230 if (MapillaryData.getInstance().getHoveredImage() != closestTemp 236 231 && closestTemp != null) { -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java
r31278 r31306 11 11 12 12 public class MapillaryCache extends 13 13 JCSCachedTileLoaderJob<String, BufferedImageCacheEntry> { 14 14 15 16 15 private volatile URL url; 16 private volatile String key; 17 17 18 19 20 18 public static enum Type { 19 FULL_IMAGE, THUMBNAIL 20 } 21 21 22 23 24 25 26 27 28 29 30 22 public MapillaryCache(String key, Type type) { 23 super(MapillaryPlugin.CACHE, 50000, 50000, 24 new HashMap<String, String>()); 25 this.key = key; 26 try { 27 if (type == Type.FULL_IMAGE) { 28 url = new URL("https://d1cuyjsrcm0gby.cloudfront.net/" + key 29 + "/thumb-2048.jpg"); 30 this.key += ".FULL_IMAGE"; 31 31 32 33 34 35 36 37 38 39 40 32 } else if (type == Type.THUMBNAIL) { 33 url = new URL("https://d1cuyjsrcm0gby.cloudfront.net/" + key 34 + "/thumb-320.jpg"); 35 this.key += ".THUMBNAIL"; 36 } 37 } catch (MalformedURLException e) { 38 Main.error(e); 39 } 40 } 41 41 42 43 44 45 42 @Override 43 public String getCacheKey() { 44 return key; 45 } 46 46 47 48 49 50 47 @Override 48 public URL getUrl() { 49 return url; 50 } 51 51 52 53 54 55 52 @Override 53 protected BufferedImageCacheEntry createCacheEntry(byte[] content) { 54 return new BufferedImageCacheEntry(content); 55 } 56 56 57 58 59 60 61 62 63 57 @Override 58 protected boolean isObjectLoadable() { 59 if (cacheData == null) 60 return false; 61 byte[] content = cacheData.getContent(); 62 return content != null && content.length > 0; 63 } 64 64 65 66 67 68 65 // @Override 66 protected boolean handleNotFound() { 67 return false; 68 } 69 69 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryDownloader.java
r31296 r31306 50 50 51 51 try { 52 Main.info(" MapillaryPlugin GET " + url2);52 Main.info("GET " + url2 + " (Mapillary plugin)"); 53 53 Main.worker.submit(new MapillarySquareDownloadManagerThread(url1, 54 54 url2, url3)); -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySquareDownloadManagerThread.java
r31278 r31306 9 9 import org.openstreetmap.josm.Main; 10 10 import org.openstreetmap.josm.plugins.mapillary.MapillaryData; 11 import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryFilterDialog; 11 12 12 13 /** … … 49 50 Main.map.statusLine.setHelpText(tr("No images found")); 50 51 MapillaryData.getInstance().dataUpdated(); 52 MapillaryFilterDialog.getInstance().refresh(); 51 53 } 52 54 -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterChooseSigns.java
r31300 r31306 20 20 public final JCheckBox roundabout = new JCheckBox(); 21 21 public final JCheckBox access = new JCheckBox(); 22 public final JCheckBox intersection = new JCheckBox(); 23 public final JCheckBox direction = new JCheckBox(); 22 24 23 25 private static MapillaryFilterChooseSigns INSTANCE; … … 29 31 roundabout.setSelected(true); 30 32 access.setSelected(true); 33 intersection.setSelected(true); 34 direction.setSelected(true); 31 35 32 36 … … 73 77 JLabel noEntryLabel = new JLabel(tr("No entry")); 74 78 noEntryLabel.setIcon(new ImageProvider( 75 " styles/standard/vehicle/restriction/access.png").get());79 "no_entry.png").get()); 76 80 noEntryPanel.add(noEntryLabel); 77 81 noEntryPanel.add(access); 78 82 this.add(noEntryPanel); 83 84 // Danger intersection 85 JPanel intersectionPanel = new JPanel(); 86 JLabel intersectionLabel = new JLabel(tr("Intersection danger")); 87 intersectionLabel.setIcon(new ImageProvider( 88 "intersection_danger.png").get()); 89 intersectionPanel.add(intersectionLabel); 90 intersectionPanel.add(intersection); 91 this.add(intersectionPanel); 92 93 // Mandatory direction 94 JPanel directionPanel = new JPanel(); 95 JLabel directionLabel = new JLabel(tr("Mandatory direction (any)")); 96 directionLabel.setIcon(new ImageProvider( 97 "/home/nokutu/josm/core/images/styles/standard/vehicle/restriction/turn_restrictions/only_straight_on.png").get()); 98 directionPanel.add(directionLabel); 99 directionPanel.add(direction); 100 this.add(directionPanel); 79 101 } 80 102 -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterDialog.java
r31300 r31306 51 51 52 52 private final JCheckBox imported = new JCheckBox("Imported images"); 53 private final JCheckBox downloaded = new JCheckBox(new downloadCheckBoxAction()); 53 private final JCheckBox downloaded = new JCheckBox( 54 new downloadCheckBoxAction()); 54 55 private final JCheckBox onlySigns = new JCheckBox(new OnlySignsAction()); 55 56 private final JComboBox<String> time; … … 62 63 public final MapillaryFilterChooseSigns signFilter = MapillaryFilterChooseSigns 63 64 .getInstance(); 65 66 private final String[] SIGN_TAGS = { "prohibitory_speed_limit", 67 "priority_stop", "other_give_way", "mandatory_roundabout", 68 "other_no_entry", "danger_intersection", "mandatory_go", 69 "mandatory_keep" }; 70 private final JCheckBox[] SIGN_CHECKBOXES = { signFilter.maxspeed, 71 signFilter.stop, signFilter.giveWay, signFilter.roundabout, 72 signFilter.access, signFilter.intersection, signFilter.direction, 73 signFilter.direction }; 64 74 65 75 public MapillaryFilterDialog() { … … 70 80 Shortcut.NONE), 200); 71 81 72 73 82 signChooser.setEnabled(false); 74 83 JPanel signChooserPanel = new JPanel(); … … 188 197 189 198 private boolean checkSigns(MapillaryImage img) { 190 // TODO move strings into an arraylist 191 if (checkSign(img, signFilter.maxspeed, "prohibitory_speed_limit")) 192 return true; 193 194 if (checkSign(img, signFilter.stop, "priority_stop")) 195 return true; 196 197 if (checkSign(img, signFilter.giveWay, "other_give_way")) 198 return true; 199 200 if (checkSign(img, signFilter.roundabout, "mandatory_roundabout")) 201 return true; 202 203 if (checkSign(img, signFilter.access, "other_no_entry")) 204 return true; 205 199 for (int i = 0; i < SIGN_TAGS.length; i++) { 200 if (checkSign(img, SIGN_CHECKBOXES[i], SIGN_TAGS[i])) 201 return true; 202 } 206 203 return false; 207 204 } 208 209 private boolean checkSign(MapillaryImage img, JCheckBox signCheckBox, String singString) { 205 206 private boolean checkSign(MapillaryImage img, JCheckBox signCheckBox, 207 String singString) { 210 208 boolean contains = false; 211 209 for (String sign : img.getSigns()) { -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryToggleDialog.java
r31300 r31306 298 298 */ 299 299 @Override 300 public void loadingFinished( CacheEntry data,301 CacheEntryAttributes attributes,LoadResult result) {300 public void loadingFinished(final CacheEntry data, 301 final CacheEntryAttributes attributes, final LoadResult result) { 302 302 if (!SwingUtilities.isEventDispatchThread()) { 303 303 SwingUtilities.invokeLater(new Runnable() { 304 304 @Override 305 305 public void run() { 306 updateImage();306 loadingFinished(data, attributes, result); 307 307 } 308 308 });
Note:
See TracChangeset
for help on using the changeset viewer.