Java 类org.jfree.chart.annotations.XYBoxAnnotation 实例源码

项目:parabuild-ci    文件:XYBoxAnnotationTests.java   
/**
 * 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);
}
项目:nabs    文件:XYBoxAnnotationTests.java   
/**
 * 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);
}
项目:astor    文件:XYBoxAnnotationTests.java   
/**
 * 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);
}
项目:astor    文件:XYBoxAnnotationTests.java   
/**
 * 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);
}
项目:astor    文件:XYBoxAnnotationTests.java   
/**
 * 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);
}