欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
JFreeChart實(shí)時(shí)曲線(xiàn)(絕對一手資料,本例子我應用與多個(gè)實(shí)際項目中,與JMS技術(shù)結合)
package com.cityinforport.demo;
/**
 * =============================================================
 * JFreeChart開(kāi)發(fā):利用JFreeChart開(kāi)發(fā)實(shí)時(shí)曲線(xiàn)
 * =============================================================
 * Description:該例子演示了單條曲線(xiàn)的簡(jiǎn)單使用方法
 * Original Author:謝莫鋒  QQ:35814522 EMAIL:xmf3000@126.com created by 2005-02-28
 *
 * Changes:
 * -------------------------------------------------------------
 * 2005-03-01 增加線(xiàn)程調用 by xmf
 * 2005-03-02 界面調整 by xmf
 * -------------------------------------------------------------
 */

//導入java2d包
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import java.io.PrintStream;
//導入jfreechart包(chart)
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.ValueAxis;
import org.jfree.chart.plot.XYPlot;
//導入jfreechart包(data)
import org.jfree.data.time.*;
import org.jfree.data.xy.XYDataset;
//導入jfreechart包(ui)
import org.jfree.ui.ApplicationFrame;
import org.jfree.ui.RefineryUtilities;

public class TimeSeriesDemo1 extends JFrame implements Runnable,ActionListener{
  //時(shí)序圖數據集
  private TimeSeries timeseries;
  //Value坐標軸初始值
  private double lastValue;
  static Class class$org$jfree$data$time$Millisecond;
  static Thread thread1;

  public static void main(String[] args){
    TimeSeriesDemo1 TimeSeriesDemo1 = new TimeSeriesDemo1();
    TimeSeriesDemo1.pack();
    RefineryUtilities.centerFrameOnScreen(TimeSeriesDemo1);
    TimeSeriesDemo1.setVisible(true);
    startThread();
  }

  public void run(){
    while(true){
      try{
    //根據實(shí)際需要在此處加入需要執行的代碼
    double d = 0.9D + 0.2D * Math.random();
    lastValue = lastValue * d;
    Millisecond millisecond = new Millisecond();
    System.out.println("Now=" + millisecond.toString());
    timeseries.add(millisecond, lastValue);
    Thread.sleep(300);
      }catch(InterruptedException e){}
    }
  }

  public static void startThread(){
    thread1.start();
  }

  public void actionPerformed(ActionEvent e){
    if(e.getActionCommand().equals("EXIT")){
      thread1.destroy();
      System.exit(0);
    }
  }


  public TimeSeriesDemo1(){
    //super(new BorderLayout());
    thread1 = new Thread(this);
    lastValue = 100D;
    //創(chuàng )建時(shí)序圖對象
    timeseries = new TimeSeries("Random Data",TimeSeriesDemo1.class$org$jfree$data$time$Millisecond != null ? TimeSeriesDemo1.class$org$jfree$data$time$Millisecond : (TimeSeriesDemo1.class$org$jfree$data$time$Millisecond = TimeSeriesDemo1.getClass("org.jfree.data.time.Millisecond")));
    TimeSeriesCollection timeseriescollection = new TimeSeriesCollection(timeseries);
    //創(chuàng )建圖表面板
    ChartPanel chartpanel = new ChartPanel(createChart(timeseriescollection));
    chartpanel.setPreferredSize(new Dimension(500,270));

    JPanel jpanel = new JPanel();
    jpanel.setBorder(BorderFactory.createEmptyBorder(4,4,4,4));//邊距為4
    JButton jbutton = new JButton("退出");
    jbutton.setActionCommand("EXIT");
    jbutton.addActionListener(this);
    jpanel.add(jbutton);

    getContentPane().add(chartpanel);
    getContentPane().add(jpanel,"South");
  }

  private JFreeChart createChart(XYDataset xydataset){
    JFreeChart jfreechart = ChartFactory.createTimeSeriesChart("時(shí)序圖例子","時(shí)間","溫度值",xydataset,true,true,false);
    XYPlot xyplot = jfreechart.getXYPlot();
    //縱坐標設定
    ValueAxis valueaxis = xyplot.getDomainAxis();
    valueaxis.setAutoRange(true);
    valueaxis.setFixedAutoRange(60000D);

    valueaxis = xyplot.getRangeAxis();
    valueaxis.setRange(0.0D,200D);

    return jfreechart;
  }

  static Class getClass(String s){
    Class cls = null;
    try{
      cls = Class.forName(s);
    }catch(ClassNotFoundException cnfe){
      throw new NoClassDefFoundError(cnfe.getMessage());
    }
    return cls;
  }

}


===============================================
package com.cityinforport.demo;
/**
 * =============================================================
 * JFreeChart開(kāi)發(fā):利用JFreeChart開(kāi)發(fā)實(shí)時(shí)曲線(xiàn)
 * =============================================================
 * Description:該例子演示了多條曲線(xiàn)的簡(jiǎn)單使用方法
 * Original Author:xmf created by 2005-03-03
 *
 * Changes:
 * -------------------------------------------------------------
 * 在此處注明修改日期、修改點(diǎn)、修改人
 * -------------------------------------------------------------
 */

//導入java2d包
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import java.io.PrintStream;
//導入jfreechart包(chart)
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.ValueAxis;
import org.jfree.chart.plot.XYPlot;
import org.jfree.chart.renderer.xy.DefaultXYItemRenderer;
//導入jfreechart包(data)
import org.jfree.data.time.*;
import org.jfree.data.xy.XYDataset;
//導入jfreechart包(ui)
import org.jfree.ui.*;

public class TimeSeriesDemo2 extends JFrame implements Runnable,ActionListener{

  //申明實(shí)時(shí)曲線(xiàn)對象
  private TimeSeries timeseries1;
  private TimeSeries timeseries2;

  //Value坐標軸初始值
  private double lastValue1,lastValue2;
  private double originalValue1,originalValue2;

  static Class class$org$jfree$data$time$Millisecond;
  static Thread thread1;

  public static void main(String[] args){
    TimeSeriesDemo2 TimeSeriesDemo2 = new TimeSeriesDemo2();
    TimeSeriesDemo2.pack();
    RefineryUtilities.centerFrameOnScreen(TimeSeriesDemo2);
    TimeSeriesDemo2.setVisible(true);
    startThread();
  }

  public void run(){
    while(true){
      try{
    //說(shuō)明:在此處添加具體的業(yè)務(wù)數據

    //隨機產(chǎn)生曲線(xiàn)1的數據
    double d1 = 2.0D * Math.random();
    lastValue1 = originalValue1 * d1;
    Millisecond millisecond1 = new Millisecond();
    System.out.println("Series1 Now=" + millisecond1.toString());
    timeseries1.add(millisecond1, lastValue1);
    //隨機產(chǎn)生曲線(xiàn)2的數據
    double d2 = 2.0D * Math.random();
    lastValue2 = originalValue2 * d2;
    Millisecond millisecond2 = new Millisecond();
    System.out.println("Series2 Now=" + millisecond2.toString());
    timeseries2.add(millisecond2,lastValue2);

    Thread.sleep(500);
      }catch(InterruptedException e){}
    }
  }

  public static void startThread(){
    thread1.start();
  }

  public void actionPerformed(ActionEvent e){
    if(e.getActionCommand().equals("EXIT")){
      thread1.interrupt();
      System.exit(0);
    }
  }


  public TimeSeriesDemo2(){
    thread1 = new Thread(this);
    originalValue1 = 100D;
    originalValue2 = 100D;
    //創(chuàng )建時(shí)序圖對象
    timeseries1 = new TimeSeries("熱風(fēng)溫1",TimeSeriesDemo2.class$org$jfree$data$time$Millisecond != null ? TimeSeriesDemo2.class$org$jfree$data$time$Millisecond : (TimeSeriesDemo2.class$org$jfree$data$time$Millisecond = TimeSeriesDemo2.getClass("org.jfree.data.time.Millisecond")));
    timeseries2 = new TimeSeries("熱風(fēng)溫2",TimeSeriesDemo2.class$org$jfree$data$time$Millisecond != null ? TimeSeriesDemo2.class$org$jfree$data$time$Millisecond : (TimeSeriesDemo2.class$org$jfree$data$time$Millisecond = TimeSeriesDemo2.getClass("org.jfree.data.time.Millisecond")));
    TimeSeriesCollection timeseriescollection = new TimeSeriesCollection(timeseries1);
    TimeSeriesCollection timeseriescollection1 = new TimeSeriesCollection(timeseries2);

    //創(chuàng )建jfreechart對象
    JFreeChart jfreechart = ChartFactory.createTimeSeriesChart("RTU溫度模擬量實(shí)時(shí)曲線(xiàn)圖","Time","Value",
                            timeseriescollection,true,true,false);
    jfreechart.setBackgroundPaint(Color.white);

    //設定顯示風(fēng)格
    XYPlot xyplot = jfreechart.getXYPlot();
    xyplot.setBackgroundPaint(Color.lightGray);
    xyplot.setDomainGridlinePaint(Color.white);
    xyplot.setRangeGridlinePaint(Color.white);
    xyplot.setAxisOffset(new Spacer(1, 4D, 4D, 4D, 4D));
    ValueAxis valueaxis = xyplot.getDomainAxis();
    valueaxis.setAutoRange(true);
    valueaxis.setFixedAutoRange(60000D);
    //設定Value的范圍
    valueaxis = xyplot.getRangeAxis();
    valueaxis.setRange(0.0D,200D);
    xyplot.setDataset(1, timeseriescollection1);
    xyplot.setRenderer(1,new DefaultXYItemRenderer());

    //創(chuàng )建圖表面板
    ChartPanel chartpanel = new ChartPanel(jfreechart);
    getContentPane().add(chartpanel);

    //根據需要添加操作按鈕
    this.setTitle("RTU實(shí)時(shí)曲線(xiàn)");
    JPanel jpanel = new JPanel();
    jpanel.setBorder(BorderFactory.createEmptyBorder(4,4,4,4));//邊距為4
    JButton jbutton = new JButton("退出");
    jbutton.setActionCommand("EXIT");
    jbutton.addActionListener(this);
    jpanel.add(jbutton);
    getContentPane().add(jpanel,"South");
    chartpanel.setPreferredSize(new Dimension(500,270));
  }

  static Class getClass(String s){
    Class cls = null;
    try{
      cls = Class.forName(s);
    }catch(ClassNotFoundException cnfe){
      throw new NoClassDefFoundError(cnfe.getMessage());
    }
    return cls;
  }

}
本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
JFreeChart教程
jfreechart簡(jiǎn)單介紹3
JScrollPane中添加JPanel不出現滾動(dòng)條
JfreeChart說(shuō)明文檔
jfreechart
JScrollPane的使用
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久