Examples of XYBoxAnnotation


Examples of org.jfree.chart.annotations.XYBoxAnnotation

    /**
     * Confirm that cloning works.
     */
    public void testCloning() {
        XYBoxAnnotation a1 = new XYBoxAnnotation(1.0, 2.0, 3.0, 4.0,
                new BasicStroke(1.2f), Color.red, Color.blue);
        XYBoxAnnotation a2 = null;
        try {
            a2 = (XYBoxAnnotation) a1.clone();
        }
        catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        assertTrue(a1 != a2);
        assertTrue(a1.getClass() == a2.getClass());
        assertTrue(a1.equals(a2));
    }
View Full Code Here

Examples of org.jfree.chart.annotations.XYBoxAnnotation

    /**
     * Checks that this class implements PublicCloneable.
     */
    public void testPublicCloneable() {
        XYBoxAnnotation a1 = new XYBoxAnnotation(1.0, 2.0, 3.0, 4.0,
                new BasicStroke(1.2f), Color.red, Color.blue);
        assertTrue(a1 instanceof PublicCloneable);
    }
View Full Code Here

Examples of org.jfree.chart.annotations.XYBoxAnnotation

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

        XYBoxAnnotation a1 = new XYBoxAnnotation(1.0, 2.0, 3.0, 4.0,
                new BasicStroke(1.2f), Color.red, Color.blue);
        XYBoxAnnotation a2 = null;

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

Examples of org.jfree.chart.annotations.XYBoxAnnotation

            s2.add(20.0, 3.5);
            dataset.addSeries(s2);
            XYPlot plot = new XYPlot(dataset,
                    new NumberAxis("X"), new NumberAxis("Y"),
                    new XYLineAndShapeRenderer());
            plot.addAnnotation(new XYBoxAnnotation(10.0, 12.0, 3.0, 4.0,
                    new BasicStroke(1.2f), Color.red, Color.blue));
            JFreeChart chart = new JFreeChart(plot);
            /* BufferedImage image = */ chart.createBufferedImage(300, 200,
                    null);
            success = true;
View Full Code Here

Examples of org.jfree.chart.annotations.XYBoxAnnotation

    /**
     * Confirm that the equals method can distinguish all the required fields.
     */
    public void testEquals() {
       
        XYBoxAnnotation a1 = new XYBoxAnnotation(
            1.0, 2.0, 3.0, 4.0, new BasicStroke(1.2f), Color.red, Color.blue
        );
        XYBoxAnnotation a2 = new XYBoxAnnotation(
            1.0, 2.0, 3.0, 4.0, new BasicStroke(1.2f), Color.red, Color.blue
        );
        assertTrue(a1.equals(a2));
        assertTrue(a2.equals(a1));
     
        // x0
        a1 = new XYBoxAnnotation(
            2.0, 2.0, 3.0, 4.0, new BasicStroke(1.2f), Color.red, Color.blue
        );
        assertFalse(a1.equals(a2));
        a2 = new XYBoxAnnotation(
            2.0, 2.0, 3.0, 4.0, new BasicStroke(1.2f), Color.red, Color.blue
        );
        assertTrue(a1.equals(a2));
       
        // stroke
        a1 = new XYBoxAnnotation(
            1.0, 2.0, 3.0, 4.0, new BasicStroke(2.3f), Color.red, Color.blue
        );
        assertFalse(a1.equals(a2));
        a2 = new XYBoxAnnotation(
            1.0, 2.0, 3.0, 4.0, new BasicStroke(2.3f), Color.red, Color.blue
        );
        assertTrue(a1.equals(a2));
       
        GradientPaint gp1a = new GradientPaint(1.0f, 2.0f, Color.blue,
                3.0f, 4.0f, Color.red);
        GradientPaint gp1b = new GradientPaint(1.0f, 2.0f, Color.blue,
                3.0f, 4.0f, Color.red);
        GradientPaint gp2a = new GradientPaint(5.0f, 6.0f, Color.pink,
                7.0f, 8.0f, Color.white);
        GradientPaint gp2b = new GradientPaint(5.0f, 6.0f, Color.pink,
                7.0f, 8.0f, Color.white);
       
        // outlinePaint
        a1 = new XYBoxAnnotation(
            1.0, 2.0, 3.0, 4.0, new BasicStroke(2.3f), gp1a, Color.blue
        );
        assertFalse(a1.equals(a2));
        a2 = new XYBoxAnnotation(
            1.0, 2.0, 3.0, 4.0, new BasicStroke(2.3f), gp1b, Color.blue
        );
        assertTrue(a1.equals(a2));
       
        // fillPaint
        a1 = new XYBoxAnnotation(
            1.0, 2.0, 3.0, 4.0, new BasicStroke(2.3f), gp1a, gp2a
        );
        assertFalse(a1.equals(a2));
        a2 = new XYBoxAnnotation(
            1.0, 2.0, 3.0, 4.0, new BasicStroke(2.3f), gp1b, gp2b
        );
        assertTrue(a1.equals(a2));
    }
View Full Code Here

Examples of org.jfree.chart.annotations.XYBoxAnnotation

    /**
     * Two objects that are equal are required to return the same hashCode.
     */
    public void testHashCode() {
        XYBoxAnnotation a1 = new XYBoxAnnotation(
            1.0, 2.0, 3.0, 4.0, new BasicStroke(1.2f), Color.red, Color.blue
        );
        XYBoxAnnotation a2 = new XYBoxAnnotation(
            1.0, 2.0, 3.0, 4.0, new BasicStroke(1.2f), Color.red, Color.blue
        );
        assertTrue(a1.equals(a2));
        int h1 = a1.hashCode();
        int h2 = a2.hashCode();
        assertEquals(h1, h2);
    }
View Full Code Here

Examples of org.jfree.chart.annotations.XYBoxAnnotation

    /**
     * Confirm that cloning works.
     */
    public void testCloning() {

        XYBoxAnnotation a1 = new XYBoxAnnotation(
            1.0, 2.0, 3.0, 4.0, new BasicStroke(1.2f), Color.red, Color.blue
        );
        XYBoxAnnotation a2 = null;
        try {
            a2 = (XYBoxAnnotation) a1.clone();
        }
        catch (CloneNotSupportedException e) {
            System.err.println("Failed to clone.");
        }
        assertTrue(a1 != a2);
        assertTrue(a1.getClass() == a2.getClass());
        assertTrue(a1.equals(a2));
    }
View Full Code Here

Examples of org.jfree.chart.annotations.XYBoxAnnotation

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

        XYBoxAnnotation a1 = new XYBoxAnnotation(
            1.0, 2.0, 3.0, 4.0,
            new BasicStroke(1.2f), Color.red, Color.blue
        );
        XYBoxAnnotation a2 = null;

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

Examples of org.jfree.chart.annotations.XYBoxAnnotation

            chromosomeAnnotations = new ArrayList<XYBoxAnnotation>();
            for(int i=0; i<numberOfChromosomes; i++){
                long chrStart = locator.getContigs().get(i).getPosition();
                long chrSize = locator.getContigs().get(i).getSize();

                XYBoxAnnotation xyBoxAnnotation = new XYBoxAnnotation( (double) chrStart, 0.0,
                    (double)( chrStart + chrSize), maxCoverage, null, null);
                xyBoxAnnotation.setToolTipText(locator.getContigs().get(i).getName());
                chromosomeAnnotations.add(xyBoxAnnotation);

              // coverageData
        chromosomeCoverageLimits.addItem(new XYItem(locator.getContigs().get(i).getEnd(),0));
        chromosomeCoverageLimits.addItem(new XYItem(locator.getContigs().get(i).getEnd(),maxCoverage));
View Full Code Here

Examples of org.jfree.chart.annotations.XYBoxAnnotation

    /**
     * Confirm that the equals method can distinguish all the required fields.
     */
    public void testEquals() {
       
        XYBoxAnnotation a1 = new XYBoxAnnotation(
            1.0, 2.0, 3.0, 4.0, new BasicStroke(1.2f), Color.red, Color.blue
        );
        XYBoxAnnotation a2 = new XYBoxAnnotation(
            1.0, 2.0, 3.0, 4.0, new BasicStroke(1.2f), Color.red, Color.blue
        );
        assertTrue(a1.equals(a2));
        assertTrue(a2.equals(a1));
     
        // x0
        a1 = new XYBoxAnnotation(
            2.0, 2.0, 3.0, 4.0, new BasicStroke(1.2f), Color.red, Color.blue
        );
        assertFalse(a1.equals(a2));
        a2 = new XYBoxAnnotation(
            2.0, 2.0, 3.0, 4.0, new BasicStroke(1.2f), Color.red, Color.blue
        );
        assertTrue(a1.equals(a2));
       
        // stroke
        a1 = new XYBoxAnnotation(
            1.0, 2.0, 3.0, 4.0, new BasicStroke(2.3f), Color.red, Color.blue
        );
        assertFalse(a1.equals(a2));
        a2 = new XYBoxAnnotation(
            1.0, 2.0, 3.0, 4.0, new BasicStroke(2.3f), Color.red, Color.blue
        );
        assertTrue(a1.equals(a2));
       
        GradientPaint gp1a = new GradientPaint(1.0f, 2.0f, Color.blue,
                3.0f, 4.0f, Color.red);
        GradientPaint gp1b = new GradientPaint(1.0f, 2.0f, Color.blue,
                3.0f, 4.0f, Color.red);
        GradientPaint gp2a = new GradientPaint(5.0f, 6.0f, Color.pink,
                7.0f, 8.0f, Color.white);
        GradientPaint gp2b = new GradientPaint(5.0f, 6.0f, Color.pink,
                7.0f, 8.0f, Color.white);
       
        // outlinePaint
        a1 = new XYBoxAnnotation(
            1.0, 2.0, 3.0, 4.0, new BasicStroke(2.3f), gp1a, Color.blue
        );
        assertFalse(a1.equals(a2));
        a2 = new XYBoxAnnotation(
            1.0, 2.0, 3.0, 4.0, new BasicStroke(2.3f), gp1b, Color.blue
        );
        assertTrue(a1.equals(a2));
       
        // fillPaint
        a1 = new XYBoxAnnotation(
            1.0, 2.0, 3.0, 4.0, new BasicStroke(2.3f), gp1a, gp2a
        );
        assertFalse(a1.equals(a2));
        a2 = new XYBoxAnnotation(
            1.0, 2.0, 3.0, 4.0, new BasicStroke(2.3f), gp1b, gp2b
        );
        assertTrue(a1.equals(a2));
    }
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.