//
import java.awt.*; public class Story extends GenericApplet { int n = 0, S = 60; int I[][] = {{-1, 0, 0, 1},{ 0,0,-1,1},{-2,-1, 1, 2},{-1, 0, 0, 1}}; int J[][] = {{-1,-2,-2,-1},{-1,1, 0,0},{-2,-1,-1,-2},{-2,-1,-1,-2}}; public void render(Graphics g) { if (S <= 60) { // while zoom not finished int width = bounds().width , x = width /2; int height = bounds().height, y = height/2; g.setColor(Color.white); g.fillRect(0, 0, width, height); // clear background g.setColor(Color.black); g.drawRect(x - S, y - S, 2*S, 2*S); // draw box, then two lines g.drawLine(x + S*I[n][0],y + S*J[n][0],x + S*I[n][1],y + S*J[n][1]); g.drawLine(x + S*I[n][2],y + S*J[n][2],x + S*I[n][3],y + S*J[n][3]); S++; // increment scale } } public void doClick(int _n) { // on user signal: n = _n; // set image state S = 1; // set scale=1 to restart zoom animation } }