/* ===========================================================
 * JFreeChart : a free chart library for the Java(tm) platform
 * ===========================================================
 *
 * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors.
 *
 * Project Info:  http://www.jfree.org/jfreechart/index.html
 *
 * 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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
 * USA.  
 *
 * [Java is a trademark or registered trademark of Sun Microsystems, Inc. 
 * in the United States and other countries.]
 *
 * ------------------
 * PieChartDemo1.java
 * ------------------
 * (C) Copyright 2003-2007, by Object Refinery Limited and Contributors.
 *
 * Original Author:  David Gilbert (for Object Refinery Limited);
 * Contributor(s):   ;
 *
 * Changes
 * -------
 * 09-Mar-2005 : Version 1, copied from the demo collection that ships with
 *               the JFreeChart Developer Guide (DG);
 *
 */

package org.jfree.chart.demo;

import java.awt.Font;

import javax.swing.JPanel;

import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PiePlot;
import org.jfree.data.general.DefaultPieDataset;
import org.jfree.data.general.PieDataset;
import org.jfree.ui.ApplicationFrame;
import org.jfree.ui.RefineryUtilities;

/**
 * A simple demonstration application showing how to create a pie chart using 
 * data from a {@link DefaultPieDataset}.
 */
public class PieChartDemo1 extends ApplicationFrame {

    /**
     * Default constructor.
     *
     * @param title  the frame title.
     */
    public PieChartDemo1(String title) {
        super(title);
        setContentPane(createDemoPanel());
    }

    /**
     * Creates a sample dataset.
     * 
     * @return A sample dataset.
     */
    private static PieDataset createDataset() {
        DefaultPieDataset dataset = new DefaultPieDataset();
        dataset.setValue("One", new Double(43.2));
        dataset.setValue("Two", new Double(10.0));
        dataset.setValue("Three", new Double(27.5));
        dataset.setValue("Four", new Double(17.5));
        dataset.setValue("Five", new Double(11.0));
        dataset.setValue("Six", new Double(19.4));
        return dataset;        
    }
    
    /**
     * Creates a chart.
     * 
     * @param dataset  the dataset.
     * 
     * @return A chart.
     */
    private static JFreeChart createChart(PieDataset dataset) {
        
        JFreeChart chart = ChartFactory.createPieChart(
            "Pie Chart Demo 1",  // chart title
            dataset,             // data
            true,               // include legend
            true,
            false
        );

        PiePlot plot = (PiePlot) chart.getPlot();
        plot.setSectionOutlinesVisible(false);
        plot.setLabelFont(new Font("SansSerif", Font.PLAIN, 10));
        plot.setNoDataMessage("No data available");
        plot.setSimpleLabels(true);
        return chart;
        
    }
    
    /**
     * Creates a panel for the demo (used by SuperDemo.java).
     * 
     * @return A panel.
     */
    public static JPanel createDemoPanel() {
        JFreeChart chart = createChart(createDataset());
        return new ChartPanel(chart);
    }
    
    /**
     * Starting point for the demonstration application.
     *
     * @param args  ignored.
     */
    public static void main(String[] args) {

        // ******************************************************************
        //  More than 150 demo applications are included with the JFreeChart
        //  Developer Guide...for more information, see:
        //
        //  >   http://www.object-refinery.com/jfreechart/guide.html
        //
        // ******************************************************************
        
        PieChartDemo1 demo = new PieChartDemo1("Pie Chart Demo 1");
        demo.pack();
        RefineryUtilities.centerFrameOnScreen(demo);
        demo.setVisible(true);
    }

}

@@ -407,17 +407,16 @@
 odify it
- 
 %0D%0A * und
@@ -484,17 +484,16 @@
 ished by
- 
 %0D%0A * the
@@ -556,17 +556,16 @@
 ense, or
- 
 %0D%0A * (at
@@ -672,17 +672,16 @@
 ful, but
- 
 %0D%0A * WIT
@@ -751,17 +751,16 @@
 TABILITY
- 
 %0D%0A * or 
@@ -826,17 +826,16 @@
 l Public
- 
 %0D%0A * Lic
@@ -1080,17 +1080,16 @@
 10-1301,
- 
 %0D%0A * USA
@@ -1089,18 +1089,16 @@
 %0A * USA.
-  
 %0D%0A *%0D%0A *
@@ -1168,17 +1168,16 @@
 ms, Inc.
- 
 %0D%0A * in 
@@ -2122,17 +2122,16 @@
 rt using
- 
 %0D%0A * dat
@@ -2482,33 +2482,32 @@
 dataset.%0D%0A     *
- 
 %0D%0A     * @return
@@ -2985,24 +2985,16 @@
 dataset;
-        
 %0D%0A    %7D%0D
@@ -2986,36 +2986,32 @@
 ataset;%0D%0A    %7D%0D%0A
-    
 %0D%0A    /**%0D%0A     
@@ -3028,33 +3028,32 @@
 a chart.%0D%0A     *
- 
 %0D%0A     * @param 
@@ -3073,33 +3073,32 @@
 dataset.%0D%0A     *
- 
 %0D%0A     * @return
@@ -3182,24 +3182,16 @@
 set) %7B%0D%0A
-        
 %0D%0A      
@@ -3687,24 +3687,26 @@
 els(true);%0D%0A
+%0D%0A
         retu
@@ -3716,24 +3716,16 @@
 chart;%0D%0A
-        
 %0D%0A    %7D%0D
@@ -3717,36 +3717,32 @@
 hart;%0D%0A%0D%0A    %7D%0D%0A
-    
 %0D%0A    /**%0D%0A     
@@ -3805,17 +3805,16 @@
 %0D%0A     *
- 
 %0D%0A     *
@@ -3991,20 +3991,16 @@
 %0A    %7D%0D%0A
-    
 %0D%0A    /*
@@ -4543,24 +4543,16 @@
 ******%0D%0A
-        
 %0D%0A      

Removed trailing whitespace.