Changeset 5316 in josm for trunk/src/org
- Timestamp:
- 2012-07-08T21:11:44+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r5208 r5316 304 304 public String locale_display_value; 305 305 public String locale_short_description; 306 private final File zipIcons = TaggingPreset.zipIcons; 306 307 307 308 public String getListDisplay() { … … 325 326 326 327 public ImageIcon getIcon() { 327 return icon == null ? null : ImageProvider.getIfAvailable(icon);328 return icon == null ? null : loadImageIcon(icon, zipIcons); 328 329 } 329 330 … … 1228 1229 } 1229 1230 1231 protected static ImageIcon loadImageIcon(String iconName, File zipIcons) { 1232 final Collection<String> s = Main.pref.getCollection("taggingpreset.icon.sources", null); 1233 return new ImageProvider(iconName).setDirs(s).setId("presets").setArchive(zipIcons).setOptional(true).get(); 1234 } 1235 1230 1236 /* 1231 1237 * Called from the XML parser to set the icon. … … 1236 1242 */ 1237 1243 public void setIcon(final String iconName) { 1238 final File zipIcons = this.zipIcons;1244 final File zipIcons = TaggingPreset.zipIcons; 1239 1245 Main.worker.submit(new Runnable() { 1240 1246 1241 1247 @Override 1242 1248 public void run() { 1243 final Collection<String> s = Main.pref.getCollection("taggingpreset.icon.sources", null); 1244 ImageIcon icon = new ImageProvider(iconName).setDirs(s).setId("presets").setArchive(zipIcons).setOptional(true).get(); 1249 ImageIcon icon = loadImageIcon(iconName, zipIcons); 1245 1250 if (icon == null) { 1246 1251 System.out.println("Could not get presets icon " + iconName); … … 1431 1436 ); 1432 1437 } 1433 zipIcons = null;1434 1438 } 1435 1439 return allPresets;
Note:
See TracChangeset
for help on using the changeset viewer.