Examples of XYImageAnnotation


Examples of org.jfree.chart.annotations.XYImageAnnotation

    /**
     * Confirm that the equals method can distinguish all the required fields.
     */
    public void testEquals() {
        Image image = JFreeChart.INFO.getLogo();
        XYImageAnnotation a1 = new XYImageAnnotation(10.0, 20.0, image);
        XYImageAnnotation a2 = new XYImageAnnotation(10.0, 20.0, image);
        assertTrue(a1.equals(a2));

        a1 = new XYImageAnnotation(10.0, 20.0, image, RectangleAnchor.LEFT);
        assertFalse(a1.equals(a2));
        a2 = new XYImageAnnotation(10.0, 20.0, image, RectangleAnchor.LEFT);
        assertTrue(a1.equals(a2));
    }
View Full Code Here

Examples of org.jfree.chart.annotations.XYImageAnnotation

    /**
     * Two objects that are equal are required to return the same hashCode.
     */
    public void testHashCode() {
        Image image = JFreeChart.INFO.getLogo();
        XYImageAnnotation a1 = new XYImageAnnotation(10.0, 20.0, image);
        XYImageAnnotation a2 = new XYImageAnnotation(10.0, 20.0, image);
        assertTrue(a1.equals(a2));
        int h1 = a1.hashCode();
        int h2 = a2.hashCode();
        assertEquals(h1, h2);
    }
View Full Code Here

Examples of org.jfree.chart.annotations.XYImageAnnotation

    /**
     * Confirm that cloning works.
     */
    public void testCloning() {
        XYImageAnnotation a1 = new XYImageAnnotation(10.0, 20.0,
                JFreeChart.INFO.getLogo());
        XYImageAnnotation a2 = null;
        try {
            a2 = (XYImageAnnotation) a1.clone();
        }
        catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        assertTrue(a1 != a2);
        assertTrue(a1.getClass() == a2.getClass());
        assertTrue(a1.equals(a2));
    }
View Full Code Here

Examples of org.jfree.chart.annotations.XYImageAnnotation

    /**
     * Checks that this class implements PublicCloneable.
     */
    public void testPublicCloneable() {
        XYImageAnnotation a1 = new XYImageAnnotation(10.0, 20.0,
                JFreeChart.INFO.getLogo());
        assertTrue(a1 instanceof PublicCloneable);
    }
View Full Code Here

Examples of org.jfree.chart.annotations.XYImageAnnotation

    /**
     * Confirm that the equals method can distinguish all the required fields.
     */
    public void testEquals() {
        Image image = JFreeChart.INFO.getLogo();
        XYImageAnnotation a1 = new XYImageAnnotation(10.0, 20.0, image);
        XYImageAnnotation a2 = new XYImageAnnotation(10.0, 20.0, image);
        assertTrue(a1.equals(a2));

        a1 = new XYImageAnnotation(10.0, 20.0, image, RectangleAnchor.LEFT);
        assertFalse(a1.equals(a2));
        a2 = new XYImageAnnotation(10.0, 20.0, image, RectangleAnchor.LEFT);
        assertTrue(a1.equals(a2));
    }
View Full Code Here

Examples of org.jfree.chart.annotations.XYImageAnnotation

    /**
     * Two objects that are equal are required to return the same hashCode.
     */
    public void testHashCode() {
        Image image = JFreeChart.INFO.getLogo();
        XYImageAnnotation a1 = new XYImageAnnotation(10.0, 20.0, image);
        XYImageAnnotation a2 = new XYImageAnnotation(10.0, 20.0, image);
        assertTrue(a1.equals(a2));
        int h1 = a1.hashCode();
        int h2 = a2.hashCode();
        assertEquals(h1, h2);
    }
View Full Code Here

Examples of org.jfree.chart.annotations.XYImageAnnotation

    /**
     * Confirm that cloning works.
     */
    public void testCloning() {
        XYImageAnnotation a1 = new XYImageAnnotation(10.0, 20.0,
                JFreeChart.INFO.getLogo());
        XYImageAnnotation a2 = null;
        try {
            a2 = (XYImageAnnotation) a1.clone();
        }
        catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        assertTrue(a1 != a2);
        assertTrue(a1.getClass() == a2.getClass());
        assertTrue(a1.equals(a2));
    }
View Full Code Here

Examples of org.jfree.chart.annotations.XYImageAnnotation

    /**
     * Checks that this class implements PublicCloneable.
     */
    public void testPublicCloneable() {
        XYImageAnnotation a1 = new XYImageAnnotation(10.0, 20.0,
                JFreeChart.INFO.getLogo());
        assertTrue(a1 instanceof PublicCloneable);
    }
View Full Code Here

Examples of org.jfree.chart.annotations.XYImageAnnotation

    /**
     * Confirm that the equals method can distinguish all the required fields.
     */
    public void testEquals() {
        XYImageAnnotation a1 = new XYImageAnnotation(10.0, 20.0, JFreeChart.INFO.getLogo());
        XYImageAnnotation a2 = new XYImageAnnotation(10.0, 20.0, JFreeChart.INFO.getLogo());
        assertTrue(a1.equals(a2));
    }
View Full Code Here

Examples of org.jfree.chart.annotations.XYImageAnnotation

    /**
     * Confirm that cloning works.
     */
    public void testCloning() {
        XYImageAnnotation a1 = new XYImageAnnotation(10.0, 20.0, JFreeChart.INFO.getLogo());
        XYImageAnnotation a2 = null;
        try {
            a2 = (XYImageAnnotation) a1.clone();
        }
        catch (CloneNotSupportedException e) {
            System.err.println("Failed to clone.");
        }
        assertTrue(a1 != a2);
        assertTrue(a1.getClass() == a2.getClass());
        assertTrue(a1.equals(a2));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.