Package org.apache.qpid.disttest.charting.definition

Examples of org.apache.qpid.disttest.charting.definition.SeriesDefinition


    public void testAddPointToSeries()
    {
        TimeSeriesHolder timeSeriesHolder = new TimeSeriesHolder();

        SeriesDefinition seriesDefinition = mock(SeriesDefinition.class);
        when(seriesDefinition.getSeriesLegend()).thenReturn(SERIES_LEGEND);

        timeSeriesHolder.beginSeries(seriesDefinition);

        timeSeriesHolder.addDataPointToSeries(seriesDefinition, new SeriesRow(_dates[0], _values[0]));
        timeSeriesHolder.addDataPointToSeries(seriesDefinition, new SeriesRow(_dates[1], _values[1]));
View Full Code Here


        createTestCsvIn(_testTempDir);
    }

    public void testBuildOneSeries() throws Exception
    {
        SeriesDefinition seriesDefinition = createTestSeriesDefinition();

        JdbcSeriesBuilder seriesBuilder = new JdbcSeriesBuilder("org.relique.jdbc.csv.CsvDriver", null);

        seriesBuilder.setDatasetHolder(_seriesWalkerCallback);
View Full Code Here

        csvWriter.close();
    }

    private SeriesDefinition createTestSeriesDefinition()
    {
        SeriesDefinition definition = new SeriesDefinition(
                TEST_SERIES_1_SELECT_STATEMENT,
                TEST_SERIES_1_LEGEND,
                _testTempDir.getAbsolutePath(),
                TEST_SERIES1_COLOUR_NAME,
                TEST_SERIES1_STROKE_WIDTH);
View Full Code Here

        @Override
        public Dataset build(List<SeriesDefinition> seriesDefinitions)
        {
            for (Iterator<SeriesDefinition> iterator = seriesDefinitions.iterator(); iterator.hasNext();)
            {
                SeriesDefinition seriesDefinition = iterator.next();
                _datasetHolder.beginSeries(seriesDefinition);
                for(SeriesRow seriesRow : _sampleSeriesRows)
                {
                    _datasetHolder.addDataPointToSeries(seriesDefinition, seriesRow);
                }
View Full Code Here

        @Override
        public Dataset build(List<SeriesDefinition> seriesDefinitions)
        {
            for (Iterator<SeriesDefinition> iterator = seriesDefinitions.iterator(); iterator.hasNext();)
            {
                SeriesDefinition seriesDefinition = iterator.next();
                _datasetHolder.beginSeries(seriesDefinition);
                for(SeriesRow seriesRow : _sampleSeriesRows)
                {
                    _datasetHolder.addDataPointToSeries(seriesDefinition, seriesRow);
                }
View Full Code Here

    public void addSeriesAttributes(List<SeriesDefinition> series, SeriesStokeAndPaintAccessor stokeAndPaintAccessor)
    {
        for (int i = 0; i < series.size(); i++)
        {
            SeriesDefinition seriesDefinition = series.get(i);
            if (seriesDefinition.getSeriesColourName() != null)
            {
                stokeAndPaintAccessor.setSeriesPaint(i, ColorFactory.toColour(seriesDefinition.getSeriesColourName()));
            }
            if (seriesDefinition.getStrokeWidth() != null)
            {
                // Negative width used to signify dashed
                boolean dashed = seriesDefinition.getStrokeWidth() < 0;
                float width = Math.abs(seriesDefinition.getStrokeWidth());
                BasicStroke stroke = buildStrokeOfWidth(width, dashed);
                stokeAndPaintAccessor.setSeriesStroke(i, stroke);
            }
        }
    }
View Full Code Here

    @Override
    public void build(List<SeriesDefinition> seriesDefinitions)
    {
        for (Iterator<SeriesDefinition> iterator = seriesDefinitions.iterator(); iterator.hasNext();)
        {
            SeriesDefinition series = iterator.next();
            buildDataSetForSingleSeries(series);
        }
    }
View Full Code Here

    }

    public void testBuildOneSeries() throws Exception
    {
        createTestCsvIn(_testTempDir);
        SeriesDefinition seriesDefinition = createTestSeriesDefinition();

        _seriesBuilder.build(Collections.singletonList(seriesDefinition));

        verify(_seriesWalkerCallback).beginSeries(seriesDefinition);
        verify(_seriesWalkerCallback).addDataPointToSeries(seriesDefinition, new Object[]{"elephant", "2"});
View Full Code Here

        csvWriter.close();
    }

    private SeriesDefinition createTestSeriesDefinition()
    {
        SeriesDefinition definition = new SeriesDefinition(TEST_SERIES_1_SELECT_STATEMENT, TEST_SERIES_1_LEGEND, _testTempDir.getAbsolutePath(), TEST_SERIES1_COLOUR_NAME, TEST_SERIES1_STROKE_WIDTH);
        return definition;
    }
View Full Code Here

                    @Override
                    public void build(List<SeriesDefinition> seriesDefinitions)
                    {
                        for (Iterator<SeriesDefinition> iterator = seriesDefinitions.iterator(); iterator.hasNext();)
                        {
                            SeriesDefinition seriesDefinition = iterator.next();
                            _dataPointCallback.beginSeries(seriesDefinition);
                            _dataPointCallback.addDataPointToSeries(seriesDefinition, new Object[]{1d, 1d, 0.5d});
                            _dataPointCallback.addDataPointToSeries(seriesDefinition, new Object[]{2d, 2d, 0.4d});
                            _dataPointCallback.addDataPointToSeries(seriesDefinition, new Object[]{4d, 4d, 0.3d});
                            _dataPointCallback.addDataPointToSeries(seriesDefinition, new Object[]{5d, 5d, 0.2d});
View Full Code Here

TOP

Related Classes of org.apache.qpid.disttest.charting.definition.SeriesDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.