//***************************************************************************** // // Beenish Chaudry, Geetika Tewari, Elif Tosun and // Ileana Streinu // // Summer 1999, Fall 1999, Spring 2000 // //***************************************************************************** import java.awt.*; import java.awt.event.*; import java.lang.*; import java.io.*; import java.applet.*; public class AnApplet extends Applet implements ActionListener{ // the main window (frame) // the data model, view and controls are there FramePoint bf; // control of the main window Button bstart, bstop; //****************** // // init // //****************** public void init() { setBackground(Color.white); bstart = new Button("Start"); bstop = new Button("Stop"); add(bstart); add(bstop); bstart.addActionListener(this); bstop.addActionListener(this); }//end of init //*********************************** // // actionPerfomed // //*********************************** public void actionPerformed(ActionEvent e){ if(e.getSource() == bstart) { if (bf == null) bf = new FramePoint("Point Drawing Window", this); bf.lf = new FrameLine(this, "Line Window"); //bf.lf.setVisible(Constants.lineFrameStart); bf.iw = new FrameInfo(bf, "Information Window"); //bf.iw.setVisible(Constants.infoFrameStart); bf.cf = new ColorFrame(bf,"Edit Color"); //bf.cf.setVisible(Constants.colorFrameStart); bf.ft = new FrameText(bf, "Change Element Name", "Enter new name"); }// end if bstart else if (e.getSource() == bstop) { QuitFramePoint(); } }//end of action method //************************** // // QuitFramePoint // //************************** public void QuitFramePoint() { if(bf != null) { bf.QuitFrameLine(); bf.QuitFrameInfo(); bf.QuitFrameColor(); bf.QuitFrameText(); bf.dispose(); bf = null; } }// end QuitFramePoint //************************** // // ResetFramePoint // may be used sometimes; // equivalent to Stop, then Start. // //************************** public void ResetFramePoint() { QuitFramePoint(); bf = new FramePoint("Point Drawing Window", this); }// end ResetFramePoint }//end of applet