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


Java XYAreaRenderer2类代码示例

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


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

示例1: testEquals

import org.jfree.chart.renderer.xy.XYAreaRenderer2; //导入依赖的package包/类
/**
 * Check that the equals() method distinguishes all fields.
 */
public void testEquals() {
    XYAreaRenderer2 r1 = new XYAreaRenderer2();
    XYAreaRenderer2 r2 = new XYAreaRenderer2();
    assertEquals(r1, r2);
    
    r1.setOutline(!r1.isOutline());
    assertFalse(r1.equals(r2));
    r2.setOutline(r1.isOutline());
    assertTrue(r1.equals(r2));
    
    r1.setLegendArea(new Rectangle(1, 2, 3, 4));
    assertFalse(r1.equals(r2));
    r2.setLegendArea(new Rectangle(1, 2, 3, 4));
    assertTrue(r1.equals(r2));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:19,代码来源:XYAreaRenderer2Tests.java

示例2: testEquals

import org.jfree.chart.renderer.xy.XYAreaRenderer2; //导入依赖的package包/类
/**
 * Check that the equals() method distinguishes all fields.
 */
public void testEquals() {
    XYAreaRenderer2 r1 = new XYAreaRenderer2();
    XYAreaRenderer2 r2 = new XYAreaRenderer2();
    assertEquals(r1, r2);

    r1.setOutline(!r1.isOutline());
    assertFalse(r1.equals(r2));
    r2.setOutline(r1.isOutline());
    assertTrue(r1.equals(r2));

    r1.setLegendArea(new Rectangle(1, 2, 3, 4));
    assertFalse(r1.equals(r2));
    r2.setLegendArea(new Rectangle(1, 2, 3, 4));
    assertTrue(r1.equals(r2));
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:19,代码来源:XYAreaRenderer2Tests.java

示例3: configureXYAreaRenderer2

import org.jfree.chart.renderer.xy.XYAreaRenderer2; //导入依赖的package包/类
private static void configureXYAreaRenderer2(ValueSourceData valueSourceData, XYAreaRenderer2 renderer) {
	int seriesCount = valueSourceData.getSeriesCount();
	SeriesFormat seriesFormat = valueSourceData.getValueSource().getSeriesFormat();
	// Loop all series and set series format.
	// Format based on dimension configs will be set later on in initFormatDelegate().
	for (int seriesIdx = 0; seriesIdx < seriesCount; ++seriesIdx) {
		renderer.setSeriesPaint(seriesIdx, seriesFormat.getAreaFillPaint());
	}
	// don't use outline paint, otherwise the plot shows vertical lines
	renderer.setOutline(false);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:12,代码来源:ChartRendererFactory.java

示例4: testHashcode

import org.jfree.chart.renderer.xy.XYAreaRenderer2; //导入依赖的package包/类
/**
 * Two objects that are equal are required to return the same hashCode. 
 */
public void testHashcode() {
    XYAreaRenderer2 r1 = new XYAreaRenderer2();
    XYAreaRenderer2 r2 = new XYAreaRenderer2();
    assertTrue(r1.equals(r2));
    int h1 = r1.hashCode();
    int h2 = r2.hashCode();
    assertEquals(h1, h2);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:XYAreaRenderer2Tests.java

示例5: testDrawWithNullInfo

import org.jfree.chart.renderer.xy.XYAreaRenderer2; //导入依赖的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 {
        DefaultTableXYDataset dataset = new DefaultTableXYDataset();
    
        XYSeries s1 = new XYSeries("Series 1", true, false);
        s1.add(5.0, 5.0);
        s1.add(10.0, 15.5);
        s1.add(15.0, 9.5);
        s1.add(20.0, 7.5);
        dataset.addSeries(s1);
    
        XYSeries s2 = new XYSeries("Series 2", true, false);
        s2.add(5.0, 5.0);
        s2.add(10.0, 15.5);
        s2.add(15.0, 9.5);
        s2.add(20.0, 3.5);
        dataset.addSeries(s2);
        XYPlot plot = new XYPlot(dataset, 
                new NumberAxis("X"), new NumberAxis("Y"), 
                new XYAreaRenderer2());
        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,代码行数:37,代码来源:XYAreaRenderer2Tests.java

示例6: buildXYAreaRenderer

import org.jfree.chart.renderer.xy.XYAreaRenderer2; //导入依赖的package包/类
private XYItemRenderer buildXYAreaRenderer(Color... colors) {
    XYItemRenderer renderer = new XYAreaRenderer2();
    for (int i = 0; i < colors.length; i++) {
        renderer.setSeriesPaint(i, colors[i]);
    }
    return renderer;
}
 
开发者ID:objektwerks,项目名称:swing,代码行数:8,代码来源:TimeSeriesChartPanel.java

示例7: testHashcode

import org.jfree.chart.renderer.xy.XYAreaRenderer2; //导入依赖的package包/类
/**
 * Two objects that are equal are required to return the same hashCode.
 */
public void testHashcode() {
    XYAreaRenderer2 r1 = new XYAreaRenderer2();
    XYAreaRenderer2 r2 = new XYAreaRenderer2();
    assertTrue(r1.equals(r2));
    int h1 = r1.hashCode();
    int h2 = r2.hashCode();
    assertEquals(h1, h2);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:12,代码来源:XYAreaRenderer2Tests.java

示例8: testDrawWithNullInfo

import org.jfree.chart.renderer.xy.XYAreaRenderer2; //导入依赖的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 {
        DefaultTableXYDataset dataset = new DefaultTableXYDataset();

        XYSeries s1 = new XYSeries("Series 1", true, false);
        s1.add(5.0, 5.0);
        s1.add(10.0, 15.5);
        s1.add(15.0, 9.5);
        s1.add(20.0, 7.5);
        dataset.addSeries(s1);

        XYSeries s2 = new XYSeries("Series 2", true, false);
        s2.add(5.0, 5.0);
        s2.add(10.0, 15.5);
        s2.add(15.0, 9.5);
        s2.add(20.0, 3.5);
        dataset.addSeries(s2);
        XYPlot plot = new XYPlot(dataset,
                new NumberAxis("X"), new NumberAxis("Y"),
                new XYAreaRenderer2());
        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,代码行数:37,代码来源:XYAreaRenderer2Tests.java

示例9: testGetLegendItemSeriesIndex

import org.jfree.chart.renderer.xy.XYAreaRenderer2; //导入依赖的package包/类
/**
 * A check for the datasetIndex and seriesIndex fields in the LegendItem
 * returned by the getLegendItem() method.
 */
public void testGetLegendItemSeriesIndex() {
    XYSeriesCollection d1 = new XYSeriesCollection();
    XYSeries s1 = new XYSeries("S1");
    s1.add(1.0, 1.1);
    XYSeries s2 = new XYSeries("S2");
    s2.add(1.0, 1.1);
    d1.addSeries(s1);
    d1.addSeries(s2);

    XYSeriesCollection d2 = new XYSeriesCollection();
    XYSeries s3 = new XYSeries("S3");
    s3.add(1.0, 1.1);
    XYSeries s4 = new XYSeries("S4");
    s4.add(1.0, 1.1);
    XYSeries s5 = new XYSeries("S5");
    s5.add(1.0, 1.1);
    d2.addSeries(s3);
    d2.addSeries(s4);
    d2.addSeries(s5);

    XYAreaRenderer2 r = new XYAreaRenderer2();
    XYPlot plot = new XYPlot(d1, new NumberAxis("x"),
            new NumberAxis("y"), r);
    plot.setDataset(1, d2);
    /*JFreeChart chart =*/ new JFreeChart(plot);
    LegendItem li = r.getLegendItem(1, 2);
    assertEquals("S5", li.getLabel());
    assertEquals(1, li.getDatasetIndex());
    assertEquals(2, li.getSeriesIndex());
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:35,代码来源:XYAreaRenderer2Tests.java

示例10: configureXYAreaRenderer2

import org.jfree.chart.renderer.xy.XYAreaRenderer2; //导入依赖的package包/类
private static void configureXYAreaRenderer2(ValueSourceData valueSourceData, XYAreaRenderer2 renderer) {
	int seriesCount = valueSourceData.getSeriesCount();
	SeriesFormat seriesFormat = valueSourceData.getValueSource().getSeriesFormat();
	// Loop all series and set series format.
	// Format based on dimension configs will be set later on in initFormatDelegate().
	for(int seriesIdx = 0; seriesIdx < seriesCount ; ++seriesIdx) {
		renderer.setSeriesPaint(seriesIdx, seriesFormat.getAreaFillPaint());
	}
	// don't use outline paint, otherwise the plot shows vertical lines
	renderer.setOutline(false);
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:12,代码来源:ChartRendererFactory.java

示例11: testPublicCloneable

import org.jfree.chart.renderer.xy.XYAreaRenderer2; //导入依赖的package包/类
/**
 * Verify that this class implements {@link PublicCloneable}.
 */
public void testPublicCloneable() {
    XYAreaRenderer2 r1 = new XYAreaRenderer2();
    assertTrue(r1 instanceof PublicCloneable);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:8,代码来源:XYAreaRenderer2Tests.java


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