1. /*
  2. * @(#)DebugGraphicsObserver.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. package javax.swing;
  8. import java.awt.*;
  9. import java.awt.image.*;
  10. /** ImageObserver for DebugGraphics, used for images only.
  11. *
  12. * @version 1.11 12/19/03
  13. * @author Dave Karlton
  14. */
  15. class DebugGraphicsObserver implements ImageObserver {
  16. int lastInfo;
  17. synchronized boolean allBitsPresent() {
  18. return (lastInfo & ImageObserver.ALLBITS) != 0;
  19. }
  20. synchronized boolean imageHasProblem() {
  21. return ((lastInfo & ImageObserver.ERROR) != 0 ||
  22. (lastInfo & ImageObserver.ABORT) != 0);
  23. }
  24. public synchronized boolean imageUpdate(Image img, int infoflags,
  25. int x, int y,
  26. int width, int height) {
  27. lastInfo = infoflags;
  28. return true;
  29. }
  30. }