Changeset 31185 in osm for applications/editors/josm/plugins
- Timestamp:
- 2015-06-03T09:38:08+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/mapillary
- Files:
-
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/README
r30944 r31185 4 4 Readme for your plugin 5 5 6 * Polyglot and HolgerMappt6 * nokutu <nokutu@openmailbox.org> 7 7 8 8 * License: GPL v2 or later 9 9 10 * Notes for future developers, if needed.10 * Feel free to contact me for any bug or suggestion. -
applications/editors/josm/plugins/mapillary/build.xml
r31183 r31185 24 24 See http://josm.openstreetmap.de/wiki/DevelopersGuide/DevelopingPlugins 25 25 --> 26 <property name="plugin.author" value=" Nokutu"/>26 <property name="plugin.author" value="nokutu <nokutu@openmailbox.org>"/> 27 27 <property name="plugin.class" value="org.openstreetmap.josm.plugins.mapillary.MapillaryPlugin"/> 28 28 <property name="plugin.description" value="Enables user to work with pictures hosted at mapillary.com"/> … … 30 30 <!-- <property name="plugin.link" value="..."/>--> 31 31 <!--<property name="plugin.early" value="..."/>--> 32 < !--<property name="plugin.requires" value="commons-imaging"/>-->32 <property name="plugin.requires" value="commons-imaging"/> 33 33 <!--<property name="plugin.stage" value="..."/>--> 34 34 -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java
r31176 r31185 1 1 package org.openstreetmap.josm.plugins.mapillary; 2 2 3 import org.apache.commons.jcs.access.CacheAccess;4 3 import org.openstreetmap.josm.Main; 5 import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry;6 4 import org.openstreetmap.josm.data.cache.CacheEntry; 7 5 import org.openstreetmap.josm.data.cache.CacheEntryAttributes; 8 6 import org.openstreetmap.josm.data.cache.ICachedLoaderListener; 9 import org.openstreetmap.josm.data.cache.JCSCacheManager;10 7 import org.openstreetmap.josm.plugins.mapillary.cache.MapillaryCache; 11 8 12 import java.io.IOException;13 9 import java.util.ArrayList; 14 import java.util.HashMap;15 10 import java.util.List; 16 11 import java.util.concurrent.CopyOnWriteArrayList; … … 147 142 /** 148 143 * Selects a new image and then starts a new MapillaryImageDownloadThread 149 * thread in order to download its surrounding thumbnails. If the 150 * user doesctrl+click, this isn't triggered.144 * thread in order to download its surrounding thumbnails. If the user does 145 * ctrl+click, this isn't triggered. 151 146 * 152 147 * @param image … … 160 155 MapillaryToggleDialog.getInstance().setImage(selectedImage); 161 156 MapillaryToggleDialog.getInstance().updateImage(); 162 CacheAccess<String, BufferedImageCacheEntry> prev = null;163 try {164 prev = JCSCacheManager.getCache("mapillary");165 } catch (IOException e) {166 // TODO Auto-generated catch block167 e.printStackTrace();168 }169 157 if (image.next() != null) { 170 158 new MapillaryCache(image.next().getKey(), 171 MapillaryCache.Type.THUMBNAIL , prev, 200000, 200000,172 new HashMap<String, String>()).submit(this, false);159 MapillaryCache.Type.THUMBNAIL).submit( 160 this, false); 173 161 if (image.next().next() != null) 174 162 new MapillaryCache(image.next().next().getKey(), 175 MapillaryCache.Type.THUMBNAIL, prev, 200000, 176 200000, new HashMap<String, String>()).submit(this, 177 false); 163 MapillaryCache.Type.THUMBNAIL) 164 .submit(this, false); 178 165 } 179 166 if (image.previous() != null) { 180 167 new MapillaryCache(image.previous().getKey(), 181 MapillaryCache.Type.THUMBNAIL , prev, 200000, 200000,182 new HashMap<String, String>()).submit(this, false);168 MapillaryCache.Type.THUMBNAIL).submit( 169 this, false); 183 170 if (image.previous().previous() != null) 184 171 new MapillaryCache(image.previous().previous().getKey(), 185 MapillaryCache.Type.THUMBNAIL, prev, 200000, 186 200000, new HashMap<String, String>()).submit(this, 187 false); 172 MapillaryCache.Type.THUMBNAIL) 173 .submit(this, false); 188 174 } 189 175 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryPlugin.java
r31183 r31185 1 1 package org.openstreetmap.josm.plugins.mapillary; 2 3 import java.io.IOException; 2 4 3 5 import javax.swing.ImageIcon; 4 6 import javax.swing.JMenuItem; 5 7 8 import org.apache.commons.jcs.access.CacheAccess; 9 import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry; 10 import org.openstreetmap.josm.data.cache.JCSCacheManager; 6 11 import org.openstreetmap.josm.gui.MainMenu; 7 12 import org.openstreetmap.josm.Main; … … 28 33 "mapiconselected.png").get(); 29 34 public static final int ICON_SIZE = 24; 35 36 public static CacheAccess<String, BufferedImageCacheEntry> CACHE; 30 37 31 38 private final MapillaryDownloadAction downloadAction; … … 48 55 false, 14); 49 56 EXPORT_MENU.setEnabled(false); 57 try { 58 CACHE = JCSCacheManager.getCache("mapillary", 10, 10000, this.getPluginDir() + "/cache/"); 59 } catch (IOException e) { 60 Main.error(e); 61 } 50 62 } 51 63 -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryToggleDialog.java
r31183 r31185 11 11 import java.io.IOException; 12 12 import java.util.Arrays; 13 import java.util.HashMap; 14 15 import org.apache.commons.jcs.access.CacheAccess; 13 16 14 import org.openstreetmap.josm.Main; 17 import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry;18 15 import org.openstreetmap.josm.data.cache.CacheEntry; 19 16 import org.openstreetmap.josm.data.cache.CacheEntryAttributes; … … 114 111 this.previousButton.setEnabled(false); 115 112 116 CacheAccess<String, BufferedImageCacheEntry> prev;117 113 try { 118 114 this.mapillaryImageDisplay.setImage(null); 119 prev= JCSCacheManager.getCache("mapillary");115 MapillaryPlugin.CACHE = JCSCacheManager.getCache("mapillary"); 120 116 if (thumbnailCache != null) 121 117 thumbnailCache.cancelOutstandingTasks(); 122 118 thumbnailCache = new MapillaryCache(image.getKey(), 123 MapillaryCache.Type.THUMBNAIL, prev, 200000, 200000, 124 new HashMap<String, String>()); 119 MapillaryCache.Type.THUMBNAIL); 125 120 thumbnailCache.submit(this, false); 126 121 … … 128 123 imageCache.cancelOutstandingTasks(); 129 124 imageCache = new MapillaryCache(image.getKey(), 130 MapillaryCache.Type.FULL_IMAGE, prev, 200000, 200000, 131 new HashMap<String, String>()); 125 MapillaryCache.Type.FULL_IMAGE); 132 126 imageCache.submit(this, false); 133 127 } catch (IOException e) { -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java
r31176 r31185 3 3 import java.net.MalformedURLException; 4 4 import java.net.URL; 5 import java.util. Map;5 import java.util.HashMap; 6 6 7 import org.apache.commons.jcs.access.behavior.ICacheAccess;8 7 import org.openstreetmap.josm.Main; 9 8 import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry; 10 9 import org.openstreetmap.josm.data.cache.JCSCachedTileLoaderJob; 10 import org.openstreetmap.josm.plugins.mapillary.MapillaryPlugin; 11 11 12 12 public class MapillaryCache extends … … 20 20 } 21 21 22 public MapillaryCache(String key, Type type, 23 ICacheAccess<String, BufferedImageCacheEntry> cache, 24 int connectTimeout, int readTimeout, Map<String, String> headers) { 25 super(cache, connectTimeout, readTimeout, headers); 22 public MapillaryCache(String key, Type type) { 23 super(MapillaryPlugin.CACHE, 50000, 50000, new HashMap<String, String>()); 26 24 this.key = key; 27 25 try { -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryExportDownloadThread.java
r31176 r31185 4 4 import java.io.ByteArrayInputStream; 5 5 import java.io.IOException; 6 import java.net.MalformedURLException;7 import java.util.HashMap;8 6 import java.util.concurrent.ArrayBlockingQueue; 9 7 10 8 import javax.imageio.ImageIO; 11 9 12 import org.apache.commons.jcs.access.CacheAccess;13 10 import org.openstreetmap.josm.Main; 14 import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry;15 11 import org.openstreetmap.josm.data.cache.CacheEntry; 16 12 import org.openstreetmap.josm.data.cache.CacheEntryAttributes; 17 13 import org.openstreetmap.josm.data.cache.ICachedLoaderListener; 18 import org.openstreetmap.josm.data.cache.JCSCacheManager;19 14 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 20 15 import org.openstreetmap.josm.plugins.mapillary.MapillaryImage; … … 50 45 @Override 51 46 public void run() { 52 try { 53 CacheAccess<String, BufferedImageCacheEntry> prev = JCSCacheManager 54 .getCache("mapillary"); 55 new MapillaryCache(image.getKey(), MapillaryCache.Type.FULL_IMAGE, 56 prev, 200000, 200000, new HashMap<String, String>()) 57 .submit(this, false); 58 } catch (MalformedURLException e) { 59 Main.error(e); 60 } catch (IOException e) { 61 Main.error(e); 62 } 47 new MapillaryCache(image.getKey(), MapillaryCache.Type.FULL_IMAGE).submit(this, 48 false); 49 63 50 } 64 51
Note:
See TracChangeset
for help on using the changeset viewer.