1. /*
  2. * @(#)DebugGraphicsFilter.java 1.8 00/02/02
  3. *
  4. * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package javax.swing;
  11. import java.awt.*;
  12. import java.awt.image.*;
  13. /** Color filter for DebugGraphics, used for images only.
  14. *
  15. * @version 1.8 02/02/00
  16. * @author Dave Karlton
  17. */
  18. class DebugGraphicsFilter extends RGBImageFilter {
  19. Color color;
  20. DebugGraphicsFilter(Color c) {
  21. canFilterIndexColorModel = true;
  22. color = c;
  23. }
  24. public int filterRGB(int x, int y, int rgb) {
  25. return color.getRGB() | (rgb & 0xFF000000);
  26. }
  27. }