KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > swing > DebugGraphicsFilter


1 /*
2  * @(#)DebugGraphicsFilter.java 1.11 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.swing;
9
10 import java.awt.*;
11 import java.awt.image.*;
12
13 /** Color filter for DebugGraphics, used for images only.
14   *
15   * @version 1.11 12/19/03
16   * @author Dave Karlton
17   */

18 class DebugGraphicsFilter extends RGBImageFilter {
19     Color color;
20
21     DebugGraphicsFilter(Color c) {
22         canFilterIndexColorModel = true;
23         color = c;
24     }
25
26     public int filterRGB(int x, int y, int rgb) {
27         return color.getRGB() | (rgb & 0xFF000000);
28     }
29 }
30
Popular Tags