Package org.jfree.chart.block

Examples of org.jfree.chart.block.BlockBorder


   
    /**
     * Confirm that the equals() method can distinguish all the required fields.
     */
    public void testEquals() {
        BlockBorder b1 = new BlockBorder(
            new RectangleInsets(1.0, 2.0, 3.0, 4.0), Color.red
        );
        BlockBorder b2 = new BlockBorder(
            new RectangleInsets(1.0, 2.0, 3.0, 4.0), Color.red
        );
        assertTrue(b1.equals(b2));
        assertTrue(b2.equals(b2));
       
        // insets
        b1 = new BlockBorder(
            new RectangleInsets(UnitType.RELATIVE, 1.0, 2.0, 3.0, 4.0),
            Color.red
        );
        assertFalse(b1.equals(b2));
        b2 = new BlockBorder(
            new RectangleInsets(UnitType.RELATIVE, 1.0, 2.0, 3.0, 4.0),
            Color.red
        );
        assertTrue(b1.equals(b2));
       
        // paint
        b1 = new BlockBorder(
            new RectangleInsets(1.0, 2.0, 3.0, 4.0), Color.blue
        );
        assertFalse(b1.equals(b2));
        b2 = new BlockBorder(
            new RectangleInsets(1.0, 2.0, 3.0, 4.0), Color.blue
        );
        assertTrue(b1.equals(b2));
    }
View Full Code Here


    /**
     * Immutable - cloning not necessary.
     */
    public void testCloning() {
        BlockBorder b1 = new BlockBorder();
        assertFalse(b1 instanceof Cloneable);
    }
View Full Code Here

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {
        BlockBorder b1 = new BlockBorder(
            new RectangleInsets(1.0, 2.0, 3.0, 4.0),
            new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.yellow)
        );
        BlockBorder b2 = null;
        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(b1);
            out.close();
View Full Code Here

TOP

Related Classes of org.jfree.chart.block.BlockBorder

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.