// Yuan Kui Shen - cs184-ac - 12940472 // Raul Joni Chu - cs184-bq - 12782756 // CS184 Fall '98 Project 1 // File: proj1.wrl import vrml.*; import vrml.node.*; import vrml.field.*; import java.io.*; import java.util.*; // This class is ONLY needed because we need to extend the Script class in // order to be able to create VRML-aware events. public class Talker extends Script { private SFInt32 atom_type; private GUIWindow TheControls; // This is the class to talk to the world - not much here public Talker() { } // Get the user's choice from the GUIWindow class public void atom_type() { atom_type.setValue(TheControls.get_type()); } // Tell the world what type of atom to add public void processEvent(Event event) { String EventName = event.getName(); if (EventName.equals("add_atom")) { atom_type(); } } // Create the pop-up window and give it a name public void initialize() { TheControls = new GUIWindow(); TheControls.inAnApplet = false; TheControls.setTitle("VRML Molecule Modeller Control Panel"); TheControls.pack(); TheControls.setVisible(true); atom_type = (SFInt32)getEventOut("atom_type"); } }