4 import java.awt.image.*;
19 protected void grow(
int ox,
int oy) {
22 if (ox>xMax) ox = xMax;
23 if (oy>yMax) oy = yMax;
24 if (ox!=xp[nPoints-1] || oy!=yp[nPoints-1]) {
28 if (nPoints==xp.length)
35 int x1 = xp[nPoints-2]+x;
36 int y1 = yp[nPoints-2]+y;
37 int x2 = xp[nPoints-1]+x;
38 int y2 = yp[nPoints-1]+y;
39 int xmin = Math.min(x1, x2);
40 int xmax = Math.max(x1, x2);
41 int ymin = Math.min(y1, y2);
42 int ymax = Math.max(y1, y2);
45 double mag = ic.getMagnification();
46 if (mag<1.0) margin = (int)(margin/mag);
48 imp.
draw(xmin-margin, ymin-margin, (xmax-xmin)+margin*2, (ymax-ymin)+margin*2);
51 protected void handleMouseUp(
int screenX,
int screenY) {
52 if (state==CONSTRUCTING) {