/*
 This file is part of the software framework JStatCom, 
 a library for building applications for data based analysis.

 Copyright (C) 2000-2005  Markus Kraetzig

 This library is free software; you can redistribute it and/or modify
 it under the terms of the GNU Lesser General Public License as
 published by the Free Software Foundation; either version 2.1 of the
 License, or (at your option) any later version.

 This library is distributed in the hope that it will be useful, but
 WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public
 License along with this library; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 USA
 */

package com.jstatcom.project;

import javax.swing.JPanel;

/**
 * Panel to display the actual output that has been selected in the
 * OutputList.
 * 
 * @author Markus Kraetzig 
 */
public final class OutputPanel extends JPanel {

    private com.jstatcom.component.ResultField resultField = null;

    /**
     * Default constructor.
     *  
     */
    public OutputPanel() {
        super();
        initialize();
    }

    /**
     * This method initializes this.
     * 
     * @return void
     */
    private void initialize() {
        this.setLayout(new java.awt.BorderLayout());
        this.setSize(488, 445);
        this.add(getResultField(), java.awt.BorderLayout.CENTER);

    }

    /**
     * Sets an array of output objects to be handled by this component. The
     * contents of all dataArray elements will be displayed in a
     * text area in the given order.
     * 
     * @param dataArray
     *            OutputData objects for display
     * @throws IllegalArgumentException
     *             if (dataArray == null)
     */
    public void setOutput(OutputData[] dataArray) {
        if (dataArray == null)
            throw new IllegalArgumentException("Argument was null.");
        getResultField().clear();
        for (int i = 0; i < dataArray.length; i++) {
            if (dataArray[i] != null)
                getResultField().append(dataArray[i].output);
        }
    }

    /**
     * 
     * This method initializes resultField
     * 
     * @return com.jstatcom.component.ResultField
     *  
     */
    private com.jstatcom.component.ResultField getResultField() {
        if (resultField == null) {
            resultField = new com.jstatcom.component.ResultField();
        }
        return resultField;
    }

} //  @jve:visual-info decl-index=0 visual-constraint="10,10"

 

Ads help maintain this website.