home *** CD-ROM | disk | FTP | other *** search
- import java.applet.Applet;
- import java.awt.Component;
- import java.awt.Dimension;
- import java.awt.Graphics;
- import java.awt.Image;
- import java.awt.image.ImageObserver;
-
- public class ObservedImageLoad extends Applet implements Runnable, ImageObserver {
- Image art;
- // $FF: renamed from: d java.awt.Dimension
- Dimension field_0;
- int progress;
- Thread motor;
- boolean loaded;
-
- public void init() {
- this.art = ((Applet)this).getImage(((Applet)this).getDocumentBase(), ((Applet)this).getParameter("img"));
- this.loaded = false;
- this.progress = 0;
- }
-
- public void paint(Graphics var1) {
- this.field_0 = ((Component)this).getSize();
- this.loaded = var1.drawImage(this.art, 0, 0, this);
- }
-
- public boolean imageUpdate(Image var1, int var2, int var3, int var4, int var5, int var6) {
- if ((var2 & 32) != 1) {
- if (this.progress < this.field_0.height) {
- this.progress += var6;
- }
-
- System.out.println(this.progress + "/" + this.field_0.height);
- return true;
- } else {
- return false;
- }
- }
-
- public void start() {
- this.motor = new Thread(this);
- this.motor.start();
- }
-
- public void stop() {
- this.motor.stop();
- }
-
- public void run() {
- this.motor.setPriority(1);
-
- while(!this.loaded) {
- ((Component)this).repaint();
-
- try {
- Thread.sleep(200L);
- } catch (InterruptedException var1) {
- }
- }
-
- }
- }
-