Logo
Distributed Genetic Programming Framework
print print

File org.dgpf.gui.wizards.chartchooser.CCWzrdFirstCard.java

Here you can find all the information about the file org.dgpf.gui.wizards.chartchooser.CCWzrdFirstCard.java. You may explore it here or download it onto your local disk.
/*
 * Copyright (c) 2006 Alexander Podlich
 * 
 * E-Mail           : podlich@student.uni-kassel.de
 * Creation Date    : 01.08.2006 22:29:50
 * Original Filename: org.dgpf.gui.wizards.chartchooser.DGPFCCWzrdFirstCard.java
 * Version          : 1.0
 * Last modification: 01.08.2006
 * Last modified by : Alexander Podlich
 * 
 * License          : GNU LESSER GENERAL PUBLIC LICENSE
 *                    Version 2.1, February 1999
 *                    You should have received a copy of this license along
 *                    with this library; if not, write to the Free Software
 *                    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *                    MA 02111-1307, USA or download the license under
 *                    http://www.gnu.org/copyleft/lesser.html.
 *                    
 * Warranty         : This software is provided "as is" 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.
 */


package org.dgpf.gui.wizards.chartchooser;

import java.awt.Dimension;
import java.util.Vector;

import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.border.EmptyBorder;
import javax.swing.tree.DefaultMutableTreeNode;

import org.dgpf.gui.charts.Bar3DChart;
import org.dgpf.gui.charts.Pie3DChart;
import org.dgpf.gui.charts.XYLineChart;
import org.dgpf.gui.charts.IChart;
import org.dgpf.gui.components.SplitPane;
import org.dgpf.gui.components.TextArea;
import org.dgpf.gui.components.Tree;
import org.dgpf.gui.utils.LanguageSwitcher;
import org.jfree.chart.ChartPanel;

/**
 * This class represents the first card of the chart chooser. In this
 * dialog it is possible to select a special chart. Herefore this dialog
 * show samples and a description of this chart.
 * 
 * @author Alexander Podlich
 */

public class CCWzrdFirstCard extends SplitPane
  {

  /**
   * The serial version UID.
   */

  private static final long serialVersionUID = 1L;

  /**
   * Constructor.
   * 
   * @param p_wizard
   *          The main wizard
   * @param p_chartPanel
   *          The chart panel
   * @param p_textArea
   *          The text area for chart-information
   * @param p_charts
   *          The charts
   * @param p_tree
   *          The tree
   */

  public CCWzrdFirstCard(CCWzrd p_wizard, ChartPanel p_chartPanel,
      TextArea p_textArea, Vector<IChart> p_charts, Tree p_tree)
    {

    super(JSplitPane.HORIZONTAL_SPLIT, true, true);
    this.setBorder(new EmptyBorder(10, 0, 10, 0));

    // Charts cathegories
    DefaultMutableTreeNode l_pieNode = new DefaultMutableTreeNode(
        LanguageSwitcher.getString("cc1_tree_pie_node"));
    DefaultMutableTreeNode l_barNode = new DefaultMutableTreeNode(
        LanguageSwitcher.getString("cc1_tree_bar_node"));
    DefaultMutableTreeNode l_lineNode = new DefaultMutableTreeNode(
        LanguageSwitcher.getString("cc1_tree_line_node"));

    p_tree.getRoot().add(l_pieNode);
    p_tree.getRoot().add(l_barNode);
    p_tree.getRoot().add(l_lineNode);

    /** Create here new chart nodes and add them to the root node */
    for(IChart l_c : p_charts)
      {

      // Add all line charts to the lineNode
      if(l_c instanceof XYLineChart)
        {
        XYLineChart l_chart = (XYLineChart) l_c;
        DefaultMutableTreeNode l_lineChartNode = new DefaultMutableTreeNode(
            l_chart);
        l_lineNode.add(l_lineChartNode);
        }

      // Add all 3d-pie charts to the pieNode
      else
        if(l_c instanceof Pie3DChart)
          {
          Pie3DChart l_chart = (Pie3DChart) l_c;
          DefaultMutableTreeNode l_pieChartNode = new DefaultMutableTreeNode(
              l_chart);
          l_pieNode.add(l_pieChartNode);
          }

        // Add all bar charts to the barNode
        else
          if(l_c instanceof Bar3DChart)
            {
            Bar3DChart l_chart = (Bar3DChart) l_c;
            DefaultMutableTreeNode barChartNode = new DefaultMutableTreeNode(
                l_chart);
            l_barNode.add(barChartNode);
            }

      }
    p_tree.expandTree(true);

    SplitPane l_chartDescPane = new SplitPane(JSplitPane.VERTICAL_SPLIT,
        true, true);

    JScrollPane l_treePane = new JScrollPane(p_tree);
    l_treePane.setSize(200, 200);
    l_treePane.setMinimumSize(new Dimension(200, p_wizard.getHeight()));
    setLeftComponent(l_treePane);

    setRightComponent(l_chartDescPane);
    p_chartPanel.setMinimumSize(new Dimension(p_wizard.getWidth(), 300));

    l_chartDescPane.setTopComponent(p_chartPanel);
    l_chartDescPane.setBottomComponent(p_textArea);

    }

  }

File Information:

file name:CCWzrdFirstCard.java
package:org.dgpf.gui.wizards.chartchooser
qualified name:org.dgpf.gui.wizards.chartchooser.CCWzrdFirstCard.java
file type:Java Source File
download location:download http://dgpf.sourceforge.net/source/org/dgpf/gui/wizards/chartchooser/CCWzrdFirstCard.java
size:4.660 KB (4772 B)
uploaded: 2015-07-22 04:10:59 GMT+0000
last update: 2006-09-24 23:47:04 GMT+0000
last access: 2017-11-23 02:02:32 GMT+0000

statistics online since 2006-01-02.   RSS Feed
Contact us by sending an email to tweise@gmx.de to receive further information, to report errors, or to join our project.
All content on this site (http://dgpf.sourceforge.net/) is LGPL-licensed.
http://dgpf.sourceforge.net/scripts/source/source.php last modified at 2015-07-22 04:10:53 GMT+0000 served at 2017-11-24 00:19:49 GMT+0000.
Valid CSS Valid XHTML 1.1
Valid RSS SourceForge.net Logo