| 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 | }); |