Examples of DialPointer


Examples of org.jfree.chart.plot.dial.DialPointer

    /**
     * Confirm that the equals method can distinguish all the required fields.
     */
    public void testEquals() {
        DialPointer i1 = new DialPointer.Pin(1);
        DialPointer i2 = new DialPointer.Pin(1);
        assertTrue(i1.equals(i2));

        // dataset index
        i1 = new DialPointer.Pin(2);
        assertFalse(i1.equals(i2));
        i2 = new DialPointer.Pin(2);
        assertTrue(i1.equals(i2));

        // check an inherited attribute
        i1.setVisible(false);
        assertFalse(i1.equals(i2));
        i2.setVisible(false);
        assertTrue(i1.equals(i2));
    }
View Full Code Here

Examples of org.jfree.chart.plot.dial.DialPointer

    /**
     * Two objects that are equal are required to return the same hashCode.
     */
    public void testHashCode() {
        DialPointer i1 = new DialPointer.Pin(1);
        DialPointer i2 = new DialPointer.Pin(1);
        assertTrue(i1.equals(i2));
        int h1 = i1.hashCode();
        int h2 = i2.hashCode();
        assertEquals(h1, h2);
    }
View Full Code Here

Examples of org.jfree.chart.plot.dial.DialPointer

    /**
     * Confirm that cloning works.
     */
    public void testCloning() {
        DialPointer i1 = new DialPointer.Pin(1);
        DialPointer i2 = null;
        try {
            i2 = (DialPointer) i1.clone();
        }
        catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        assertTrue(i1 != i2);
        assertTrue(i1.getClass() == i2.getClass());
        assertTrue(i1.equals(i2));

        // check that the listener lists are independent
        MyDialLayerChangeListener l1 = new MyDialLayerChangeListener();
        i1.addChangeListener(l1);
        assertTrue(i1.hasListener(l1));
        assertFalse(i2.hasListener(l1));
    }
View Full Code Here

Examples of org.jfree.chart.plot.dial.DialPointer

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {
        // test a default instance
        DialPointer i1 = new DialPointer.Pin(1);
        DialPointer i2 = null;

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

Examples of org.jfree.chart.plot.dial.DialPointer

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization2() {
        // test a default instance
        DialPointer i1 = new DialPointer.Pointer(1);
        DialPointer i2 = null;

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

Examples of org.jfree.chart.plot.dial.DialPointer

    Font f =new Font("Arial",Font.PLAIN,11);
    scale.setTickLabelFont(f);
    //scale.setMajorTickIncrement(25.0);
    plot.addScale(0, scale);

    DialPointer needle = new DialPointer.Pin();
    needle.setRadius(0.82);
    plot.addLayer(needle);
   
    JFreeChart chart1 = new JFreeChart(plot);
    logger.debug("Created the chart");
    chart1.setBackgroundPaint(color);
View Full Code Here

Examples of org.jfree.chart.plot.dial.DialPointer

    scale.setTickLabelFont(tickLabelsFont);
    scale.setTickLabelPaint(labelsTickStyle.getColor());
    //scale.setMajorTickIncrement(25.0);
    plot.addScale(0, scale);

    DialPointer needle = new DialPointer.Pin();
    needle.setRadius(0.82);
    plot.addLayer(needle);
    DialValueIndicator dvi = new DialValueIndicator(0);
    dvi.setFont(new Font(labelsValueStyle.getFontName(), Font.PLAIN, labelsValueStyle.getSize()));
    dvi.setPaint(labelsValueStyle.getColor());
    plot.addLayer(dvi);
View Full Code Here

Examples of org.jfree.chart.plot.dial.DialPointer

        scale.setUpperBound(40);
        scale.setTickLabelOffset(0.14);
        scale.setTickLabelFont(new Font("Dialog", Font.PLAIN, 10));
        plot.addScale(0, scale);

        DialPointer needle = new DialPointer.Pointer(0);
       
        plot.addLayer(needle);
       
        JFreeChart chart1 = new JFreeChart(plot);
        chart1.setTitle("Temperature °C");
View Full Code Here

Examples of org.jfree.chart.plot.dial.DialPointer

        scale.setUpperBound(50);
        scale.setTickLabelOffset(0.14);
        scale.setTickLabelFont(new Font("Dialog", Font.PLAIN, 10));
        plot.addScale(0, scale);

        DialPointer needle = new DialPointer.Pointer(0);

        plot.addLayer(needle);

        JFreeChart chart1 = new JFreeChart(plot);
        chart1.setTitle("Daily Rain mm");
View Full Code Here

Examples of org.jfree.chart.plot.dial.DialPointer

        scale.setTickLabelOffset(0.14);
        scale.setTickLabelFont(new Font("Dialog", Font.PLAIN, 10));
        plot.addScale(0, scale);
        plot.setInsets( RectangleInsets.ZERO_INSETS);

        DialPointer needle = new DialPointer.Pointer(0);

        plot.addLayer(needle);

        JFreeChart chart1 = new JFreeChart(plot);
        chart1.setTitle("Humidity %");
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.