.class public AllEvents

.super AllComponents

.method public <init>(Ljava/lang/String;)V
  .limit locals 2
  .limit stack 2
  aload_0
  aload_1
  invokenonvirtual AllComponents/<init>(Ljava/lang/String;)V
  return
.end method

.method public handleEvent(Ljava/awt/Event;)Z
  .limit locals 8
  .limit stack 7
  new joos/lib/JoosConstants
  dup
  invokenonvirtual joos/lib/JoosConstants/<init>()V
  astore_3
  new joos/lib/JoosEvent
  dup
  aload_1
  invokenonvirtual joos/lib/JoosEvent/<init>(Ljava/awt/Event;)V
  astore_2
  aload_2
  invokevirtual joos/lib/JoosEvent/target()Ljava/lang/Object;
  astore 4
  aload_2
  invokevirtual joos/lib/JoosEvent/id()I
  istore 5
  aload_2
  invokevirtual joos/lib/JoosEvent/arg()Ljava/lang/Object;
  astore 6
  iload 5
  aload_3
  invokevirtual joos/lib/JoosConstants/ACTION_EVENT()I
  if_icmpne else_0
  aload 4
  aload_0
  getfield AllComponents/textfield Ljava/awt/TextField;
  if_acmpne else_4
  aload_0
  getfield AllComponents/textarea Ljava/awt/TextArea;
  ldc "Your name is: "
  aload 6
  dup
  ifnull null_12
  invokevirtual java/lang/Object/toString()Ljava/lang/String;
  goto stop_13
  null_12:
  pop
  ldc "null"
  stop_13:
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  dup
  ifnonnull stop_9
  pop
  ldc "null"
  stop_9:
  ldc "\n"
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  invokevirtual java/awt/TextComponent/setText(Ljava/lang/String;)V
  goto stop_1
  else_4:
  aload 4
  aload_0
  getfield AllComponents/choice Ljava/awt/Choice;
  if_acmpne else_16
  aload_0
  getfield AllComponents/textarea Ljava/awt/TextArea;
  ldc "Your favorite color is: "
  aload 6
  dup
  ifnull null_24
  invokevirtual java/lang/Object/toString()Ljava/lang/String;
  goto stop_25
  null_24:
  pop
  ldc "null"
  stop_25:
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  dup
  ifnonnull stop_21
  pop
  ldc "null"
  stop_21:
  ldc "\n"
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  invokevirtual java/awt/TextComponent/setText(Ljava/lang/String;)V
  goto stop_1
  else_16:
  aload 4
  aload_0
  getfield AllComponents/checkboxes Ljava/util/Vector;
  iconst_0
  invokevirtual java/util/Vector/elementAt(I)Ljava/lang/Object;
  if_acmpeq true_32
  iconst_0
  goto stop_33
  true_32:
  iconst_1
  stop_33:
  dup
  ifne true_30
  pop
  aload 4
  aload_0
  getfield AllComponents/checkboxes Ljava/util/Vector;
  iconst_1
  invokevirtual java/util/Vector/elementAt(I)Ljava/lang/Object;
  if_acmpeq true_34
  iconst_0
  goto stop_35
  true_34:
  iconst_1
  stop_35:
  dup
  ifne true_30
  pop
  aload 4
  aload_0
  getfield AllComponents/checkboxes Ljava/util/Vector;
  iconst_2
  invokevirtual java/util/Vector/elementAt(I)Ljava/lang/Object;
  if_acmpeq true_36
  iconst_0
  goto stop_37
  true_36:
  iconst_1
  stop_37:
  true_30:
  ifeq else_28
  aload_0
  getfield AllComponents/textarea Ljava/awt/TextArea;
  ldc "Your favorite flavor is: "
  aload_0
  getfield AllComponents/checkbox_group Ljava/awt/CheckboxGroup;
  invokevirtual java/awt/CheckboxGroup/getCurrent()Ljava/awt/Checkbox;
  invokevirtual java/awt/Checkbox/getLabel()Ljava/lang/String;
  dup
  ifnonnull stop_43
  pop
  ldc "null"
  stop_43:
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  dup
  ifnonnull stop_39
  pop
  ldc "null"
  stop_39:
  ldc "\n"
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  invokevirtual java/awt/TextComponent/setText(Ljava/lang/String;)V
  goto stop_1
  else_28:
  aload 4
  aload_0
  getfield AllComponents/mylist Ljava/awt/List;
  if_acmpne else_46
  aload_0
  getfield AllComponents/textarea Ljava/awt/TextArea;
  ldc "You double-clicked on: "
  aload 6
  dup
  ifnull null_54
  invokevirtual java/lang/Object/toString()Ljava/lang/String;
  goto stop_55
  null_54:
  pop
  ldc "null"
  stop_55:
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  dup
  ifnonnull stop_51
  pop
  ldc "null"
  stop_51:
  ldc "\n"
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  invokevirtual java/awt/TextComponent/setText(Ljava/lang/String;)V
  goto stop_1
  else_46:
  aload 4
  aload_0
  getfield AllComponents/okay Ljava/awt/Button;
  if_acmpne else_58
  aload_0
  getfield AllComponents/textarea Ljava/awt/TextArea;
  ldc "Okay button clicked.\n"
  invokevirtual java/awt/TextComponent/setText(Ljava/lang/String;)V
  goto stop_1
  else_58:
  aload 4
  aload_0
  getfield AllComponents/cancel Ljava/awt/Button;
  if_acmpne else_62
  aload_0
  getfield AllComponents/textarea Ljava/awt/TextArea;
  ldc "Cancel button clicked.\n"
  invokevirtual java/awt/TextComponent/setText(Ljava/lang/String;)V
  goto stop_1
  else_62:
  aload 4
  instanceof java/awt/MenuItem
  ifeq else_66
  aload 6
  checkcast java/lang/String
  ldc "Quit"
  invokevirtual java/lang/String/equals(Ljava/lang/Object;)Z
  ifeq else_68
  new ReallyQuitDialog
  dup
  aload_0
  aload_0
  getfield AllComponents/textarea Ljava/awt/TextArea;
  invokenonvirtual ReallyQuitDialog/<init>(Ljava/awt/Frame;Ljava/awt/TextComponent;)V
  astore 7
  aload 7
  invokevirtual java/awt/Window/show()V
  aload_0
  getfield AllComponents/textarea Ljava/awt/TextArea;
  ldc "You selected Quit\n"
  invokevirtual java/awt/TextComponent/setText(Ljava/lang/String;)V
  goto stop_1
  else_68:
  aload 6
  checkcast java/lang/String
  ldc "Open"
  invokevirtual java/lang/String/equals(Ljava/lang/Object;)Z
  ifeq else_70
  aload_0
  getfield AllComponents/textarea Ljava/awt/TextArea;
  ldc "You selected Open.\n"
  invokevirtual java/awt/TextComponent/setText(Ljava/lang/String;)V
  aload_0
  getfield AllComponents/file_dialog Ljava/awt/FileDialog;
  invokevirtual java/awt/Window/pack()V
  aload_0
  getfield AllComponents/file_dialog Ljava/awt/FileDialog;
  invokevirtual java/awt/Window/show()V
  aload_0
  getfield AllComponents/textarea Ljava/awt/TextArea;
  ldc "You selected file: "
  aload_0
  getfield AllComponents/file_dialog Ljava/awt/FileDialog;
  invokevirtual java/awt/FileDialog/getFile()Ljava/lang/String;
  dup
  ifnonnull stop_75
  pop
  ldc "null"
  stop_75:
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  invokevirtual java/awt/TextComponent/setText(Ljava/lang/String;)V
  goto stop_1
  else_70:
  aload 6
  checkcast java/lang/String
  ldc "About"
  invokevirtual java/lang/String/equals(Ljava/lang/Object;)Z
  ifeq stop_76
  new InfoDialog
  dup
  aload_0
  ldc "About AWT Demo"
  ldc "This demo was written by David Flanagan\n"
  ldc "Copyright (c) 1996 O'Reilly & Associates\n"
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  dup
  ifnonnull stop_78
  pop
  ldc "null"
  stop_78:
  ldc "Modified by Laurie Hendren to work with JOOS"
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  invokenonvirtual InfoDialog/<init>(Ljava/awt/Frame;Ljava/lang/String;Ljava/lang/String;)V
  astore 7
  aload 7
  invokevirtual java/awt/Window/show()V
  aload_0
  getfield AllComponents/textarea Ljava/awt/TextArea;
  ldc "You selected About.\n"
  invokevirtual java/awt/TextComponent/setText(Ljava/lang/String;)V
  stop_76:
  goto stop_1
  else_66:
  aload_0
  getfield AllComponents/textarea Ljava/awt/TextArea;
  ldc "Unknown action event."
  invokevirtual java/awt/TextComponent/setText(Ljava/lang/String;)V
  goto stop_1
  else_0:
  iload 5
  aload_3
  invokevirtual joos/lib/JoosConstants/LIST_SELECT()I
  if_icmpne else_85
  aload_0
  getfield AllComponents/textarea Ljava/awt/TextArea;
  ldc "You selected: "
  aload_0
  getfield AllComponents/mylist Ljava/awt/List;
  aload 6
  checkcast java/lang/Integer
  invokevirtual java/lang/Integer/intValue()I
  invokevirtual java/awt/List/getItem(I)Ljava/lang/String;
  dup
  ifnonnull stop_94
  pop
  ldc "null"
  stop_94:
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  dup
  ifnonnull stop_90
  pop
  ldc "null"
  stop_90:
  ldc "\n"
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  invokevirtual java/awt/TextComponent/setText(Ljava/lang/String;)V
  goto stop_86
  else_85:
  iload 5
  aload_3
  invokevirtual joos/lib/JoosConstants/LIST_DESELECT()I
  if_icmpne else_97
  aload_0
  getfield AllComponents/textarea Ljava/awt/TextArea;
  ldc "You deselected: "
  aload_0
  getfield AllComponents/mylist Ljava/awt/List;
  aload 6
  checkcast java/lang/Integer
  invokevirtual java/lang/Integer/intValue()I
  invokevirtual java/awt/List/getItem(I)Ljava/lang/String;
  dup
  ifnonnull stop_106
  pop
  ldc "null"
  stop_106:
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  dup
  ifnonnull stop_102
  pop
  ldc "null"
  stop_102:
  ldc "\n"
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  invokevirtual java/awt/TextComponent/setText(Ljava/lang/String;)V
  goto stop_98
  else_97:
  iload 5
  aload_3
  invokevirtual joos/lib/JoosConstants/WINDOW_DESTROY()I
  if_icmpne else_109
  aload_0
  getfield AllComponents/textarea Ljava/awt/TextArea;
  ldc "Window Destroy\n"
  invokevirtual java/awt/TextComponent/setText(Ljava/lang/String;)V
  goto stop_110
  else_109:
  iload 5
  aload_3
  invokevirtual joos/lib/JoosConstants/WINDOW_ICONIFY()I
  if_icmpne else_113
  aload_0
  getfield AllComponents/textarea Ljava/awt/TextArea;
  ldc "Window iconify\n"
  invokevirtual java/awt/TextComponent/setText(Ljava/lang/String;)V
  goto stop_114
  else_113:
  iload 5
  aload_3
  invokevirtual joos/lib/JoosConstants/WINDOW_DEICONIFY()I
  if_icmpne else_117
  aload_0
  getfield AllComponents/textarea Ljava/awt/TextArea;
  ldc "Window deiconify\n"
  invokevirtual java/awt/TextComponent/setText(Ljava/lang/String;)V
  goto stop_118
  else_117:
  iload 5
  aload_3
  invokevirtual joos/lib/JoosConstants/WINDOW_MOVED()I
  if_icmpne else_121
  aload_0
  getfield AllComponents/textarea Ljava/awt/TextArea;
  ldc "Window moved\n"
  invokevirtual java/awt/TextComponent/setText(Ljava/lang/String;)V
  goto stop_122
  else_121:
  iload 5
  aload_3
  invokevirtual joos/lib/JoosConstants/MOUSE_DOWN()I
  if_icmpne else_125
  aload_0
  getfield AllComponents/textarea Ljava/awt/TextArea;
  ldc "Mouse down: ["
  new java/lang/Integer
  dup
  aload_2
  invokevirtual joos/lib/JoosEvent/x()I
  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_134
  pop
  ldc "null"
  stop_134:
  ldc ","
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  dup
  ifnonnull stop_132
  pop
  ldc "null"
  stop_132:
  new java/lang/Integer
  dup
  aload_2
  invokevirtual joos/lib/JoosEvent/y()I
  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_130
  pop
  ldc "null"
  stop_130:
  ldc "]\n"
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  invokevirtual java/awt/TextComponent/setText(Ljava/lang/String;)V
  iconst_0
  ireturn
  else_125:
  iload 5
  aload_3
  invokevirtual joos/lib/JoosConstants/MOUSE_UP()I
  if_icmpne else_145
  aload_0
  getfield AllComponents/textarea Ljava/awt/TextArea;
  ldc "Mouse up: ["
  new java/lang/Integer
  dup
  aload_2
  invokevirtual joos/lib/JoosEvent/x()I
  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_154
  pop
  ldc "null"
  stop_154:
  ldc ","
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  dup
  ifnonnull stop_152
  pop
  ldc "null"
  stop_152:
  new java/lang/Integer
  dup
  aload_2
  invokevirtual joos/lib/JoosEvent/y()I
  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_150
  pop
  ldc "null"
  stop_150:
  ldc "]\n"
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  invokevirtual java/awt/TextComponent/setText(Ljava/lang/String;)V
  iconst_0
  ireturn
  else_145:
  iload 5
  aload_3
  invokevirtual joos/lib/JoosConstants/MOUSE_DRAG()I
  if_icmpne else_165
  aload_0
  getfield AllComponents/textarea Ljava/awt/TextArea;
  ldc "Mouse drag: ["
  new java/lang/Integer
  dup
  aload_2
  invokevirtual joos/lib/JoosEvent/x()I
  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_174
  pop
  ldc "null"
  stop_174:
  ldc ","
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  dup
  ifnonnull stop_172
  pop
  ldc "null"
  stop_172:
  new java/lang/Integer
  dup
  aload_2
  invokevirtual joos/lib/JoosEvent/y()I
  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_170
  pop
  ldc "null"
  stop_170:
  ldc "]\n"
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  invokevirtual java/awt/TextComponent/setText(Ljava/lang/String;)V
  iconst_0
  ireturn
  else_165:
  iload 5
  aload_3
  invokevirtual joos/lib/JoosConstants/KEY_PRESS()I
  if_icmpeq true_188
  iconst_0
  goto stop_189
  true_188:
  iconst_1
  stop_189:
  dup
  ifne true_187
  pop
  iload 5
  aload_3
  invokevirtual joos/lib/JoosConstants/KEY_ACTION()I
  if_icmpeq true_190
  iconst_0
  goto stop_191
  true_190:
  iconst_1
  stop_191:
  true_187:
  ifeq else_185
  aload_0
  getfield AllComponents/textarea Ljava/awt/TextArea;
  ldc "Key press\n"
  invokevirtual java/awt/TextComponent/setText(Ljava/lang/String;)V
  iconst_0
  ireturn
  else_185:
  iload 5
  aload_3
  invokevirtual joos/lib/JoosConstants/KEY_RELEASE()I
  if_icmpeq true_195
  iconst_0
  goto stop_196
  true_195:
  iconst_1
  stop_196:
  dup
  ifne true_194
  pop
  iload 5
  aload_3
  invokevirtual joos/lib/JoosConstants/KEY_ACTION_RELEASE()I
  if_icmpeq true_197
  iconst_0
  goto stop_198
  true_197:
  iconst_1
  stop_198:
  true_194:
  ifeq else_192
  aload_0
  getfield AllComponents/textarea Ljava/awt/TextArea;
  ldc "Key release\n"
  invokevirtual java/awt/TextComponent/setText(Ljava/lang/String;)V
  iconst_0
  ireturn
  else_192:
  iload 5
  aload_3
  invokevirtual joos/lib/JoosConstants/GOT_FOCUS()I
  if_icmpeq true_205
  iconst_0
  goto stop_206
  true_205:
  iconst_1
  stop_206:
  dup
  ifne true_201
  pop
  iload 5
  aload_3
  invokevirtual joos/lib/JoosConstants/LOST_FOCUS()I
  if_icmpeq true_207
  iconst_0
  goto stop_208
  true_207:
  iconst_1
  stop_208:
  dup
  ifne true_201
  pop
  iload 5
  aload_3
  invokevirtual joos/lib/JoosConstants/MOUSE_ENTER()I
  if_icmpeq true_209
  iconst_0
  goto stop_210
  true_209:
  iconst_1
  stop_210:
  true_203:
  dup
  ifne true_201
  pop
  iload 5
  aload_3
  invokevirtual joos/lib/JoosConstants/MOUSE_EXIT()I
  if_icmpeq true_211
  iconst_0
  goto stop_212
  true_211:
  iconst_1
  stop_212:
  true_202:
  dup
  ifne true_201
  pop
  iload 5
  aload_3
  invokevirtual joos/lib/JoosConstants/MOUSE_MOVE()I
  if_icmpeq true_213
  iconst_0
  goto stop_214
  true_213:
  iconst_1
  stop_214:
  true_201:
  ifeq else_199
  iconst_0
  ireturn
  else_199:
  aload_0
  getfield AllComponents/textarea Ljava/awt/TextArea;
  ldc "Unexpected Event type: "
  aload_1
  dup
  ifnull null_219
  invokevirtual java/awt/Event/toString()Ljava/lang/String;
  goto stop_220
  null_219:
  pop
  ldc "null"
  stop_220:
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  dup
  ifnonnull stop_216
  pop
  ldc "null"
  stop_216:
  ldc "\n"
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  invokevirtual java/awt/TextComponent/setText(Ljava/lang/String;)V
  stop_122:
  stop_118:
  stop_114:
  stop_110:
  stop_98:
  stop_86:
  stop_1:
  iconst_1
  ireturn
.end method

.method public static main([Ljava/lang/String;)V
  .limit locals 2
  .limit stack 3
  new AllEvents
  dup
  ldc "AWT Demo - with event handler"
  invokenonvirtual AllEvents/<init>(Ljava/lang/String;)V
  astore_1
  aload_1
  ldc 450
  ldc 475
  invokevirtual java/awt/Component/resize(II)V
  aload_1
  invokevirtual java/awt/Window/show()V
  return
.end method

