package FDATI;

import JavaAgent.context.*;
import java.awt.*;
import java.applet.Applet;
import java.net.URL;

/**
 * Subclass of AgentApplet which creates a FDATContext.<p>
 *
 * <hr>
 * Copyright (c) 1995, H. Robert Frost, Stanford University.
 * All rights reserved.<p>
 * Copyright (c) 1996, H. Robert Frost, Enterprise Integration Technologies,
 * Inc. All rights reserved.<p>
 *
 * RESTRICTED RIGHTS LEGEND: Use, duplication or disclosure by the 
 * Government is subject to restrictions as set forth in 
 * subparagraph(c)(1)(ii) of the Rights in Technical Data and Computer
 * Software clause at DFARS 252.227-7013 and in similar clauses in the
 * FAR and NASA FAR supplement.<p>
 * 
 * This software is bound by the terms and conditions listed in the
 * attached <a href="../LICENSE">LICENSE file</A>.
 * <hr>
 * @author <A HREF="http://cdr.stanford.edu/html/people/frost-bio.html"> Rob Frost</A>
 * @version 0.3 5/21/96 for Java(tm) Language Version 1.0.2
 */

public class FDATApplet extends AgentApplet {
  
  /**
   * Parameters which govern execution.
   */
  protected FDATParams fdat_params = new FDATParams();
    
  /**
   * Constructor for a FDATApplet. Creates a button for creating an
   * FDATContext.
   */
  
  public FDATApplet(){
    params = fdat_params;
    setLayout(new BorderLayout());
    add("Center", new Button("Create FDATAgent"));
  }

  /**
   * Get the parameters.
   */
  
  public void init(){
    super.init();

    String address = getParameter("address");
    
    if(address != null){
	((FDATParams)params).submission_address = address;
    } else {
      System.out.println("You did not provide a submission address!");
      stop();
    }
  }

  /**
   * Called when an event happens in the FDATApplet.
   * @param evt The event which triggered the method call.
   * @param arg Who called the method. For buttons, string name of button.
   */

  public boolean action(Event evt, Object arg) {
    if("Create FDATAgent".equals((String)arg)) {      
      FDATContext fdat = new FDATContext((FDATParams)params);
    }
    return true;
  }

}



