当前位置: 首页>>代码示例>>Java>>正文


Java DefaultIntervalCategoryDataset类代码示例

本文整理汇总了Java中org.jfree.data.category.DefaultIntervalCategoryDataset的典型用法代码示例。如果您正苦于以下问题:Java DefaultIntervalCategoryDataset类的具体用法?Java DefaultIntervalCategoryDataset怎么用?Java DefaultIntervalCategoryDataset使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DefaultIntervalCategoryDataset类属于org.jfree.data.category包,在下文中一共展示了DefaultIntervalCategoryDataset类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testDrawWithNullInfo

import org.jfree.data.category.DefaultIntervalCategoryDataset; //导入依赖的package包/类
/**
 * Draws the chart with a <code>null</code> info object to make sure that 
 * no exceptions are thrown (particularly by code in the renderer).
 */
public void testDrawWithNullInfo() {
    boolean success = false;
    try {
        double[][] starts = new double[][] {{0.1, 0.2, 0.3}, 
                {0.3, 0.4, 0.5}};
        double[][] ends = new double[][] {{0.5, 0.6, 0.7}, {0.7, 0.8, 0.9}};
        DefaultIntervalCategoryDataset dataset 
            = new DefaultIntervalCategoryDataset(starts, ends);        
        IntervalBarRenderer renderer = new IntervalBarRenderer();
        CategoryPlot plot = new CategoryPlot(dataset, 
                new CategoryAxis("Category"), new NumberAxis("Value"), 
                renderer);
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200, 
                null);
        success = true;
    }
    catch (NullPointerException e) {
        e.printStackTrace();
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:28,代码来源:IntervalBarRendererTests.java

示例2: testEquals

import org.jfree.data.category.DefaultIntervalCategoryDataset; //导入依赖的package包/类
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
public void testEquals() {
    double[] starts_S1A = new double[] {0.1, 0.2, 0.3};
    double[] starts_S2A = new double[] {0.3, 0.4, 0.5};
    double[] ends_S1A = new double[] {0.5, 0.6, 0.7};
    double[] ends_S2A = new double[] {0.7, 0.8, 0.9};
    double[][] startsA = new double[][] {starts_S1A, starts_S2A};
    double[][] endsA = new double[][] {ends_S1A, ends_S2A};
    DefaultIntervalCategoryDataset dA 
            = new DefaultIntervalCategoryDataset(startsA, endsA);        

    double[] starts_S1B = new double[] {0.1, 0.2, 0.3};
    double[] starts_S2B = new double[] {0.3, 0.4, 0.5};
    double[] ends_S1B = new double[] {0.5, 0.6, 0.7};
    double[] ends_S2B = new double[] {0.7, 0.8, 0.9};
    double[][] startsB = new double[][] {starts_S1B, starts_S2B};
    double[][] endsB = new double[][] {ends_S1B, ends_S2B};
    DefaultIntervalCategoryDataset dB 
            = new DefaultIntervalCategoryDataset(startsB, endsB);        
        
    assertTrue(dA.equals(dB));
    assertTrue(dB.equals(dA));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:26,代码来源:DefaultIntervalCategoryDatasetTests.java

示例3: testDrawWithNullInfo

import org.jfree.data.category.DefaultIntervalCategoryDataset; //导入依赖的package包/类
/**
 * Draws the chart with a <code>null</code> info object to make sure that
 * no exceptions are thrown (particularly by code in the renderer).
 */
@Test
public void testDrawWithNullInfo() {
    try {
        double[][] starts = new double[][] {{0.1, 0.2, 0.3},
                {0.3, 0.4, 0.5}};
        double[][] ends = new double[][] {{0.5, 0.6, 0.7}, {0.7, 0.8, 0.9}};
        DefaultIntervalCategoryDataset dataset
                = new DefaultIntervalCategoryDataset(starts, ends);
        IntervalBarRenderer renderer = new IntervalBarRenderer();
        CategoryPlot plot = new CategoryPlot(dataset,
                new CategoryAxis("Category"), new NumberAxis("Value"),
                renderer);
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200,
                null);
    }
    catch (NullPointerException e) {
        fail("No exception should be thrown.");
    }
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:25,代码来源:IntervalBarRendererTest.java

示例4: testDrawWithNullInfo

import org.jfree.data.category.DefaultIntervalCategoryDataset; //导入依赖的package包/类
/**
 * Draws the chart with a {@code null} info object to make sure that
 * no exceptions are thrown (particularly by code in the renderer).
 */
@Test
public void testDrawWithNullInfo() {
    try {
        double[][] starts = new double[][] {{0.1, 0.2, 0.3},
                {0.3, 0.4, 0.5}};
        double[][] ends = new double[][] {{0.5, 0.6, 0.7}, {0.7, 0.8, 0.9}};
        DefaultIntervalCategoryDataset dataset
                = new DefaultIntervalCategoryDataset(starts, ends);
        IntervalBarRenderer renderer = new IntervalBarRenderer();
        CategoryPlot plot = new CategoryPlot(dataset,
                new CategoryAxis("Category"), new NumberAxis("Value"),
                renderer);
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200,
                null);
    }
    catch (NullPointerException e) {
        fail("No exception should be thrown.");
    }
}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:25,代码来源:IntervalBarRendererTest.java

示例5: testDrawWithNullInfo

import org.jfree.data.category.DefaultIntervalCategoryDataset; //导入依赖的package包/类
/**
 * Draws the chart with a <code>null</code> info object to make sure that
 * no exceptions are thrown (particularly by code in the renderer).
 */
public void testDrawWithNullInfo() {
    boolean success = false;
    try {
        double[][] starts = new double[][] {{0.1, 0.2, 0.3},
                {0.3, 0.4, 0.5}};
        double[][] ends = new double[][] {{0.5, 0.6, 0.7}, {0.7, 0.8, 0.9}};
        DefaultIntervalCategoryDataset dataset
            = new DefaultIntervalCategoryDataset(starts, ends);
        IntervalBarRenderer renderer = new IntervalBarRenderer();
        CategoryPlot plot = new CategoryPlot(dataset,
                new CategoryAxis("Category"), new NumberAxis("Value"),
                renderer);
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200,
                null);
        success = true;
    }
    catch (NullPointerException e) {
        e.printStackTrace();
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:28,代码来源:IntervalBarRendererTests.java

示例6: testIterateRangeBounds3_CategoryDataset

import org.jfree.data.category.DefaultIntervalCategoryDataset; //导入依赖的package包/类
/**
 * Some checks for the iterateRangeBounds() method using an
 * IntervalCategoryDataset.
 */
public void testIterateRangeBounds3_CategoryDataset() {
    Number[][] starts = new Double[2][3];
    Number[][] ends = new Double[2][3];
    starts[0][0] = new Double(1.0);
    starts[0][1] = new Double(2.0);
    starts[0][2] = new Double(3.0);
    starts[1][0] = new Double(11.0);
    starts[1][1] = new Double(12.0);
    starts[1][2] = new Double(13.0);
    ends[0][0] = new Double(4.0);
    ends[0][1] = new Double(5.0);
    ends[0][2] = new Double(6.0);
    ends[1][0] = new Double(16.0);
    ends[1][1] = new Double(15.0);
    ends[1][2] = new Double(14.0);

    DefaultIntervalCategoryDataset d = new DefaultIntervalCategoryDataset(
            starts, ends);
    Range r = DatasetUtilities.iterateRangeBounds(d, false);
    assertEquals(4.0, r.getLowerBound(), EPSILON);
    assertEquals(16.0, r.getUpperBound(), EPSILON);
    r = DatasetUtilities.iterateRangeBounds(d, true);
    assertEquals(1.0, r.getLowerBound(), EPSILON);
    assertEquals(16.0, r.getUpperBound(), EPSILON);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:30,代码来源:DatasetUtilitiesTests.java

示例7: testGetRowAndColumnCount

import org.jfree.data.category.DefaultIntervalCategoryDataset; //导入依赖的package包/类
/**
 * Some tests for the getRowCount() method.
 */
public void testGetRowAndColumnCount() {
    double[] starts_S1 = new double[] {0.1, 0.2, 0.3};
    double[] starts_S2 = new double[] {0.3, 0.4, 0.5};
    double[] ends_S1 = new double[] {0.5, 0.6, 0.7};
    double[] ends_S2 = new double[] {0.7, 0.8, 0.9};
    double[][] starts = new double[][] {starts_S1, starts_S2};
    double[][] ends = new double[][] {ends_S1, ends_S2};
    DefaultIntervalCategoryDataset d 
            = new DefaultIntervalCategoryDataset(starts, ends);        

    assertEquals(2, d.getRowCount());
    assertEquals(3, d.getColumnCount());
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:17,代码来源:DefaultIntervalCategoryDatasetTests.java

示例8: testIterateRangeBounds3_CategoryDataset

import org.jfree.data.category.DefaultIntervalCategoryDataset; //导入依赖的package包/类
/**
 * Some checks for the iterateRangeBounds() method using an
 * IntervalCategoryDataset.
 */
@Test
public void testIterateRangeBounds3_CategoryDataset() {
    Number[][] starts = new Double[2][3];
    Number[][] ends = new Double[2][3];
    starts[0][0] = new Double(1.0);
    starts[0][1] = new Double(2.0);
    starts[0][2] = new Double(3.0);
    starts[1][0] = new Double(11.0);
    starts[1][1] = new Double(12.0);
    starts[1][2] = new Double(13.0);
    ends[0][0] = new Double(4.0);
    ends[0][1] = new Double(5.0);
    ends[0][2] = new Double(6.0);
    ends[1][0] = new Double(16.0);
    ends[1][1] = new Double(15.0);
    ends[1][2] = new Double(14.0);

    DefaultIntervalCategoryDataset d = new DefaultIntervalCategoryDataset(
            starts, ends);
    Range r = DatasetUtilities.iterateRangeBounds(d, false);
    assertEquals(4.0, r.getLowerBound(), EPSILON);
    assertEquals(16.0, r.getUpperBound(), EPSILON);
    r = DatasetUtilities.iterateRangeBounds(d, true);
    assertEquals(1.0, r.getLowerBound(), EPSILON);
    assertEquals(16.0, r.getUpperBound(), EPSILON);
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:31,代码来源:DatasetUtilitiesTest.java

示例9: testIterateRangeBounds3_CategoryDataset

import org.jfree.data.category.DefaultIntervalCategoryDataset; //导入依赖的package包/类
/**
 * Some checks for the iterateRangeBounds() method using an
 * IntervalCategoryDataset.
 */
@Test
public void testIterateRangeBounds3_CategoryDataset() {
    Number[][] starts = new Double[2][3];
    Number[][] ends = new Double[2][3];
    starts[0][0] = new Double(1.0);
    starts[0][1] = new Double(2.0);
    starts[0][2] = new Double(3.0);
    starts[1][0] = new Double(11.0);
    starts[1][1] = new Double(12.0);
    starts[1][2] = new Double(13.0);
    ends[0][0] = new Double(4.0);
    ends[0][1] = new Double(5.0);
    ends[0][2] = new Double(6.0);
    ends[1][0] = new Double(16.0);
    ends[1][1] = new Double(15.0);
    ends[1][2] = new Double(14.0);

    DefaultIntervalCategoryDataset d = new DefaultIntervalCategoryDataset(
            starts, ends);
    Range r = DatasetUtils.iterateRangeBounds(d, false);
    assertEquals(4.0, r.getLowerBound(), EPSILON);
    assertEquals(16.0, r.getUpperBound(), EPSILON);
    r = DatasetUtils.iterateRangeBounds(d, true);
    assertEquals(1.0, r.getLowerBound(), EPSILON);
    assertEquals(16.0, r.getUpperBound(), EPSILON);
}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:31,代码来源:DatasetUtilsTest.java

示例10: testGetRowAndColumnCount

import org.jfree.data.category.DefaultIntervalCategoryDataset; //导入依赖的package包/类
/**
 * Some tests for the getRowCount() method.
 */
public void testGetRowAndColumnCount() {
    double[] starts_S1 = new double[] {0.1, 0.2, 0.3};
    double[] starts_S2 = new double[] {0.3, 0.4, 0.5};
    double[] ends_S1 = new double[] {0.5, 0.6, 0.7};
    double[] ends_S2 = new double[] {0.7, 0.8, 0.9};
    double[][] starts = new double[][] {starts_S1, starts_S2};
    double[][] ends = new double[][] {ends_S1, ends_S2};
    DefaultIntervalCategoryDataset d
            = new DefaultIntervalCategoryDataset(starts, ends);

    assertEquals(2, d.getRowCount());
    assertEquals(3, d.getColumnCount());
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:17,代码来源:DefaultIntervalCategoryDatasetTests.java

示例11: testEquals

import org.jfree.data.category.DefaultIntervalCategoryDataset; //导入依赖的package包/类
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
public void testEquals() {
    double[] starts_S1A = new double[] {0.1, 0.2, 0.3};
    double[] starts_S2A = new double[] {0.3, 0.4, 0.5};
    double[] ends_S1A = new double[] {0.5, 0.6, 0.7};
    double[] ends_S2A = new double[] {0.7, 0.8, 0.9};
    double[][] startsA = new double[][] {starts_S1A, starts_S2A};
    double[][] endsA = new double[][] {ends_S1A, ends_S2A};
    DefaultIntervalCategoryDataset dA
            = new DefaultIntervalCategoryDataset(startsA, endsA);

    double[] starts_S1B = new double[] {0.1, 0.2, 0.3};
    double[] starts_S2B = new double[] {0.3, 0.4, 0.5};
    double[] ends_S1B = new double[] {0.5, 0.6, 0.7};
    double[] ends_S2B = new double[] {0.7, 0.8, 0.9};
    double[][] startsB = new double[][] {starts_S1B, starts_S2B};
    double[][] endsB = new double[][] {ends_S1B, ends_S2B};
    DefaultIntervalCategoryDataset dB
            = new DefaultIntervalCategoryDataset(startsB, endsB);

    assertTrue(dA.equals(dB));
    assertTrue(dB.equals(dA));

    // check that two empty datasets are equal
    DefaultIntervalCategoryDataset empty1
            = new DefaultIntervalCategoryDataset(new double[0][0],
                    new double[0][0]);
    DefaultIntervalCategoryDataset empty2
            = new DefaultIntervalCategoryDataset(new double[0][0],
                    new double[0][0]);
    assertTrue(empty1.equals(empty2));
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:35,代码来源:DefaultIntervalCategoryDatasetTests.java

示例12: testGetSeriesCount

import org.jfree.data.category.DefaultIntervalCategoryDataset; //导入依赖的package包/类
/**
 * Some checks for the getSeriesCount() method.
 */
public void testGetSeriesCount() {
    // check an empty dataset
    DefaultIntervalCategoryDataset empty
            = new DefaultIntervalCategoryDataset(new double[0][0],
                    new double[0][0]);
    assertEquals(0, empty.getSeriesCount());
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:11,代码来源:DefaultIntervalCategoryDatasetTests.java

示例13: testGetCategoryCount

import org.jfree.data.category.DefaultIntervalCategoryDataset; //导入依赖的package包/类
/**
 * Some checks for the getCategoryCount() method.
 */
public void testGetCategoryCount() {
    // check an empty dataset
    DefaultIntervalCategoryDataset empty
            = new DefaultIntervalCategoryDataset(new double[0][0],
                    new double[0][0]);
    assertEquals(0, empty.getCategoryCount());
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:11,代码来源:DefaultIntervalCategoryDatasetTests.java

示例14: testGetSeriesIndex

import org.jfree.data.category.DefaultIntervalCategoryDataset; //导入依赖的package包/类
/**
 * Some checks for the getSeriesIndex() method.
 */
public void testGetSeriesIndex() {
    // check an empty dataset
    DefaultIntervalCategoryDataset empty
            = new DefaultIntervalCategoryDataset(new double[0][0],
                    new double[0][0]);
    assertEquals(-1, empty.getSeriesIndex("ABC"));
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:11,代码来源:DefaultIntervalCategoryDatasetTests.java

示例15: testGetRowIndex

import org.jfree.data.category.DefaultIntervalCategoryDataset; //导入依赖的package包/类
/**
 * Some checks for the getRowIndex() method.
 */
public void testGetRowIndex() {
    // check an empty dataset
    DefaultIntervalCategoryDataset empty
            = new DefaultIntervalCategoryDataset(new double[0][0],
                    new double[0][0]);
    assertEquals(-1, empty.getRowIndex("ABC"));
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:11,代码来源:DefaultIntervalCategoryDatasetTests.java


注:本文中的org.jfree.data.category.DefaultIntervalCategoryDataset类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。