/** * {@inheritDoc} */ @Override public void addChangeListener(DatasetChangeListener listener) { dataset.addChangeListener(listener); }
/** * {@inheritDoc} */ @Override public void addChangeListener(DatasetChangeListener listener) { dataset.addChangeListener(listener); }
/** * An adaptor class that converts any {@link CategoryDataset} into a * {@link PieDataset}, by taking the values from a single row or column. * <p> * If <code>source</code> is <code>null</code>, the created dataset will * be empty. * * @param source the source dataset (<code>null</code> permitted). * @param extract extract data from rows or columns? (<code>null</code> * not permitted). * @param index the row or column index. */ public CategoryToPieDataset(CategoryDataset source, TableOrder extract, int index) { if (extract == null) { throw new IllegalArgumentException("Null 'extract' argument."); } this.source = source; if (this.source != null) { this.source.addChangeListener(this); } this.extract = extract; this.index = index; }
/** * An adaptor class that converts any {@link CategoryDataset} into a * {@link PieDataset}, by taking the values from a single row or column. * <p> * If {@code source} is {@code null}, the created dataset will * be empty. * * @param source the source dataset ({@code null} permitted). * @param extract extract data from rows or columns? ({@code null} * not permitted). * @param index the row or column index. */ public CategoryToPieDataset(CategoryDataset source, TableOrder extract, int index) { Args.nullNotPermitted(extract, "extract"); this.source = source; if (this.source != null) { this.source.addChangeListener(this); } this.extract = extract; this.index = index; }
/** * Sets a dataset for the plot and sends a change notification to all * registered listeners. * * @param index the dataset index (must be >= 0). * @param dataset the dataset ({@code null} permitted). * * @see #getDataset(int) */ public void setDataset(int index, CategoryDataset dataset) { CategoryDataset existing = (CategoryDataset) this.datasets.get(index); if (existing != null) { existing.removeChangeListener(this); } this.datasets.put(index, dataset); if (dataset != null) { dataset.addChangeListener(this); } // send a dataset change event to self... DatasetChangeEvent event = new DatasetChangeEvent(this, dataset); datasetChanged(event); }
/** * Creates a new plot with a given dataset and paint maps. * * @param dataset The dataset. * @param paintMaps The paint maps.. */ public ChartMultiplePiePlot(CategoryDataset dataset, PaintMaps paintMaps) { super(dataset); this.paintMaps = paintMaps; this.sectionPaints = new HashMap(); this.drawingSupplier = new DefaultDrawingSupplier(); this.baseItemLabelGenerator = new StandardCategoryItemLabelGenerator(); this.legendItemLabelGenerator = new StandardCategoryItemLabelGenerator(); // important: listen to change events from dataset dataset.addChangeListener(this); }
this.datasets.put(0, dataset); if (dataset != null) { dataset.addChangeListener(this);
dataset.addChangeListener(this);
this.dataset = dataset; if (dataset != null) { dataset.addChangeListener(this);
/** * Sets the dataset used by the plot and sends a {@link PlotChangeEvent} * to all registered listeners. * * @param dataset the dataset (<code>null</code> permitted). */ public void setDataset(CategoryDataset dataset) { // if there is an existing dataset, remove the plot from the list of // change listeners... if (this.dataset != null) { this.dataset.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); } // send a dataset change event to self to trigger plot change event datasetChanged(new DatasetChangeEvent(this, dataset)); }
/** * Sets the dataset used by the plot and sends a {@link PlotChangeEvent} * to all registered listeners. * * @param dataset the dataset ({@code null} permitted). * * @see #getDataset() */ public void setDataset(CategoryDataset dataset) { // if there is an existing dataset, remove the plot from the list of // change listeners... if (this.dataset != null) { this.dataset.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); } // send a dataset change event to self to trigger plot change event datasetChanged(new DatasetChangeEvent(this, dataset)); }
/** * Sets the dataset used by the plot and sends a {@link PlotChangeEvent} * to all registered listeners. * * @param dataset the dataset ({@code null} permitted). */ public void setDataset(CategoryDataset dataset) { // if there is an existing dataset, remove the plot from the list of // change listeners... if (this.dataset != null) { this.dataset.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); } // send a dataset change event to self to trigger plot change event datasetChanged(new DatasetChangeEvent(this, dataset)); }
/** * Sets a dataset for the plot. * * @param index the dataset index. * @param dataset the dataset (<code>null</code> permitted). * * @see #getDataset(int) */ public void setDataset(int index, CategoryDataset dataset) { CategoryDataset existing = (CategoryDataset) this.datasets.get(index); if (existing != null) { existing.removeChangeListener(this); } this.datasets.set(index, dataset); if (dataset != null) { dataset.addChangeListener(this); } // send a dataset change event to self... DatasetChangeEvent event = new DatasetChangeEvent(this, dataset); datasetChanged(event); }
/** * Sets the dataset used by the plot and sends a {@link PlotChangeEvent} * to all registered listeners. * * @param dataset the dataset (<code>null</code> permitted). * * @see #getDataset() */ public void setDataset(CategoryDataset dataset) { // if there is an existing dataset, remove the plot from the list of // change listeners... if (this.dataset != null) { this.dataset.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); } // send a dataset change event to self to trigger plot change event datasetChanged(new DatasetChangeEvent(this, dataset)); }
for (CategoryDataset dataset : clone.datasets.values()) { if (dataset != null) { dataset.addChangeListener(clone);
/** * Provides serialization support. * * @param stream the input stream. * * @throws IOException if there is an I/O error. * @throws ClassNotFoundException if there is a classpath problem. */ private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); this.legendItemShape = SerialUtils.readShape(stream); this.seriesPaint = SerialUtils.readPaint(stream); this.baseSeriesPaint = SerialUtils.readPaint(stream); this.seriesOutlinePaint = SerialUtils.readPaint(stream); this.baseSeriesOutlinePaint = SerialUtils.readPaint(stream); this.seriesOutlineStroke = SerialUtils.readStroke(stream); this.baseSeriesOutlineStroke = SerialUtils.readStroke(stream); this.labelPaint = SerialUtils.readPaint(stream); this.axisLinePaint = SerialUtils.readPaint(stream); this.axisLineStroke = SerialUtils.readStroke(stream); if (this.dataset != null) { this.dataset.addChangeListener(this); } }
dataset.addChangeListener(this);
/** * Provides serialization support. * * @param stream the input stream. * * @throws IOException if there is an I/O error. * @throws ClassNotFoundException if there is a classpath problem. */ private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); this.legendItemShape = SerialUtilities.readShape(stream); this.seriesPaint = SerialUtilities.readPaint(stream); this.baseSeriesPaint = SerialUtilities.readPaint(stream); this.seriesOutlinePaint = SerialUtilities.readPaint(stream); this.baseSeriesOutlinePaint = SerialUtilities.readPaint(stream); this.seriesOutlineStroke = SerialUtilities.readStroke(stream); this.baseSeriesOutlineStroke = SerialUtilities.readStroke(stream); this.labelPaint = SerialUtilities.readPaint(stream); this.axisLinePaint = SerialUtilities.readPaint(stream); this.axisLineStroke = SerialUtilities.readStroke(stream); if (this.dataset != null) { this.dataset.addChangeListener(this); } }
this.datasets.set(0, dataset); if (dataset != null) { dataset.addChangeListener(this);