Examples of StandardCategoryLabelGenerator


Examples of org.jfree.chart.labels.StandardCategoryLabelGenerator

    /**
     * Tests the equals() method.
     */
    public void testEquals() {
       
        StandardCategoryLabelGenerator g1 = new StandardCategoryLabelGenerator();
        StandardCategoryLabelGenerator g2 = new StandardCategoryLabelGenerator();
        assertTrue(g1.equals(g2));
        assertTrue(g2.equals(g1));
       
        g1 = new StandardCategoryLabelGenerator("{0}", new DecimalFormat("0.000"));
        assertFalse(g1.equals(g2));
        g2 = new StandardCategoryLabelGenerator("{0}", new DecimalFormat("0.000"));
        assertTrue(g1.equals(g2));

        g1 = new StandardCategoryLabelGenerator("{1}", new DecimalFormat("0.000"));
        assertFalse(g1.equals(g2));
        g2 = new StandardCategoryLabelGenerator("{1}", new DecimalFormat("0.000"));
        assertTrue(g1.equals(g2));

        g1 = new StandardCategoryLabelGenerator("{2}", new SimpleDateFormat("d-MMM"));
        assertFalse(g1.equals(g2));
        g2 = new StandardCategoryLabelGenerator("{2}", new SimpleDateFormat("d-MMM"));
        assertTrue(g1.equals(g2));
       
    }
View Full Code Here

Examples of org.jfree.chart.labels.StandardCategoryLabelGenerator

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

Examples of org.jfree.chart.labels.StandardCategoryLabelGenerator

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

        StandardCategoryLabelGenerator g1 = new StandardCategoryLabelGenerator(
            "{2}", DateFormat.getInstance()
        );
        StandardCategoryLabelGenerator g2 = null;

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

Examples of org.jfree.chart.labels.StandardCategoryLabelGenerator

    /**
     * Confirm that cloning works.
     */
    public void testCloning() {
        BarRenderer r1 = new BarRenderer();
        r1.setLabelGenerator(new StandardCategoryLabelGenerator());
        BarRenderer r2 = null;
        try {
            r2 = (BarRenderer) r1.clone();
        }
        catch (CloneNotSupportedException e) {
View Full Code Here

Examples of org.jfree.chart.labels.StandardCategoryLabelGenerator

     * Confirm that cloning works.
     */
    public void testCloning1() {
       
        AbstractCategoryItemRenderer r1 = new BarRenderer();
        r1.setLabelGenerator(new StandardCategoryLabelGenerator());
        AbstractCategoryItemRenderer r2 = null;
        try {
            r2 = (BarRenderer) r1.clone();
        }
        catch (CloneNotSupportedException e) {
            System.err.println("AbstractCategoryItemRendererTests.testCloning: failed to clone.");
        }
        assertTrue(r1 != r2);
        assertTrue(r1.getClass() == r2.getClass());
        assertTrue(r1.equals(r2));
       
        r1 = new BarRenderer();
        r1.setSeriesLabelGenerator(0, new StandardCategoryLabelGenerator());
        r2 = null;
        try {
            r2 = (BarRenderer) r1.clone();
        }
        catch (CloneNotSupportedException e) {
            System.err.println("AbstractCategoryItemRendererTests.testCloning: failed to clone.");
        }
        assertTrue(r1 != r2);
        assertTrue(r1.getClass() == r2.getClass());
        assertTrue(r1.equals(r2));
       
        r1 = new BarRenderer();
        r1.setBaseLabelGenerator(new StandardCategoryLabelGenerator());
        r2 = null;
        try {
            r2 = (BarRenderer) r1.clone();
        }
        catch (CloneNotSupportedException e) {
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.