// file: DesignerHelp.java
//
//import java.awt.*;
import javax.swing.*;
import java.awt.Color;
import java.awt.BorderLayout;
import java.awt.event.*;

class DesignerHelp extends JFrame implements ActionListener {
  
  private final static int borders = 5;
  private JTextArea help_area;
  private String title = new String("Applet Help");
  private String help_text;
  private JButton button = new JButton ("Dismiss");

  //****************************************************************
  //
  // public methods
  //
  //****************************************************************

  // method DesignerHelp
  //
  // parameters: none
  //
  // this method initializes the class
  //
  // returns: none
  //
  public DesignerHelp() {
    
    // initialize the super class
    //
    super();
    
    // set the title of this frame
    //
    this.setTitle(title);

    // set the layout options for this canvas
    //
    this.setLayout(new BorderLayout(borders, borders));
    
    // change the foreground and background colors of this frame
    //
    this.setBackground(Color.lightGray);

    // add the help text to the frame
    //
    help_text = this.get_help_text();
    help_area = new JTextArea(help_text, 24, 80);
    help_area.setEditable(false);
    this.add("Center", help_area);

    // change the fore and background colors of the canvas
    //
    help_area.setBackground(Color.lightGray);
    help_area.setForeground(Color.black);

    // add a dismiss button in a panel at the bottom of the window.
    //
    this.add("South", button);

    // add action performed and actionlistener to button
    //
    button.setActionCommand("dismiss");
    button.addActionListener(this);
    

    // add the help data to the canvas
    //
    
    // pack everything in
    //
    this.pack();
    this.setVisible(true);
  }


  // method: get_help_text
  //
  // parameters: 
  //     String text: string to write the help text to. this pointer 
  //                  should initially be null
  //
  // this method writes the help text to the string for the text area
  //
  // returns String
  //
  private String get_help_text() {
    
    // assign the help text
    //
    String text = new String (
			      "Long string describing the help");
    return text;
  }

    public void actionPerformed(ActionEvent e) {
	this.setVisible(false);
    }

} // end class DesignerHelp
