Changeset 5405 in josm for trunk/src/org
- Timestamp:
- 2012-08-07T23:55:43+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r5404 r5405 1262 1262 */ 1263 1263 public void setIcon(final String iconName) { 1264 final File zipIcons = TaggingPreset.zipIcons; 1265 Main.worker.submit(new Runnable() { 1266 1264 ImageProvider imgProv = new ImageProvider(iconName); 1265 final Collection<String> s = Main.pref.getCollection("taggingpreset.icon.sources", null); 1266 imgProv.setDirs(s); 1267 imgProv.setId("presets"); 1268 imgProv.setArchive(TaggingPreset.zipIcons); 1269 imgProv.setOptional(true); 1270 imgProv.setMaxWidth(16).setMaxHeight(16); 1271 imgProv.getInBackground(new ImageProvider.ImageCallback() { 1267 1272 @Override 1268 public void run() { 1269 ImageIcon icon = loadImageIcon(iconName, zipIcons); 1270 if (icon == null) { 1273 public void finished(final ImageIcon result) { 1274 if (result != null) { 1275 GuiHelper.runInEDT(new Runnable() { 1276 @Override 1277 public void run() { 1278 putValue(Action.SMALL_ICON, result); 1279 } 1280 }); 1281 } else { 1271 1282 System.out.println("Could not get presets icon " + iconName); 1272 icon = new ImageIcon(iconName); 1273 } 1274 if (Math.max(icon.getIconHeight(), icon.getIconWidth()) != 16) { 1275 icon = new ImageIcon(icon.getImage().getScaledInstance(16, 16, Image.SCALE_SMOOTH)); 1276 } 1277 putValue(Action.SMALL_ICON, icon); 1283 } 1278 1284 } 1279 1285 });
Note:
See TracChangeset
for help on using the changeset viewer.