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);
}
}
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);
}
}
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);
}
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);
}
Aggregations