.class public AnimatorRun

.super joos/lib/JoosRunnable

.field private protected myApplet LAnimator;
.field private protected myImages Ljava/util/Vector;
.field private protected myTracker Ljava/awt/MediaTracker;

.method public <init>(LAnimator;Ljava/util/Vector;Ljava/awt/MediaTracker;)V
  .limit locals 4
  .limit stack 3
  aload_0
  invokenonvirtual joos/lib/JoosRunnable/<init>()V
  aload_0
  aload_1
  putfield AnimatorRun/myApplet LAnimator;
  aload_0
  aload_2
  putfield AnimatorRun/myImages Ljava/util/Vector;
  aload_0
  aload_3
  putfield AnimatorRun/myTracker Ljava/awt/MediaTracker;
  return
.end method

.method public waitForLoading()V
  .limit locals 4
  .limit stack 5
  new joos/lib/JoosMediaTracker
  dup
  aload_0
  getfield AnimatorRun/myTracker Ljava/awt/MediaTracker;
  invokenonvirtual joos/lib/JoosMediaTracker/<init>(Ljava/awt/MediaTracker;)V
  astore_3
  aload_0
  getfield AnimatorRun/myImages Ljava/util/Vector;
  invokevirtual java/util/Vector/size()I
  istore_2
  iconst_0
  istore_1
  start_0:
  iload_1
  iload_2
  if_icmpge stop_1
  aload_0
  getfield AnimatorRun/myApplet LAnimator;
  ldc "Loading image: "
  new java/lang/Integer
  dup
  iload_1
  invokenonvirtual java/lang/Integer/<init>(I)V
  invokevirtual java/lang/Integer/toString()Ljava/lang/String;
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  dup
  ifnonnull stop_5
  pop
  ldc "null"
  stop_5:
  ldc "  "
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  invokevirtual java/applet/Applet/showStatus(Ljava/lang/String;)V
  aload_3
  iload_1
  invokevirtual joos/lib/JoosMediaTracker/waitForID(I)Z
  pop
  aload_0
  getfield AnimatorRun/myTracker Ljava/awt/MediaTracker;
  iload_1
  invokevirtual java/awt/MediaTracker/isErrorID(I)Z
  ifeq stop_12
  aload_0
  getfield AnimatorRun/myApplet LAnimator;
  ldc "Error loading image "
  new java/lang/Integer
  dup
  iload_1
  invokenonvirtual java/lang/Integer/<init>(I)V
  invokevirtual java/lang/Integer/toString()Ljava/lang/String;
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  dup
  ifnonnull stop_14
  pop
  ldc "null"
  stop_14:
  ldc " .. quitting"
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  invokevirtual java/applet/Applet/showStatus(Ljava/lang/String;)V
  return
  stop_12:
  iinc 1 1
  goto start_0
  stop_1:
  aload_0
  getfield AnimatorRun/myApplet LAnimator;
  new java/lang/Integer
  dup
  iload_2
  invokenonvirtual java/lang/Integer/<init>(I)V
  invokevirtual java/lang/Integer/toString()Ljava/lang/String;
  ldc " images loaded."
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  invokevirtual java/applet/Applet/showStatus(Ljava/lang/String;)V
  return
.end method

.method public run()V
  .limit locals 2
  .limit stack 5
  aload_0
  invokevirtual AnimatorRun/waitForLoading()V
  iconst_0
  istore_1
  start_0:
  iconst_1
  ifeq stop_1
  iinc 1 1
  iload_1
  aload_0
  getfield AnimatorRun/myImages Ljava/util/Vector;
  invokevirtual java/util/Vector/size()I
  if_icmplt stop_2
  iconst_0
  istore_1
  stop_2:
  aload_0
  getfield AnimatorRun/myApplet LAnimator;
  invokevirtual java/awt/Component/getGraphics()Ljava/awt/Graphics;
  aload_0
  getfield AnimatorRun/myImages Ljava/util/Vector;
  iload_1
  invokevirtual java/util/Vector/elementAt(I)Ljava/lang/Object;
  checkcast java/awt/Image
  iconst_0
  iconst_0
  aload_0
  getfield AnimatorRun/myApplet LAnimator;
  invokevirtual java/awt/Graphics/drawImage(Ljava/awt/Image;IILjava/awt/image/ImageObserver;)Z
  pop
  aload_0
  getfield AnimatorRun/myApplet LAnimator;
  invokevirtual java/awt/Component/getToolkit()Ljava/awt/Toolkit;
  invokevirtual java/awt/Toolkit/sync()V
  new joos/lib/JoosThread
  dup
  aconst_null
  invokenonvirtual joos/lib/JoosThread/<init>(Ljava/lang/Thread;)V
  ldc 200
  invokevirtual joos/lib/JoosThread/sleep(I)Z
  pop
  goto start_0
  stop_1:
  return
.end method

