⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lineplotstrategy.java

📁 A Java virtual machine instruction consists of an opcode specifying the operation to be performed, f
💻 JAVA
字号:
import java.awt.*;
import java.awt.event.*;
import java.util.*;

//swing classes
import com.sun.java.swing.text.*;
import com.sun.java.swing.*;
import com.sun.java.swing.event.*;

public class LinePlotStrategy extends PlotStrategy
{
   LinePlotPanel lp;

//--------------------------------------
   public LinePlotStrategy()
   {
     super("Line plot");
     lp = new LinePlotPanel();
     getContentPane().add(lp);
   }
//--------------------------------------
   public void plot(float[] xp, float[] yp)
   {
      x = xp;  y = yp;        //copy in data
      findBounds();           //sets maxes and mins
      setSize(width, height);
      setVisible(true);
      setBackground(Color.white);
      lp.setBounds(minX, minY, maxX, maxY);
      lp.plot(xp, yp, color); //set up plot data
      repaint();              //call paint to plot
   }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -