.class public Animator

.super java/applet/Applet

.field private protected images Ljava/util/Vector;
.field private protected animator_thread Ljava/lang/Thread;
.field private protected tracker Ljava/awt/MediaTracker;

.method public <init>()V
  .limit locals 1
  .limit stack 3
  aload_0
  invokenonvirtual java/applet/Applet/<init>()V
  aload_0
  aconst_null
  putfield Animator/animator_thread Ljava/lang/Thread;
  return
.end method

.method public init()V
  .limit locals 4
  .limit stack 7
  aload_0
  ldc "basename"
  invokevirtual java/applet/Applet/getParameter(Ljava/lang/String;)Ljava/lang/String;
  astore_1
  new joos/lib/JoosString
  dup
  aload_0
  ldc "num_images"
  invokevirtual java/applet/Applet/getParameter(Ljava/lang/String;)Ljava/lang/String;
  invokenonvirtual joos/lib/JoosString/<init>(Ljava/lang/String;)V
  invokevirtual joos/lib/JoosString/string2Int()I
  istore_3
  new java/awt/MediaTracker
  dup
  aload_0
  invokenonvirtual java/awt/MediaTracker/<init>(Ljava/awt/Component;)V
  aload_0
  swap
  putfield Animator/tracker Ljava/awt/MediaTracker;
  new java/util/Vector
  dup
  iload_3
  iconst_1
  invokenonvirtual java/util/Vector/<init>(II)V
  aload_0
  swap
  putfield Animator/images Ljava/util/Vector;
  iconst_0
  istore_2
  start_0:
  iload_2
  iload_3
  if_icmpge stop_1
  aload_0
  getfield Animator/images Ljava/util/Vector;
  aload_0
  aload_0
  invokevirtual java/applet/Applet/getDocumentBase()Ljava/net/URL;
  aload_1
  dup
  ifnonnull stop_5
  pop
  ldc "null"
  stop_5:
  new java/lang/Integer
  dup
  iload_2
  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;
  invokevirtual java/applet/Applet/getImage(Ljava/net/URL;Ljava/lang/String;)Ljava/awt/Image;
  invokevirtual java/util/Vector/addElement(Ljava/lang/Object;)V
  aload_0
  getfield Animator/tracker Ljava/awt/MediaTracker;
  aload_0
  getfield Animator/images Ljava/util/Vector;
  iload_2
  invokevirtual java/util/Vector/elementAt(I)Ljava/lang/Object;
  checkcast java/awt/Image
  iload_2
  invokevirtual java/awt/MediaTracker/addImage(Ljava/awt/Image;I)V
  iinc 2 1
  goto start_0
  stop_1:
  return
.end method

.method public start()V
  .limit locals 1
  .limit stack 7
  aload_0
  getfield Animator/animator_thread Ljava/lang/Thread;
  aconst_null
  if_acmpne stop_0
  new java/lang/Thread
  dup
  new AnimatorRun
  dup
  aload_0
  aload_0
  getfield Animator/images Ljava/util/Vector;
  aload_0
  getfield Animator/tracker Ljava/awt/MediaTracker;
  invokenonvirtual AnimatorRun/<init>(LAnimator;Ljava/util/Vector;Ljava/awt/MediaTracker;)V
  invokenonvirtual java/lang/Thread/<init>(Ljava/lang/Runnable;)V
  aload_0
  swap
  putfield Animator/animator_thread Ljava/lang/Thread;
  aload_0
  getfield Animator/animator_thread Ljava/lang/Thread;
  invokevirtual java/lang/Thread/start()V
  stop_0:
  return
.end method

.method public stop()V
  .limit locals 1
  .limit stack 3
  aload_0
  getfield Animator/animator_thread Ljava/lang/Thread;
  aconst_null
  if_acmpne true_2
  iconst_0
  goto stop_3
  true_2:
  iconst_1
  stop_3:
  dup
  ifeq false_1
  pop
  aload_0
  getfield Animator/animator_thread Ljava/lang/Thread;
  invokevirtual java/lang/Thread/isAlive()Z
  false_1:
  ifeq stop_0
  aload_0
  getfield Animator/animator_thread Ljava/lang/Thread;
  invokevirtual java/lang/Thread/stop()V
  stop_0:
  aload_0
  aconst_null
  putfield Animator/animator_thread Ljava/lang/Thread;
  return
.end method

