Package org.jfree.chart.axis

Examples of org.jfree.chart.axis.ColorBar


    /**
     * Check that the equals() method can distinguish all fields.
     */
    public void testEquals() {
        ColorBar c1 = new ColorBar("Test");
        ColorBar c2 = new ColorBar("Test");
        assertEquals(c1, c2);
       
        c1.setAxis(new NumberAxis("Axis 1"));
        assertTrue(!c1.equals(c2));
        c2.setAxis(new NumberAxis("Axis 1"));
        assertTrue(c1.equals(c2));
       
        c1.setColorPalette(new GreyPalette());
        assertTrue(!c1.equals(c2));
        c2.setColorPalette(new GreyPalette());
        assertTrue(c1.equals(c2));
    }
View Full Code Here


   
    /**
     * Two objects that are equal are required to return the same hashCode.
     */
    public void testHashCode() {
        ColorBar c1 = new ColorBar("Test");
        ColorBar c2 = new ColorBar("Test");
        assertTrue(c1.equals(c2));
        int h1 = c1.hashCode();
        int h2 = c2.hashCode();
        assertEquals(h1, h2);
    }
View Full Code Here

    /**
     * Confirm that cloning works.
     */
    public void testCloning() {
        ColorBar c1 = new ColorBar("Test");
        ColorBar c2 = null;
        try {
            c2 = (ColorBar) c1.clone();
        }
        catch (CloneNotSupportedException e) {
            System.err.println("Failed to clone.");
        }
        assertTrue(c1 != c2);
        assertTrue(c1.getClass() == c2.getClass());
        assertTrue(c1.equals(c2));
    }
View Full Code Here

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

        ColorBar a1 = new ColorBar("Test Axis");
        ColorBar a2 = null;

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

TOP

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

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.