home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1996 June / PCPRO_696.ISO / plugins / wirl3d / data.1 / VRCJuice.class (.txt) < prev    next >
Encoding:
Java Class File  |  1995-03-11  |  1.6 KB  |  63 lines

  1. import java.applet.Applet;
  2. import java.awt.Button;
  3. import java.awt.Container;
  4. import java.awt.Event;
  5. import java.awt.GridLayout;
  6.  
  7. public class VRCJuice extends Applet {
  8.    VRCRobot VRCRobo;
  9.    boolean INIT = false;
  10.  
  11.    public void init() {
  12.       ((Container)this).setLayout(new GridLayout(1, 3));
  13.       ((Container)this).add("a", new Button("Right Arm"));
  14.       ((Container)this).add("b", new Button("Right Leg"));
  15.       ((Container)this).add("c", new Button("Torso"));
  16.       ((Container)this).add("d", new Button("Left Leg"));
  17.       ((Container)this).add("e", new Button("Left Arm"));
  18.       ((Container)this).add("i", new Button("Color"));
  19.       ((Container)this).add("f", new Button("Animate"));
  20.       ((Container)this).add("h", new Button("Walk"));
  21.       ((Container)this).add("g", new Button("Restart"));
  22.    }
  23.  
  24.    public void destroy() {
  25.       this.VRCRobo.destroy();
  26.       System.gc();
  27.       this.INIT = false;
  28.    }
  29.  
  30.    public boolean action(Event var1, Object var2) {
  31.       if (var1.target instanceof Button) {
  32.          if (!this.INIT) {
  33.             this.VRCRobo = new VRCRobot();
  34.             this.INIT = true;
  35.          }
  36.  
  37.          String var3 = (String)var2;
  38.          if (var3.equals("Right Arm")) {
  39.             this.VRCRobo.asyncRWave();
  40.          } else if (var3.equals("Left Arm")) {
  41.             this.VRCRobo.asyncLWave();
  42.          } else if (var3.equals("Left Leg")) {
  43.             this.VRCRobo.asyncLLeg();
  44.          } else if (var3.equals("Right Leg")) {
  45.             this.VRCRobo.asyncRLeg();
  46.          } else if (var3.equals("Restart")) {
  47.             this.destroy();
  48.          } else if (var3.equals("Torso")) {
  49.             this.VRCRobo.twist(-1);
  50.             this.VRCRobo.twist(1);
  51.          } else if (var3.equals("Animate")) {
  52.             this.VRCRobo.asyncAnimate();
  53.          } else if (var3.equals("Walk")) {
  54.             this.VRCRobo.asyncWalk();
  55.          } else if (var3.equals("Color")) {
  56.             this.VRCRobo.asyncColor();
  57.          }
  58.       }
  59.  
  60.       return true;
  61.    }
  62. }
  63.