/** * HW1 Sample * * This file creates the main window and buttons, * and instantiates a WorkSpace to contain and * render the BasicCells. * * @version $Id$ * @author Michael Shilman */ import java.awt.*; import java.applet.*; import java.util.Vector; import java.util.Random; public class hw1 extends Applet { static OctCell m_design = null; WorkSpace m_workSpace = null; Vector netvector = new Vector(); /** * Create the GUI elements and * initialize the design */ public void init() { Button button1,button2; super.init(); //System.out.println("add workspace"); setLayout(new BorderLayout()); m_workSpace = new WorkSpace(); add("Center", m_workSpace); Panel button_panel = new Panel(); button_panel.setLayout(new FlowLayout()); button_panel.add(button1 = new Button("Display Cell")); button_panel.add(button2 = new Button("Make Layout")); add("South",button_panel); initDesign(); } /** * Build the design, adding 100 BasicCell instances */ void initDesign() { BasicCell instance_of_BaseCell= null; //Initialize the BasicCell master BasicCell.initClass(); //Initialize the design m_design = new OctCell("Design", "password1", "R"); add_instance(100,m_design); attachNets(m_design); makeLayout(); } void add_instance(int index,OctCell oc ){ OctCell env = oc; OctTransform transform; //String name = "cell "+i; String view = "m_view"; String master = "m_master"; String facet = "contents"; int version = OCT.CURRENT_VERSION; BasicCell instance_of_BasicCell; OctView m_view = new OctView(oc,"Jimmy Jackson"); oc.Attach(m_view); OctFacet m_facet = new OctFacet(oc, "m_design","m_view","m_facet",OCT.CURRENT_VERSION, OCT.APPEND); m_view.Attach(m_facet); //System.out.println("add_instance"); transform = new OctTransform(env); for (int i=0; i