Example usage for org.jfree.data.general PieDataset getGroup

List of usage examples for org.jfree.data.general PieDataset getGroup

Introduction

In this page you can find the example usage for org.jfree.data.general PieDataset getGroup.

Prototype

public DatasetGroup getGroup();

Source Link

Document

Returns the dataset group.

Usage

From source file:net.sourceforge.processdash.ui.lib.chart.DiscPlot.java

/**
 * Sets the dataset and sends a {@link DatasetChangeEvent} to 'this'.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 * //from  w  w  w . j  a va  2 s  .c o  m
 * @see #getDataset()
 */
public void setDataset(PieDataset dataset) {
    // if there is an existing dataset, remove the plot from the list of
    // change listeners...
    PieDataset existing = this.dataset;
    if (existing != null) {
        existing.removeChangeListener(this);
    }

    // set the new dataset, and register the chart as a change listener...
    this.dataset = dataset;
    if (dataset != null) {
        setDatasetGroup(dataset.getGroup());
        dataset.addChangeListener(this);
    }

    // tell the item distributor about the change
    if (discDistributor != null) {
        discDistributor.setDataset(dataset);
    }

    // send a dataset change event to self...
    DatasetChangeEvent event = new DatasetChangeEvent(this, dataset);
    datasetChanged(event);
}