Changeset 397 in josm for trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
- Timestamp:
- 16.10.2007 23:18:46 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r304 r397 167 167 /** 168 168 * Called from the XML parser to set the icon 169 * 170 * FIXME for Java 1.6 - use 24x24 icons for LARGE_ICON_KEY (button bar) 171 * and the 16x16 icons for SMALL_ICON. 169 172 */ 170 173 public void setIcon(String iconName) { … … 172 175 if (icon == null) 173 176 icon = new ImageIcon(iconName); 174 if (Math.max(icon.getIconHeight(), icon.getIconWidth()) != 24)175 icon = new ImageIcon(icon.getImage().getScaledInstance( 24, 24, Image.SCALE_SMOOTH));177 if (Math.max(icon.getIconHeight(), icon.getIconWidth()) != 16) 178 icon = new ImageIcon(icon.getImage().getScaledInstance(16, 16, Image.SCALE_SMOOTH)); 176 179 putValue(Action.SMALL_ICON, icon); 177 180 } … … 225 228 LinkedList<TaggingPreset> allPresets = new LinkedList<TaggingPreset>(); 226 229 String allTaggingPresets = Main.pref.get("taggingpreset.sources"); 230 231 if (Main.pref.getBoolean("taggingpreset.enable-defaults")) { 232 InputStream in = Main.class.getResourceAsStream("/presets/presets.xml"); 233 try { 234 allPresets.addAll(TaggingPreset.readAll(in)); 235 } catch (SAXException x) { 236 JOptionPane.showMessageDialog(Main.parent, tr("Error parsing presets.xml: ")+x.getMessage()); 237 } 238 } 239 227 240 StringTokenizer st = new StringTokenizer(allTaggingPresets, ";"); 228 241 while (st.hasMoreTokens()) { … … 232 245 if (source.startsWith("http") || source.startsWith("ftp") || source.startsWith("file")) 233 246 in = new URL(source).openStream(); 234 else if (source.startsWith("resource://")) 247 else if (source.startsWith("resource://")) 235 248 in = Main.class.getResourceAsStream(source.substring("resource:/".length())); 236 249 else … … 248 261 return allPresets; 249 262 } 250 251 263 252 264 public JPanel createPanel() {
Note: See TracChangeset
for help on using the changeset viewer.
