package Nodepad;

import javax.swing.*;
import java.awt.*;

/**
 * NodePad.java
 *
 *
 * Created: Mon Dec 16 15:04:06 2002
 *
 * @author <a href="mailto:shapiro@cse.buffalo.edu">Stuart C. Shapiro</a>
 * @version
 *
 * An applet that provides a sketchpad for nodes whose values are integers.
 *
 */
public class NodePad extends JApplet {
    ButtonPanel panel;
    Pad pad;

    /** 
     * Initializes this NodePad with a button panel and a node sketchpad.
     */
    public void init() {
	Container cp = getContentPane();
	pad = new Pad();
	panel = new ButtonPanel(pad);
	cp.add(panel,BorderLayout.NORTH);
	cp.add(pad,BorderLayout.CENTER);

	// Pad Contents
	pad.add(new Node(pad,75,75,(int)(Math.random()*1000))); 
	pad.add(new Node(pad,200,200,(int)(Math.random()*1000)));
	pad.add(new PointerNode(pad,0,400,"p"));
	pad.add(new ListNode(pad,300,400, 33));
    }

    /**
     * Repaints this NodePad.
     */
    public void start() {
	repaint();
    }    
		 
} // NodePad
