Examples of DialPlot


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

    /**
     * Check the notification event mechanism for the dial cap.
     */
    public void testCapListener() {
        DialPlot p = new DialPlot();
        DialCap c1 = new DialCap();
        p.setCap(c1);
        p.addChangeListener(this);
        this.lastEvent = null;
        c1.setFillPaint(Color.red);
        assertNotNull(this.lastEvent);

        DialCap c2 = new DialCap();
        p.setCap(c2);
        this.lastEvent = null;
        c1.setFillPaint(Color.blue);
        assertNull(this.lastEvent);
        c2.setFillPaint(Color.green);
        assertNotNull(this.lastEvent);
View Full Code Here

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

    /**
     * Check the notification event mechanism for the dial frame.
     */
    public void testFrameListener() {
        DialPlot p = new DialPlot();
        ArcDialFrame f1 = new ArcDialFrame();
        p.setDialFrame(f1);
        p.addChangeListener(this);
        this.lastEvent = null;
        f1.setBackgroundPaint(Color.gray);
        assertNotNull(this.lastEvent);

        ArcDialFrame f2 = new ArcDialFrame();
        p.setDialFrame(f2);
        this.lastEvent = null;
        f1.setBackgroundPaint(Color.blue);
        assertNull(this.lastEvent);
        f2.setBackgroundPaint(Color.green);
        assertNotNull(this.lastEvent);
View Full Code Here

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

    /**
     * Check the notification event mechanism for the dial scales.
     */
    public void testScaleListener() {
        DialPlot p = new DialPlot();
        StandardDialScale s1 = new StandardDialScale();
        p.addScale(0, s1);
        p.addChangeListener(this);
        this.lastEvent = null;
        s1.setStartAngle(22.0);
        assertNotNull(this.lastEvent);

        StandardDialScale s2 = new StandardDialScale();
        p.addScale(0, s2);
        this.lastEvent = null;
        s1.setStartAngle(33.0);
        assertNull(this.lastEvent);
        s2.setStartAngle(33.0);
        assertNotNull(this.lastEvent);
View Full Code Here

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

    /**
     * Check the notification event mechanism for a layer.
     */
    public void testLayerListener() {
        DialPlot p = new DialPlot();
        DialBackground b1 = new DialBackground(Color.red);
        p.addLayer(b1);
        p.addChangeListener(this);
        this.lastEvent = null;
        b1.setPaint(Color.blue);
        assertNotNull(this.lastEvent);

        DialBackground b2 = new DialBackground(Color.green);
        p.addLayer(b2);
        this.lastEvent = null;
        b1.setPaint(Color.red);
        assertNotNull(this.lastEvent);
        b2.setPaint(Color.green);
        assertNotNull(this.lastEvent);

        p.removeLayer(b2);
        this.lastEvent = null;
        b2.setPaint(Color.red);
        assertNull(this.lastEvent);
    }
View Full Code Here

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

    if (dataset==null){
      logger.debug("The dataset to be represented is null");
      return null;   
    }
   
    DialPlot plot = new DialPlot();
    plot.setDataset((ValueDataset)dataset);
    logger.debug("Created the new Dial Plot");

    ArcDialFrame dialFrame=null;
    plot.setView(0.21, 0.0, 0.58, 0.30);
    dialFrame = new ArcDialFrame(60.0, 60.0);
    dialFrame.setInnerRadius(0.65);
    dialFrame.setOuterRadius(0.90);
    dialFrame.setForegroundPaint(Color.darkGray);
    dialFrame.setStroke(new BasicStroke(3.0f));
    plot.setDialFrame(dialFrame);

    GradientPaint gp = new GradientPaint(new Point(), new Color(255, 255, 255), new Point(), new Color(240, 240, 240));
    DialBackground sdb = new DialBackground(gp);

    GradientPaintTransformType gradientPaintTransformType=GradientPaintTransformType.HORIZONTAL;

    sdb.setGradientPaintTransformer(new StandardGradientPaintTransformer(gradientPaintTransformType));
    plot.addLayer(sdb);

    increment = (upper-lower)/4;
    StandardDialScale scale=null;
    scale = new StandardDialScale(lower, upper, 115.0,-50.0, increment, minorTickCount);

    // sets intervals
    for (Iterator iterator = intervals.iterator(); iterator.hasNext();) {
      KpiInterval interval = (KpiInterval)iterator.next();
      StandardDialRange range = new StandardDialRange(interval.getMin(), interval.getMax(), interval.getColor());
      range.setInnerRadius(0.70);
      range.setOuterRadius(0.75);
      plot.addLayer(range);

    }

    scale.setTickRadius(0.88);
    scale.setTickLabelOffset(0.07);
    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);
    logger.debug("Setted background color of the chart");
View Full Code Here

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

    if (dataset==null){
      logger.debug("The dataset to be represented is null");
      return null;   
    }
   
    DialPlot plot = new DialPlot();
    logger.debug("Created new DialPlot");
   
    plot.setDataset((ValueDataset)dataset);
    plot.setDialFrame(new StandardDialFrame());
    plot.setBackground(new DialBackground());
   
   
    if(dialtextuse){
      //Usually it shoudn'tbe used. It is a type of title written into the graph
      DialTextAnnotation annotation1 = new DialTextAnnotation(dialtext);     
      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)){
//      increment = 0.01;
//    }
    scale.setMajorTickIncrement(increment);
    logger.debug("Setted the unit after which a new MajorTickline will be drawed");
    scale.setMinorTickCount(minorTickCount);
    logger.debug("Setted the number of MinorTickLines between every MajorTickline");
    scale.setTickRadius(0.88);
    scale.setTickLabelOffset(0.15);
    Font f =new Font("Arial",Font.PLAIN,11);
    scale.setTickLabelFont(f);
    plot.addScale(0, scale);
    plot.addPointer(new DialPointer.Pin());
   
    DialCap cap = new DialCap();
    plot.setCap(cap);

    // sets intervals
    for (Iterator iterator = intervals.iterator(); iterator.hasNext();) {
      KpiInterval interval = (KpiInterval) iterator.next();
      StandardDialRange range = new StandardDialRange(interval.getMin(), interval.getMax(), interval.getColor());
      range.setInnerRadius(0.52);
      range.setOuterRadius(0.55);
      plot.addLayer(range);
      logger.debug("new range added to the plot");
    }

    GradientPaint gp = new GradientPaint(new Point(),new Color(255, 255, 255), new Point(), new Color(170, 170, 220));
    DialBackground db = new DialBackground(gp);
    db.setGradientPaintTransformer(new StandardGradientPaintTransformer(GradientPaintTransformType.VERTICAL));
    plot.setBackground(db);
    plot.removePointer(0);
   
    DialPointer.Pointer p = new DialPointer.Pointer();
    //Pointer color
    p.setFillPaint(Color.black);
    plot.addPointer(p);
    logger.debug("Setted all properties of the plot");

    JFreeChart chart=new JFreeChart(name, plot);
    logger.debug("Created the chart");
    TextTitle title = setStyleTitle(name, styleTitle);
View Full Code Here

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

    // get data for diagrams
    logger.debug("IN");
    Dataset dataset=(Dataset)datasets.getDatasets().get("1");


    DialPlot plot = new DialPlot();
    plot.setDataset((ValueDataset)dataset);

    ArcDialFrame dialFrame=null;
    if(!horizontalView){
      plot.setView(0.78, 0.37, 0.22, 0.26);    
      dialFrame = new ArcDialFrame(-10.0, 20.0);
    }
    else{
      plot.setView(0.21, 0.0, 0.58, 0.30);
      dialFrame = new ArcDialFrame(60.0, 60.0);
    }

    dialFrame.setInnerRadius(0.65);
    dialFrame.setOuterRadius(0.90);
    dialFrame.setForegroundPaint(Color.darkGray);
    dialFrame.setStroke(new BasicStroke(3.0f));
    plot.setDialFrame(dialFrame);

    GradientPaint gp = new GradientPaint(new Point(),
        new Color(255, 255, 255), new Point(),
        new Color(240, 240, 240));
    DialBackground sdb = new DialBackground(gp);

    GradientPaintTransformType gradientPaintTransformType=GradientPaintTransformType.VERTICAL;
    if(horizontalView){
      gradientPaintTransformType=GradientPaintTransformType.HORIZONTAL;
    }

    sdb.setGradientPaintTransformer(new StandardGradientPaintTransformer(
        gradientPaintTransformType));
    plot.addLayer(sdb);

    if(! ( increment > 0) ){
      logger.warn("increment cannot be less than 0, put default to 0.1 ");
      increment=0.1;
    }


    StandardDialScale scale=null;
    if(!horizontalView){
      scale = new StandardDialScale(lower, upper, -8, 16.0,
          increment, minorTickCount);
    }
    else{
      scale = new StandardDialScale(lower, upper, 115.0,
          -50.0, increment, minorTickCount);
    }

    // sets intervals
    for (Iterator iterator = intervals.iterator(); iterator.hasNext();) {
      KpiInterval interval = (KpiInterval) iterator.next();
      StandardDialRange range = new StandardDialRange(interval.getMin(), interval.getMax(),
          interval.getColor());
      range.setInnerRadius(0.70);
      range.setOuterRadius(0.75);
      plot.addLayer(range);

    }

    scale.setTickRadius(0.88);
    scale.setTickLabelOffset(0.07);
    //set tick label style
    Font tickLabelsFont = new Font(labelsTickStyle.getFontName(), Font.PLAIN, labelsTickStyle.getSize());
    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);

    JFreeChart chart1 = new JFreeChart(plot);
    chart1.setBackgroundPaint(color);

    TextTitle title = setStyleTitle(name, styleTitle);
View Full Code Here

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

  public JFreeChart createChart(DatasetMap datasets) {
    logger.debug("IN");
    Dataset dataset=(Dataset)datasets.getDatasets().get("1");

    DialPlot plot = new DialPlot();
    plot.setDataset((ValueDataset)dataset);
    plot.setDialFrame(new StandardDialFrame());

    plot.setBackground(new DialBackground());
    if(dialtextuse){
      DialTextAnnotation annotation1 = new DialTextAnnotation(dialtext);     
      annotation1.setFont(styleTitle.getFont());
      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);

    if (!( increment > 0)){
      logger.warn("increment cannot be less than 0, put default to 0.1");
      increment = 0.01;
    }

    scale.setMajorTickIncrement(increment);

//    if (!( minorTickCount > 0)){
//      logger.warn("minor tick count cannot be less than 0, put default to 1");
//      minorTickCount = 1;
//    }

    scale.setMinorTickCount(minorTickCount);
    scale.setTickRadius(0.88);
    scale.setTickLabelOffset(0.15);
    //set tick label style
    Font tickLabelsFont = new Font(labelsTickStyle.getFontName(), Font.PLAIN, labelsTickStyle.getSize());
    scale.setTickLabelFont(tickLabelsFont);
    scale.setTickLabelPaint(labelsTickStyle.getColor());
    plot.addScale(0, scale);

    plot.addPointer(new DialPointer.Pin());

    DialCap cap = new DialCap();
    plot.setCap(cap);

    // sets intervals
    for (Iterator iterator = intervals.iterator(); iterator.hasNext();) {
      KpiInterval interval = (KpiInterval) iterator.next();
      StandardDialRange range = new StandardDialRange(interval.getMin(), interval.getMax(),
          interval.getColor());
      range.setInnerRadius(0.52);
      range.setOuterRadius(0.55);
      plot.addLayer(range);

    }

    GradientPaint gp = new GradientPaint(new Point(),
        new Color(255, 255, 255), new Point(),
        new Color(170, 170, 220));
    DialBackground db = new DialBackground(gp);
    db.setGradientPaintTransformer(new StandardGradientPaintTransformer(
        GradientPaintTransformType.VERTICAL));
    plot.setBackground(db);

    plot.removePointer(0);
    DialPointer.Pointer p = new DialPointer.Pointer();
    p.setFillPaint(Color.yellow);
    plot.addPointer(p);

    logger.debug("OUT");
    JFreeChart chart=new JFreeChart(name, plot);

    TextTitle title = setStyleTitle(name, styleTitle);
View Full Code Here

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


  DefaultValueDataset dataset = new DefaultValueDataset(meteolog.getOutdoorTemperature());
       
        // get data for diagrams
        DialPlot plot = new DialPlot();
        plot.setView(0.0, 0.0, 1.0, 1.0);
        plot.setDataset(0, dataset);
     
        GradientPaint gp = new GradientPaint(new Point(),
                new Color(255, 255, 255), new Point(),
                new Color(170, 170, 220));
       
        DialBackground db = new DialBackground(gp);
       
        db.setGradientPaintTransformer(new StandardGradientPaintTransformer(
                GradientPaintTransformType.CENTER_HORIZONTAL));
        plot.setBackground(db);
       
       
        StandardDialScale scale = new StandardDialScale();
        scale.setLowerBound(-20);
        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");
 
        final File f = File.createTempFile("mbmeteo", ".jpg");
View Full Code Here

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


        DefaultValueDataset dataset = new DefaultValueDataset(meteolog.getDayRainfall());

        // get data for diagrams
        DialPlot plot = new DialPlot();
        plot.setView(0.0, 0.0, 1.0, 1.0);
        plot.setDataset(0, dataset);

        GradientPaint gp = new GradientPaint(new Point(),
                new Color(255, 255, 255), new Point(),
                new Color(170, 170, 220));

        DialBackground db = new DialBackground(gp);

        db.setGradientPaintTransformer(new StandardGradientPaintTransformer(
                GradientPaintTransformType.CENTER_HORIZONTAL));
        plot.setBackground(db);


        StandardDialScale scale = new StandardDialScale();
        scale.setLowerBound(0);
        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");

        final File f = File.createTempFile("mbmeteo", ".jpg");
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.