1. /*
  2. * @(#)DebugGraphicsObserver.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. /** ImageObserver for DebugGraphics, used for images only.
  14. *
  15. * @version 1.8 02/02/00
  16. * @author Dave Karlton
  17. */
  18. class DebugGraphicsObserver implements ImageObserver {
  19. int lastInfo;
  20. synchronized boolean allBitsPresent() {
  21. return (lastInfo & ImageObserver.ALLBITS) != 0;
  22. }
  23. synchronized boolean imageHasProblem() {
  24. return ((lastInfo & ImageObserver.ERROR) != 0 ||
  25. (lastInfo & ImageObserver.ABORT) != 0);
  26. }
  27. public synchronized boolean imageUpdate(Image img, int infoflags,
  28. int x, int y,
  29. int width, int height) {
  30. lastInfo = infoflags;
  31. return true;
  32. }
  33. }