//******************************************************************************
// venn1.java: basic set theory applet
//
// Copyleft (c) 1992-1998 Formal Systems Inc. All lights preserved.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
//******************************************************************************
import java.applet.*;
import java.awt.*;
import java.util.*;
//==============================================================================
// Main Class for applet venn1
//
//==============================================================================
public class venn1 extends Applet implements Runnable {
TextField tf4;
Panel p,p1,p2,p3,p4,p0,p5,p6,p7;
VennCanvas m_venncanvas;
VennCanvas m_venncanvasSol;
TextArea m_problem;
Choice m_choice;
Choice m_choicevalid;
Marking m_solution, m_exercise;
boolean bShowing = false;
int lastx;
int lasty;
final String PARAM_taga = "taga";
final String PARAM_tagb = "tagb";
final String PARAM_tagc = "tagc";
final String PARAM_text = "text";
final String PARAM_circle1 = "circle1";
final String PARAM_circle2 = "circle2";
final String PARAM_circle3 = "circle3";
final String PARAM_region1 = "region1";
final String PARAM_region2 = "region2";
final String PARAM_region3 = "region3";
final String PARAM_region4 = "region4";
final String PARAM_region5 = "region5";
final String PARAM_region6 = "region6";
final String PARAM_region7 = "region7";
final String PARAM_region8 = "region8";
final String PARAM_valid = "valid";
public static boolean inapplet = true;
static public AppletContext ac;
static public String codebase;
private Frame parent;
// THREAD SUPPORT:
// m_venn1 is the Thread object for the applet
//--------------------------------------------------------------------------
Thread m_venn1 = null;
// PARAMETER SUPPORT:
//Parameters allow an HTML author to pass information to the applet;
// the HTML author specifies them using the tag within the " );
printFooterHTML();
// System.out.println("We generated the diagram") ;
}
public void printHeadHTML( ) {
System.out.println( "" );
System.out.println( "
" );
System.out.print( " " );
System.out.print( " " );
System.out.print( "Venn Diagramming Exercise" );
System.out.println( "" );
System.out.println( "" );
System.out.println("");
}
public void printAppletHTML( String sCodeBase ) {
System.out.println( "