/*
 * @(#)BasePane.java  2.5.0  30 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;

import edu.neu.ccs.*;

import java.awt.*;
import java.awt.font.*;

/**
 * <p>Class <code>BasePane</code> contains the common
 * font and size definitions for use in certain other
 * JPT classes.</p>
 * 
 * <p>For example, this class is used as a base class
 * for:</p>
 * 
 * <ul>
 *   <li><code>SimpleFunctionPane</code></li>
 *   <li><code>ExpressionEvaluationPane</code></li>
 * </ul>
 * 
 * @author Richard Rasala
 * @version 2.5.0
 */
public class BasePane
    extends DisplayPanel
{
    /** The common gap in table panels. */
    protected int gap = 6;
    
    
    /**
     * <p>The common font size for fields, labels, and buttons.</p>
     * 
     * <p>To make the fonts defined here slightly larger than
     * the Java default fonts, the current definition of this
     * size is 14 plus whatever net adjustment has been made
     * using the methods in <code>LookAndFeelTools</code>.</p>
     */
    protected int fontSize =
        14 + (int)LookAndFeelTools.getNetFontSizeAdjustment();
    
    
    /** The monospaced font name from class <code>Fonts</code>. */
    protected String monoFontName =
        Fonts.getMonospacedFontFamilyName();
    
    /** The serif font name from class <code>Fonts</code>. */
    protected String serifFontName =
        Fonts.getSerifFontFamilyName();
    
    /** The sans serif font name from class <code>Fonts</code>. */
    protected String sansserifFontName =
        Fonts.getSansSerifFontFamilyName();
    
    /**
     * The field font uses the monospaced font
     * with BOLD style
     * in the font size defined above.
     */
    protected Font fieldFont =
        new Font(monoFontName, Font.BOLD, fontSize);
    
    /**
     * The label font uses the serif font
     * with BOLD style
     * in the font size defined above.
     */
    protected Font labelFont =
        new Font(serifFontName, Font.BOLD, fontSize);
    
    /**
     * The button font uses the sans serif font
     * with BOLD style
     * in the font size defined above.
     */
    protected Font buttonFont =
        new Font(sansserifFontName, Font.BOLD, fontSize);
    
    
    /**
     * The small field width is the width of 20 characters
     * in the field font.
     */
    protected int smallFieldWidth =
        TextFieldView.getSampleWidth
            (fieldFont, Strings.suffixRepeatChar("", ' ', 20));
    
    /**
     * The large field width is 900 pixels so the panes using
     * this class will fit on a screen that 1024 pixels wide.
     */
    protected int largeFieldWidth = 900;
    
}

