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


Java XYBoxAnnotation类代码示例

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


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

示例1: testHashCode

import org.jfree.chart.annotations.XYBoxAnnotation; //导入依赖的package包/类
/**
 * Two objects that are equal are required to return the same hashCode. 
 */
public void testHashCode() {
    XYBoxAnnotation a1 = new XYBoxAnnotation(
        1.0, 2.0, 3.0, 4.0, new BasicStroke(1.2f), Color.red, Color.blue
    );
    XYBoxAnnotation a2 = new XYBoxAnnotation(
        1.0, 2.0, 3.0, 4.0, new BasicStroke(1.2f), Color.red, Color.blue
    );
    assertTrue(a1.equals(a2));
    int h1 = a1.hashCode();
    int h2 = a2.hashCode();
    assertEquals(h1, h2);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:16,代码来源:XYBoxAnnotationTests.java

示例2: testHashCode

import org.jfree.chart.annotations.XYBoxAnnotation; //导入依赖的package包/类
/**
 * Two objects that are equal are required to return the same hashCode.
 */
public void testHashCode() {
    XYBoxAnnotation a1 = new XYBoxAnnotation(1.0, 2.0, 3.0, 4.0,
            new BasicStroke(1.2f), Color.red, Color.blue);
    XYBoxAnnotation a2 = new XYBoxAnnotation(1.0, 2.0, 3.0, 4.0,
            new BasicStroke(1.2f), Color.red, Color.blue);
    assertTrue(a1.equals(a2));
    int h1 = a1.hashCode();
    int h2 = a2.hashCode();
    assertEquals(h1, h2);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:14,代码来源:XYBoxAnnotationTests.java

示例3: testDrawWithNullInfo

import org.jfree.chart.annotations.XYBoxAnnotation; //导入依赖的package包/类
/**
 * Draws the chart with a <code>null</code> info object to make sure that
 * no exceptions are thrown.
 */
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 XYLineAndShapeRenderer());
        plot.addAnnotation(new XYBoxAnnotation(10.0, 12.0, 3.0, 4.0,
                new BasicStroke(1.2f), Color.red, Color.blue));
        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,代码行数:39,代码来源:XYBoxAnnotationTests.java

示例4: testPublicCloneable

import org.jfree.chart.annotations.XYBoxAnnotation; //导入依赖的package包/类
/**
 * Checks that this class implements PublicCloneable.
 */
public void testPublicCloneable() {
    XYBoxAnnotation a1 = new XYBoxAnnotation(1.0, 2.0, 3.0, 4.0,
            new BasicStroke(1.2f), Color.red, Color.blue);
    assertTrue(a1 instanceof PublicCloneable);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:9,代码来源:XYBoxAnnotationTests.java


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