/*
 * @(#)SimpleFunctionBuilder.java  2.5.0  31 August 2006
 *
 * Copyright 2006
 * College of Computer and Information Science
 * Northeastern University
 * Boston, MA  02115
 *
 * The Java Power Tools software may be used for educational
 * purposes as long as this copyright notice is retained intact
 * at the top of all source files.
 *
 * To discuss possible commercial use of this software, 
 * contact Richard Rasala at Northeastern University, 
 * College of Computer and Information Science,
 * 617-373-2462 or rasala@ccs.neu.edu.
 *
 * The Java Power Tools software has been designed and built
 * in collaboration with Viera Proulx and Jeff Raab.
 *
 * Should this software be modified, the words "Modified from 
 * Original" must be included as a comment below this notice.
 *
 * All publication rights are retained.  This software or its 
 * documentation may not be published in any media either
 * in whole or in part without explicit permission.
 *
 * This software was created with support from Northeastern 
 * University and from NSF grant DUE-9950829.
 */

package edu.neu.ccs.gui;

/**
 * <p>Class <code>SimpleFunctionBuilder</code>
 * builds a panel that combines
 * a <code>SimpleFunctionPane</code> with
 * an <code>ExpressionEvaluationPane</code> so
 * that a user can both interactively define
 * simple functions and then test them in an
 * evaluation scenario immediately.</p>
 * 
 * <p>This panel may be used by applications
 * that work with functions and wish to permit
 * users to define such functions on the fly.</p>
 * 
 * @author Richard Rasala
 * @version 2.5.0
 */
public class SimpleFunctionBuilder
    extends DisplayPanel
{
    /** The gap between the two panes in this panel. */
    protected int gap = 12;
    
    /** The simple function definition pane. */
    protected DisplayPanel defPane =
        new SimpleFunctionPane();
    
    /** The expression-evaluation pane. */
    protected DisplayPanel expPane =
        new ExpressionEvaluationPane();
    
    /** The array with the two panes. */
    protected Object[] vStuff = { defPane, expPane };
    
    /** The table with the two panes. */
    protected VTable vTable =
        new VTable(vStuff, gap, gap, CENTER);
    
    
    /**
     * The constructor for a simple function builder panel.
     */
    public SimpleFunctionBuilder() {
        add(vTable);
    }
    
    
    /**
     * <p>The main method launches
     * a simple function builder panel
     * in its own GUI frame.</p>
     * 
     * <p>Use the call:</p>
     * 
     * <pre>  SimpleFunctionBuilder.main(null)</pre>
     * 
     * @param args ignored and may be <code>null</code>
     */
    public static void main(String[] args) {
        new SimpleFunctionBuilder().frame("Simple Function Builder");
    }
   
}

