List of usage examples for org.jfree.data.xy XYSeries addVetoableChangeListener
public void addVetoableChangeListener(VetoableChangeListener listener)
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(); }