KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > swing > DebugGraphicsObserver


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
8 package javax.swing;
9
10 import java.awt.*;
11 import java.awt.image.*;
12
13 /** ImageObserver for DebugGraphics, used for images only.
14   *
15   * @version 1.11 12/19/03
16   * @author Dave Karlton
17   */

18 class DebugGraphicsObserver implements ImageObserver {
19     int lastInfo;
20
21     synchronized boolean allBitsPresent() {
22         return (lastInfo & ImageObserver.ALLBITS) != 0;
23     }
24
25     synchronized boolean imageHasProblem() {
26         return ((lastInfo & ImageObserver.ERROR) != 0 ||
27                 (lastInfo & ImageObserver.ABORT) != 0);
28     }
29
30     public synchronized boolean imageUpdate(Image img, int infoflags,
31                                             int x, int y,
32                                             int width, int height) {
33         lastInfo = infoflags;
34         return true;
35     }
36 }
37
Popular Tags