home *** CD-ROM | disk | FTP | other *** search
- package java.awt;
-
- import java.awt.image.ImageObserver;
-
- class ImageMediaEntry extends MediaEntry implements ImageObserver {
- Image image;
- int width;
- int height;
-
- ImageMediaEntry(MediaTracker mt, Image img, int c, int w, int h) {
- super(mt, c);
- this.image = img;
- this.width = w;
- this.height = h;
- }
-
- Object getMedia() {
- return this.image;
- }
-
- void startLoad() {
- if (super.tracker.target.prepareImage(this.image, this.width, this.height, this)) {
- ((MediaEntry)this).setStatus(8);
- }
-
- }
-
- public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h) {
- if ((infoflags & 64) != 0) {
- ((MediaEntry)this).setStatus(4);
- } else if ((infoflags & 128) != 0) {
- ((MediaEntry)this).setStatus(2);
- } else if ((infoflags & 48) != 0) {
- ((MediaEntry)this).setStatus(8);
- }
-
- return true;
- }
- }
-