home *** CD-ROM | disk | FTP | other *** search
- import java.applet.Applet;
- import java.awt.Canvas;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Dimension;
- import java.awt.Graphics;
- import java.awt.Image;
- import java.awt.Polygon;
- import java.awt.image.ImageObserver;
- import java.util.Random;
-
- public class FlasherCanvas2 extends Canvas implements Runnable {
- Image osImage;
- Graphics osg;
- boolean started = false;
- boolean modeFinished = false;
- int increment = 2;
- int expandWidth;
- int expandHeight;
- int currMode = -1;
- int numModes = 23;
- int currentX;
- int currentY;
- Image theImage;
- Thread theThread;
- int delayTime;
- int speed;
- int displayTime;
- int centerX;
- int centerY;
- int currentWidth;
- int currentHeight;
- int numVertBlinds = 10;
- int blindWidth;
- int numHorizBlinds = 5;
- int blindHeight;
- Random randomizer = new Random();
- boolean randomize;
- static final int MODE_EXPAND = 0;
- static final int MODE_SPIN_OUT = 1;
- static final int MODE_OPEN_BLINDS_LEFT = 2;
- static final int MODE_OPEN_BLINDS_RIGHT = 3;
- static final int MODE_OPEN_BLINDS_DOWN = 4;
- static final int MODE_OPEN_BLINDS_UP = 5;
- static final int MODE_MOVE_DOWN = 6;
- static final int MODE_MOVE_UP = 7;
- static final int MODE_MOVE_LEFT = 8;
- static final int MODE_MOVE_RIGHT = 9;
- static final int MODE_MOVE_SOUTHEAST = 10;
- static final int MODE_MOVE_SOUTHWEST = 11;
- static final int MODE_MOVE_NORTHEAST = 12;
- static final int MODE_MOVE_NORTHWEST = 13;
- static final int MODE_GROW_INWARD = 14;
- static final int MODE_GROW_DOWN = 15;
- static final int MODE_GROW_UP = 16;
- static final int MODE_GROW_LEFT = 17;
- static final int MODE_GROW_RIGHT = 18;
- static final int MODE_CURTAIN_DOWN = 19;
- static final int MODE_CURTAIN_UP = 20;
- static final int MODE_CURTAIN_LEFT = 21;
- static final int MODE_CURTAIN_RIGHT = 22;
- Color bkColor;
- Image bkImage;
-
- public FlasherCanvas2(Applet var1, int var2) {
- this.GetParameters(var1, var2);
- }
-
- void GetParameters(Applet var1, int var2) {
- String var3 = var1.getParameter("flasherImage" + var2);
- this.theImage = AppletParam2.GetImage(var1, var3);
- var3 = var1.getParameter("flasherIncrement" + var2);
- this.increment = AppletParam2.GetInt(var3, 2);
- var3 = var1.getParameter("flasherDisplayTime" + var2);
- this.displayTime = AppletParam2.GetInt(var3, 5000);
- var3 = var1.getParameter("flasherRandomize" + var2);
- this.randomize = AppletParam2.GetBoolean(var3, true);
- var3 = var1.getParameter("flasherSpeed" + var2);
- this.speed = AppletParam2.GetInt(var3, 250);
- this.delayTime = this.speed;
- var3 = var1.getParameter("flasherBkColor" + var2);
- this.bkColor = AppletParam2.GetColor(var3, (Color)null);
- if (this.bkColor != null) {
- ((Component)this).setBackground(this.bkColor);
- }
-
- }
-
- public void update(Graphics var1) {
- if (this.osImage == null) {
- this.osImage = ((Component)this).createImage(((Component)this).size().width, ((Component)this).size().height);
- this.osg = this.osImage.getGraphics();
- this.centerX = ((Component)this).size().width / 2;
- this.centerY = ((Component)this).size().height / 2;
- this.blindWidth = ((Component)this).size().width / this.numVertBlinds;
- this.blindHeight = ((Component)this).size().height / this.numHorizBlinds;
- this.SetupNextMode();
- }
-
- if (!this.modeFinished) {
- this.osg.setColor(((Component)this).getBackground());
- this.osg.fillRect(0, 0, ((Component)this).size().width, ((Component)this).size().height);
- switch (this.currMode) {
- case 0:
- this.currentX = ((Component)this).size().width / 2 - this.expandWidth / 2;
- this.currentY = ((Component)this).size().height / 2 - this.expandHeight / 2;
- this.osg.drawImage(this.theImage, this.currentX, this.currentY, this.expandWidth, this.expandHeight, this);
- break;
- case 1:
- this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
- this.osg.setColor(((Component)this).getBackground());
- if (this.currentY == 0 && this.currentX > 0) {
- Polygon var18 = new Polygon();
- var18.addPoint(this.centerX, this.centerY);
- var18.addPoint(this.currentX, -1);
- var18.addPoint(0, 0);
- var18.addPoint(0, ((Component)this).size().height);
- var18.addPoint(((Component)this).size().width, ((Component)this).size().height);
- var18.addPoint(((Component)this).size().width, 0);
- var18.addPoint(this.centerX, this.centerY);
- this.osg.fillPolygon(var18);
- }
-
- if (this.currentX == 0 && this.currentY > 0) {
- Polygon var19 = new Polygon();
- var19.addPoint(this.centerX, this.centerY);
- var19.addPoint(-1, this.currentY);
- var19.addPoint(0, ((Component)this).size().height);
- var19.addPoint(((Component)this).size().width, ((Component)this).size().height);
- var19.addPoint(((Component)this).size().width, 0);
- var19.addPoint(this.centerX, this.centerY);
- this.osg.fillPolygon(var19);
- }
-
- if (this.currentX > 0 && this.currentY == ((Component)this).size().height - 1) {
- Polygon var20 = new Polygon();
- var20.addPoint(this.centerX, this.centerY);
- var20.addPoint(this.currentX, ((Component)this).size().height);
- var20.addPoint(((Component)this).size().width, ((Component)this).size().height);
- var20.addPoint(((Component)this).size().width, 0);
- var20.addPoint(this.centerX, this.centerY);
- this.osg.fillPolygon(var20);
- }
-
- if (this.currentX == ((Component)this).size().width - 1 && this.currentY > 0) {
- Polygon var21 = new Polygon();
- var21.addPoint(this.centerX, this.centerY);
- var21.addPoint(((Component)this).size().width, this.currentY);
- var21.addPoint(((Component)this).size().width, -1);
- var21.addPoint(this.centerX, this.centerY);
- this.osg.fillPolygon(var21);
- }
- break;
- case 2:
- this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
-
- for(int var17 = 0; var17 < this.numVertBlinds; ++var17) {
- this.osg.fillRect(var17 * this.blindWidth + this.blindWidth - this.currentWidth, 0, this.currentWidth, ((Component)this).size().height);
- }
- break;
- case 3:
- this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
-
- for(int var16 = 0; var16 < this.numVertBlinds; ++var16) {
- this.osg.fillRect(var16 * this.blindWidth, 0, this.currentWidth, ((Component)this).size().height);
- }
- break;
- case 4:
- this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
-
- for(int var15 = 0; var15 < this.numHorizBlinds; ++var15) {
- this.osg.fillRect(0, var15 * this.blindHeight + this.blindHeight - this.currentHeight, ((Component)this).size().width, this.currentHeight);
- }
- break;
- case 5:
- this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
-
- for(int var14 = 0; var14 < this.numHorizBlinds; ++var14) {
- this.osg.fillRect(0, var14 * this.blindHeight, ((Component)this).size().width, this.currentHeight);
- }
- break;
- case 6:
- this.osg.drawImage(this.theImage, this.currentX, this.currentY, ((Component)this).size().width, ((Component)this).size().height, this);
- break;
- case 7:
- this.osg.drawImage(this.theImage, this.currentX, this.currentY, ((Component)this).size().width, ((Component)this).size().height, this);
- break;
- case 8:
- this.osg.drawImage(this.theImage, this.currentX, this.currentY, ((Component)this).size().width, ((Component)this).size().height, this);
- break;
- case 9:
- this.osg.drawImage(this.theImage, this.currentX, this.currentY, ((Component)this).size().width, ((Component)this).size().height, this);
- break;
- case 10:
- this.osg.drawImage(this.theImage, this.currentX, this.currentY, ((Component)this).size().width, ((Component)this).size().height, this);
- break;
- case 11:
- this.osg.drawImage(this.theImage, this.currentX, this.currentY, ((Component)this).size().width, ((Component)this).size().height, this);
- break;
- case 12:
- this.osg.drawImage(this.theImage, this.currentX, this.currentY, ((Component)this).size().width, ((Component)this).size().height, this);
- break;
- case 13:
- this.osg.drawImage(this.theImage, this.currentX, this.currentY, ((Component)this).size().width, ((Component)this).size().height, this);
- break;
- case 14:
- this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
- this.osg.fillRect(this.currentX, this.currentY, this.currentWidth, this.currentHeight);
- break;
- case 15:
- this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
- this.osg.fillRect(this.currentX, this.currentY, ((Component)this).size().width, ((Component)this).size().height);
- break;
- case 16:
- this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
- this.osg.fillRect(this.currentX, this.currentY, ((Component)this).size().width, ((Component)this).size().height);
- break;
- case 17:
- this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
- this.osg.fillRect(this.currentX, this.currentY, ((Component)this).size().width, ((Component)this).size().height);
- break;
- case 18:
- this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
- this.osg.fillRect(this.currentX, this.currentY, ((Component)this).size().width, ((Component)this).size().height);
- break;
- case 19:
- this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
- if (this.currentY == ((Component)this).size().height) {
- Polygon var11 = new Polygon();
- var11.addPoint(this.centerX, this.centerY);
- var11.addPoint(this.currentX, this.currentY);
- var11.addPoint(-1, ((Component)this).size().height);
- var11.addPoint(-1, -1);
- var11.addPoint(((Component)this).size().width, -1);
- var11.addPoint(((Component)this).size().width, ((Component)this).size().height);
- var11.addPoint(((Component)this).size().width / 2 + ((Component)this).size().width / 2 - this.currentX, this.currentY);
- var11.addPoint(this.centerX, this.centerY);
- this.osg.fillPolygon(var11);
- }
-
- if (this.currentX == -1) {
- Polygon var12 = new Polygon();
- var12.addPoint(this.centerX, this.centerY);
- var12.addPoint(this.currentX, this.currentY);
- var12.addPoint(-1, -1);
- var12.addPoint(((Component)this).size().width, -1);
- var12.addPoint(((Component)this).size().width, this.currentY);
- var12.addPoint(this.centerX, this.centerY);
- this.osg.fillPolygon(var12);
- }
-
- if (this.currentY == -1) {
- Polygon var13 = new Polygon();
- var13.addPoint(this.centerX, this.centerY);
- var13.addPoint(this.currentX, this.currentY);
- var13.addPoint(((Component)this).size().width / 2 + ((Component)this).size().width / 2 - this.currentX, this.currentY);
- var13.addPoint(this.centerX, this.centerY);
- this.osg.fillPolygon(var13);
- }
- break;
- case 20:
- this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
- if (this.currentY == -1) {
- Polygon var8 = new Polygon();
- var8.addPoint(this.centerX, this.centerY);
- var8.addPoint(this.currentX, this.currentY);
- var8.addPoint(-1, -1);
- var8.addPoint(-1, ((Component)this).size().height);
- var8.addPoint(((Component)this).size().width, ((Component)this).size().height);
- var8.addPoint(((Component)this).size().width, -1);
- var8.addPoint(((Component)this).size().width / 2 + ((Component)this).size().width / 2 - this.currentX, this.currentY);
- var8.addPoint(this.centerX, this.centerY);
- this.osg.fillPolygon(var8);
- }
-
- if (this.currentX == -1) {
- Polygon var9 = new Polygon();
- var9.addPoint(this.centerX, this.centerY);
- var9.addPoint(this.currentX, this.currentY);
- var9.addPoint(-1, ((Component)this).size().height);
- var9.addPoint(((Component)this).size().width, ((Component)this).size().height);
- var9.addPoint(((Component)this).size().width, this.currentY);
- var9.addPoint(this.centerX, this.centerY);
- this.osg.fillPolygon(var9);
- }
-
- if (this.currentY == ((Component)this).size().height) {
- Polygon var10 = new Polygon();
- var10.addPoint(this.centerX, this.centerY);
- var10.addPoint(this.currentX, this.currentY);
- var10.addPoint(((Component)this).size().width / 2 + ((Component)this).size().width / 2 - this.currentX, this.currentY);
- var10.addPoint(this.centerX, this.centerY);
- this.osg.fillPolygon(var10);
- }
- break;
- case 21:
- this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
- if (this.currentX == -1) {
- Polygon var5 = new Polygon();
- var5.addPoint(this.centerX, this.centerY);
- var5.addPoint(this.currentX, this.currentY);
- var5.addPoint(-1, -1);
- var5.addPoint(((Component)this).size().width, -1);
- var5.addPoint(((Component)this).size().width, ((Component)this).size().height);
- var5.addPoint(-1, ((Component)this).size().height);
- var5.addPoint(-1, ((Component)this).size().height / 2 + ((Component)this).size().height / 2 - this.currentY);
- var5.addPoint(this.centerX, this.centerY);
- this.osg.fillPolygon(var5);
- }
-
- if (this.currentY == -1) {
- Polygon var6 = new Polygon();
- var6.addPoint(this.centerX, this.centerY);
- var6.addPoint(this.currentX, this.currentY);
- var6.addPoint(((Component)this).size().width, -1);
- var6.addPoint(((Component)this).size().width, ((Component)this).size().height);
- var6.addPoint(this.currentX, ((Component)this).size().height);
- var6.addPoint(this.centerX, this.centerY);
- this.osg.fillPolygon(var6);
- }
-
- if (this.currentX == ((Component)this).size().width) {
- Polygon var7 = new Polygon();
- var7.addPoint(this.centerX, this.centerY);
- var7.addPoint(this.currentX, this.currentY);
- var7.addPoint(this.currentX, ((Component)this).size().height / 2 + ((Component)this).size().height / 2 - this.currentY);
- var7.addPoint(this.centerX, this.centerY);
- this.osg.fillPolygon(var7);
- }
- break;
- case 22:
- this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
- if (this.currentX == ((Component)this).size().width) {
- Polygon var2 = new Polygon();
- var2.addPoint(this.centerX, this.centerY);
- var2.addPoint(this.currentX, this.currentY);
- var2.addPoint(((Component)this).size().width, -1);
- var2.addPoint(-1, -1);
- var2.addPoint(-1, ((Component)this).size().height);
- var2.addPoint(((Component)this).size().width, ((Component)this).size().height);
- var2.addPoint(this.currentX, ((Component)this).size().height / 2 + ((Component)this).size().height / 2 - this.currentY);
- var2.addPoint(this.centerX, this.centerY);
- this.osg.fillPolygon(var2);
- }
-
- if (this.currentY == -1) {
- Polygon var3 = new Polygon();
- var3.addPoint(this.centerX, this.centerY);
- var3.addPoint(this.currentX, this.currentY);
- var3.addPoint(-1, -1);
- var3.addPoint(-1, ((Component)this).size().height);
- var3.addPoint(this.currentX, ((Component)this).size().height);
- var3.addPoint(this.centerX, this.centerY);
- this.osg.fillPolygon(var3);
- }
-
- if (this.currentX == -1) {
- Polygon var4 = new Polygon();
- var4.addPoint(this.centerX, this.centerY);
- var4.addPoint(this.currentX, this.currentY);
- var4.addPoint(-1, ((Component)this).size().height / 2 + ((Component)this).size().height / 2 - this.currentY);
- var4.addPoint(this.centerX, this.centerY);
- this.osg.fillPolygon(var4);
- }
- }
-
- this.UpdateMode();
- } else {
- this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
- this.SetupNextMode();
- }
-
- var1.drawImage(this.osImage, 0, 0, (ImageObserver)null);
- }
-
- void SetupNextMode() {
- this.modeFinished = false;
- this.delayTime = this.speed;
- if (this.randomize) {
- this.currMode = Math.abs(this.randomizer.nextInt()) % this.numModes;
- } else {
- ++this.currMode;
- if (this.currMode > this.numModes - 1) {
- this.currMode = 0;
- }
- }
-
- this.modeFinished = false;
- switch (this.currMode) {
- case 0:
- this.expandWidth = 2;
- this.expandHeight = 2;
- return;
- case 1:
- this.currentX = ((Component)this).size().width - 1;
- this.currentY = 0;
- return;
- case 2:
- this.currentWidth = this.blindWidth;
- return;
- case 3:
- this.currentWidth = this.blindWidth;
- return;
- case 4:
- this.currentHeight = this.blindHeight;
- return;
- case 5:
- this.currentHeight = this.blindHeight;
- return;
- case 6:
- this.currentX = 0;
- this.currentY = -((Component)this).size().height;
- return;
- case 7:
- this.currentX = 0;
- this.currentY = ((Component)this).size().height;
- return;
- case 8:
- this.currentX = ((Component)this).size().width;
- this.currentY = 0;
- return;
- case 9:
- this.currentX = -((Component)this).size().width;
- this.currentY = 0;
- return;
- case 10:
- this.currentX = -((Component)this).size().height;
- this.currentY = -((Component)this).size().height;
- return;
- case 11:
- this.currentX = ((Component)this).size().height;
- this.currentY = -((Component)this).size().height;
- return;
- case 12:
- this.currentX = -((Component)this).size().height;
- this.currentY = ((Component)this).size().height;
- return;
- case 13:
- this.currentX = ((Component)this).size().height;
- this.currentY = ((Component)this).size().height;
- return;
- case 14:
- this.currentX = 0;
- this.currentY = 0;
- this.currentWidth = ((Component)this).size().width;
- this.currentHeight = ((Component)this).size().height;
- return;
- case 15:
- this.currentX = 0;
- this.currentY = 0;
- return;
- case 16:
- this.currentX = 0;
- this.currentY = 0;
- return;
- case 17:
- this.currentX = 0;
- this.currentY = 0;
- return;
- case 18:
- this.currentX = 0;
- this.currentY = 0;
- return;
- case 19:
- this.currentX = ((Component)this).size().width / 2;
- this.currentY = ((Component)this).size().height;
- return;
- case 20:
- this.currentX = ((Component)this).size().width / 2;
- this.currentY = -1;
- return;
- case 21:
- this.currentX = -1;
- this.currentY = ((Component)this).size().height / 2;
- return;
- case 22:
- this.currentX = ((Component)this).size().width;
- this.currentY = ((Component)this).size().height / 2;
- return;
- default:
- }
- }
-
- void UpdateMode() {
- switch (this.currMode) {
- case 0:
- this.expandWidth += this.increment;
- this.expandHeight += this.increment;
- if (this.expandWidth > ((Component)this).size().width) {
- this.expandWidth = ((Component)this).size().width;
- }
-
- if (this.expandHeight > ((Component)this).size().height) {
- this.expandHeight = ((Component)this).size().height;
- }
-
- if (this.expandWidth == ((Component)this).size().width && this.expandHeight == ((Component)this).size().height) {
- this.modeFinished = true;
- this.delayTime = this.displayTime;
- return;
- }
- break;
- case 1:
- if (this.currentY == 0 && this.currentX > 0) {
- this.currentX -= this.increment;
- if (this.currentX < 0) {
- this.currentX = 0;
- }
- }
-
- if (this.currentX == 0 && this.currentY > 0) {
- this.currentY += this.increment;
- if (this.currentY > ((Component)this).size().height - 1) {
- this.currentY = ((Component)this).size().height - 1;
- }
- }
-
- if (this.currentX > 0 && this.currentY == ((Component)this).size().height - 1) {
- this.currentX += this.increment;
- if (this.currentX > ((Component)this).size().width - 1) {
- this.currentX = ((Component)this).size().width - 1;
- }
- }
-
- if (this.currentX == ((Component)this).size().width - 1 && this.currentY > 0) {
- this.currentY -= this.increment;
- if (this.currentY < 0) {
- this.currentY = 0;
- }
- }
-
- if (this.currentX == 0 && this.currentY == 0) {
- this.currentY += this.increment;
- }
-
- if (this.currentX == 0 && this.currentY == ((Component)this).size().height - 1) {
- this.currentX += this.increment;
- }
-
- if (this.currentX == ((Component)this).size().width - 1 && this.currentY == ((Component)this).size().height - 1) {
- this.currentY -= this.increment;
- }
-
- if (this.currentX == ((Component)this).size().width - 1 && this.currentY == 0) {
- this.modeFinished = true;
- this.delayTime = this.displayTime;
- return;
- }
- break;
- case 2:
- --this.currentWidth;
- if (this.currentWidth <= 0) {
- this.modeFinished = true;
- this.delayTime = this.displayTime;
- return;
- }
- break;
- case 3:
- --this.currentWidth;
- if (this.currentWidth <= 0) {
- this.modeFinished = true;
- this.delayTime = this.displayTime;
- return;
- }
- break;
- case 4:
- --this.currentHeight;
- if (this.currentHeight <= 0) {
- this.modeFinished = true;
- this.delayTime = this.displayTime;
- return;
- }
- break;
- case 5:
- --this.currentHeight;
- if (this.currentHeight <= 0) {
- this.modeFinished = true;
- this.delayTime = this.displayTime;
- return;
- }
- break;
- case 6:
- this.currentY += this.increment;
- if (this.currentY > 0) {
- this.currentY = 0;
- }
-
- if (this.currentY == 0) {
- this.modeFinished = true;
- this.delayTime = this.displayTime;
- return;
- }
- break;
- case 7:
- this.currentY -= this.increment;
- if (this.currentY < 0) {
- this.currentY = 0;
- }
-
- if (this.currentY == 0) {
- this.modeFinished = true;
- this.delayTime = this.displayTime;
- return;
- }
- break;
- case 8:
- this.currentX -= this.increment;
- if (this.currentX < 0) {
- this.currentX = 0;
- }
-
- if (this.currentX == 0) {
- this.modeFinished = true;
- this.delayTime = this.displayTime;
- return;
- }
- break;
- case 9:
- this.currentX += this.increment;
- if (this.currentX > 0) {
- this.currentX = 0;
- }
-
- if (this.currentX == 0) {
- this.modeFinished = true;
- this.delayTime = this.displayTime;
- return;
- }
- break;
- case 10:
- this.currentX += this.increment;
- this.currentY += this.increment;
- if (this.currentX > 0) {
- this.currentX = 0;
- }
-
- if (this.currentY > 0) {
- this.currentY = 0;
- }
-
- if (this.currentX == 0 && this.currentY == 0) {
- this.modeFinished = true;
- this.delayTime = this.displayTime;
- return;
- }
- break;
- case 11:
- this.currentX -= this.increment;
- this.currentY += this.increment;
- if (this.currentX < 0) {
- this.currentX = 0;
- }
-
- if (this.currentY > 0) {
- this.currentY = 0;
- }
-
- if (this.currentX == 0 && this.currentY == 0) {
- this.modeFinished = true;
- this.delayTime = this.displayTime;
- return;
- }
- break;
- case 12:
- this.currentX += this.increment;
- this.currentY -= this.increment;
- if (this.currentX > 0) {
- this.currentX = 0;
- }
-
- if (this.currentY < 0) {
- this.currentY = 0;
- }
-
- if (this.currentX == 0 && this.currentY == 0) {
- this.modeFinished = true;
- this.delayTime = this.displayTime;
- return;
- }
- break;
- case 13:
- this.currentX -= this.increment;
- this.currentY -= this.increment;
- if (this.currentX < 0) {
- this.currentX = 0;
- }
-
- if (this.currentY < 0) {
- this.currentY = 0;
- }
-
- if (this.currentX == 0 && this.currentY == 0) {
- this.modeFinished = true;
- this.delayTime = this.displayTime;
- return;
- }
- break;
- case 14:
- this.currentX += this.increment / 2;
- this.currentY += this.increment / 2;
- this.currentWidth -= this.increment;
- this.currentHeight -= this.increment;
- if (this.currentWidth < 0) {
- this.currentWidth = 0;
- }
-
- if (this.currentHeight < 0) {
- this.currentHeight = 0;
- }
-
- if (this.currentWidth == 0 && this.currentHeight == 0) {
- this.modeFinished = true;
- this.delayTime = this.displayTime;
- return;
- }
- break;
- case 15:
- this.currentY += this.increment;
- if (this.currentY > ((Component)this).size().height - 1) {
- this.currentY = ((Component)this).size().height - 1;
- }
-
- if (this.currentY == ((Component)this).size().height - 1) {
- this.modeFinished = true;
- this.delayTime = this.displayTime;
- return;
- }
- break;
- case 16:
- this.currentY -= this.increment;
- if (this.currentY < -(((Component)this).size().height - 1)) {
- this.currentY = -(((Component)this).size().height - 1);
- }
-
- if (this.currentY == -(((Component)this).size().height - 1)) {
- this.modeFinished = true;
- this.delayTime = this.displayTime;
- return;
- }
- break;
- case 17:
- this.currentX -= this.increment;
- if (this.currentX < -(((Component)this).size().width - 1)) {
- this.currentX = -(((Component)this).size().width - 1);
- }
-
- if (this.currentX == -(((Component)this).size().width - 1)) {
- this.modeFinished = true;
- this.delayTime = this.displayTime;
- return;
- }
- break;
- case 18:
- this.currentX += this.increment;
- if (this.currentX > ((Component)this).size().width - 1) {
- this.currentX = ((Component)this).size().width - 1;
- }
-
- if (this.currentX == ((Component)this).size().width - 1) {
- this.modeFinished = true;
- this.delayTime = this.displayTime;
- return;
- }
- break;
- case 19:
- if (this.currentX > -1 && this.currentY == ((Component)this).size().height) {
- this.currentX -= this.increment / 2;
- if (this.currentX < -1) {
- this.currentX = -1;
- }
- }
-
- if (this.currentX == -1 && this.currentY > -1) {
- this.currentY -= this.increment;
- if (this.currentY < -1) {
- this.currentY = -1;
- this.currentX += this.increment / 2;
- }
- }
-
- if (this.currentX > -1 && this.currentY == -1) {
- this.currentX += this.increment / 2;
- if (this.currentX > ((Component)this).size().width / 2) {
- this.currentX = ((Component)this).size().width / 2;
- }
- }
-
- if (this.currentX == ((Component)this).size().width / 2 && this.currentY == -1) {
- this.modeFinished = true;
- this.delayTime = this.displayTime;
- return;
- }
- break;
- case 20:
- if (this.currentY == -1) {
- this.currentX -= this.increment / 2;
- if (this.currentX < -1) {
- this.currentX = -1;
- }
- }
-
- if (this.currentX == -1) {
- this.currentY += this.increment;
- if (this.currentY > ((Component)this).size().height) {
- this.currentY = ((Component)this).size().height;
- }
- }
-
- if (this.currentY == ((Component)this).size().height) {
- this.currentX += this.increment / 2;
- if (this.currentX > ((Component)this).size().width / 2) {
- this.currentX = ((Component)this).size().width / 2;
- }
- }
-
- if (this.currentY == ((Component)this).size().height && this.currentX == ((Component)this).size().width / 2) {
- this.modeFinished = true;
- this.delayTime = this.displayTime;
- return;
- }
- break;
- case 21:
- if (this.currentX == -1) {
- this.currentY -= this.increment / 2;
- if (this.currentY < -1) {
- this.currentY = -1;
- }
- }
-
- if (this.currentY == -1) {
- this.currentX += this.increment;
- if (this.currentX > ((Component)this).size().width) {
- this.currentX = ((Component)this).size().width;
- }
- }
-
- if (this.currentX == ((Component)this).size().width) {
- this.currentY += this.increment / 2;
- if (this.currentY > ((Component)this).size().height / 2) {
- this.currentY = ((Component)this).size().height / 2;
- }
- }
-
- if (this.currentX == ((Component)this).size().width && this.currentY == ((Component)this).size().height / 2) {
- this.modeFinished = true;
- this.delayTime = this.displayTime;
- return;
- }
- break;
- case 22:
- if (this.currentX == ((Component)this).size().width) {
- this.currentY -= this.increment / 2;
- if (this.currentY < -1) {
- this.currentY = -1;
- }
- }
-
- if (this.currentY == -1) {
- this.currentX -= this.increment;
- if (this.currentX < -1) {
- this.currentX = -1;
- }
- }
-
- if (this.currentX == -1) {
- this.currentY += this.increment / 2;
- if (this.currentY > ((Component)this).size().height / 2) {
- this.currentY = ((Component)this).size().height / 2;
- }
- }
-
- if (this.currentX == -1 && this.currentY == ((Component)this).size().height / 2) {
- this.modeFinished = true;
- this.delayTime = this.displayTime;
- return;
- }
- }
-
- }
-
- public void run() {
- while(true) {
- try {
- ((Component)this).repaint();
- Thread.sleep((long)this.delayTime);
- } catch (InterruptedException var1) {
- }
- }
- }
-
- public void Start() {
- this.theThread = new Thread(this);
- this.theThread.start();
- }
-
- public void Stop() {
- this.theThread.stop();
- this.theThread = null;
- }
-
- public Dimension minimumSize() {
- return new Dimension(10, 10);
- }
-
- public Dimension preferredSize() {
- return new Dimension(10, 10);
- }
-
- public synchronized void reshape(int var1, int var2, int var3, int var4) {
- super.reshape(var1, var2, var3, var4);
- this.osImage = null;
- this.osg = null;
- }
- }
-