Package org.jfree.chart.labels

Examples of org.jfree.chart.labels.StandardXYLabelGenerator


        NumberFormat xnf1 = new DecimalFormat("0.00");
        NumberFormat xnf2 = new DecimalFormat("0.000");
        NumberFormat ynf1 = new DecimalFormat("0.00");
        NumberFormat ynf2 = new DecimalFormat("0.000");

        StandardXYLabelGenerator g1 = null;
        StandardXYLabelGenerator g2 = null;
       
        g1 = new StandardXYLabelGenerator(f1, xnf1, ynf1);
        g2 = new StandardXYLabelGenerator(f1, xnf1, ynf1);
        assertTrue(g1.equals(g2));
        assertTrue(g2.equals(g1));
       
        g1 = new StandardXYLabelGenerator(f2, xnf1, ynf1);
        assertFalse(g1.equals(g2));
        g2 = new StandardXYLabelGenerator(f2, xnf1, ynf1);
        assertTrue(g1.equals(g2));
               
        g1 = new StandardXYLabelGenerator(f2, xnf2, ynf1);
        assertFalse(g1.equals(g2));
        g2 = new StandardXYLabelGenerator(f2, xnf2, ynf1);
        assertTrue(g1.equals(g2));

        g1 = new StandardXYLabelGenerator(f2, xnf2, ynf2);
        assertFalse(g1.equals(g2));
        g2 = new StandardXYLabelGenerator(f2, xnf2, ynf2);
        assertTrue(g1.equals(g2));
               
        DateFormat xdf1 = new SimpleDateFormat("d-MMM");
        DateFormat xdf2 = new SimpleDateFormat("d-MMM-yyyy");
        DateFormat ydf1 = new SimpleDateFormat("d-MMM");
        DateFormat ydf2 = new SimpleDateFormat("d-MMM-yyyy");

        g1 = new StandardXYLabelGenerator(f1, xdf1, ydf1);
        g2 = new StandardXYLabelGenerator(f1, xdf1, ydf1);
        assertTrue(g1.equals(g2));
        assertTrue(g2.equals(g1));
       
        g1 = new StandardXYLabelGenerator(f1, xdf2, ydf1);
        assertFalse(g1.equals(g2));
        g2 = new StandardXYLabelGenerator(f1, xdf2, ydf1);
        assertTrue(g1.equals(g2));
               
        g1 = new StandardXYLabelGenerator(f1, xdf2, ydf2);
        assertFalse(g1.equals(g2));
        g2 = new StandardXYLabelGenerator(f1, xdf2, ydf2);
        assertTrue(g1.equals(g2));

    }
View Full Code Here


   
    /**
     * Confirm that cloning works.
     */
    public void testCloning() {
        StandardXYLabelGenerator g1 = new StandardXYLabelGenerator();
        StandardXYLabelGenerator g2 = null;
        try {
            g2 = (StandardXYLabelGenerator) g1.clone();
        }
        catch (CloneNotSupportedException e) {
            System.err.println("Clone failed.");
        }
        assertTrue(g1 != g2);
        assertTrue(g1.getClass() == g2.getClass());
        assertTrue(g1.equals(g2));
    }
View Full Code Here

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

        StandardXYLabelGenerator g1 = new StandardXYLabelGenerator();
        StandardXYLabelGenerator g2 = null;

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

TOP

Related Classes of org.jfree.chart.labels.StandardXYLabelGenerator

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.