// plot2du.java plot 2d data Utah graphics .dat // also handles 3d, color each dimension import java.io.*; import java.awt.*; import java.awt.event.*; public class plot2du extends Frame { // mouse and display variables boolean debug = true; int xm, ym, bm; // mouse position int height = 700; int width = 700; double xmin, xmax, ymin, ymax, zmin, zmax; double ya, xs, ys, zs; // scale for data 0..1 int xp, yp; // ortho returns int pts, pt, k; datread DR; // = new datread(filename); // defines data structures String filein; int grid = 1; // box off/on int colora = 0; // black, X, Y, Z int points = 0; // lines, points only, both public plot2du(String filename) { System.out.println("plot2du.java running"); setTitle("plot2du"); setSize(width,height); setBackground(Color.white); setForeground(Color.black); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); setVisible(true); this.addMouseListener (new mousePressHandler()); System.out.println("datread.java reading "+filename); filein = filename; DR = new datread(filename); // defines data structures System.out.println("num_points="+DR.num_points+ ", num_polys="+DR.num_polys); System.out.println("print vertices"); xmin = DR.data_points[0].x; xmax = DR.data_points[0].x; ymin = DR.data_points[0].y; ymax = DR.data_points[0].y; zmin = DR.data_points[0].z; zmax = DR.data_points[0].z; for(int i=0; i