Example usage for org.jfree.data.xy XYSeries addVetoableChangeListener

List of usage examples for org.jfree.data.xy XYSeries addVetoableChangeListener

Introduction

In this page you can find the example usage for org.jfree.data.xy XYSeries addVetoableChangeListener.

Prototype

public void addVetoableChangeListener(VetoableChangeListener listener) 

Source Link

Document

Adds a vetoable property change listener to the series.

Usage

From source file:org.jfree.data.xy.XYSeriesCollection.java

/**
 * Constructs a dataset and populates it with a single series.
 *
 * @param series  the series (<code>null</code> ignored).
 *//*from ww  w .  j  ava 2 s . com*/
public XYSeriesCollection(XYSeries series) {
    this.data = new java.util.ArrayList();
    this.intervalDelegate = new IntervalXYDelegate(this, false);
    addChangeListener(this.intervalDelegate);
    if (series != null) {
        this.data.add(series);
        series.addChangeListener(this);
        series.addVetoableChangeListener(this);
    }
}

From source file:org.jfree.data.xy.XYSeriesCollection.java

/**
 * Adds a series to the collection and sends a {@link DatasetChangeEvent}
 * to all registered listeners./*w w w.j a  v  a 2  s . c  o  m*/
 *
 * @param series  the series (<code>null</code> not permitted).
 * 
 * @throws IllegalArgumentException if the key for the series is null or
 *     not unique within the dataset.
 */
public void addSeries(XYSeries series) {
    ParamChecks.nullNotPermitted(series, "series");
    if (getSeriesIndex(series.getKey()) >= 0) {
        throw new IllegalArgumentException(
                "This dataset already contains a series with the key " + series.getKey());
    }
    this.data.add(series);
    series.addChangeListener(this);
    series.addVetoableChangeListener(this);
    fireDatasetChanged();
}