Changeset 1711 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2009-06-28T14:40:12+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r1677 r1711 15 15 import java.awt.image.BufferedImage; 16 16 import java.io.File; 17 import java.io.IOException; 17 18 import java.net.MalformedURLException; 18 19 import java.net.URL; … … 28 29 29 30 import org.openstreetmap.josm.Main; 31 import org.openstreetmap.josm.io.MirroredInputStream; 30 32 31 33 /** … … 85 87 if (name == null) 86 88 return null; 89 if (name.startsWith("http://")) 90 { 91 Image img = cache.get(name); 92 if(img == null) 93 { 94 try 95 { 96 MirroredInputStream is = new MirroredInputStream(name, 97 new File(Main.pref.getPreferencesDir(), "images").toString()); 98 if(is != null) 99 { 100 img = Toolkit.getDefaultToolkit().createImage(is.getFile().toURI().toURL()); 101 cache.put(name, img); 102 } 103 } 104 catch(IOException e) { 105 } 106 } 107 return img == null ? null : new ImageIcon(img); 108 } 87 109 if (subdir == null) 88 110 subdir = "";
Note:
See TracChangeset
for help on using the changeset viewer.