- Timestamp:
- 2007-06-13T22:30:51+02:00 (18 years ago)
- Location:
- src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/gui/annotation/AnnotationPreset.java
r212 r255 35 35 import org.openstreetmap.josm.data.osm.OsmPrimitive; 36 36 import org.openstreetmap.josm.tools.GBC; 37 import org.openstreetmap.josm.tools.ImageProvider; 37 38 import org.openstreetmap.josm.tools.XmlObjectParser; 38 39 import org.xml.sax.SAXException; … … 54 55 boolean requestFocusInWindow() {return false;} 55 56 } 56 57 57 58 public static class Text extends Item { 58 59 public String key; … … 81 82 public String text; 82 83 public boolean default_ = false; 83 84 84 85 private JCheckBox check = new JCheckBox(); 85 86 … … 143 144 144 145 /** 145 146 147 146 * The types as preparsed collection. 147 */ 148 public Collection<Class<?>> types; 148 149 private List<Item> data = new LinkedList<Item>(); 149 150 … … 166 167 * Called from the XML parser to set the icon 167 168 */ 168 public void setIcon(String icon) { 169 putValue(Action.SMALL_ICON, new ImageIcon(new ImageIcon(icon).getImage().getScaledInstance(24, 24, Image.SCALE_SMOOTH))); 170 } 171 169 public void setIcon(String iconName) { 170 ImageIcon icon = ImageProvider.getIfAvailable(null, iconName); 171 if (icon == null) 172 icon = new ImageIcon(iconName); 173 if (Math.max(icon.getIconHeight(), icon.getIconWidth()) != 24) 174 icon = new ImageIcon(icon.getImage().getScaledInstance(24, 24, Image.SCALE_SMOOTH)); 175 putValue(Action.SMALL_ICON, icon); 176 } 177 172 178 /** 173 179 * Called from the XML parser to set the types, this preset affects … … 186 192 } 187 193 } 188 194 189 195 public static List<AnnotationPreset> readAll(InputStream inStream) throws SAXException { 190 196 BufferedReader in = null; -
src/org/openstreetmap/josm/tools/ImageProvider.java
r243 r255 69 69 if (name == null) 70 70 return null; 71 if (subdir == null || subdir != "") 71 if (subdir == null) 72 subdir = ""; 73 else 72 74 subdir += "/"; 73 75 String ext = name.indexOf('.') != -1 ? "" : ".png";
Note:
See TracChangeset
for help on using the changeset viewer.