Search in sources :

Example 1 with DatasetChangeEvent

use of org.jfree.data.general.DatasetChangeEvent in project processdash by dtuma.

the class ChartDataEventRecalcHelper method fireChangeEvent.

private void fireChangeEvent() {
    if (listenerList == null)
        return;
    DatasetChangeEvent e = null;
    Object[] listeners = listenerList.toArray();
    // those that are interested in this event
    for (int i = listeners.length; i-- > 0; ) {
        if (e == null)
            e = new DatasetChangeEvent(this, this);
        ((DatasetChangeListener) listeners[i]).datasetChanged(e);
    }
}
Also used : DatasetChangeListener(org.jfree.data.general.DatasetChangeListener) DatasetChangeEvent(org.jfree.data.general.DatasetChangeEvent)

Example 2 with DatasetChangeEvent

use of org.jfree.data.general.DatasetChangeEvent in project processdash by dtuma.

the class XYDatasetFilter method fireDatasetChanged.

@Override
protected void fireDatasetChanged() {
    DatasetChangeEvent e = new DatasetChangeEvent(this, this);
    for (Iterator i = listeners.iterator(); i.hasNext(); ) {
        DatasetChangeListener l = (DatasetChangeListener) i.next();
        l.datasetChanged(e);
    }
}
Also used : Iterator(java.util.Iterator) DatasetChangeListener(org.jfree.data.general.DatasetChangeListener) DatasetChangeEvent(org.jfree.data.general.DatasetChangeEvent)

Example 3 with DatasetChangeEvent

use of org.jfree.data.general.DatasetChangeEvent in project processdash by dtuma.

the class AbstractDiscItemDistributor method setDataset.

/**
     * Sets the dataset and sends a {@link DatasetChangeEvent} to 'this'.
     * 
     * @param dataset
     *                the dataset (<code>null</code> permitted).
     * 
     * @see #getDataset()
     */
public void setDataset(PieDataset dataset) {
    // if there is an existing dataset, remove the distributor from the
    // list of change listeners...
    PieDataset existing = this.dataset;
    if (existing != null) {
        existing.removeChangeListener(this);
    }
    // set the new dataset, and register the distributor as a change
    // listener...
    this.dataset = dataset;
    if (dataset != null) {
        dataset.addChangeListener(this);
    }
    // send a dataset change event to self...
    DatasetChangeEvent event = new DatasetChangeEvent(this, dataset);
    datasetChanged(event);
}
Also used : PieDataset(org.jfree.data.general.PieDataset) DatasetChangeEvent(org.jfree.data.general.DatasetChangeEvent)

Example 4 with DatasetChangeEvent

use of org.jfree.data.general.DatasetChangeEvent in project processdash by dtuma.

the class DiscPlot method setDataset.

/**
     * Sets the dataset and sends a {@link DatasetChangeEvent} to 'this'.
     *
     * @param dataset  the dataset (<code>null</code> permitted).
     * 
     * @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);
}
Also used : PieDataset(org.jfree.data.general.PieDataset) DatasetChangeEvent(org.jfree.data.general.DatasetChangeEvent)

Aggregations

DatasetChangeEvent (org.jfree.data.general.DatasetChangeEvent)4 DatasetChangeListener (org.jfree.data.general.DatasetChangeListener)2 PieDataset (org.jfree.data.general.PieDataset)2 Iterator (java.util.Iterator)1