/*
 * @(#)VisualColorSampler.java    2.6  25 May 2007
 *
 * Copyright 2007
 * 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.*;

/**
 * <p>Class <code>VisualColorSampler</code> combines
 * a <code>VisualColorList</code> with
 * a <code>CheckerBoard</code> so that a user can
 * experiment with colors and color contrasts.</p>
 * 
 * <p>This class returns no color information directly
 * but the caller can obtain references to the internal
 * views and obtain information from these views.</p>
 * 
 * @author  Richard Rasala
 * @version 2.6
 * @since   2.6
 * @see     ColorView
 * @see     MultiColorView
 * @see     VisualColorList
 * @see     CheckerBoard
 */
public class VisualColorSampler extends DisplayPanel {
    
    /** The gap between the cells in the internal TablePanel. */
    protected int GAP = 20;
    
    /** The left hand panel title. */
    protected String title1 = "VisualColorList";
    
    /** The right hand panel title. */
    protected String title2 = "CheckerBoard";
    
    /** The left hand panel: <code>VisualColorList<code>. */
    protected VisualColorList panel1 = new VisualColorList();
    
    /** The right hand panel: <code>CheckerBoard<code>. */
    protected CheckerBoard panel2 =
        new CheckerBoard(CheckerBoard.BLOCK, null, null, true, false);
    
    // Add borders to panel2
    {
        panel2.emptyBorder(8);
        panel2.lineBorder(Colors.black, 2);
    }
    
    /** The stuff in the internal TablePanel. */
    protected Object[][] mainStuff =
        { { title1, title2 }, { panel1, panel2 } };
    
    /** The internal TablePanel. */
    protected TablePanel mainPanel =
        new TablePanel(mainStuff, GAP, GAP, CENTER);
    
    // Add borders to the internal TablePanel
    {
        mainPanel.emptyBorder(8);
    }
    
    
    /**
     * <p>Constructs the <code>VisualColorSampler</code>
     * with its <code>VisualColorList</code> and
     * <code>CheckerBoard</code>.</p>
     */
    public VisualColorSampler() {
        add(mainPanel);
    }
    
    
    /**
     * Returns the internal <code>VisualColorList</code>.</p>
     */
    public VisualColorList getVisualColorList() {
        return panel1;
    }
    
    
    /**
     * Returns the internal <code>CheckerBoard</code>.</p>
     */
    public CheckerBoard getCheckerBoard() {
        return panel2;
    }
    
    
    /**
     * <p>Launches a <code>VisualColorSampler</code> in its
     * own frame.</p>
     * 
     * @param args ignored
     */
    public static void main(String[] args) {
        new VisualColorSampler().frame("Visual Color Sampler");
    }
}

