org.jfree.data.general.Dataset Java Examples

The following examples show how to use org.jfree.data.general.Dataset. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: VariablePlot.java    From netcdf-java with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public void clear() {
  XYPlot p = chart.getXYPlot();

  for (int i = 0; i < p.getDatasetCount(); i++) {
    Dataset dataset = p.getDataset(i);

    log.info("clear dataset " + i + " dataset " + dataset);

    if (dataset instanceof TimeSeriesCollection)
      ((TimeSeriesCollection) dataset).removeAllSeries();
    if (dataset instanceof XYSeriesCollection)
      ((XYSeriesCollection) dataset).removeAllSeries();

    p.setDataset(i, null);
    if (i > 0)
      p.setRangeAxis(i, null);
  }
}
 
Example #2
Source File: BaseChartBuilderTest.java    From qpid-broker-j with Apache License 2.0 6 votes vote down vote up
@Test
public void testBuildChart()
{
    BaseChartBuilder chartBuilder = new ChartBuilder(_seriesBuilder, _strokeAndPaintApplier, _datasetHolder)
    {
        @Override
        protected JFreeChart createChartImpl(String title, String xAxisTitle, String yAxisTitle, Dataset dataset, PlotOrientation plotOrientation, boolean showLegend, boolean showToolTips, boolean showUrls)
        {
            assertEquals(CHART_TITLE, title);
            assertEquals(X_TITLE, xAxisTitle);
            assertEquals(Y_TITLE, yAxisTitle);

            return _jFreeChart;
        }
    };

    JFreeChart chart = chartBuilder.buildChart(_chartingDefinition);

    assertEquals(BaseChartBuilder.BLUE_GRADIENT, chart.getBackgroundPaint());
    assertEquals(
            "The *second* subtitle of the generated chart should have the text from the chart definition",
            CHART_SUB_TITLE,
            ((TextTitle)chart.getSubtitle(1)).getText());

    verify(_seriesPainter).applySeriesAppearance(_jFreeChart, _seriesDefinitions, _strokeAndPaintApplier);
}
 
Example #3
Source File: BarChart3DBuilder.java    From qpid-broker-j with Apache License 2.0 6 votes vote down vote up
@Override
protected JFreeChart createCategoryChart(String title, String xAxisTitle,
        String yAxisTitle, final Dataset dataset, PlotOrientation plotOrientation,
        boolean showLegend, boolean showToolTips, boolean showUrls)
{
    JFreeChart chart = ChartFactory.createBarChart3D(title,
            xAxisTitle,
            yAxisTitle,
            (CategoryDataset)dataset,
            plotOrientation,
            showLegend,
            showToolTips,
            showUrls);

    return chart;
}
 
Example #4
Source File: DatasetMap.java    From Knowage-Server with GNU Affero General Public License v3.0 6 votes vote down vote up
public DatasetMap copyDatasetMap(Dataset dataset){
	logger.debug("IN");
	DatasetMap copy=new DatasetMap();

	copy.setSeries(this.series);
	copy.setSeriesNumber(this.seriesNumber);
	copy.setCategories(this.getCategories());
	copy.setCatsnum(this.getCatsnum());
	copy.setNumberCatVisualization(this.getNumberCatVisualization());
	copy.setNumberSerVisualization(this.getNumberSerVisualization());
	copy.setCatTitle(this.getCatTitle());
	copy.setSerTitle(this.getSerTitle());
	copy.setCategoryCurrent(this.getCategoryCurrent());
	copy.setValueSlider(this.getValueSlider());
	copy.setCategoryCurrentName(this.getCategoryCurrentName());		
	copy.setSelectedSeries(this.getSelectedSeries());
	copy.setMakeSlider(this.isMakeSlider());
	copy.selectedCatGroups=this.getSelectedCatGroups();
	copy.addDataset("1", dataset);
	logger.debug("OUT");
	return copy;

}
 
Example #5
Source File: TimeSeriesLineChartBuilder.java    From qpid-broker-j with Apache License 2.0 6 votes vote down vote up
@Override
public JFreeChart createChartImpl(String title, String xAxisTitle,
        String yAxisTitle, final Dataset dataset, PlotOrientation plotOrientation,
        boolean showLegend, boolean showToolTips, boolean showUrls)
{
    JFreeChart chart = ChartFactory.createTimeSeriesChart(
            title,
            xAxisTitle,
            yAxisTitle,
            (XYDataset)dataset,
            showLegend,
            showToolTips,
            showUrls);

    return chart;
}
 
Example #6
Source File: BaseChartBuilder.java    From qpid-broker-j with Apache License 2.0 6 votes vote down vote up
private JFreeChart createChart(ChartingDefinition chartingDefinition, final Dataset dataset)
{
    String title = chartingDefinition.getChartTitle();
    String xAxisTitle = chartingDefinition.getXAxisTitle();
    String yAxisTitle = chartingDefinition.getYAxisTitle();

    final JFreeChart chart = createChartImpl(
            title, xAxisTitle, yAxisTitle,
            dataset,
            PLOT_ORIENTATION, SHOW_LEGEND, SHOW_TOOL_TIPS, SHOW_URLS);

    configureYAxisBounds(chartingDefinition, chart);
    addSubtitle(chart, chartingDefinition);
    chart.setBackgroundPaint(BLUE_GRADIENT);
    _seriesPainter.applySeriesAppearance(chart, chartingDefinition.getSeriesDefinitions(), newStrokeAndPaintApplier());

    return chart;
}
 
Example #7
Source File: BarCharts.java    From Knowage-Server with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Limits the dataset to a particular serie.
 * 
 * @param dataset the dataset
 * @param serie the serie
 * 
 * @return the dataset
 */

public Dataset filterDatasetSeries(Dataset dataset, Vector series) {
	logger.debug("IN");
	DefaultCategoryDataset catDataset=(DefaultCategoryDataset)dataset;

	//keeps track of wich series has to be shown
	currentSeries=series;

	//List rowKeys=new Vector();

	List rowKeys=new Vector(catDataset.getRowKeys());

	for (Iterator iterator = rowKeys.iterator(); iterator.hasNext();) {
		String row = (String) iterator.next();
		if(!(series.contains(row))){
			catDataset.removeRow(row);	
			seriesNames.remove(row);
		}			
	}

	logger.debug("OUT");
	return catDataset;

}
 
Example #8
Source File: JRFillTimePeriodDataset.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public Dataset getCustomDataset()
{
	TimePeriodValuesCollection dataset = new TimePeriodValuesCollection();
	if (seriesNames != null)
	{
		for(int i = 0; i < seriesNames.size(); i++)
		{
			Comparable<?> seriesName = seriesNames.get(i);
			dataset.addSeries(seriesMap.get(seriesName));
		}
	}
	return dataset;
}
 
Example #9
Source File: BoxCharts.java    From Knowage-Server with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Use for slider: limits the categories visualization from cat selected to cat selected+numberscatsVisualization.
 * 
 * @param dataset the dataset
 * @param categories the categories
 * @param catSelected the cat selected
 * @param numberCatsVisualization the number cats visualization
 * 
 * @return the dataset
 */

public Dataset filterDataset(Dataset dataset, HashMap categories, int catSelected, int numberCatsVisualization) {
	logger.debug("IN");
	DefaultCategoryDataset catDataset=(DefaultCategoryDataset)dataset;

	int numCats=categories.size();
	Vector visCat=new Vector();
	// from the choice point to min(chose point+interval, end point)
	//int startPoint=((catSelected-1)*numberCatsVisualization)+1;
	int startPoint=catSelected;

	int endPoint;
	if((startPoint+numberCatsVisualization-1)<=(categories.size()))
		endPoint=startPoint+numberCatsVisualization-1;
	else
		endPoint=categories.size();

	for(int i=(startPoint);i<=endPoint;i++){
		String name=(String)categories.get(new Integer(i));
		visCat.add(name);
	}


	List columns=new Vector(catDataset.getColumnKeys());
	for (Iterator iterator = columns.iterator(); iterator.hasNext();) {
		String col = (String) iterator.next();
		if(!(visCat.contains(col))){
			catDataset.removeColumn(col);
		}			
	}
	logger.debug("OUT");

	return catDataset;

}
 
Example #10
Source File: PolarPlot.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
/**
 * 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.angleGridlineStroke = SerialUtilities.readStroke(stream);
    this.angleGridlinePaint = SerialUtilities.readPaint(stream);
    this.radiusGridlineStroke = SerialUtilities.readStroke(stream);
    this.radiusGridlinePaint = SerialUtilities.readPaint(stream);
    this.angleLabelPaint = SerialUtilities.readPaint(stream);

    int rangeAxisCount = this.axes.size();
    for (int i = 0; i < rangeAxisCount; i++) {
        Axis axis = (Axis) this.axes.get(i);
        if (axis != null) {
            axis.setPlot(this);
            axis.addChangeListener(this);
        }
    }
    int datasetCount = this.datasets.size();
    for (int i = 0; i < datasetCount; i++) {
        Dataset dataset = (Dataset) this.datasets.get(i);
        if (dataset != null) {
            dataset.addChangeListener(this);
        }
    }
    int rendererCount = this.renderers.size();
    for (int i = 0; i < rendererCount; i++) {
        PolarItemRenderer renderer = (PolarItemRenderer) this.renderers.get(i);
        if (renderer != null) {
            renderer.addChangeListener(this);
        }
    }
}
 
Example #11
Source File: JRFillGanttDataset.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public Dataset getCustomDataset()
{
	TaskSeriesCollection dataset = new TaskSeriesCollection();
	if (seriesNames != null)
	{
		for(int i = 0; i < seriesNames.size(); i++)
		{
			Comparable<?> seriesName = seriesNames.get(i);
			dataset.add(seriesMap.get(seriesName));
		}
	}
	return dataset;
}
 
Example #12
Source File: PolarPlot.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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.angleGridlineStroke = SerialUtilities.readStroke(stream);
    this.angleGridlinePaint = SerialUtilities.readPaint(stream);
    this.radiusGridlineStroke = SerialUtilities.readStroke(stream);
    this.radiusGridlinePaint = SerialUtilities.readPaint(stream);
    this.angleLabelPaint = SerialUtilities.readPaint(stream);

    int rangeAxisCount = this.axes.size();
    for (int i = 0; i < rangeAxisCount; i++) {
        Axis axis = (Axis) this.axes.get(i);
        if (axis != null) {
            axis.setPlot(this);
            axis.addChangeListener(this);
        }
    }
    int datasetCount = this.datasets.size();
    for (int i = 0; i < datasetCount; i++) {
        Dataset dataset = (Dataset) this.datasets.get(i);
        if (dataset != null) {
            dataset.addChangeListener(this);
        }
    }
    int rendererCount = this.renderers.size();
    for (int i = 0; i < rendererCount; i++) {
        PolarItemRenderer renderer = (PolarItemRenderer) this.renderers.get(i);
        if (renderer != null) {
            renderer.addChangeListener(this);
        }
    }
}
 
Example #13
Source File: JRFillXyDataset.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public Dataset getCustomDataset()
{
	XYSeriesCollection dataset = new XYSeriesCollection();
	if (seriesNames != null)
	{
		for(int i = 0; i < seriesNames.size(); i++)
		{
			Comparable<?> seriesName = seriesNames.get(i);
			dataset.addSeries(seriesMap.get(seriesName));
		}
	}
	return dataset;
}
 
Example #14
Source File: JRFillTimeSeriesDataset.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public Dataset getCustomDataset()
{
	TimeSeriesCollection dataset = new TimeSeriesCollection(getTimeZone());
	if (seriesNames != null)
	{
		for(int i = 0; i < seriesNames.size(); i++)
		{
			Comparable<?> seriesName = seriesNames.get(i);
			dataset.addSeries(seriesMap.get(seriesName));
		}
	}
	return dataset;
}
 
Example #15
Source File: BaseChartBuilder.java    From qpid-broker-j with Apache License 2.0 5 votes vote down vote up
@Override
public JFreeChart buildChart(ChartingDefinition chartingDefinition)
{
    _seriesBuilder.setDatasetHolder(newDatasetHolder());
    Dataset dataset = _seriesBuilder.build(chartingDefinition.getSeriesDefinitions());

    JFreeChart chart = createChart(chartingDefinition, dataset);
    return chart;
}
 
Example #16
Source File: JdbcSeriesBuilder.java    From qpid-broker-j with Apache License 2.0 5 votes vote down vote up
@Override
public Dataset build(List<SeriesDefinition> seriesDefinitions)
{
    for (Iterator<SeriesDefinition> iterator = seriesDefinitions.iterator(); iterator.hasNext();)
    {
        SeriesDefinition series = iterator.next();
        buildDataSetForSingleSeries(series);
    }
    return _datasetHolder.getPopulatedDataset();
}
 
Example #17
Source File: BarChartBuilder.java    From qpid-broker-j with Apache License 2.0 5 votes vote down vote up
@Override
protected JFreeChart createCategoryChart(String title, String xAxisTitle,
        String yAxisTitle, final Dataset dataset, PlotOrientation plotOrientation,
        boolean showLegend, boolean showToolTips, boolean showUrls)
{
    JFreeChart chart = ChartFactory.createBarChart(title,
            xAxisTitle,
            yAxisTitle,
            (CategoryDataset) dataset,
            plotOrientation,
            showLegend,
            showToolTips,
            showUrls);
    return chart;
}
 
Example #18
Source File: LineChartBuilder.java    From qpid-broker-j with Apache License 2.0 5 votes vote down vote up
@Override
protected JFreeChart createCategoryChart(String title, String xAxisTitle,
        String yAxisTitle, final Dataset dataset, PlotOrientation plotOrientation,
        boolean showLegend, boolean showToolTips, boolean showUrls)
{
    JFreeChart chart = ChartFactory.createLineChart(title,
                                                    xAxisTitle,
                                                    yAxisTitle,
                                                    (CategoryDataset)dataset,
                                                    plotOrientation,
                                                    showLegend,
                                                    showToolTips,
                                                    showUrls);
    return chart;
}
 
Example #19
Source File: LineChart3DBuilder.java    From qpid-broker-j with Apache License 2.0 5 votes vote down vote up
@Override
protected JFreeChart createCategoryChart(String title, String xAxisTitle,
        String yAxisTitle, final Dataset dataset, PlotOrientation plotOrientation,
        boolean showLegend, boolean showToolTips, boolean showUrls)
{
    JFreeChart chart = ChartFactory.createLineChart3D(title,
                                                      xAxisTitle,
                                                      yAxisTitle,
                                                      (CategoryDataset)dataset,
                                                      plotOrientation,
                                                      showLegend,
                                                      showToolTips,
                                                      showUrls);
    return chart;
}
 
Example #20
Source File: CategoryDataSetBasedChartBuilder.java    From qpid-broker-j with Apache License 2.0 5 votes vote down vote up
@Override
protected final JFreeChart createChartImpl(String title, String xAxisTitle, String yAxisTitle, Dataset dataset, PlotOrientation plotOrientation, boolean showLegend, boolean showToolTips, boolean showUrls)
{
    JFreeChart chart = createCategoryChart(title, xAxisTitle, yAxisTitle, dataset, plotOrientation, showLegend, showToolTips, showUrls);
    chart.getCategoryPlot().getDomainAxis().setCategoryLabelPositions(CategoryLabelPositions.UP_45);
    return chart;
}
 
Example #21
Source File: MultiAxisChartHyperlinkProvider.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
protected Dataset getEntityDataset(ChartEntity entity)
{
	Dataset dataset = null;
	if (entity instanceof CategoryItemEntity)
	{
		dataset = ((CategoryItemEntity) entity).getDataset();
	}
	else if (entity instanceof XYItemEntity)
	{
		dataset = ((XYItemEntity) entity).getDataset();
	}
	return dataset;
}
 
Example #22
Source File: MultiAxisChartHyperlinkProvider.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
protected ChartHyperlinkProvider resolveEntityProvider(ChartEntity entity)
{
	ChartHyperlinkProvider provider = null;
	Dataset dataset = getEntityDataset(entity);
	if (dataset != null)
	{
		provider = datasetProviders.get(dataset);
	}
	return provider;
}
 
Example #23
Source File: PolarPlot.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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.angleGridlineStroke = SerialUtilities.readStroke(stream);
    this.angleGridlinePaint = SerialUtilities.readPaint(stream);
    this.radiusGridlineStroke = SerialUtilities.readStroke(stream);
    this.radiusGridlinePaint = SerialUtilities.readPaint(stream);
    this.angleLabelPaint = SerialUtilities.readPaint(stream);

    int rangeAxisCount = this.axes.size();
    for (int i = 0; i < rangeAxisCount; i++) {
        Axis axis = (Axis) this.axes.get(i);
        if (axis != null) {
            axis.setPlot(this);
            axis.addChangeListener(this);
        }
    }
    int datasetCount = this.datasets.size();
    for (int i = 0; i < datasetCount; i++) {
        Dataset dataset = (Dataset) this.datasets.get(i);
        if (dataset != null) {
            dataset.addChangeListener(this);
        }
    }
    int rendererCount = this.renderers.size();
    for (int i = 0; i < rendererCount; i++) {
        PolarItemRenderer renderer = (PolarItemRenderer) this.renderers.get(i);
        if (renderer != null) {
            renderer.addChangeListener(this);
        }
    }
}
 
Example #24
Source File: Cardumen_006_t.java    From coming with MIT License 4 votes vote down vote up
/**
 * 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.domainGridlineStroke = SerialUtilities.readStroke(stream);
    this.domainGridlinePaint = SerialUtilities.readPaint(stream);
    this.rangeGridlineStroke = SerialUtilities.readStroke(stream);
    this.rangeGridlinePaint = SerialUtilities.readPaint(stream);
    this.rangeCrosshairStroke = SerialUtilities.readStroke(stream);
    this.rangeCrosshairPaint = SerialUtilities.readPaint(stream);

    for (int i = 0; i < this.domainAxes.size(); i++) {
        CategoryAxis xAxis = (CategoryAxis) this.domainAxes.get(i);
        if (xAxis != null) {
            xAxis.setPlot(this);
            xAxis.addChangeListener(this);
        }
    } 
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis yAxis = (ValueAxis) this.rangeAxes.get(i);
        if (yAxis != null) {
            yAxis.setPlot(this);   
            yAxis.addChangeListener(this);
        }
    }
    int datasetCount = this.datasets.size();
    for (int i = 0; i < datasetCount; i++) {
        Dataset dataset = (Dataset) this.datasets.get(i);
        if (dataset != null) {
            dataset.addChangeListener(this);
        }
    }
    int rendererCount = this.renderers.size();
    for (int i = 0; i < rendererCount; i++) {
        CategoryItemRenderer renderer 
            = (CategoryItemRenderer) this.renderers.get(i);
        if (renderer != null) {
            renderer.addChangeListener(this);
        }
    }

}
 
Example #25
Source File: Cardumen_00243_t.java    From coming with MIT License 4 votes vote down vote up
/**
 * 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.domainGridlineStroke = SerialUtilities.readStroke(stream);
    this.domainGridlinePaint = SerialUtilities.readPaint(stream);
    this.rangeGridlineStroke = SerialUtilities.readStroke(stream);
    this.rangeGridlinePaint = SerialUtilities.readPaint(stream);
    this.rangeCrosshairStroke = SerialUtilities.readStroke(stream);
    this.rangeCrosshairPaint = SerialUtilities.readPaint(stream);

    for (int i = 0; i < this.domainAxes.size(); i++) {
        CategoryAxis xAxis = (CategoryAxis) this.domainAxes.get(i);
        if (xAxis != null) {
            xAxis.setPlot(this);
            xAxis.addChangeListener(this);
        }
    } 
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis yAxis = (ValueAxis) this.rangeAxes.get(i);
        if (yAxis != null) {
            yAxis.setPlot(this);   
            yAxis.addChangeListener(this);
        }
    }
    int datasetCount = this.datasets.size();
    for (int i = 0; i < datasetCount; i++) {
        Dataset dataset = (Dataset) this.datasets.get(i);
        if (dataset != null) {
            dataset.addChangeListener(this);
        }
    }
    int rendererCount = this.renderers.size();
    for (int i = 0; i < rendererCount; i++) {
        CategoryItemRenderer renderer 
            = (CategoryItemRenderer) this.renderers.get(i);
        if (renderer != null) {
            renderer.addChangeListener(this);
        }
    }

}
 
Example #26
Source File: SimpleChartTheme.java    From jasperreports with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 *
 */
protected Dataset getDataset()
{
	return getChartContext().getDataset();
}
 
Example #27
Source File: jKali_001_t.java    From coming with MIT License 4 votes vote down vote up
/**
 * 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.domainGridlineStroke = SerialUtilities.readStroke(stream);
    this.domainGridlinePaint = SerialUtilities.readPaint(stream);
    this.rangeGridlineStroke = SerialUtilities.readStroke(stream);
    this.rangeGridlinePaint = SerialUtilities.readPaint(stream);
    this.rangeCrosshairStroke = SerialUtilities.readStroke(stream);
    this.rangeCrosshairPaint = SerialUtilities.readPaint(stream);

    for (int i = 0; i < this.domainAxes.size(); i++) {
        CategoryAxis xAxis = (CategoryAxis) this.domainAxes.get(i);
        if (xAxis != null) {
            xAxis.setPlot(this);
            xAxis.addChangeListener(this);
        }
    } 
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis yAxis = (ValueAxis) this.rangeAxes.get(i);
        if (yAxis != null) {
            yAxis.setPlot(this);   
            yAxis.addChangeListener(this);
        }
    }
    int datasetCount = this.datasets.size();
    for (int i = 0; i < datasetCount; i++) {
        Dataset dataset = (Dataset) this.datasets.get(i);
        if (dataset != null) {
            dataset.addChangeListener(this);
        }
    }
    int rendererCount = this.renderers.size();
    for (int i = 0; i < rendererCount; i++) {
        CategoryItemRenderer renderer 
            = (CategoryItemRenderer) this.renderers.get(i);
        if (renderer != null) {
            renderer.addChangeListener(this);
        }
    }

}
 
Example #28
Source File: JRFillCategoryDataset.java    From jasperreports with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public Dataset getCustomDataset()
{
	return dataset;
}
 
Example #29
Source File: Cardumen_00143_t.java    From coming with MIT License 4 votes vote down vote up
/**
 * 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.domainGridlineStroke = SerialUtilities.readStroke(stream);
    this.domainGridlinePaint = SerialUtilities.readPaint(stream);
    this.rangeGridlineStroke = SerialUtilities.readStroke(stream);
    this.rangeGridlinePaint = SerialUtilities.readPaint(stream);
    this.rangeCrosshairStroke = SerialUtilities.readStroke(stream);
    this.rangeCrosshairPaint = SerialUtilities.readPaint(stream);

    for (int i = 0; i < this.domainAxes.size(); i++) {
        CategoryAxis xAxis = (CategoryAxis) this.domainAxes.get(i);
        if (xAxis != null) {
            xAxis.setPlot(this);
            xAxis.addChangeListener(this);
        }
    } 
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis yAxis = (ValueAxis) this.rangeAxes.get(i);
        if (yAxis != null) {
            yAxis.setPlot(this);   
            yAxis.addChangeListener(this);
        }
    }
    int datasetCount = this.datasets.size();
    for (int i = 0; i < datasetCount; i++) {
        Dataset dataset = (Dataset) this.datasets.get(i);
        if (dataset != null) {
            dataset.addChangeListener(this);
        }
    }
    int rendererCount = this.renderers.size();
    for (int i = 0; i < rendererCount; i++) {
        CategoryItemRenderer renderer 
            = (CategoryItemRenderer) this.renderers.get(i);
        if (renderer != null) {
            renderer.addChangeListener(this);
        }
    }

}
 
Example #30
Source File: Cardumen_006_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * 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.domainGridlineStroke = SerialUtilities.readStroke(stream);
    this.domainGridlinePaint = SerialUtilities.readPaint(stream);
    this.rangeGridlineStroke = SerialUtilities.readStroke(stream);
    this.rangeGridlinePaint = SerialUtilities.readPaint(stream);
    this.rangeCrosshairStroke = SerialUtilities.readStroke(stream);
    this.rangeCrosshairPaint = SerialUtilities.readPaint(stream);

    for (int i = 0; i < this.domainAxes.size(); i++) {
        CategoryAxis xAxis = (CategoryAxis) this.domainAxes.get(i);
        if (xAxis != null) {
            xAxis.setPlot(this);
            xAxis.addChangeListener(this);
        }
    } 
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis yAxis = (ValueAxis) this.rangeAxes.get(i);
        if (yAxis != null) {
            yAxis.setPlot(this);   
            yAxis.addChangeListener(this);
        }
    }
    int datasetCount = this.datasets.size();
    for (int i = 0; i < datasetCount; i++) {
        Dataset dataset = (Dataset) this.datasets.get(i);
        if (dataset != null) {
            dataset.addChangeListener(this);
        }
    }
    int rendererCount = this.renderers.size();
    for (int i = 0; i < rendererCount; i++) {
        CategoryItemRenderer renderer 
            = (CategoryItemRenderer) this.renderers.get(i);
        if (renderer != null) {
            renderer.addChangeListener(this);
        }
    }

}