Changeset 5484 in josm for trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java
- Timestamp:
- 2012-08-30T22:38:56+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java
r5297 r5484 7 7 import java.awt.Container; 8 8 import java.awt.Image; 9 import java.awt.Toolkit; 10 import java.awt.image.FilteredImageSource; 9 11 import java.lang.reflect.InvocationTargetException; 10 12 13 import javax.swing.GrayFilter; 11 14 import javax.swing.Icon; 12 15 import javax.swing.ImageIcon; … … 80 83 return dlg.showDialog().getValue() != 2; 81 84 } 85 86 /** 87 * Replies the disabled (grayed) version of the specified image. 88 * @param image The image to disable 89 * @return The disabled (grayed) version of the specified image, brightened by 20%. 90 * @since 5484 91 */ 92 public static final Image getDisabledImage(Image image) { 93 return Toolkit.getDefaultToolkit().createImage( 94 new FilteredImageSource(image.getSource(), new GrayFilter(true, 20))); 95 } 82 96 97 /** 98 * Replies the disabled (grayed) version of the specified icon. 99 * @param icon The icon to disable 100 * @return The disabled (grayed) version of the specified icon, brightened by 20%. 101 * @since 5484 102 */ 103 public static final ImageIcon getDisabledIcon(ImageIcon icon) { 104 return new ImageIcon(getDisabledImage(icon.getImage())); 105 } 83 106 }
Note:
See TracChangeset
for help on using the changeset viewer.
