Package org.jfree.chart.axis

Examples of org.jfree.chart.axis.CategoryLabelPositions


   
    /**
     * Check that the equals method distinguishes all fields.
     */
    public void testEquals() {
        CategoryLabelPositions p1 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER)
        );
        CategoryLabelPositions p2 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER)
        );
        assertEquals(p1, p2);

        p1 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER)
        );
        assertTrue(!p1.equals(p2));
        p2 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER)
        );
        assertTrue(p1.equals(p2));

        p1 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER)
        );
        assertTrue(!p1.equals(p2));
        p2 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER)
        );
        assertTrue(p1.equals(p2));

        p1 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER)
        );
        assertTrue(!p1.equals(p2));
        p2 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER)
        );
        assertTrue(p1.equals(p2));

        p1 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER)
        );
        assertTrue(!p1.equals(p2));
        p2 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER)
        );
View Full Code Here


   
    /**
     * Two objects that are equal are required to return the same hashCode.
     */
    public void testHashCode() {
        CategoryLabelPositions p1 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER)
        );
        CategoryLabelPositions p2 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER)
        );
        assertTrue(p1.equals(p2));
        int h1 = p1.hashCode();
        int h2 = p2.hashCode();
        assertEquals(h1, h2);
    }
View Full Code Here

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {

        CategoryLabelPositions p1 = CategoryLabelPositions.STANDARD;
        CategoryLabelPositions p2 = null;

        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(p1);
View Full Code Here

   
    /**
     * Check that the equals method distinguishes all fields.
     */
    public void testEquals() {
        CategoryLabelPositions p1 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER)
        );
        CategoryLabelPositions p2 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER)
        );
        assertEquals(p1, p2);

        p1 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER)
        );
        assertTrue(!p1.equals(p2));
        p2 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER)
        );
        assertTrue(p1.equals(p2));

        p1 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER)
        );
        assertTrue(!p1.equals(p2));
        p2 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER)
        );
        assertTrue(p1.equals(p2));

        p1 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER)
        );
        assertTrue(!p1.equals(p2));
        p2 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER)
        );
        assertTrue(p1.equals(p2));

        p1 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER)
        );
        assertTrue(!p1.equals(p2));
        p2 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER),
            new CategoryLabelPosition(RA_BOTTOM, TextBlockAnchor.TOP_CENTER)
        );
View Full Code Here

   
    /**
     * Two objects that are equal are required to return the same hashCode.
     */
    public void testHashCode() {
        CategoryLabelPositions p1 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER)
        );
        CategoryLabelPositions p2 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER)
        );
        assertTrue(p1.equals(p2));
        int h1 = p1.hashCode();
        int h2 = p2.hashCode();
        assertEquals(h1, h2);
    }
View Full Code Here

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {

        CategoryLabelPositions p1 = CategoryLabelPositions.STANDARD;
        CategoryLabelPositions p2 = null;

        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(p1);
View Full Code Here

TOP

Related Classes of org.jfree.chart.axis.CategoryLabelPositions

Copyright © 2018 www.massapicom. 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.