Examples of MeterInterval


Examples of org.jfree.chart.plot.MeterInterval

    /**
     * Confirm that the equals method can distinguish all the required fields.
     */
    public void testEquals() {

        MeterInterval m1 = new MeterInterval(
            "Label 1", new Range(1.2, 3.4), Color.red, new BasicStroke(1.0f),
            Color.blue
        );
        MeterInterval m2 = new MeterInterval(
            "Label 1", new Range(1.2, 3.4), Color.red, new BasicStroke(1.0f),
            Color.blue
        );
        assertTrue(m1.equals(m2));
        assertTrue(m2.equals(m1));

        m1 = new MeterInterval(
            "Label 2", new Range(1.2, 3.4), Color.red, new BasicStroke(1.0f),
            Color.blue
        );
        assertFalse(m1.equals(m2));
        m2 = new MeterInterval(
            "Label 2", new Range(1.2, 3.4), Color.red, new BasicStroke(1.0f),
            Color.blue
        );
        assertTrue(m1.equals(m2));

View Full Code Here

Examples of org.jfree.chart.plot.MeterInterval

        assertFalse(plot1.equals(plot2));
        plot2.setRange(new Range(50.0, 70.0));
        assertTrue(plot1.equals(plot2));

        // interval
        plot1.addInterval(new MeterInterval("Normal", new Range(55.0, 60.0)));
        assertFalse(plot1.equals(plot2));
        plot2.addInterval(new MeterInterval("Normal", new Range(55.0, 60.0)));
        assertTrue(plot1.equals(plot2));

        // dial outline paint
        plot1.setDialOutlinePaint(new GradientPaint(1.0f, 2.0f, Color.red,
                3.0f, 4.0f, Color.blue));
View Full Code Here

Examples of org.jfree.chart.plot.MeterInterval

        p1.getTickLabelFormat().setMinimumIntegerDigits(99);
        assertFalse(p1.equals(p2));
        p2.getTickLabelFormat().setMinimumIntegerDigits(99);
        assertTrue(p1.equals(p2));

        p1.addInterval(new MeterInterval("Test", new Range(1.234, 5.678)));
        assertFalse(p1.equals(p2));
        p2.addInterval(new MeterInterval("Test", new Range(1.234, 5.678)));
        assertTrue(p1.equals(p2));

    }
View Full Code Here

Examples of org.jfree.chart.plot.MeterInterval

     * pointer exception (fixed now).
     */
    public void testDrawWithNullInfo() {
        boolean success = false;
        MeterPlot plot = new MeterPlot(new DefaultValueDataset(60.0));
        plot.addInterval(new MeterInterval("Normal", new Range(0.0, 80.0)));
        JFreeChart chart = new JFreeChart(plot);
        try {
            BufferedImage image = new BufferedImage(200, 100,
                    BufferedImage.TYPE_INT_RGB);
            Graphics2D g2 = image.createGraphics();
View Full Code Here

Examples of org.jfree.chart.plot.MeterInterval

    /**
     * Confirm that the equals method can distinguish all the required fields.
     */
    public void testEquals() {

        MeterInterval m1 = new MeterInterval(
            "Label 1", new Range(1.2, 3.4), Color.red, new BasicStroke(1.0f),
            Color.blue
        );
        MeterInterval m2 = new MeterInterval(
            "Label 1", new Range(1.2, 3.4), Color.red, new BasicStroke(1.0f),
            Color.blue
        );
        assertTrue(m1.equals(m2));
        assertTrue(m2.equals(m1));

        m1 = new MeterInterval(
            "Label 2", new Range(1.2, 3.4), Color.red, new BasicStroke(1.0f),
            Color.blue
        );
        assertFalse(m1.equals(m2));
        m2 = new MeterInterval(
            "Label 2", new Range(1.2, 3.4), Color.red, new BasicStroke(1.0f),
            Color.blue
        );
        assertTrue(m1.equals(m2));

View Full Code Here

Examples of org.jfree.chart.plot.MeterInterval

    /**
     * This class is immutable so cloning isn't required.
     */
    public void testCloning() {
        MeterInterval m1 = new MeterInterval("X", new Range(1.0, 2.0));
        assertFalse(m1 instanceof Cloneable);
    }
View Full Code Here

Examples of org.jfree.chart.plot.MeterInterval

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

        MeterInterval m1 = new MeterInterval("X", new Range(1.0, 2.0));
        MeterInterval m2 = null;
        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(m1);
            out.close();
View Full Code Here

Examples of org.jfree.chart.plot.MeterInterval

    logger.debug("Setted plot range");


    for (Iterator iterator = intervals.iterator(); iterator.hasNext();) {
      KpiInterval interval = (KpiInterval) iterator.next();
      plot.addInterval(new MeterInterval(interval.getLabel(), new Range(interval.getMin(), interval.getMax()),
          Color.lightGray, new BasicStroke(2.0f), interval.getColor()));
      logger.debug("Added new interval to the plot");
    }

    plot.setNeedlePaint(Color.darkGray);
View Full Code Here

Examples of org.jfree.chart.plot.MeterInterval

          outlineStroke = new BasicStroke();
        }
        Paint outlinePaint = JFreeChartEngine.getPaint( textColor );

        // create the interval object
        MeterInterval interval = new MeterInterval( label, range, outlinePaint, outlineStroke, backgroundPaint );

        // add the interval to the widget
        widgetDefinition.addInterval( interval );
      }
    }
View Full Code Here

Examples of org.jfree.chart.plot.MeterInterval

      MeterPlot meter = (MeterPlot) plot;
      DialWidgetDefinition widget = (DialWidgetDefinition) chartDefinition;
      List intervals = widget.getIntervals();
      Iterator intervalIterator = intervals.iterator();
      while ( intervalIterator.hasNext() ) {
        MeterInterval interval = (MeterInterval) intervalIterator.next();
        meter.addInterval( interval );
      }

      meter.setNeedlePaint( widget.getNeedlePaint() );
      meter.setDialShape( widget.getDialShape() );
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.