javax.swing
Class GrayFilter

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.image.ImageFilter sample code for java.awt.image.ImageFilter definition code for java.awt.image.ImageFilter 
      extended by java.awt.image.RGBImageFilter sample code for java.awt.image.RGBImageFilter definition code for java.awt.image.RGBImageFilter 
          extended by javax.swing.GrayFilter
All Implemented Interfaces:
ImageConsumer sample code for java.awt.image.ImageConsumer definition code for java.awt.image.ImageConsumer , Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable

public class GrayFilter
extends RGBImageFilter sample code for java.awt.image.RGBImageFilter definition code for java.awt.image.RGBImageFilter

An image filter that "disables" an image by turning it into a grayscale image, and brightening the pixels in the image. Used by buttons to create an image for a disabled button.


Field Summary
 
Fields inherited from class java.awt.image.RGBImageFilter sample code for java.awt.image.RGBImageFilter definition code for java.awt.image.RGBImageFilter
canFilterIndexColorModel sample code for java.awt.image.RGBImageFilter.canFilterIndexColorModel definition code for java.awt.image.RGBImageFilter.canFilterIndexColorModel , newmodel sample code for java.awt.image.RGBImageFilter.newmodel definition code for java.awt.image.RGBImageFilter.newmodel , origmodel sample code for java.awt.image.RGBImageFilter.origmodel definition code for java.awt.image.RGBImageFilter.origmodel
 
Fields inherited from class java.awt.image.ImageFilter sample code for java.awt.image.ImageFilter definition code for java.awt.image.ImageFilter
consumer sample code for java.awt.image.ImageFilter.consumer definition code for java.awt.image.ImageFilter.consumer
 
Fields inherited from interface java.awt.image.ImageConsumer sample code for java.awt.image.ImageConsumer definition code for java.awt.image.ImageConsumer
COMPLETESCANLINES sample code for java.awt.image.ImageConsumer.COMPLETESCANLINES definition code for java.awt.image.ImageConsumer.COMPLETESCANLINES , IMAGEABORTED sample code for java.awt.image.ImageConsumer.IMAGEABORTED definition code for java.awt.image.ImageConsumer.IMAGEABORTED , IMAGEERROR sample code for java.awt.image.ImageConsumer.IMAGEERROR definition code for java.awt.image.ImageConsumer.IMAGEERROR , RANDOMPIXELORDER sample code for java.awt.image.ImageConsumer.RANDOMPIXELORDER definition code for java.awt.image.ImageConsumer.RANDOMPIXELORDER , SINGLEFRAME sample code for java.awt.image.ImageConsumer.SINGLEFRAME definition code for java.awt.image.ImageConsumer.SINGLEFRAME , SINGLEFRAMEDONE sample code for java.awt.image.ImageConsumer.SINGLEFRAMEDONE definition code for java.awt.image.ImageConsumer.SINGLEFRAMEDONE , SINGLEPASS sample code for java.awt.image.ImageConsumer.SINGLEPASS definition code for java.awt.image.ImageConsumer.SINGLEPASS , STATICIMAGEDONE sample code for java.awt.image.ImageConsumer.STATICIMAGEDONE definition code for java.awt.image.ImageConsumer.STATICIMAGEDONE , TOPDOWNLEFTRIGHT sample code for java.awt.image.ImageConsumer.TOPDOWNLEFTRIGHT definition code for java.awt.image.ImageConsumer.TOPDOWNLEFTRIGHT
 
Constructor Summary
GrayFilter sample code for javax.swing.GrayFilter.GrayFilter(boolean, int) definition code for javax.swing.GrayFilter.GrayFilter(boolean, int) (boolean b, int p)
          Constructs a GrayFilter object that filters a color image to a grayscale image.
 
Method Summary
static Image sample code for java.awt.Image definition code for java.awt.Image createDisabledImage sample code for javax.swing.GrayFilter.createDisabledImage(java.awt.Image) definition code for javax.swing.GrayFilter.createDisabledImage(java.awt.Image) (Image sample code for java.awt.Image definition code for java.awt.Image  i)
          Creates a disabled image
 int filterRGB sample code for javax.swing.GrayFilter.filterRGB(int, int, int) definition code for javax.swing.GrayFilter.filterRGB(int, int, int) (int x, int y, int rgb)
          Overrides RGBImageFilter.filterRGB.
 
Methods inherited from class java.awt.image.RGBImageFilter sample code for java.awt.image.RGBImageFilter definition code for java.awt.image.RGBImageFilter
filterIndexColorModel sample code for java.awt.image.RGBImageFilter.filterIndexColorModel(java.awt.image.IndexColorModel) definition code for java.awt.image.RGBImageFilter.filterIndexColorModel(java.awt.image.IndexColorModel) , filterRGBPixels sample code for java.awt.image.RGBImageFilter.filterRGBPixels(int, int, int, int, int[], int, int) definition code for java.awt.image.RGBImageFilter.filterRGBPixels(int, int, int, int, int[], int, int) , setColorModel sample code for java.awt.image.RGBImageFilter.setColorModel(java.awt.image.ColorModel) definition code for java.awt.image.RGBImageFilter.setColorModel(java.awt.image.ColorModel) , setPixels sample code for java.awt.image.RGBImageFilter.setPixels(int, int, int, int, java.awt.image.ColorModel, byte[], int, int) definition code for java.awt.image.RGBImageFilter.setPixels(int, int, int, int, java.awt.image.ColorModel, byte[], int, int) , setPixels sample code for java.awt.image.RGBImageFilter.setPixels(int, int, int, int, java.awt.image.ColorModel, int[], int, int) definition code for java.awt.image.RGBImageFilter.setPixels(int, int, int, int, java.awt.image.ColorModel, int[], int, int) , substituteColorModel sample code for java.awt.image.RGBImageFilter.substituteColorModel(java.awt.image.ColorModel, java.awt.image.ColorModel) definition code for java.awt.image.RGBImageFilter.substituteColorModel(java.awt.image.ColorModel, java.awt.image.ColorModel)
 
Methods inherited from class java.awt.image.ImageFilter sample code for java.awt.image.ImageFilter definition code for java.awt.image.ImageFilter
clone sample code for java.awt.image.ImageFilter.clone() definition code for java.awt.image.ImageFilter.clone() , getFilterInstance sample code for java.awt.image.ImageFilter.getFilterInstance(java.awt.image.ImageConsumer) definition code for java.awt.image.ImageFilter.getFilterInstance(java.awt.image.ImageConsumer) , imageComplete sample code for java.awt.image.ImageFilter.imageComplete(int) definition code for java.awt.image.ImageFilter.imageComplete(int) , resendTopDownLeftRight sample code for java.awt.image.ImageFilter.resendTopDownLeftRight(java.awt.image.ImageProducer) definition code for java.awt.image.ImageFilter.resendTopDownLeftRight(java.awt.image.ImageProducer) , setDimensions sample code for java.awt.image.ImageFilter.setDimensions(int, int) definition code for java.awt.image.ImageFilter.setDimensions(int, int) , setHints sample code for java.awt.image.ImageFilter.setHints(int) definition code for java.awt.image.ImageFilter.setHints(int) , setProperties sample code for java.awt.image.ImageFilter.setProperties(java.util.Hashtable) definition code for java.awt.image.ImageFilter.setProperties(java.util.Hashtable)
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

GrayFilter sample code for javax.swing.GrayFilter(boolean, int) definition code for javax.swing.GrayFilter(boolean, int)

public GrayFilter(boolean b,
                  int p)
Constructs a GrayFilter object that filters a color image to a grayscale image. Used by buttons to create disabled ("grayed out") button images.

Parameters:
b - a boolean -- true if the pixels should be brightened
p - an int in the range 0..100 that determines the percentage of gray, where 100 is the darkest gray, and 0 is the lightest
Method Detail

createDisabledImage sample code for javax.swing.GrayFilter.createDisabledImage(java.awt.Image) definition code for javax.swing.GrayFilter.createDisabledImage(java.awt.Image)

public static Image sample code for java.awt.Image definition code for java.awt.Image  createDisabledImage(Image sample code for java.awt.Image definition code for java.awt.Image  i)
Creates a disabled image


filterRGB sample code for javax.swing.GrayFilter.filterRGB(int, int, int) definition code for javax.swing.GrayFilter.filterRGB(int, int, int)

public int filterRGB(int x,
                     int y,
                     int rgb)
Overrides RGBImageFilter.filterRGB.

Specified by:
filterRGB sample code for java.awt.image.RGBImageFilter.filterRGB(int, int, int) definition code for java.awt.image.RGBImageFilter.filterRGB(int, int, int) in class RGBImageFilter sample code for java.awt.image.RGBImageFilter definition code for java.awt.image.RGBImageFilter
rgb - the integer pixel representation in the default RGB color model
Returns:
a filtered pixel in the default RGB color model.
See Also:
ColorModel.getRGBdefault() sample code for java.awt.image.ColorModel.getRGBdefault() definition code for java.awt.image.ColorModel.getRGBdefault() , RGBImageFilter.filterRGBPixels(int, int, int, int, int[], int, int) sample code for java.awt.image.RGBImageFilter.filterRGBPixels(int, int, int, int, int[], int, int) definition code for java.awt.image.RGBImageFilter.filterRGBPixels(int, int, int, int, int[], int, int)