import java.awt.*; public class SketchBoard extends Canvas { public Line lines[]=null; public float scanx; public InterestingPoint currentIP=null; private int lastx=0; public int MAX_X, MAX_Y, OFF_X, OFF_Y, NUM_LINES; public Line select_line=null; private InterestingPoint lastpoint=null; public SketchBoard(Line l[], float Scanx, InterestingPoint ip, Line sl, int _MAX_X, int _MAX_Y, int _OFF_X, int _OFF_Y, int _NUM_LINES) { lines=l; scanx=Scanx; currentIP=ip; select_line=sl; MAX_X=_MAX_X; MAX_Y=_MAX_Y; OFF_X=_OFF_X; OFF_Y=_OFF_Y; NUM_LINES=_NUM_LINES; } public void paint(Graphics gd) { if(lines==null) return; // erase our previous stuff if(lastpoint!=null) lastpoint.erase(gd, OFF_X, 0+ OFF_Y, this.getBackground()); gd.setColor(this.getBackground()); Dimension d=this.size(); gd.fillRect(0,0,d.width, d.height); gd.drawLine(lastx +OFF_X,0+ OFF_Y, lastx +OFF_X, MAX_Y+ OFF_Y); // draw our new stuff gd.setColor(Color.black); for(int i=0;i