Changeset 10358 in josm for trunk/src/org/openstreetmap/josm/plugins
- Timestamp:
- 2016-06-12T12:00:38+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java
r10294 r10358 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.awt.Image;7 import java.awt.image.BufferedImage;8 6 import java.io.File; 9 7 import java.io.FileInputStream; … … 77 75 public String iconPath; 78 76 /** The plugin icon. */ 79 p ublic ImageIconicon;77 private ImageProvider icon; 80 78 /** Plugin can be loaded at any time and not just at start. */ 81 79 public boolean canloadatruntime; … … 84 82 /** All manifest attributes. */ 85 83 public final Map<String, String> attr = new TreeMap<>(); 86 87 private static final ImageIcon emptyIcon = new ImageIcon(new BufferedImage(24, 24, BufferedImage.TYPE_INT_ARGB));84 /** Empty icon for these plugins which have none */ 85 private static final ImageIcon emptyIcon = ImageProvider.getEmpty(ImageProvider.ImageSizes.LARGEICON); 88 86 89 87 /** … … 244 242 if (file != null) { 245 243 // extract icon from the plugin jar file 246 icon = new ImageProvider(iconPath).setArchive(file).setMax Width(24).setMaxHeight(24).setOptional(true).get();244 icon = new ImageProvider(iconPath).setArchive(file).setMaxSize(ImageProvider.ImageSizes.LARGEICON).setOptional(true); 247 245 } else if (iconPath.startsWith("data:")) { 248 icon = new ImageProvider(iconPath).setMax Width(24).setMaxHeight(24).setOptional(true).get();246 icon = new ImageProvider(iconPath).setMaxSize(ImageProvider.ImageSizes.LARGEICON).setOptional(true); 249 247 } 250 248 } … … 494 492 495 493 /** 496 * Replies the plugin icon, scaled to 24x24 pixels.497 * @return the plugin icon, scaled to 24x24 pixels.494 * Replies the plugin icon, scaled to LARGE_ICON size. 495 * @return the plugin icon, scaled to LARGE_ICON size. 498 496 */ 499 497 public ImageIcon getScaledIcon() { 500 if (icon == null) 498 ImageIcon img = (icon != null) ? icon.get() : null; 499 if (img == null) 501 500 return emptyIcon; 502 return new ImageIcon(icon.getImage().getScaledInstance(24, 24, Image.SCALE_SMOOTH));501 return img; 503 502 } 504 503
Note: See TracChangeset
for help on using the changeset viewer.