Changeset 5139 in josm
- Timestamp:
- 2012-03-31T11:30:04+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r5136 r5139 1050 1050 return group != null ? group.getRawName() + "/" + name : name; 1051 1051 } 1052 /** 1053 * Called from the XML parser to set the icon 1052 1053 /* 1054 * Called from the XML parser to set the icon. 1055 * This task is performed in the background in order to speedup startup. 1054 1056 * 1055 1057 * FIXME for Java 1.6 - use 24x24 icons for LARGE_ICON_KEY (button bar) 1056 1058 * and the 16x16 icons for SMALL_ICON. 1057 1059 */ 1058 public void setIcon(String iconName) { 1059 Collection<String> s = Main.pref.getCollection("taggingpreset.icon.sources", null); 1060 ImageIcon icon = new ImageProvider(iconName).setDirs(s).setId("presets").setArchive(zipIcons).setOptional(true).get(); 1061 if (icon == null) 1062 { 1063 System.out.println("Could not get presets icon " + iconName); 1064 icon = new ImageIcon(iconName); 1065 } 1066 if (Math.max(icon.getIconHeight(), icon.getIconWidth()) != 16) { 1067 icon = new ImageIcon(icon.getImage().getScaledInstance(16, 16, Image.SCALE_SMOOTH)); 1068 } 1069 putValue(Action.SMALL_ICON, icon); 1060 public void setIcon(final String iconName) { 1061 Main.worker.submit(new Runnable() { 1062 1063 @Override 1064 public void run() { 1065 final Collection<String> s = Main.pref.getCollection("taggingpreset.icon.sources", null); 1066 ImageIcon icon = new ImageProvider(iconName).setDirs(s).setId("presets").setArchive(zipIcons).setOptional(true).get(); 1067 if (icon == null) { 1068 System.out.println("Could not get presets icon " + iconName); 1069 icon = new ImageIcon(iconName); 1070 } 1071 if (Math.max(icon.getIconHeight(), icon.getIconWidth()) != 16) { 1072 icon = new ImageIcon(icon.getImage().getScaledInstance(16, 16, Image.SCALE_SMOOTH)); 1073 } 1074 putValue(Action.SMALL_ICON, icon); 1075 } 1076 }); 1070 1077 } 1071 1078
Note:
See TracChangeset
for help on using the changeset viewer.