/* A GUI that contains 1 int field and one Spiral frame with a paint
   method that draws a spiral. Put in int field 0 of the GUI an integer,
   which is the angle between successive lines, and hit the ready button.
   */
   
   import java.awt.*;

public class MyJLiveWindow extends JLiveWindow {

   public static Spiral d;  // A window with method paint that draws a spiral

   // Change the angle between successive lines to int field 0
   // and repaint the Spiral
   public Object buttonPressed() {
      if (getIntField(0) != 0)
      	d.setTurn(getIntField(0));
      setStringField(0, "angle between lines");
      d.repaint(); 
      return null;
   }
 
   // Create an instance of me and show it; store a new Spiral in d
   public static void main(String args[]) {
      // The first argument to MyJLiveWindow is the number of int fields,
      // the second argument is the number of double fields, and
      // the third argument is the number of text (or String) fields.
      MyJLiveWindow testJLiveWindow= new MyJLiveWindow(1, 0, 1);
      testJLiveWindow.showWindow();
      d= new Spiral();
      d.resize(600,500);
      d.move(0,75);
      d.setTitle("Logarithmic spiral");
      d.show();
      d.toFront();
   }
  
   // Create my window with
   //    max( min(i,MAX_FIELDS), 0) integer fields,
   //    max( min(d,MAX_FIELDS), 0) double fields, and
   //    max( min(s,MAX_FIELDS), 0) String fields
   //    and a "ready" button
   public MyJLiveWindow(int i, int d, int s) {
      super(i, d, s);
   }
}

