Examples of DialValueIndicator


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

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {
        // test a default instance
        DialValueIndicator i1 = new DialValueIndicator(0);
        DialValueIndicator 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.DialValueIndicator

      annotation1.setFont(styleTitle.getFont());
      annotation1.setRadius(0.7);
      plot.addLayer(annotation1);
    }
   
    DialValueIndicator dvi = new DialValueIndicator(0);
    plot.addLayer(dvi);

    increment = (upper-lower)/10;
    StandardDialScale scale = new StandardDialScale(lower, upper, -120, -300, 10.0, 4);
//    if (!( increment > 0)){
View Full Code Here

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

    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);

    JFreeChart chart1 = new JFreeChart(plot);
    chart1.setBackgroundPaint(color);
View Full Code Here

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

      annotation1.setRadius(0.7);

      plot.addLayer(annotation1);
    }

    DialValueIndicator dvi = new DialValueIndicator(0);
    dvi.setFont(new Font(labelsValueStyle.getFontName(), Font.PLAIN, labelsValueStyle.getSize()));
    dvi.setPaint(labelsValueStyle.getColor());
    plot.addLayer(dvi);

    StandardDialScale scale = new StandardDialScale(lower,
        upper, -120, -300, 10.0, 4);
View Full Code Here

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

    /**
     * Confirm that the equals method can distinguish all the required fields.
     */
    public void testEquals() {
        DialValueIndicator i1 = new DialValueIndicator(0);
        DialValueIndicator i2 = new DialValueIndicator(0);
        assertTrue(i1.equals(i2));
       
        // dataset index
        i1.setDatasetIndex(99);
        assertFalse(i1.equals(i2));
        i2.setDatasetIndex(99);
        assertTrue(i1.equals(i2));
       
        // angle
        i1.setAngle(43);
        assertFalse(i1.equals(i2));
        i2.setAngle(43);
        assertTrue(i1.equals(i2));
       
        // radius
        i1.setRadius(0.77);
        assertFalse(i1.equals(i2));
        i2.setRadius(0.77);
        assertTrue(i1.equals(i2));
       
        // frameAnchor
        i1.setFrameAnchor(RectangleAnchor.TOP_LEFT);
        assertFalse(i1.equals(i2));
        i2.setFrameAnchor(RectangleAnchor.TOP_LEFT);
        assertTrue(i1.equals(i2));
       
        // templateValue
        i1.setTemplateValue(new Double(1.23));
        assertFalse(i1.equals(i2));
        i2.setTemplateValue(new Double(1.23));
        assertTrue(i1.equals(i2));
       
        // font
        i1.setFont(new Font("Dialog", Font.PLAIN, 7));
        assertFalse(i1.equals(i2));
        i2.setFont(new Font("Dialog", Font.PLAIN, 7));
        assertTrue(i1.equals(i2));
       
        // paint
        i1.setPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f,
                Color.green));
        assertFalse(i1.equals(i2));
        i2.setPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f,
                Color.green));
        assertTrue(i1.equals(i2));

        // backgroundPaint
        i1.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f,
                4.0f, Color.green));
        assertFalse(i1.equals(i2));
        i2.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f,
                4.0f, Color.green));
        assertTrue(i1.equals(i2));
       
        // outlineStroke
        i1.setOutlineStroke(new BasicStroke(1.1f));
        assertFalse(i1.equals(i2));
        i2.setOutlineStroke(new BasicStroke(1.1f));
        assertTrue(i1.equals(i2));
       
        // outlinePaint
        i1.setOutlinePaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f,
                Color.green));
        assertFalse(i1.equals(i2));
        i2.setOutlinePaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f,
                Color.green));
        assertTrue(i1.equals(i2));

        // insets
        i1.setInsets(new RectangleInsets(1, 2, 3, 4));
        assertFalse(i1.equals(i2));
        i2.setInsets(new RectangleInsets(1, 2, 3, 4));
        assertTrue(i1.equals(i2));
       
        // valueAnchor
        i1.setValueAnchor(RectangleAnchor.BOTTOM_LEFT);       
        assertFalse(i1.equals(i2));
        i2.setValueAnchor(RectangleAnchor.BOTTOM_LEFT);      
        assertTrue(i1.equals(i2));
       
        // textAnchor
        i1.setTextAnchor(TextAnchor.TOP_LEFT);
        assertFalse(i1.equals(i2));
        i2.setTextAnchor(TextAnchor.TOP_LEFT);
        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.DialValueIndicator

    /**
     * Two objects that are equal are required to return the same hashCode.
     */
    public void testHashCode() {
        DialValueIndicator i1 = new DialValueIndicator(0);
        DialValueIndicator i2 = new DialValueIndicator(0);
        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.DialValueIndicator

    /**
     * Confirm that cloning works.
     */
    public void testCloning() {
        // test a default instance
        DialValueIndicator i1 = new DialValueIndicator(0);
        DialValueIndicator i2 = null;
        try {
            i2 = (DialValueIndicator) 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.DialValueIndicator

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

        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(i1);
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.