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


Java CombinedRangeXYPlot类代码示例

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


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

示例1: testNotification

import org.jfree.chart.plot.CombinedRangeXYPlot; //导入依赖的package包/类
/**
 * Check that only one chart change event is generated by a change to a
 * subplot.
 */
public void testNotification() {
    CombinedRangeXYPlot plot = createPlot();
    JFreeChart chart = new JFreeChart(plot);
    chart.addChangeListener(this);
    XYPlot subplot1 = (XYPlot) plot.getSubplots().get(0);
    NumberAxis xAxis = (NumberAxis) subplot1.getDomainAxis();
    xAxis.setAutoRangeIncludesZero(!xAxis.getAutoRangeIncludesZero());
    assertEquals(1, this.events.size());

    // a redraw should NOT trigger another change event
    BufferedImage image = new BufferedImage(200, 100,
            BufferedImage.TYPE_INT_RGB);
    Graphics2D g2 = image.createGraphics();
    this.events.clear();
    chart.draw(g2, new Rectangle2D.Double(0.0, 0.0, 200.0, 100.0));
    assertTrue(this.events.isEmpty());
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:22,代码来源:CombinedRangeXYPlotTests.java

示例2: testEquals

import org.jfree.chart.plot.CombinedRangeXYPlot; //导入依赖的package包/类
/**
 * Test the equals method.
 */
public void testEquals() {
    CombinedRangeXYPlot plot1 = createPlot();
    CombinedRangeXYPlot plot2 = createPlot();
    assertTrue(plot1.equals(plot2));    
    assertTrue(plot2.equals(plot1));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:10,代码来源:CombinedRangeXYPlotTests.java

示例3: testRemoveSubplot

import org.jfree.chart.plot.CombinedRangeXYPlot; //导入依赖的package包/类
/**
 * This is a test to replicate the bug report 987080.
 */
public void testRemoveSubplot() {
    CombinedRangeXYPlot plot = new CombinedRangeXYPlot();
    XYPlot plot1 = new XYPlot();
    XYPlot plot2 = new XYPlot();
    plot.add(plot1);
    plot.add(plot2);
    // remove plot2, but plot1 is removed instead
    plot.remove(plot2);
    List plots = plot.getSubplots();
    assertTrue(plots.get(0) == plot1);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:15,代码来源:CombinedRangeXYPlotTests.java

示例4: createPlot

import org.jfree.chart.plot.CombinedRangeXYPlot; //导入依赖的package包/类
/**
 * Creates a sample plot.
 * 
 * @return A sample plot.
 */
private CombinedRangeXYPlot createPlot() {
    // create subplot 1...
    XYDataset data1 = createDataset1();
    XYItemRenderer renderer1 = new StandardXYItemRenderer();
    NumberAxis rangeAxis1 = new NumberAxis("Range 1");
    XYPlot subplot1 = new XYPlot(data1, null, rangeAxis1, renderer1);
    subplot1.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
     
    XYTextAnnotation annotation = new XYTextAnnotation("Hello!", 50.0, 10000.0);
    annotation.setFont(new Font("SansSerif", Font.PLAIN, 9));
    annotation.setRotationAngle(Math.PI / 4.0);
    subplot1.addAnnotation(annotation);
     
    // create subplot 2...
    XYDataset data2 = createDataset2();
    XYItemRenderer renderer2 = new StandardXYItemRenderer();
    NumberAxis rangeAxis2 = new NumberAxis("Range 2");
    rangeAxis2.setAutoRangeIncludesZero(false);
    XYPlot subplot2 = new XYPlot(data2, null, rangeAxis2, renderer2);
    subplot2.setRangeAxisLocation(AxisLocation.TOP_OR_LEFT); 

    // parent plot...
    CombinedRangeXYPlot plot = new CombinedRangeXYPlot(new NumberAxis("Range"));
    plot.setGap(10.0);
    
    // add the subplots...
    plot.add(subplot1, 1);
    plot.add(subplot2, 1);
    plot.setOrientation(PlotOrientation.VERTICAL);
    return plot;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:37,代码来源:CombinedRangeXYPlotTests.java

示例5: createPlot

import org.jfree.chart.plot.CombinedRangeXYPlot; //导入依赖的package包/类
/**
 * Creates a sample plot.
 * 
 * @return A sample plot.
 */
private CombinedRangeXYPlot createPlot() {
    // create subplot 1...
    XYDataset data1 = createDataset1();
    XYItemRenderer renderer1 = new StandardXYItemRenderer();
    NumberAxis rangeAxis1 = new NumberAxis("Range 1");
    XYPlot subplot1 = new XYPlot(data1, null, rangeAxis1, renderer1);
    subplot1.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
     
    XYTextAnnotation annotation 
        = new XYTextAnnotation("Hello!", 50.0, 10000.0);
    annotation.setFont(new Font("SansSerif", Font.PLAIN, 9));
    annotation.setRotationAngle(Math.PI / 4.0);
    subplot1.addAnnotation(annotation);
     
    // create subplot 2...
    XYDataset data2 = createDataset2();
    XYItemRenderer renderer2 = new StandardXYItemRenderer();
    NumberAxis rangeAxis2 = new NumberAxis("Range 2");
    rangeAxis2.setAutoRangeIncludesZero(false);
    XYPlot subplot2 = new XYPlot(data2, null, rangeAxis2, renderer2);
    subplot2.setRangeAxisLocation(AxisLocation.TOP_OR_LEFT); 

    // parent plot...
    CombinedRangeXYPlot plot 
        = new CombinedRangeXYPlot(new NumberAxis("Range"));
    plot.setGap(10.0);
    
    // add the subplots...
    plot.add(subplot1, 1);
    plot.add(subplot2, 1);
    plot.setOrientation(PlotOrientation.VERTICAL);
    return plot;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:39,代码来源:CombinedRangeXYPlotTests.java

示例6: testEquals

import org.jfree.chart.plot.CombinedRangeXYPlot; //导入依赖的package包/类
/**
 * Test the equals method.
 */
public void testEquals() {
    CombinedRangeXYPlot plot1 = createPlot();
    CombinedRangeXYPlot plot2 = createPlot();
    assertTrue(plot1.equals(plot2));
    assertTrue(plot2.equals(plot1));
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:10,代码来源:CombinedRangeXYPlotTests.java

示例7: createPlot

import org.jfree.chart.plot.CombinedRangeXYPlot; //导入依赖的package包/类
/**
 * Creates a sample plot.
 *
 * @return A sample plot.
 */
private CombinedRangeXYPlot createPlot() {
    // create subplot 1...
    XYDataset data1 = createDataset1();
    XYItemRenderer renderer1 = new StandardXYItemRenderer();
    NumberAxis xAxis1 = new NumberAxis("X1");
    XYPlot subplot1 = new XYPlot(data1, xAxis1, null, renderer1);
    subplot1.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);

    XYTextAnnotation annotation
            = new XYTextAnnotation("Hello!", 50.0, 10000.0);
    annotation.setFont(new Font("SansSerif", Font.PLAIN, 9));
    annotation.setRotationAngle(Math.PI / 4.0);
    subplot1.addAnnotation(annotation);

    // create subplot 2...
    XYDataset data2 = createDataset2();
    XYItemRenderer renderer2 = new StandardXYItemRenderer();
    NumberAxis xAxis2 = new NumberAxis("X2");
    xAxis2.setAutoRangeIncludesZero(false);
    XYPlot subplot2 = new XYPlot(data2, xAxis2, null, renderer2);
    subplot2.setRangeAxisLocation(AxisLocation.TOP_OR_LEFT);

    // parent plot...
    CombinedRangeXYPlot plot = new CombinedRangeXYPlot(new NumberAxis(
            "Range"));
    plot.setGap(10.0);

    // add the subplots...
    plot.add(subplot1, 1);
    plot.add(subplot2, 1);
    plot.setOrientation(PlotOrientation.VERTICAL);
    return plot;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:39,代码来源:CombinedRangeXYPlotTests.java


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