Examples of CategoryLabelPosition


Examples of org.jfree.chart.axis.CategoryLabelPosition

    /**
     * Check that the equals() method can distinguish all fields.
     */
    public void testEquals() {
        CategoryLabelPosition p1 = new CategoryLabelPosition(
                RectangleAnchor.BOTTOM_LEFT, TextBlockAnchor.CENTER_RIGHT,
                TextAnchor.BASELINE_LEFT, Math.PI / 4.0,
                CategoryLabelWidthType.RANGE, 0.44f);
        CategoryLabelPosition p2 = new CategoryLabelPosition(
                RectangleAnchor.BOTTOM_LEFT, TextBlockAnchor.CENTER_RIGHT,
                TextAnchor.BASELINE_LEFT, Math.PI / 4.0,
                CategoryLabelWidthType.RANGE, 0.44f);
        assertTrue(p1.equals(p2));
        assertTrue(p2.equals(p1));

        p1 = new CategoryLabelPosition(RectangleAnchor.TOP,
                TextBlockAnchor.CENTER_RIGHT, TextAnchor.BASELINE_LEFT,
                Math.PI / 4.0, CategoryLabelWidthType.RANGE, 0.44f);
        assertFalse(p1.equals(p2));
        p2 = new CategoryLabelPosition(RectangleAnchor.TOP,
                TextBlockAnchor.CENTER_RIGHT, TextAnchor.BASELINE_LEFT,
                Math.PI / 4.0, CategoryLabelWidthType.RANGE, 0.44f);
        assertTrue(p1.equals(p2));

        p1 = new CategoryLabelPosition(RectangleAnchor.TOP,
                TextBlockAnchor.CENTER, TextAnchor.BASELINE_LEFT, Math.PI / 4.0,
                CategoryLabelWidthType.RANGE, 0.44f);
        assertFalse(p1.equals(p2));
        p2 = new CategoryLabelPosition(RectangleAnchor.TOP,
                TextBlockAnchor.CENTER, TextAnchor.BASELINE_LEFT, Math.PI / 4.0,
                CategoryLabelWidthType.RANGE, 0.44f);
        assertTrue(p1.equals(p2));

        p1 = new CategoryLabelPosition(RectangleAnchor.TOP,
                TextBlockAnchor.CENTER, TextAnchor.CENTER, Math.PI / 4.0,
                CategoryLabelWidthType.RANGE, 0.44f);
        assertFalse(p1.equals(p2));
        p2 = new CategoryLabelPosition(RectangleAnchor.TOP,
                TextBlockAnchor.CENTER, TextAnchor.CENTER, Math.PI / 4.0,
                CategoryLabelWidthType.RANGE, 0.44f);
        assertTrue(p1.equals(p2));

        p1 = new CategoryLabelPosition(RectangleAnchor.TOP,
                TextBlockAnchor.CENTER, TextAnchor.CENTER, Math.PI / 6.0,
                CategoryLabelWidthType.RANGE, 0.44f);
        assertFalse(p1.equals(p2));
        p2 = new CategoryLabelPosition(RectangleAnchor.TOP,
                TextBlockAnchor.CENTER, TextAnchor.CENTER, Math.PI / 6.0,
                CategoryLabelWidthType.RANGE, 0.44f);
        assertTrue(p1.equals(p2));

        p1 = new CategoryLabelPosition(RectangleAnchor.TOP,
                TextBlockAnchor.CENTER, TextAnchor.CENTER, Math.PI / 6.0,
                CategoryLabelWidthType.CATEGORY, 0.44f);
        assertFalse(p1.equals(p2));
        p2 = new CategoryLabelPosition(RectangleAnchor.TOP,
                TextBlockAnchor.CENTER, TextAnchor.CENTER, Math.PI / 6.0,
                CategoryLabelWidthType.CATEGORY, 0.44f);
        assertTrue(p1.equals(p2));

        p1 = new CategoryLabelPosition(RectangleAnchor.TOP,
                TextBlockAnchor.CENTER, TextAnchor.CENTER,  Math.PI / 6.0,
                CategoryLabelWidthType.CATEGORY, 0.55f);
        assertFalse(p1.equals(p2));
        p2 = new CategoryLabelPosition(RectangleAnchor.TOP,
                TextBlockAnchor.CENTER, TextAnchor.CENTER, Math.PI / 6.0,
                CategoryLabelWidthType.CATEGORY, 0.55f);
        assertTrue(p1.equals(p2));
    }
View Full Code Here

Examples of org.jfree.chart.axis.CategoryLabelPosition

    /**
     * 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));
        assertTrue(p1.equals(p2));
    }
View Full Code Here

Examples of org.jfree.chart.axis.CategoryLabelPosition

    /**
     * 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

Examples of org.jfree.chart.axis.CategoryLabelPosition

               true, // tooltips
               false // urls
               );
             plot = chart.getCategoryPlot();
             CategoryAxis axis = plot.getDomainAxis();
             CategoryLabelPosition position = new CategoryLabelPosition(
                                                   RectangleAnchor.TOP
                                                 , TextBlockAnchor.TOP_RIGHT
                                                 , TextAnchor.TOP_RIGHT, -Math.PI / 8.0
                                                 );
             axis.setBottomCategoryLabelPosition(position);
View Full Code Here

Examples of org.jfree.chart.axis.CategoryLabelPosition

   
    /**
     * Problem equals method.
     */
    public void testEquals() {
        CategoryLabelPosition p1 = new CategoryLabelPosition();
        CategoryLabelPosition p2 = new CategoryLabelPosition();
        assertTrue(p1.equals(p2));
        assertTrue(p2.equals(p1));
    }
View Full Code Here

Examples of org.jfree.chart.axis.CategoryLabelPosition

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

        CategoryLabelPosition p1 = new CategoryLabelPosition();
        CategoryLabelPosition p2 = null;

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

Examples of org.jfree.chart.axis.CategoryLabelPosition

    /**
     * Problem equals method.
     */
    public void testEquals() {
        CategoryLabelPositions p1 = new CategoryLabelPositions(
            new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER)
        );
        CategoryLabelPositions p2 = new CategoryLabelPositions(
            new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER)
        );
        assertEquals(p1, p2);
    }
View Full Code Here

Examples of org.jfree.chart.axis.CategoryLabelPosition

    /**
     * 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)
        );
        assertTrue(p1.equals(p2));
    }
View Full Code Here

Examples of org.jfree.chart.axis.CategoryLabelPosition

    /**
     * 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

Examples of org.jfree.chart.axis.CategoryLabelPosition

   
    /**
     * Check that the equals() method can distinguish all fields.
     */
    public void testEquals() {
        CategoryLabelPosition p1 = new CategoryLabelPosition(
            RectangleAnchor.BOTTOM_LEFT, TextBlockAnchor.CENTER_RIGHT,
            TextAnchor.BASELINE_LEFT, Math.PI / 4.0,
            CategoryLabelWidthType.RANGE, 0.44f
        );
        CategoryLabelPosition p2 = new CategoryLabelPosition(
            RectangleAnchor.BOTTOM_LEFT, TextBlockAnchor.CENTER_RIGHT,
            TextAnchor.BASELINE_LEFT, Math.PI / 4.0,
            CategoryLabelWidthType.RANGE, 0.44f
        );
        assertTrue(p1.equals(p2));
        assertTrue(p2.equals(p1));
       
        p1 = new CategoryLabelPosition(
            RectangleAnchor.TOP, TextBlockAnchor.CENTER_RIGHT,
            TextAnchor.BASELINE_LEFT, Math.PI / 4.0,
            CategoryLabelWidthType.RANGE, 0.44f
        );
        assertFalse(p1.equals(p2));
        p2 = new CategoryLabelPosition(
            RectangleAnchor.TOP, TextBlockAnchor.CENTER_RIGHT,
            TextAnchor.BASELINE_LEFT, Math.PI / 4.0,
            CategoryLabelWidthType.RANGE, 0.44f
        );
        assertTrue(p1.equals(p2));

        p1 = new CategoryLabelPosition(RectangleAnchor.TOP,
            TextBlockAnchor.CENTER, TextAnchor.BASELINE_LEFT, Math.PI / 4.0,
            CategoryLabelWidthType.RANGE, 0.44f
        );
        assertFalse(p1.equals(p2));
        p2 = new CategoryLabelPosition(RectangleAnchor.TOP,
            TextBlockAnchor.CENTER, TextAnchor.BASELINE_LEFT, Math.PI / 4.0,
            CategoryLabelWidthType.RANGE, 0.44f
        );
        assertTrue(p1.equals(p2));
   
        p1 = new CategoryLabelPosition(RectangleAnchor.TOP,
            TextBlockAnchor.CENTER, TextAnchor.CENTER, Math.PI / 4.0,
            CategoryLabelWidthType.RANGE, 0.44f
        );
        assertFalse(p1.equals(p2));
        p2 = new CategoryLabelPosition(RectangleAnchor.TOP,
            TextBlockAnchor.CENTER, TextAnchor.CENTER, Math.PI / 4.0,
            CategoryLabelWidthType.RANGE, 0.44f
        );
        assertTrue(p1.equals(p2));
   
        p1 = new CategoryLabelPosition(
            RectangleAnchor.TOP, TextBlockAnchor.CENTER, TextAnchor.CENTER,
            Math.PI / 6.0, CategoryLabelWidthType.RANGE, 0.44f
        );
        assertFalse(p1.equals(p2));
        p2 = new CategoryLabelPosition(
            RectangleAnchor.TOP, TextBlockAnchor.CENTER, TextAnchor.CENTER,
            Math.PI / 6.0, CategoryLabelWidthType.RANGE, 0.44f
        );
        assertTrue(p1.equals(p2));
   
        p1 = new CategoryLabelPosition(
            RectangleAnchor.TOP, TextBlockAnchor.CENTER, TextAnchor.CENTER,
            Math.PI / 6.0, CategoryLabelWidthType.CATEGORY, 0.44f
        );
        assertFalse(p1.equals(p2));
        p2 = new CategoryLabelPosition(
            RectangleAnchor.TOP, TextBlockAnchor.CENTER, TextAnchor.CENTER,
            Math.PI / 6.0, CategoryLabelWidthType.CATEGORY, 0.44f
        );
        assertTrue(p1.equals(p2));
   
        p1 = new CategoryLabelPosition(
            RectangleAnchor.TOP, TextBlockAnchor.CENTER, TextAnchor.CENTER,
            Math.PI / 6.0, CategoryLabelWidthType.CATEGORY, 0.55f
        );
        assertFalse(p1.equals(p2));
        p2 = new CategoryLabelPosition(
            RectangleAnchor.TOP, TextBlockAnchor.CENTER, TextAnchor.CENTER,
            Math.PI / 6.0, CategoryLabelWidthType.CATEGORY, 0.55f
        );
        assertTrue(p1.equals(p2));  
    }
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.