public class Lake extends Applet implements Runnable {
private int boatHeight;
private boolean keepRunning = true;
private transient Thread thrLake;
private static final String PARAM_IMAGE = "image";
private static final String PARAM_OVERLAY = "overlay";
private static final String PARAM_TARGET = "target";
private static final String PARAM_HREF = "hRef";
private static final String PARAM_ROCKING = "rocking";
private static final String PARAM_UNDERWATER = "underwater";
private static final String PARAM_SPEED = "speed";
private Image image;
private Image overlay;
private MediaTracker overlayTracker;
private String target = "_self";
private URL hRef;
private boolean rocking = false;
private boolean underwater = false;
private int speed = 50;
private int numFrames = 12;
private transient Graphics gMain;
private transient Graphics gWave;
private transient Image imgWave;
private transient int currImage;
private transient int widthImage;
private transient int heightImage;
private transient int widthOverlay;
private transient int heightOverlay;
private transient boolean allLoaded = false;
private transient boolean isAnimating = true;
private transient int boatPhase;
private transient int boatPhaseTotal = 50;
public void start() {
this.keepRunning = true;
if (this.thrLake == null) {
this.thrLake = new Thread(this);
this.thrLake.start();
}
}
public void stop() {
this.keepRunning = false;
}
public void run() {
this.currImage = 0;
while(this.keepRunning) {
try {
while(!this.isAnimating) {
Thread.sleep(500L);
}
if (++this.currImage == this.numFrames) {
this.currImage = 0;
}
if (++this.boatPhase == this.boatPhaseTotal) {
this.boatPhase = 0;
}
this.displayImage();
((Component)this).repaint();
Thread.sleep(30L);
} catch (InterruptedException var1) {
this.stop();
}
}
}
public String getAppletInfo() {
return "Name: Lake Version 3.1\r\nAuthor: David Griffiths\r\nis an applet class which takes in an \r\nimage and reflects it in a virtual Lake.\r\nLast compiled: 4th April 1999 at 08:27 \r\nFor more information about this and other applets\r\ngo to http://www.demon.co.uk/davidg/spigots.htm\r\nCreated with Sun JDK 1.1";
String[][] var1 = new String[][]{{"image", "Image", "JPG or GIF file to reflect"}, {"overlay", "Image", "JPG or GIF file to use as an overlay"}, {"target", "String", "Target frame"}, {"hRef", "URL", "URL to link to"}, {"rocking", "boolean", "TRUE if boat rocking"}, {"underwater", "boolean", "TRUE if viewer underwater"}, {"speed", "int", "The animation speed: 1-100"}};