home *** CD-ROM | disk | FTP | other *** search
- import java.applet.Applet;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Dimension;
- import java.awt.Event;
- import java.awt.Frame;
- import java.awt.Graphics;
- import java.awt.Image;
- import java.awt.MediaTracker;
- import java.awt.image.ImageObserver;
- import java.net.MalformedURLException;
- import java.net.URL;
- import java.util.StringTokenizer;
-
- public class wiz extends Applet implements Runnable {
- private Thread engine;
- private wizinfo[] imageData;
- private MediaTracker tracker;
- private int totalImages;
- private boolean[] imageLoaded;
- private int imageWidth;
- private int imageHeight;
- private int tempwidth;
- private int tempheight;
- // $FF: renamed from: x int
- private int field_0;
- // $FF: renamed from: y int
- private int field_1;
- private int oldX;
- private int oldY;
- private int revealX;
- private int revealY;
- private int revealW;
- private int revealH;
- private int repeatNumber;
- private int globalRepeat = -1;
- private int loopCounter;
- private Dimension imageCenter;
- private Dimension appletDim;
- private Dimension[] imageDim;
- private Dimension bgImageDim;
- private int ratioW = 1;
- private int ratioH = 1;
- private URL destURL;
- private Image bgimage;
- private boolean tiled;
- private Image offImage;
- private Graphics offGraphics;
- private Image reverseImage;
- private Image img1ptr;
- private Image imgNewptr;
- private int imgNum;
- private boolean goSmall = true;
- private boolean clearApp = true;
- private boolean ready;
- private boolean firstTime = true;
- private boolean nextFunction = true;
- private boolean oldImage = true;
- private boolean centered = true;
- private boolean cursorDone;
- private boolean mouseIn;
- private int transitionNum = 4;
- private int functionNumber = 1;
- private boolean invertNow;
- private Color bgColor;
- private int checkBoardPanelSize = 16;
- private int regnumber;
- private boolean serialIdError;
- private boolean unreg;
- int bounceCount = 1;
-
- public void stop() {
- if (this.engine != null && this.engine.isAlive()) {
- this.engine.stop();
- }
-
- this.engine = null;
- }
-
- private boolean isOverScroll(boolean var1) {
- if (this.img1ptr == null) {
- var1 = true;
- }
-
- if (var1) {
- this.oldImage = true;
- }
-
- return var1;
- }
-
- public boolean mouseEnter(Event var1, int var2, int var3) {
- if (!this.serialIdError) {
- String var4 = this.imageData[this.imgNum].getDest();
- this.mouseIn = true;
- if (var4 != null) {
- ((Applet)this).showStatus(var4);
- if (!this.cursorDone) {
- this.setMouseCursor(1);
- this.cursorDone = true;
- }
-
- return true;
- }
- }
-
- return false;
- }
-
- private void revealWipeUpDown(boolean var1, boolean var2) {
- if (var1) {
- if (var2) {
- this.revealY -= this.transitionNum;
- this.revealH += this.transitionNum;
- if (this.revealY <= this.field_1) {
- this.revealY = this.field_1;
- this.revealH = this.imageHeight;
- this.nextFunction = this.oldImage = true;
- }
- } else {
- this.revealH -= this.transitionNum;
- if (this.revealH <= 0) {
- this.revealH = 0;
- this.nextFunction = this.oldImage = true;
- this.imgNewptr = null;
- }
- }
- } else if (var2) {
- this.revealH += this.transitionNum;
- if (this.revealH >= this.imageHeight) {
- this.revealH = this.imageHeight;
- this.nextFunction = this.oldImage = true;
- }
- } else {
- this.revealY += this.transitionNum;
- this.revealH -= this.transitionNum;
- if (this.revealH <= 0) {
- this.revealH = 0;
- this.nextFunction = this.oldImage = true;
- this.imgNewptr = null;
- }
- }
-
- this.offGraphics.clipRect(this.revealX, this.revealY, this.revealW, this.revealH);
- }
-
- private void getNextFunc() {
- this.functionNumber = this.imageData[this.imgNum].getFunction();
- this.img1ptr = this.imgNewptr;
- this.imgNewptr = this.imageData[this.imgNum].getImageData();
- if (this.img1ptr != null) {
- this.imageDim[0] = new Dimension(this.img1ptr.getWidth(this), this.img1ptr.getHeight(this));
- this.oldX = this.field_0;
- this.oldY = this.field_1;
- } else {
- this.imageDim[0] = new Dimension(0, 0);
- }
-
- this.transitionNum = this.imageData[this.imgNum].getMoveRate();
- this.tempwidth = this.imageWidth = this.imgNewptr.getWidth(this);
- this.tempheight = this.imageHeight = this.imgNewptr.getHeight(this);
- this.imageDim[1] = new Dimension(this.tempwidth, this.tempheight);
- this.getImageCenter(this.imgNewptr);
- this.field_0 = this.imageData[this.imgNum].x;
- this.field_1 = this.imageData[this.imgNum].y;
- switch (this.functionNumber) {
- case 10:
- case 11:
- if (this.repeatNumber <= 0) {
- this.repeatNumber = this.imageData[this.imgNum].getRepeatNum();
- }
-
- this.img1ptr = null;
- this.goSmall = true;
- break;
- case 13:
- if (this.repeatNumber <= 0) {
- this.repeatNumber = this.imageData[this.imgNum].getRepeatNum();
- }
-
- this.img1ptr = null;
- this.field_1 += this.imageHeight / 2;
- this.tempheight = 0;
- this.goSmall = false;
- break;
- case 20:
- case 21:
- case 22:
- case 23:
- this.img1ptr = null;
- break;
- case 30:
- this.img1ptr = null;
- this.field_0 = this.imageCenter.width;
- this.field_1 = this.imageCenter.height;
- break;
- case 31:
- this.img1ptr = null;
- this.field_0 = this.appletDim.width / 2;
- this.field_1 = this.appletDim.height / 2;
- this.tempheight = 0;
- this.tempwidth = 0;
- if (this.imageWidth > this.imageHeight) {
- int var1 = this.imageWidth % this.transitionNum;
- this.field_0 += var1;
- this.ratioW = this.imageWidth / this.imageHeight;
- if (this.ratioW < 1) {
- this.ratioW = 1;
- }
-
- this.ratioH = 1;
- } else {
- int var2 = this.imageHeight % this.transitionNum;
- this.field_0 += var2;
- this.ratioW = 1;
- this.ratioH = this.imageHeight / this.imageWidth;
- if (this.ratioH < 1) {
- this.ratioH = 1;
- }
- }
- break;
- case 60:
- this.revealX = this.field_0;
- this.revealY = this.field_1 + this.imageHeight;
- this.revealW = this.imageWidth;
- this.revealH = 0;
- if (this.totalImages == 1) {
- this.img1ptr = null;
- }
- break;
- case 61:
- this.revealX = this.field_0;
- this.revealY = this.field_1;
- this.revealW = this.imageWidth;
- this.revealH = 0;
- if (this.totalImages == 1) {
- this.img1ptr = null;
- }
- break;
- case 62:
- this.revealX = this.field_0 + this.imageWidth;
- this.revealY = this.field_1;
- this.revealW = this.imageWidth;
- this.revealH = this.imageHeight;
- if (this.totalImages == 1) {
- this.img1ptr = null;
- }
- break;
- case 63:
- this.revealX = this.field_0;
- this.revealY = this.field_1;
- this.revealW = 0;
- this.revealH = this.imageHeight;
- if (this.totalImages == 1) {
- this.img1ptr = null;
- }
- break;
- case 64:
- this.revealX = this.field_0 + this.imageWidth / 2;
- this.revealY = this.field_1 + this.imageHeight / 2;
- this.revealW = 1;
- this.revealH = 1;
- if (this.totalImages == 1) {
- this.img1ptr = null;
- }
- break;
- case 65:
- this.tempwidth = this.imageWidth;
- this.tempheight = this.imageHeight;
- this.revealX = this.field_0;
- this.revealY = this.field_1;
- break;
- case 66:
- this.revealX = this.field_0;
- this.revealY = this.field_1;
- this.revealH = this.revealW = 0;
- break;
- case 67:
- this.revealX = this.field_0 + this.imageWidth;
- this.revealH = this.revealW = 0;
- break;
- case 68:
- this.revealY = this.field_1 + this.imageHeight;
- this.revealH = this.revealW = 0;
- break;
- case 69:
- this.revealX = this.field_0 + this.imageWidth;
- this.revealY = this.field_1 + this.imageHeight;
- this.revealH = this.revealW = 0;
- break;
- case 70:
- case 71:
- case 72:
- case 73:
- case 74:
- this.revealX = this.field_0;
- this.revealY = this.field_1;
- this.revealW = this.imageWidth;
- this.revealH = this.imageHeight;
- this.img1ptr = null;
- break;
- case 75:
- this.revealX = this.field_0 + this.imageWidth / 2;
- this.revealY = this.field_1 + this.imageHeight / 2;
- this.tempwidth = 0;
- this.tempheight = 0;
- this.img1ptr = null;
- break;
- case 81:
- this.revealX = this.field_0;
- this.revealW = this.imageWidth;
- this.revealH = this.imageHeight;
- break;
- case 90:
- this.revealH = 0;
- break;
- case 91:
- case 92:
- this.revealX = -(this.imageWidth / 2);
- this.tempwidth = this.appletDim.width;
- this.tempheight = this.revealY = this.field_1;
- }
-
- if (this.totalImages == 1) {
- this.img1ptr = null;
- }
-
- }
-
- private String intoLetters(String var1) {
- char[] var2 = new char[var1.length()];
-
- for(int var3 = 0; var3 < var1.length(); ++var3) {
- var2[var3] = (char)(Character.digit(var1.charAt(var3), 10) + 65);
- }
-
- return String.valueOf(var2);
- }
-
- private void setMouseCursor(int var1) {
- Container var2;
- for(var2 = ((Component)this).getParent(); !(var2 instanceof Frame); var2 = ((Component)var2).getParent()) {
- }
-
- ((Frame)var2).setCursor(var1);
- }
-
- private synchronized void slider(Graphics var1, Image var2, int var3) {
- if (var3 < 2) {
- var3 = 2;
- } else if (var3 > 20) {
- var3 = 20;
- }
-
- int var4 = 22 - var3;
- int var5 = 200 / var4;
- int var6 = 2 * var4;
- int var7 = this.imageHeight / var4;
- Image var8 = ((Component)this).createImage(this.imageWidth, var7);
- Image var9 = ((Component)this).createImage(this.imageWidth, var7);
- Graphics var10 = var8.getGraphics();
- Graphics var11 = var9.getGraphics();
-
- for(int var12 = 0; var12 < var4; ++var12) {
- int var13 = this.field_1 + var12 * var7;
- if (var12 % 2 == 0) {
- for(int var23 = 0; var23 < this.field_0; var23 += var6) {
- while(!var11.drawImage(this.offImage, -var23, -var13, this)) {
- Thread.yield();
- }
-
- while(!var10.drawImage(var9, 0, 0, this)) {
- Thread.yield();
- }
-
- while(!var10.drawImage(var2, 0, -(var12 * var7), this)) {
- Thread.yield();
- }
-
- while(!var1.drawImage(var8, var23, var13, this)) {
- Thread.yield();
- }
-
- this.ready = true;
- ((Component)this).repaint();
-
- try {
- Thread.sleep((long)var5);
- } catch (Exception var18) {
- }
-
- while(!var1.drawImage(var9, var23, var13, this)) {
- Thread.yield();
- }
- }
- } else {
- for(int var14 = this.appletDim.width - this.imageWidth; var14 > this.field_0; var14 -= var6) {
- while(!var11.drawImage(this.offImage, -var14, -var13, this)) {
- Thread.yield();
- }
-
- while(!var10.drawImage(var9, 0, 0, this)) {
- Thread.yield();
- }
-
- while(!var10.drawImage(var2, 0, -(var12 * var7), this)) {
- Thread.yield();
- }
-
- while(!var1.drawImage(var8, var14, var13, this)) {
- Thread.yield();
- }
-
- this.ready = true;
- ((Component)this).repaint();
-
- try {
- Thread.sleep((long)var5);
- } catch (Exception var17) {
- }
-
- while(!var1.drawImage(var9, var14, var13, this)) {
- Thread.yield();
- }
- }
- }
-
- while(!var11.drawImage(this.offImage, -this.field_0, -var13, this)) {
- Thread.yield();
- }
-
- while(!var10.drawImage(var9, 0, 0, this)) {
- Thread.yield();
- }
-
- while(!var10.drawImage(var2, 0, -(var12 * var7), this)) {
- Thread.yield();
- }
-
- while(!var1.drawImage(var8, this.field_0, var13, this)) {
- Thread.yield();
- }
-
- this.ready = true;
- ((Component)this).repaint();
- }
-
- if (this.imageHeight % var4 > 0) {
- var7 = this.imageHeight % var4;
- int var20 = this.imageHeight - var7;
- var8.flush();
- var9.flush();
- var10.dispose();
- var11.dispose();
- var8 = ((Component)this).createImage(this.imageWidth, var7);
- var9 = ((Component)this).createImage(this.imageWidth, var7);
- var10 = var8.getGraphics();
- var11 = var9.getGraphics();
- if (var4 % 2 == 0) {
- for(int var22 = 0; var22 < this.field_0; var22 += var6) {
- while(!var11.drawImage(this.offImage, -var22, -this.field_1 - var20, this)) {
- Thread.yield();
- }
-
- while(!var10.drawImage(var9, 0, 0, this)) {
- Thread.yield();
- }
-
- while(!var10.drawImage(var2, 0, -var20, this)) {
- Thread.yield();
- }
-
- while(!var1.drawImage(var8, var22, this.field_1 + var20, this)) {
- Thread.yield();
- }
-
- this.ready = true;
- ((Component)this).repaint();
-
- try {
- Thread.sleep((long)var5);
- } catch (Exception var16) {
- }
-
- while(!var1.drawImage(var9, var22, this.field_1 + var20, this)) {
- Thread.yield();
- }
- }
- } else {
- for(int var21 = this.appletDim.width - this.imageWidth; var21 > this.field_0; var21 -= var6) {
- while(!var11.drawImage(this.offImage, -var21, -this.field_1 - var20, this)) {
- Thread.yield();
- }
-
- while(!var10.drawImage(var9, 0, 0, this)) {
- Thread.yield();
- }
-
- while(!var10.drawImage(var2, 0, -var20, this)) {
- Thread.yield();
- }
-
- while(!var1.drawImage(var8, var21, this.field_1 + var20, this)) {
- Thread.yield();
- }
-
- this.ready = true;
- ((Component)this).repaint();
-
- try {
- Thread.sleep((long)var5);
- } catch (Exception var15) {
- }
-
- while(!var1.drawImage(var9, var21, this.field_1 + var20, this)) {
- Thread.yield();
- }
- }
- }
-
- while(!var11.drawImage(this.offImage, -this.field_0, -this.field_1 - var20, this)) {
- Thread.yield();
- }
-
- while(!var10.drawImage(var9, 0, 0, this)) {
- Thread.yield();
- }
-
- while(!var10.drawImage(var2, 0, -var20, this)) {
- Thread.yield();
- }
-
- while(!var1.drawImage(var8, this.field_0, this.field_1 + var20, this)) {
- Thread.yield();
- }
-
- this.ready = true;
- ((Component)this).repaint();
- }
-
- var8.flush();
- var9.flush();
- var10.dispose();
- var11.dispose();
- this.nextFunction = true;
- this.oldImage = true;
- this.imgNewptr = null;
- }
-
- private void squeezeLeftRight(boolean var1) {
- if (this.tempwidth > 0) {
- if (!var1) {
- this.field_0 += this.transitionNum;
- }
-
- this.tempwidth -= this.transitionNum;
- if (this.tempwidth < 0) {
- this.tempwidth = 0;
- }
- } else {
- this.nextFunction = true;
- this.oldImage = true;
- }
-
- }
-
- private synchronized void bounce(Graphics var1, Image var2) {
- int var10000 = this.imageWidth / 3;
- var10000 = this.imageHeight / 3;
- Image var3 = ((Component)this).createImage(this.imageWidth, this.imageHeight);
- var3.getGraphics();
- int var4 = 1;
-
- do {
- int var5 = this.imageWidth + 10 * var4;
- System.out.println("drawImage " + var5 + "," + this.imageHeight);
-
- while(!var1.drawImage(var2, this.field_0, this.field_1, var5, this.imageHeight, (ImageObserver)null)) {
- Thread.yield();
- }
-
- this.ready = true;
- ((Component)this).repaint();
-
- try {
- Thread.sleep(1000L);
- } catch (Exception var6) {
- }
-
- ++var4;
- } while(var4 < 6);
-
- this.nextFunction = false;
- this.oldImage = true;
- this.imgNewptr = null;
- }
-
- private void calcXY() {
- String var1 = ((Applet)this).getParameter("serialid");
- if (var1 == null) {
- this.NotRegistered();
- } else {
- String var2 = this.intoLetters(Integer.toString(this.regnumber));
- this.dbg(var2);
- boolean var3 = var1.regionMatches(true, 0, var2, 0, var2.length());
- if (!var3) {
- this.NotRegistered();
- }
- }
-
- }
-
- private void donut(Graphics var1, Image var2, boolean var3) {
- if (var3) {
- this.tempwidth -= this.transitionNum * 2;
- this.tempheight -= this.transitionNum * 2;
- this.revealX += this.transitionNum;
- this.revealY += this.transitionNum;
- if (this.tempwidth <= 0 || this.tempheight <= 0) {
- this.oldImage = this.nextFunction = true;
- var1.drawImage(var2, this.field_0, this.field_1, this);
- return;
- }
- } else {
- this.tempwidth += this.transitionNum * 2;
- this.tempheight += this.transitionNum * 2;
- this.revealX -= this.transitionNum;
- this.revealY -= this.transitionNum;
- if (this.tempwidth >= this.imageDim[1].width) {
- this.oldImage = true;
- this.revealX = this.field_0;
- this.tempwidth = this.imageDim[1].width;
- }
-
- if (this.tempheight >= this.imageDim[1].height) {
- this.nextFunction = true;
- this.revealY = this.field_1;
- this.tempheight = this.imageDim[1].height;
- }
-
- if (this.nextFunction && this.oldImage) {
- this.imgNewptr = null;
- }
- }
-
- if (this.tempwidth > 0 && this.tempheight > 0) {
- Image var4 = ((Component)this).createImage(this.tempwidth, this.tempheight);
- Graphics var5 = var4.getGraphics();
- var5.drawImage(this.offImage, -this.revealX, -this.revealY, this);
- var1.drawImage(var2, this.field_0, this.field_1, this);
- var1.drawImage(var4, this.revealX, this.revealY, this);
- var5.dispose();
- }
-
- }
-
- public void update(Graphics var1) {
- this.paint(var1);
- }
-
- private void scrollUp(boolean var1) {
- if (this.field_1 <= -this.imageHeight) {
- this.outApp();
- }
-
- if (this.centered && this.field_1 <= this.imageCenter.height && this.imageData[this.imgNum].y > this.imageCenter.height) {
- this.nextFunction = true;
- this.field_1 = this.imageCenter.height;
- }
-
- if (!this.nextFunction) {
- this.field_1 -= this.transitionNum;
- } else {
- var1 = this.isOverScroll(var1);
- }
-
- if (!var1) {
- if (this.oldY < -this.imageDim[0].height) {
- this.oldImage = true;
- } else {
- this.oldY -= this.transitionNum;
- }
- }
-
- }
-
- private void slidingDoor(Graphics var1, Image var2) {
- int var3 = var2.getWidth(this);
- int var4 = var2.getHeight(this);
- this.revealX += this.transitionNum;
- this.tempwidth -= this.transitionNum;
- if (this.revealX > this.field_0) {
- this.revealX = this.field_0;
- this.oldImage = true;
- }
-
- if (this.tempwidth < this.field_0 + var3 / 2) {
- this.tempwidth = this.field_0 + var3 / 2;
- this.nextFunction = true;
- }
-
- if (this.nextFunction && this.oldImage) {
- var1.drawImage(var2, this.field_0, this.field_1, this);
- } else {
- Image var5 = ((Component)this).createImage(var3 / 2, var4);
- Graphics var6 = var5.getGraphics();
- var6.drawImage(this.offImage, -this.revealX, this.field_1, this);
- var6.drawImage(var2, 0, 0, this);
- var1.drawImage(var5, this.revealX, this.field_1, this);
- var1.clipRect(this.tempwidth, this.field_1, var3 / 2, var4);
- var1.drawImage(var2, this.tempwidth - var3 / 2, this.field_1, this);
- var6.dispose();
- }
- }
-
- public void start() {
- if (this.engine == null) {
- this.engine = new Thread(this, "ImageWizPLUS");
- }
-
- this.engine.start();
- }
-
- private void addReguser() {
- String var1 = ((Applet)this).getParameter("reguser");
- if (var1 == null) {
- this.NotRegistered();
- } else {
- if (var1.equalsIgnoreCase("unregistered")) {
- URL var2 = ((Applet)this).getDocumentBase();
- if (var2.toString().indexOf("http:") != -1) {
- this.unreg = true;
- this.NotRegistered();
- }
- }
-
- this.whatXY(var1);
- }
-
- }
-
- public String getAppletInfo() {
- return "ImageWizPLUS v1.0 Copyright (c) Sausage Software 1996";
- }
-
- private void rotateLeftRight(int var1) {
- if (this.goSmall) {
- this.field_0 += this.transitionNum;
- this.tempwidth -= var1;
- if (this.tempwidth <= 0) {
- this.tempwidth = 0;
- this.nextFunction = true;
- if (this.repeatNumber > 0) {
- this.repeatNumber += -1;
- this.invertNow = !this.invertNow;
- } else {
- this.imgNewptr = null;
- this.oldImage = true;
- this.invertNow = false;
- }
- }
- } else {
- this.field_0 -= this.transitionNum;
- this.tempwidth += var1;
- }
-
- }
-
- private void scrollLeft(boolean var1) {
- if (this.field_0 <= -this.imageWidth) {
- this.outApp();
- }
-
- if (this.centered && this.field_0 <= this.imageCenter.width && this.imageData[this.imgNum].x > this.imageCenter.width) {
- this.field_0 = this.imageCenter.width;
- this.nextFunction = true;
- }
-
- if (!this.nextFunction) {
- this.field_0 -= this.transitionNum;
- } else {
- var1 = this.isOverScroll(var1);
- }
-
- if (!var1) {
- if (this.oldX < -this.imageDim[0].width) {
- this.oldImage = true;
- } else {
- this.oldX -= this.transitionNum;
- }
- }
-
- }
-
- private void scrollRight(boolean var1) {
- if (this.field_0 >= this.appletDim.width) {
- this.outApp();
- }
-
- if (this.centered && this.field_0 >= this.imageCenter.width && this.imageData[this.imgNum].x < this.imageCenter.width) {
- this.nextFunction = true;
- this.field_0 = this.imageCenter.width;
- }
-
- if (!this.nextFunction) {
- this.field_0 += this.transitionNum;
- } else {
- var1 = this.isOverScroll(var1);
- }
-
- if (!var1) {
- if (this.oldX > this.appletDim.width) {
- this.oldImage = true;
- } else {
- this.oldX += this.transitionNum;
- }
- }
-
- }
-
- private void revealWipeCenter(boolean var1, Graphics var2, Image var3) {
- this.dbg("revealWipeCenter:revealX=" + this.revealX + " revealY=" + this.revealY + " transition=" + this.transitionNum);
- if (var1) {
- this.revealX -= this.transitionNum;
- this.revealY -= this.transitionNum;
- this.revealW += this.transitionNum * 2;
- this.revealH += this.transitionNum * 2;
- if (this.revealX <= this.field_0) {
- this.revealX = this.field_0;
- this.revealW = this.imageDim[1].width;
- this.nextFunction = true;
- }
-
- if (this.revealY <= this.field_1) {
- this.revealY = this.field_1;
- this.revealH = this.imageDim[1].height;
- this.oldImage = true;
- }
- } else {
- this.revealX += this.transitionNum;
- this.revealY += this.transitionNum;
- this.revealW -= this.transitionNum * 2;
- this.revealH -= this.transitionNum * 2;
- if (this.revealW <= 0 || this.revealH <= 0) {
- this.nextFunction = this.oldImage = true;
- this.imgNewptr = null;
- return;
- }
- }
-
- var2.clipRect(this.revealX, this.revealY, this.revealW, this.revealH);
- var2.drawImage(var3, this.field_0, this.field_1, this);
- }
-
- private void getImageCenter(Image var1) {
- int var2 = var1.getHeight(this);
- int var3 = var1.getWidth(this);
- this.imageCenter = new Dimension(this.appletDim.width / 2 - var3 / 2, this.appletDim.height / 2 - var2 / 2);
- }
-
- private synchronized void spiralout(Graphics var1, Image var2, int var3) {
- if (var3 < 1) {
- var3 = 1;
- } else if (var3 > 20) {
- var3 = 20;
- }
-
- int var4 = 7 - var3 / 4;
- int var5 = (8 - var4) * 40;
- int var6 = var4 * var4;
- double var7 = (double)(this.imageWidth / var4);
- double var9 = (double)(this.imageHeight / var4);
- int[] var11 = new int[var6];
- int var12 = 0;
- int var13 = 0;
- int var14 = 0;
- int var15 = 0;
- int var16 = 0;
- int var17 = var4 - 1;
- int var18 = var17;
-
- for(int var19 = 0; var19 < var6; ++var19) {
- var11[var6 - var19 - 1] = var13 * var4 + var14;
- switch (var12) {
- case 0:
- if (var14 == var17) {
- ++var16;
- ++var13;
- var12 = (var12 + 1) % 4;
- } else {
- ++var14;
- }
- break;
- case 1:
- if (var13 == var18) {
- --var17;
- --var14;
- var12 = (var12 + 1) % 4;
- } else {
- ++var13;
- }
- break;
- case 2:
- if (var14 == var15) {
- --var18;
- --var13;
- var12 = (var12 + 1) % 4;
- } else {
- --var14;
- }
- break;
- case 3:
- if (var13 == var16) {
- ++var15;
- ++var14;
- var12 = (var12 + 1) % 4;
- } else {
- --var13;
- }
- }
- }
-
- Image var25 = ((Component)this).createImage((int)var7, (int)var9);
- Graphics var20 = var25.getGraphics();
-
- for(int var21 = 0; var21 < var6; ++var21) {
- var13 = var11[var21] / var4;
- var14 = var11[var21] % var4;
- if (this.bgColor != null) {
- var20.setColor(this.bgColor);
- }
-
- var20.fillRect(0, 0, (int)var7, (int)var9);
-
- while(!var20.drawImage(this.offImage, (int)((double)(-var14) * var7 - (double)this.field_0), (int)((double)(-var13) * var9 - (double)this.field_1), this)) {
- Thread.yield();
- }
-
- while(!var20.drawImage(var2, (int)((double)(-var14) * var7), (int)((double)(-var13) * var9), this)) {
- Thread.yield();
- }
-
- while(!var1.drawImage(var25, this.field_0 + (int)((double)var14 * var7), this.field_1 + (int)((double)var13 * var9), this)) {
- Thread.yield();
- }
-
- this.ready = true;
- ((Component)this).repaint();
-
- try {
- Thread.sleep((long)var5);
- } catch (Exception var22) {
- }
- }
-
- var20.dispose();
- Object var26 = null;
- System.gc();
- this.nextFunction = true;
- this.oldImage = true;
- this.imgNewptr = null;
- }
-
- private synchronized void trailsHorizontal(Graphics var1, Image var2, boolean var3) {
- Image var4 = ((Component)this).createImage(this.appletDim.width, this.imageHeight);
- Graphics var5 = var4.getGraphics();
- Image var6 = ((Component)this).createImage(this.imageWidth, this.imageHeight);
- Graphics var7 = var6.getGraphics();
- if (this.offImage != null && var1 != null && var2 != null) {
- while(!var5.drawImage(this.offImage, 0, -this.field_1, this)) {
- Thread.yield();
- }
-
- if (var3) {
- for(int var8 = this.appletDim.width - this.imageWidth; var8 > this.field_0; var8 -= this.transitionNum) {
- while(!var1.drawImage(var2, var8, this.field_1, this)) {
- Thread.yield();
- }
-
- this.ready = true;
- ((Component)this).repaint();
- }
- } else {
- for(int var11 = 0; var11 < this.field_0; var11 += this.transitionNum) {
- while(!var1.drawImage(var2, var11, this.field_1, this)) {
- Thread.yield();
- }
-
- this.ready = true;
- ((Component)this).repaint();
- }
- }
-
- if (var3) {
- for(int var12 = this.appletDim.width - this.imageWidth; var12 > this.field_0 + this.imageWidth - this.transitionNum; var12 -= this.transitionNum) {
- while(!var7.drawImage(var4, -var12, 0, this)) {
- Thread.yield();
- }
-
- while(!var1.drawImage(var6, var12, this.field_1, this)) {
- Thread.yield();
- }
-
- this.ready = true;
- ((Component)this).repaint();
- }
- } else {
- for(int var13 = 0; var13 < this.field_0 - this.imageWidth + this.transitionNum; var13 += this.transitionNum) {
- while(!var7.drawImage(var4, -var13, 0, this)) {
- Thread.yield();
- }
-
- while(!var1.drawImage(var6, var13, this.field_1, this)) {
- Thread.yield();
- }
-
- this.ready = true;
- ((Component)this).repaint();
- }
- }
-
- while(!var1.drawImage(var4, 0, this.field_1, this)) {
- Thread.yield();
- }
-
- while(!var1.drawImage(var2, this.field_0, this.field_1, this)) {
- Thread.yield();
- }
-
- this.ready = true;
- ((Component)this).repaint();
- var4.flush();
- Object var9 = null;
- var5.dispose();
- var6.flush();
- Object var10 = null;
- var7.dispose();
- System.gc();
- this.nextFunction = true;
- this.oldImage = true;
- this.imgNewptr = null;
- }
- }
-
- private void barnDoor(Graphics var1, Image var2) {
- Image var3 = ((Component)this).createImage(this.revealW, this.revealH);
- Graphics var4 = var3.getGraphics();
- var4.drawImage(this.offImage, -this.revealX, -this.field_1, this);
- var4.dispose();
- this.revealX += this.transitionNum;
- this.revealW -= this.transitionNum * 2;
- var1.drawImage(var2, this.field_0, this.field_1, this);
- if (this.revealW < 1) {
- this.oldImage = this.nextFunction = true;
- } else {
- var1.drawImage(var3, this.revealX, this.field_1, this);
- }
- }
-
- private void drawTile(Graphics var1) {
- if (this.bgimage != null && this.tracker.checkID(this.totalImages)) {
- int var2 = this.bgImageDim.width;
- int var3 = this.bgImageDim.height;
- var1.drawImage(this.bgimage, 0, 0, var2, var3, this);
- if (this.tiled) {
- if (var2 > 0 && var3 > 0) {
- int var4 = this.appletDim.width;
- int var5 = this.appletDim.height;
- int var6 = var2;
- int var7 = 0;
- boolean var8 = false;
- var1.clipRect(0, 0, var4, var5);
-
- while(!var8) {
- var1.drawImage(this.bgimage, var6, var7, var2, var3, this);
- var6 += var2;
- if (var6 > var4) {
- var7 += var3;
- var6 = 0;
- }
-
- if (var7 > var5) {
- var8 = true;
- }
-
- try {
- Thread.sleep(3L);
- } catch (Exception var9) {
- }
- }
- }
-
- }
- }
- }
-
- private void scrollDown(boolean var1) {
- if (this.field_1 >= this.appletDim.height) {
- this.outApp();
- }
-
- if (this.centered && this.field_1 >= this.imageCenter.height && this.imageData[this.imgNum].y < this.imageCenter.height) {
- this.nextFunction = true;
- this.field_1 = this.imageCenter.height;
- }
-
- if (!this.nextFunction) {
- this.field_1 += this.transitionNum;
- } else {
- var1 = this.isOverScroll(var1);
- }
-
- if (!var1) {
- if (this.oldY > this.appletDim.height) {
- this.oldImage = true;
- } else {
- this.oldY += this.transitionNum;
- }
- }
-
- }
-
- private void rotateUpDown(int var1) {
- if (this.goSmall) {
- this.field_1 += this.transitionNum;
- this.tempheight -= var1;
- if (this.tempheight <= 0) {
- this.tempheight = 0;
- this.nextFunction = true;
- this.imgNewptr = null;
- if (this.repeatNumber > 0) {
- this.repeatNumber += -1;
- this.oldImage = true;
- } else {
- this.oldImage = true;
- this.invertNow = false;
- this.repeatNumber = 0;
- }
- }
- } else {
- this.field_1 -= this.transitionNum;
- this.tempheight += var1;
- if (this.tempheight >= this.imageHeight) {
- this.tempheight = this.imageHeight;
- this.nextFunction = true;
- if (this.repeatNumber > 0) {
- this.repeatNumber += -1;
- this.oldImage = true;
- } else {
- this.oldImage = true;
- this.invertNow = false;
- this.repeatNumber = 0;
- }
- }
- }
-
- }
-
- private void whatXY(String var1) {
- long var2 = 345L;
- long var4 = 56L;
- long var6 = 345L;
- long var8 = 49L;
-
- for(int var10 = 0; var10 < var1.length(); ++var10) {
- if (var1.charAt(var10) >= 'a' && var1.charAt(var10) <= 'z') {
- char var14 = var1.charAt(var10);
- this.regnumber += var14;
- } else if (var1.charAt(var10) >= 'A' && var1.charAt(var10) <= 'Z') {
- char var11 = var1.charAt(var10);
- this.regnumber += var11;
- }
-
- var2 = (long)((double)(var4 * 23L) / (double)2.5F + (double)var6);
- var8 = 34L / var6;
- var4 = var2 + var4 + (long)this.regnumber;
- }
-
- }
-
- public boolean mouseExit(Event var1, int var2, int var3) {
- this.setMouseCursor(0);
- this.cursorDone = false;
- this.mouseIn = false;
- return true;
- }
-
- private void NotRegistered() {
- System.out.println("Program not registered");
- this.serialIdError = true;
- }
-
- private synchronized void spiralin(Graphics var1, Image var2, int var3) {
- if (var3 < 1) {
- var3 = 1;
- } else if (var3 > 20) {
- var3 = 20;
- }
-
- int var4 = 7 - var3 / 4;
- int var5 = (8 - var4) * 40;
- int var6 = var4 * var4;
- double var7 = (double)(this.imageWidth / var4);
- double var9 = (double)(this.imageHeight / var4);
- Image var11 = ((Component)this).createImage((int)var7, (int)var9);
- Graphics var12 = var11.getGraphics();
- int var13 = 0;
- int var14 = 0;
- int var15 = 0;
- int var16 = 0;
- int var17 = 0;
- int var18 = var4 - 1;
- int var19 = var18;
-
- for(int var20 = 0; var20 < var6; ++var20) {
- if (this.bgColor != null) {
- var12.setColor(this.bgColor);
- }
-
- var12.fillRect(0, 0, (int)var7, (int)var9);
-
- while(!var12.drawImage(this.offImage, (int)((double)(-var15) * var7 - (double)this.field_0), (int)((double)(-var14) * var9 - (double)this.field_1), this)) {
- Thread.yield();
- }
-
- while(!var12.drawImage(var2, (int)((double)(-var15) * var7), (int)((double)(-var14) * var9), this)) {
- Thread.yield();
- }
-
- while(!var1.drawImage(var11, this.field_0 + (int)((double)var15 * var7), this.field_1 + (int)((double)var14 * var9), this)) {
- Thread.yield();
- }
-
- this.ready = true;
- ((Component)this).repaint();
-
- try {
- Thread.sleep((long)var5);
- } catch (Exception var21) {
- }
-
- switch (var13) {
- case 0:
- if (var15 == var18) {
- ++var17;
- ++var14;
- var13 = (var13 + 1) % 4;
- } else {
- ++var15;
- }
- break;
- case 1:
- if (var14 == var19) {
- --var18;
- --var15;
- var13 = (var13 + 1) % 4;
- } else {
- ++var14;
- }
- break;
- case 2:
- if (var15 == var16) {
- --var19;
- --var14;
- var13 = (var13 + 1) % 4;
- } else {
- --var15;
- }
- break;
- case 3:
- if (var14 == var17) {
- ++var16;
- ++var15;
- var13 = (var13 + 1) % 4;
- } else {
- --var14;
- }
- }
- }
-
- var12.dispose();
- var11.flush();
- Object var22 = null;
- System.gc();
- this.nextFunction = true;
- this.oldImage = true;
- this.imgNewptr = null;
- }
-
- public void paint(Graphics var1) {
- if (this.engine != null) {
- if (!this.serialIdError) {
- if (this.firstTime) {
- if (this.bgColor != null) {
- var1.setColor(this.bgColor);
- var1.fillRect(0, 0, this.appletDim.width, this.appletDim.height);
- if (this.bgimage != null) {
- this.drawTile(var1);
- }
- }
-
- this.firstTime = false;
- }
-
- if (this.ready) {
- var1.drawImage(this.offImage, 0, 0, this);
- }
- } else {
- var1.setColor(Color.red);
- var1.drawString("ID error, please run ImageWizPLUS again", 2, this.appletDim.width - 2);
- }
- }
-
- var1.dispose();
- }
-
- private Color getColor(String var1) {
- int var2 = 0;
- int var3 = 0;
- int var4 = 0;
- StringTokenizer var5 = new StringTokenizer(var1, ",");
-
- try {
- var2 = Integer.parseInt(var5.nextToken());
- var3 = Integer.parseInt(var5.nextToken());
- var4 = Integer.parseInt(var5.nextToken());
- } catch (Exception var6) {
- }
-
- return new Color(var2, var3, var4);
- }
-
- private void dbg(String var1) {
- }
-
- private void initSetup() {
- this.imageData = new wizinfo[this.totalImages];
- wizinfo.setTable();
- this.imageDim = new Dimension[2];
- this.imageLoaded = new boolean[this.totalImages];
-
- for(int var1 = 0; var1 < this.totalImages; ++var1) {
- this.imageLoaded[var1] = false;
- }
-
- }
-
- private synchronized void trailsVertical(Graphics var1, Image var2, boolean var3) {
- Image var4 = ((Component)this).createImage(this.imageWidth, this.appletDim.height);
- Graphics var5 = var4.getGraphics();
- Image var6 = ((Component)this).createImage(this.imageWidth, this.imageHeight);
- Graphics var7 = var6.getGraphics();
- if (this.offImage != null && var1 != null && var2 != null) {
- while(!var5.drawImage(this.offImage, -this.field_0, 0, this)) {
- Thread.yield();
- }
-
- if (var3) {
- for(int var8 = 0; var8 < this.field_1; var8 += this.transitionNum) {
- while(!var1.drawImage(var2, this.field_0, var8, this)) {
- Thread.yield();
- }
-
- this.ready = true;
- ((Component)this).repaint();
- }
- } else {
- for(int var11 = this.appletDim.height - this.imageHeight; var11 > this.field_1; var11 -= this.transitionNum) {
- while(!var1.drawImage(var2, this.field_0, var11, this)) {
- Thread.yield();
- }
-
- this.ready = true;
- ((Component)this).repaint();
- }
- }
-
- if (var3) {
- for(int var12 = 0; var12 < this.field_1 - this.imageHeight + this.transitionNum; var12 += this.transitionNum) {
- while(!var7.drawImage(var4, 0, -var12, this)) {
- Thread.yield();
- }
-
- while(!var1.drawImage(var6, this.field_0, var12, this)) {
- Thread.yield();
- }
-
- this.ready = true;
- ((Component)this).repaint();
- }
- } else {
- for(int var13 = this.appletDim.height - this.imageHeight; var13 > this.field_1 + this.imageHeight - this.transitionNum; var13 -= this.transitionNum) {
- while(!var7.drawImage(var4, 0, -var13, this)) {
- Thread.yield();
- }
-
- while(!var1.drawImage(var6, this.field_0, var13, this)) {
- Thread.yield();
- }
-
- this.ready = true;
- ((Component)this).repaint();
- }
- }
-
- while(!var1.drawImage(var4, this.field_0, 0, this)) {
- Thread.yield();
- }
-
- while(!var1.drawImage(var2, this.field_0, this.field_1, this)) {
- Thread.yield();
- }
-
- var4.flush();
- Object var9 = null;
- var5.dispose();
- var6.flush();
- Object var10 = null;
- var7.dispose();
- this.nextFunction = true;
- this.oldImage = true;
- this.imgNewptr = null;
- }
- }
-
- private void revealCorners(Graphics var1, int var2) {
- if (var2 == 2 || var2 == 4) {
- this.revealX -= this.transitionNum;
- }
-
- if (this.revealX <= this.field_0) {
- this.revealX = this.field_0;
- }
-
- if (var2 == 3 || var2 == 4) {
- this.revealY -= this.transitionNum;
- }
-
- if (this.revealY <= this.field_1) {
- this.revealY = this.field_1;
- }
-
- this.revealW += this.transitionNum;
- this.revealH += this.transitionNum;
- if (this.revealW >= this.imageDim[1].width) {
- this.oldImage = true;
- this.revealW = this.imageDim[1].width;
- }
-
- if (this.revealH >= this.imageDim[1].height) {
- this.nextFunction = true;
- this.revealH = this.imageDim[1].height;
- }
-
- this.offGraphics.clipRect(this.revealX, this.revealY, this.revealW, this.revealH);
- }
-
- private void imageShrink(int var1) {
- this.field_0 += this.transitionNum;
- this.field_1 += this.transitionNum;
- this.tempwidth -= var1;
- this.tempheight -= var1;
- if (this.tempwidth <= 0 || this.tempheight <= 0) {
- this.tempwidth = 0;
- this.tempheight = 0;
- this.nextFunction = true;
- this.oldImage = true;
- this.imgNewptr = null;
- this.img1ptr = null;
- }
-
- }
-
- public void drawGraphics(int var1) {
- this.offGraphics = this.offImage.getGraphics();
- if (this.clearApp) {
- if (this.bgColor != null) {
- this.offGraphics.setColor(this.bgColor);
- } else {
- this.offGraphics.setColor(((Component)this).getBackground());
- }
-
- this.offGraphics.fillRect(0, 0, this.appletDim.width, this.appletDim.height);
- this.drawTile(this.offGraphics);
- }
-
- if (this.img1ptr != null) {
- this.offGraphics.drawImage(this.img1ptr, this.oldX, this.oldY, this.imageDim[0].width, this.imageDim[0].height, this);
- }
-
- if (this.field_0 <= this.appletDim.width || this.field_1 <= this.appletDim.height) {
- if (!this.invertNow) {
- switch (this.functionNumber) {
- case 8:
- this.img1ptr = null;
- this.imgNewptr = null;
- this.nextFunction = this.oldImage = true;
- break;
- case 60:
- this.revealWipeUpDown(true, true);
- break;
- case 61:
- this.revealWipeUpDown(false, true);
- break;
- case 62:
- this.revealWipeLeftRight(true, true);
- break;
- case 63:
- this.revealWipeLeftRight(false, true);
- break;
- case 64:
- this.revealWipeCenter(true, this.offGraphics, this.imgNewptr);
- this.offGraphics.dispose();
- return;
- case 65:
- this.donut(this.offGraphics, this.imgNewptr, true);
- this.offGraphics.dispose();
- return;
- case 66:
- this.revealCorners(this.offGraphics, 1);
- break;
- case 67:
- this.revealCorners(this.offGraphics, 2);
- break;
- case 68:
- this.revealCorners(this.offGraphics, 3);
- break;
- case 69:
- this.revealCorners(this.offGraphics, 4);
- break;
- case 70:
- this.revealWipeUpDown(true, false);
- break;
- case 71:
- this.revealWipeUpDown(false, false);
- break;
- case 72:
- this.revealWipeLeftRight(true, false);
- break;
- case 73:
- this.revealWipeLeftRight(false, false);
- break;
- case 74:
- this.revealWipeCenter(false, this.offGraphics, this.imgNewptr);
- this.offGraphics.dispose();
- break;
- case 75:
- this.donut(this.offGraphics, this.imgNewptr, false);
- this.offGraphics.dispose();
- return;
- case 81:
- this.barnDoor(this.offGraphics, this.imgNewptr);
- this.offGraphics.dispose();
- return;
- case 90:
- this.checkBoard(this.offGraphics, this.imgNewptr);
- this.offGraphics.dispose();
- return;
- case 91:
- this.method_0(this.offGraphics, this.imgNewptr);
- this.offGraphics.dispose();
- return;
- case 92:
- this.slidingDoor(this.offGraphics, this.imgNewptr);
- this.offGraphics.dispose();
- return;
- case 200:
- this.trailsHorizontal(this.offGraphics, this.imgNewptr, true);
- this.offGraphics.dispose();
- return;
- case 201:
- this.trailsHorizontal(this.offGraphics, this.imgNewptr, false);
- this.offGraphics.dispose();
- return;
- case 202:
- this.trailsVertical(this.offGraphics, this.imgNewptr, true);
- this.offGraphics.dispose();
- return;
- case 203:
- this.trailsVertical(this.offGraphics, this.imgNewptr, false);
- this.offGraphics.dispose();
- return;
- case 204:
- this.spiralin(this.offGraphics, this.imgNewptr, this.transitionNum);
- this.offGraphics.dispose();
- return;
- case 205:
- this.spiralout(this.offGraphics, this.imgNewptr, this.transitionNum);
- this.offGraphics.dispose();
- return;
- case 206:
- this.slider(this.offGraphics, this.imgNewptr, this.transitionNum);
- this.offGraphics.dispose();
- return;
- }
-
- if (this.imgNewptr != null) {
- this.offGraphics.clipRect(0, 0, this.appletDim.width, this.appletDim.height);
- this.offGraphics.drawImage(this.imgNewptr, this.field_0, this.field_1, this.tempwidth, this.tempheight, this);
- }
- } else {
- this.offGraphics.drawImage(this.reverseImage, this.field_0, this.field_1, this.tempwidth, this.tempheight, this);
- }
- }
-
- this.offGraphics.dispose();
- }
-
- private void outApp() {
- this.nextFunction = true;
- this.imgNewptr = null;
- }
-
- private void squeezeUpDown(boolean var1) {
- if (this.tempheight > 0) {
- if (!var1) {
- this.field_1 += this.transitionNum;
- }
-
- this.tempheight -= this.transitionNum;
- if (this.tempheight < 0) {
- this.tempheight = 0;
- }
- } else {
- this.nextFunction = true;
- this.oldImage = true;
- }
-
- }
-
- private void revealWipeLeftRight(boolean var1, boolean var2) {
- if (var1) {
- if (var2) {
- this.revealX -= this.transitionNum;
- if (this.revealX <= this.field_0) {
- this.revealX = this.field_0;
- this.nextFunction = this.oldImage = true;
- }
- } else {
- this.revealW -= this.transitionNum;
- if (this.revealW <= 0) {
- this.revealW = 0;
- this.nextFunction = this.oldImage = true;
- this.imgNewptr = null;
- }
- }
- } else if (var2) {
- this.revealW += this.transitionNum;
- if (this.revealW >= this.imageWidth) {
- this.revealW = this.imageWidth;
- this.nextFunction = this.oldImage = true;
- }
- } else {
- this.revealX += this.transitionNum;
- this.revealW -= this.transitionNum;
- if (this.revealW <= 0) {
- this.revealW = 0;
- this.nextFunction = this.oldImage = true;
- this.imgNewptr = null;
- }
- }
-
- this.offGraphics.clipRect(this.revealX, this.revealY, this.revealW, this.revealH);
- }
-
- public boolean mouseDown(Event var1, int var2, int var3) {
- if (!this.serialIdError && this.imageData[this.imgNum] != null) {
- String var4 = this.imageData[this.imgNum].getDest();
- if (var4 != null) {
- try {
- if (var4.indexOf("http:") == -1 && var4.indexOf("ftp:") == -1 && var4.indexOf("file:") == -1) {
- System.out.println("no location");
- ((Applet)this).getAppletContext().showDocument(new URL(((Applet)this).getDocumentBase(), var4), this.imageData[this.imgNum].getFrame());
- } else {
- ((Applet)this).getAppletContext().showDocument(new URL(this.imageData[this.imgNum].getDest()), this.imageData[this.imgNum].getFrame());
- }
- } catch (MalformedURLException var5) {
- if (this.imageData[this.imgNum].getDest() != null) {
- System.out.println("Could not go to " + this.imageData[this.imgNum].getDest());
- }
-
- return false;
- }
- }
- }
-
- return true;
- }
-
- private void imageGrow(int var1) {
- this.field_0 -= this.transitionNum * this.ratioW;
- this.field_1 -= this.transitionNum * this.ratioH;
- this.tempwidth += var1 * this.ratioW;
- this.tempheight += var1 * this.ratioH;
- if (this.tempwidth > this.imageWidth || this.tempheight > this.imageHeight) {
- this.nextFunction = this.oldImage = true;
- this.tempwidth = this.imageWidth;
- this.tempheight = this.imageHeight;
- this.field_0 = this.imageCenter.width;
- this.field_1 = this.imageCenter.height;
- }
-
- }
-
- public void run() {
- int var1 = 0;
- if (this.unreg) {
- System.out.println("Please Register ImageWizPLUS");
-
- while(true) {
- ((Applet)this).showStatus("Please Register ImageWizPLUS");
- }
- }
-
- try {
- if (this.offImage == null) {
- this.offImage = ((Component)this).createImage(this.appletDim.width, this.appletDim.height);
- }
- } catch (Exception var11) {
- System.out.println("fie:run():Trouble creating offImage. " + var11);
- }
-
- if (!this.serialIdError) {
- try {
- if (this.bgimage != null) {
- this.tracker.waitForID(this.totalImages);
- this.bgImageDim = new Dimension(this.bgimage.getWidth(this), this.bgimage.getHeight(this));
- }
-
- this.tracker.waitForID(0);
- } catch (InterruptedException var10) {
- }
-
- this.imageLoaded[0] = true;
-
- try {
- ((Applet)this).showStatus(this.getAppletInfo());
- Thread.sleep(1000L);
- } catch (Exception var9) {
- }
-
- boolean var2 = true;
- this.loopCounter = 0;
- this.repeatNumber = 0;
- this.imgNum = 0;
- boolean var3 = false;
-
- while(!var3) {
- if (!this.imageData[this.imgNum].picString.equals("") && this.tracker.isErrorID(this.imgNum)) {
- System.out.println("********** Error with image number " + (this.imgNum + 1));
- ((Applet)this).showStatus("********** Error with image number " + (this.imgNum + 1));
- }
-
- if (this.tracker.checkID(this.imgNum)) {
- if (this.nextFunction && this.oldImage) {
- try {
- Thread.sleep((long)var1);
- } catch (Exception var5) {
- System.out.println("Hey the thread got interrupted!!!");
- }
-
- if (this.repeatNumber < 1) {
- ++this.imgNum;
- if (var2) {
- this.imgNum = 0;
- var2 = false;
- }
-
- if (this.imgNum >= this.totalImages) {
- this.imgNum = 0;
- ++this.loopCounter;
- }
-
- if (this.globalRepeat == -1) {
- this.loopCounter = 0;
- var3 = false;
- } else if (this.loopCounter > this.globalRepeat) {
- var3 = true;
- break;
- }
-
- System.gc();
- if (!this.imageLoaded[this.imgNum]) {
- try {
- this.tracker.waitForID(this.imgNum);
- this.imageLoaded[this.imgNum] = true;
- } catch (InterruptedException var8) {
- }
- }
- }
-
- this.getNextFunc();
- ((Component)this).repaint();
- if (!this.centered) {
- this.img1ptr = null;
- }
-
- this.oldImage = false;
- this.nextFunction = false;
- var1 = this.imageData[this.imgNum].getImageDelay();
- String var4 = this.imageData[this.imgNum].getDest();
- if (var4 != null) {
- ((Applet)this).showStatus(var4);
- this.setMouseCursor(1);
- this.cursorDone = true;
- } else {
- ((Applet)this).showStatus(" ");
- this.setMouseCursor(0);
- this.cursorDone = false;
- }
- }
-
- int var13 = this.transitionNum * 2;
- switch (this.functionNumber) {
- case 1:
- this.scrollLeft(false);
- break;
- case 2:
- this.scrollRight(false);
- break;
- case 3:
- this.scrollUp(false);
- break;
- case 4:
- this.scrollDown(false);
- break;
- case 7:
- if (!this.oldImage) {
- this.oldImage = true;
- } else {
- try {
- Thread.sleep((long)var1);
- } catch (InterruptedException var7) {
- }
-
- this.nextFunction = true;
- this.imgNewptr = null;
- this.img1ptr = null;
- }
- break;
- case 9:
- this.oldImage = this.nextFunction = true;
- break;
- case 10:
- case 12:
- this.rotateLeftRight(var13);
- break;
- case 11:
- case 13:
- this.rotateUpDown(var13);
- break;
- case 20:
- this.squeezeUpDown(true);
- break;
- case 21:
- this.squeezeUpDown(false);
- break;
- case 22:
- this.squeezeLeftRight(false);
- break;
- case 23:
- this.squeezeLeftRight(true);
- break;
- case 30:
- this.imageShrink(var13);
- break;
- case 31:
- this.imageGrow(var13);
- break;
- case 50:
- this.scrollLeft(true);
- break;
- case 51:
- this.scrollRight(true);
- break;
- case 52:
- this.scrollUp(true);
- break;
- case 53:
- this.scrollDown(true);
- break;
- case 80:
- this.fade();
- }
-
- if (!this.tracker.isErrorID(this.imgNum)) {
- this.drawGraphics(var13);
- this.ready = true;
- ((Component)this).repaint();
-
- try {
- Thread.sleep(20L);
- } catch (Exception var6) {
- System.out.println("Hey the thread got interrupted!!!");
- }
-
- this.ready = false;
- } else {
- this.oldImage = this.nextFunction = true;
- }
- }
- }
- } else {
- ((Applet)this).showStatus("Serialid error, please use ImageWizPLUS again");
- System.out.println("Serialid error");
- }
-
- System.out.println("Applet finished");
- }
-
- public void init() {
- String var1 = ((Applet)this).getParameter("bgcolor");
- if (var1 != null) {
- this.bgColor = this.getColor(var1);
- } else {
- this.bgColor = null;
- }
-
- this.tracker = new MediaTracker(this);
- var1 = ((Applet)this).getParameter("bgimage");
- if (var1 != null) {
- String var2 = new String(var1.trim());
- int var3 = var2.lastIndexOf("/");
- if (var3 == -1 && var3 != var2.length()) {
- this.bgimage = ((Applet)this).getImage(((Applet)this).getDocumentBase(), var1);
- } else {
- try {
- URL var4 = new URL(var2.substring(0, var3 + 1));
- String var5 = new String(var2.substring(var3 + 1));
- this.bgimage = ((Applet)this).getImage(var4, var5);
- } catch (MalformedURLException var9) {
- this.bgimage = ((Applet)this).getImage(((Applet)this).getDocumentBase(), var1);
- }
- }
-
- this.bgImageDim = new Dimension(this.bgimage.getWidth(this), this.bgimage.getHeight(this));
- var1 = ((Applet)this).getParameter("tiled");
- if (var1 != null && var1.equals("true")) {
- this.tiled = true;
- }
- } else {
- this.bgimage = null;
- }
-
- this.totalImages = 0;
- int var14 = 0;
- boolean var16 = false;
-
- while(!var16) {
- ++var14;
- var1 = ((Applet)this).getParameter("no" + var14);
- if (var1 == null) {
- var16 = true;
- } else {
- this.whatXY(var1);
- ++this.totalImages;
- }
- }
-
- this.initSetup();
- this.appletDim = ((Component)this).size();
- this.addReguser();
- this.calcXY();
- if (this.bgimage != null) {
- this.tracker.addImage(this.bgimage, this.totalImages);
- }
-
- for(int var15 = 0; var15 < this.totalImages; ++var15) {
- this.imageData[var15] = new wizinfo();
- this.imageData[var15].parseFunction(((Applet)this).getParameter("no" + (var15 + 1)));
- if (this.imageData[var15].baseURL == null) {
- this.imageData[var15].baseURL = ((Applet)this).getDocumentBase();
- }
-
- this.imageData[var15].setImageData(((Applet)this).getImage(this.imageData[var15].baseURL, this.imageData[var15].picString));
- this.tracker.addImage(this.imageData[var15].getImageData(), var15);
- var1 = ((Applet)this).getParameter("rotate" + (var15 + 1));
- if (var1 != null) {
- this.imageData[var15].setRepeatNum(Integer.parseInt(var1));
- }
- }
-
- try {
- this.centered = ((Applet)this).getParameter("center").equalsIgnoreCase("true");
- } catch (Exception var8) {
- this.centered = true;
- }
-
- try {
- this.globalRepeat = Integer.parseInt(((Applet)this).getParameter("repeat"));
- } catch (Exception var7) {
- this.globalRepeat = -1;
- }
-
- try {
- this.offImage = ((Component)this).createImage(this.appletDim.width, this.appletDim.height);
- } catch (Exception var6) {
- System.out.println("fie:init():Trouble creating offImage. " + var6);
- }
-
- }
-
- private void fade() {
- }
-
- // $FF: renamed from: t2 (java.awt.Graphics, java.awt.Image) void
- public void method_0(Graphics var1, Image var2) {
- this.revealX += this.transitionNum;
- if (this.revealX >= this.field_0) {
- this.oldImage = true;
- this.revealX = this.field_0;
- }
-
- this.tempwidth -= this.transitionNum;
- if (this.tempwidth <= this.field_0) {
- this.nextFunction = true;
- this.tempwidth = this.field_0;
- }
-
- var1.drawImage(var2, this.revealX, this.revealY, this);
- if (!this.oldImage || !this.nextFunction) {
- var1.drawImage(var2, this.tempwidth, this.tempheight, this);
- }
- }
-
- private synchronized void checkBoard(Graphics var1, Image var2) {
- var2.getWidth(this);
- var2.getHeight(this);
- }
- }
-