.class public InfoDialog

.super java/awt/Dialog

.field private protected button Ljava/awt/Button;
.field private protected label LMultiLineLabel;
.field private protected c Ljoos/lib/JoosConstants;
.field private protected p Ljava/awt/Panel;

.method public <init>(Ljava/awt/Frame;Ljava/lang/String;Ljava/lang/String;)V
  .limit locals 4
  .limit stack 6
  aload_0
  aload_1
  aload_2
  iconst_0
  invokenonvirtual java/awt/Dialog/<init>(Ljava/awt/Frame;Ljava/lang/String;Z)V
  new joos/lib/JoosConstants
  dup
  invokenonvirtual joos/lib/JoosConstants/<init>()V
  aload_0
  swap
  putfield InfoDialog/c Ljoos/lib/JoosConstants;
  aload_0
  new java/awt/BorderLayout
  dup
  ldc 15
  ldc 15
  invokenonvirtual java/awt/BorderLayout/<init>(II)V
  invokevirtual java/awt/Container/setLayout(Ljava/awt/LayoutManager;)V
  new MultiLineLabel
  dup
  aload_3
  ldc 20
  ldc 20
  invokenonvirtual MultiLineLabel/<init>(Ljava/lang/String;II)V
  aload_0
  swap
  putfield InfoDialog/label LMultiLineLabel;
  new joos/lib/JoosContainer
  dup
  aload_0
  invokenonvirtual joos/lib/JoosContainer/<init>(Ljava/awt/Container;)V
  ldc "Center"
  aload_0
  getfield InfoDialog/label LMultiLineLabel;
  invokevirtual joos/lib/JoosContainer/addString(Ljava/lang/String;Ljava/awt/Component;)Ljava/awt/Component;
  pop
  new java/awt/Button
  dup
  ldc "Okay"
  invokenonvirtual java/awt/Button/<init>(Ljava/lang/String;)V
  aload_0
  swap
  putfield InfoDialog/button Ljava/awt/Button;
  new java/awt/Panel
  dup
  invokenonvirtual java/awt/Panel/<init>()V
  aload_0
  swap
  putfield InfoDialog/p Ljava/awt/Panel;
  aload_0
  getfield InfoDialog/p Ljava/awt/Panel;
  new java/awt/FlowLayout
  dup
  aload_0
  getfield InfoDialog/c Ljoos/lib/JoosConstants;
  invokevirtual joos/lib/JoosConstants/FLOWLAYOUT_CENTER()I
  ldc 15
  ldc 15
  invokenonvirtual java/awt/FlowLayout/<init>(III)V
  invokevirtual java/awt/Container/setLayout(Ljava/awt/LayoutManager;)V
  aload_0
  getfield InfoDialog/p Ljava/awt/Panel;
  aload_0
  getfield InfoDialog/button Ljava/awt/Button;
  invokevirtual java/awt/Container/add(Ljava/awt/Component;)Ljava/awt/Component;
  pop
  new joos/lib/JoosContainer
  dup
  aload_0
  invokenonvirtual joos/lib/JoosContainer/<init>(Ljava/awt/Container;)V
  ldc "South"
  aload_0
  getfield InfoDialog/p Ljava/awt/Panel;
  invokevirtual joos/lib/JoosContainer/addString(Ljava/lang/String;Ljava/awt/Component;)Ljava/awt/Component;
  pop
  return
.end method

.method public action(Ljava/awt/Event;Ljava/lang/Object;)Z
  .limit locals 3
  .limit stack 3
  new joos/lib/JoosEvent
  dup
  aload_1
  invokenonvirtual joos/lib/JoosEvent/<init>(Ljava/awt/Event;)V
  invokevirtual joos/lib/JoosEvent/target()Ljava/lang/Object;
  aload_0
  getfield InfoDialog/button Ljava/awt/Button;
  if_acmpne else_0
  aload_0
  invokevirtual java/awt/Component/hide()V
  aload_0
  invokevirtual java/awt/Window/dispose()V
  iconst_1
  ireturn
  else_0:
  iconst_0
  ireturn
.end method

.method public gotFocus(Ljava/awt/Event;Ljava/lang/Object;)Z
  .limit locals 3
  .limit stack 1
  aload_0
  getfield InfoDialog/button Ljava/awt/Button;
  invokevirtual java/awt/Component/requestFocus()V
  iconst_1
  ireturn
.end method

.method public static main([Ljava/lang/String;)V
  .limit locals 3
  .limit stack 7
  new java/awt/Frame
  dup
  ldc "InfoDialog Test"
  invokenonvirtual java/awt/Frame/<init>(Ljava/lang/String;)V
  astore_1
  aload_1
  ldc 100
  ldc 100
  invokevirtual java/awt/Component/resize(II)V
  aload_1
  invokevirtual java/awt/Window/show()V
  new InfoDialog
  dup
  aload_1
  ldc "Help"
  ldc "The host you are trying to contact\n"
  ldc "is not currently responding.\n"
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  dup
  ifnonnull stop_1
  pop
  ldc "null"
  stop_1:
  ldc "Please try again later."
  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_2
  aload_2
  invokevirtual java/awt/Window/show()V
  return
.end method

