Package org.jfree.chart.plot

Examples of org.jfree.chart.plot.MeterInterval


    float[] components = color.getRGBColorComponents(null);

    float alpha = interval.getAlphaDouble() == null ? (float)JRMeterInterval.DEFAULT_TRANSPARENCY : interval.getAlphaDouble().floatValue();
    Color alphaColor = new Color(components[0], components[1], components[2], alpha);

    return new MeterInterval(label, range, alphaColor, null, alphaColor);
  }
View Full Code Here


    float[] components = color.getRGBColorComponents(null);

    float alpha = interval.getAlphaDouble() == null ? (float)JRMeterInterval.DEFAULT_TRANSPARENCY : interval.getAlphaDouble().floatValue();
    Color alphaColor = new Color(components[0], components[1], components[2], alpha);

    return new MeterInterval(label, range, alphaColor, null, alphaColor);
  }
View Full Code Here

    float[] components = color.getRGBColorComponents(null);

    float alpha = interval.getAlphaDouble() == null ? (float)JRMeterInterval.DEFAULT_TRANSPARENCY : interval.getAlphaDouble().floatValue();
    Color alphaColor = new Color(components[0], components[1], components[2], alpha);

    return new MeterInterval(label, range, alphaColor, null, alphaColor);
  }
View Full Code Here

    float[] components = color.getRGBColorComponents(null);
    float alpha = interval.getAlphaDouble() == null ? (float)JRMeterInterval.DEFAULT_TRANSPARENCY : interval.getAlphaDouble().floatValue();

    Color alphaColor = new Color(components[0], components[1], components[2], alpha);

    return new MeterInterval(label, range, alphaColor, null, alphaColor);
  }
View Full Code Here

  {
    DefaultValueDataset dataset = createDefaultValueDataset(values);

    MeterPlot plot = new MeterPlot(dataset);
    plot.setRange(new Range(0, 60));
    plot.addInterval(new MeterInterval("Normal", new Range(0.0, 35.0),
        Color.lightGray, new BasicStroke(2.0f), new Color(0, 255, 0, 64)));
    plot.addInterval(new MeterInterval("Warning", new Range(35.0, 50.0),
        Color.lightGray, new BasicStroke(2.0f), new Color(255, 255, 0, 64)));
    plot.addInterval(new MeterInterval("Critical", new Range(50.0, 60.0),
        Color.lightGray, new BasicStroke(2.0f), new Color(255, 0, 0, 128)));
    plot.setNeedlePaint(Color.darkGray);
    plot.setDialBackgroundPaint(Color.white);
    plot.setDialOutlinePaint(Color.gray);
    plot.setDialShape(DialShape.CHORD);
View Full Code Here

     * 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

        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

        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

    /**
     * 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

   /**
     * 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

TOP

Related Classes of org.jfree.chart.plot.MeterInterval

Copyright © 2018 www.massapicom. 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.