Beispiel #1
0
  /**
   * Adds a series to the collection and sends a {@link DatasetChangeEvent} to all registered
   * listeners.
   *
   * @param series the series (<code>null</code> not permitted).
   */
  public void addSeries(XYSeries series) {

    if (series == null) {
      throw new IllegalArgumentException("Null 'series' argument.");
    }
    this.data.add(series);
    series.addChangeListener(this);
    fireDatasetChanged();
  }
Beispiel #2
0
 /**
  * Constructs a dataset and populates it with a single series.
  *
  * @param series the series (<code>null</code> ignored).
  */
 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);
   }
 }
 /**
  * Adds a series to the collection and sends a {@link DatasetChangeEvent} to all registered
  * listeners. The series should be configured to NOT allow duplicate x-values.
  *
  * @param series the series (<code>null</code> not permitted).
  */
 public void addSeries(XYSeries series) {
   if (series == null) {
     throw new IllegalArgumentException("Null 'series' argument.");
   }
   if (series.getAllowDuplicateXValues()) {
     throw new IllegalArgumentException(
         "Cannot accept XYSeries that allow duplicate values. "
             + "Use XYSeries(seriesName, <sort>, false) constructor.");
   }
   updateXPoints(series);
   this.data.add(series);
   series.addChangeListener(this);
   fireDatasetChanged();
 }