Java 8 GrayFilter - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 GrayFilter class.

This code example shows how to use the following methods:
     * @return The disabled (grayed) version of the specified image, brightened by 20%. 
     * @since 5484 
     */ 
    public static final Image getDisabledImage(Image image) {
        return Toolkit.getDefaultToolkit().createImage(
                new FilteredImageSource(image.getSource(), new GrayFilter(true, 20)));
    } 
 
    /** 
     * Replies the disabled (grayed) version of the specified icon. 
     * @param icon The icon to disable 
     * @return The disabled (grayed) version of the specified icon, brightened by 20%. 
     * @since 5484 
     */ 
    public static final ImageIcon getDisabledIcon(ImageIcon icon) {
        return new ImageIcon(getDisabledImage(icon.getImage()));
    } 
 
    /** 
     * Attaches a {@code HierarchyListener} to the specified {@code Component} that 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	implements IconBuilder, Cloneable, Serializable
{ 
	private IconBuilder original;
	private boolean active;
 
	private static final ImageFilter INACTIVE_ICON_FILTER = new GrayFilter(true, 50);
	private static final long serialVersionUID = 1L;
 
 
	/** 
	 * Construct an IconBuilder that will "dim" the original icon 
	 * if the "active" flag is false. 
	 */ 
	public ActiveIconBuilder(IconBuilder original, boolean active) {
		super(); 
		if (original == null) {
			throw new NullPointerException();
		} 
		this.original = original;
		this.active = active;
3
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Java 8 GrayFilter Methods: