com.jgoodies.looks.common
Class RGBGrayFilter
RGBImageFilter
com.jgoodies.looks.common.RGBGrayFilter
public final class RGBGrayFilter
extends RGBImageFilter
An image filter that turns an icon into a grayscale icon. Used by
the JGoodies Windows and Plastic L&Fs to create a disabled icon.
The high-resolution gray filter can be disabled globally using
Options.setHiResGrayFilterEnabled(boolean)
; it is enabled by default.
The global setting can be overridden per component by setting
the client property key
Options.HI_RES_DISABLED_ICON_CLIENT_KEY
to
Boolean.FALSE
.
int | filterRGB(int x, int y, int rgb) - Converts a single input pixel in the default RGB ColorModel to a single
gray pixel.
|
static Icon | getDisabledIcon(JComponent component, Icon icon) - Returns an icon with a disabled appearance.
|
filterRGB
public int filterRGB(int x,
int y,
int rgb)
Converts a single input pixel in the default RGB ColorModel to a single
gray pixel.
x
- the horizontal pixel coordinatey
- the vertical pixel coordinatergb
- the integer pixel representation in the default RGB color model
- a gray pixel in the default RGB color model.
ColorModel.getRGBdefault
, RGBGrayFilter
getDisabledIcon
public static Icon getDisabledIcon(JComponent component,
Icon icon)
Returns an icon with a disabled appearance. This method is used
to generate a disabled icon when one has not been specified.
component
- the component that will display the icon, may be null.icon
- the icon to generate disabled icon from.
- disabled icon, or null if a suitable icon can not be generated.
Copyright © 2001-2008 JGoodies Karsten Lentzsch. All Rights Reserved.