home *** CD-ROM | disk | FTP | other *** search
/ Your Web Site Creator / Your Web Site Creator.iso / WebSite / data1.cab / Program_Executable_Files / Classes / FLCANVA2.CLA (.txt) < prev    next >
Encoding:
Java Class File  |  1999-01-13  |  10.5 KB  |  915 lines

  1. import java.applet.Applet;
  2. import java.awt.Canvas;
  3. import java.awt.Color;
  4. import java.awt.Component;
  5. import java.awt.Dimension;
  6. import java.awt.Graphics;
  7. import java.awt.Image;
  8. import java.awt.Polygon;
  9. import java.awt.image.ImageObserver;
  10. import java.util.Random;
  11.  
  12. public class FlasherCanvas2 extends Canvas implements Runnable {
  13.    Image osImage;
  14.    Graphics osg;
  15.    boolean started = false;
  16.    boolean modeFinished = false;
  17.    int increment = 2;
  18.    int expandWidth;
  19.    int expandHeight;
  20.    int currMode = -1;
  21.    int numModes = 23;
  22.    int currentX;
  23.    int currentY;
  24.    Image theImage;
  25.    Thread theThread;
  26.    int delayTime;
  27.    int speed;
  28.    int displayTime;
  29.    int centerX;
  30.    int centerY;
  31.    int currentWidth;
  32.    int currentHeight;
  33.    int numVertBlinds = 10;
  34.    int blindWidth;
  35.    int numHorizBlinds = 5;
  36.    int blindHeight;
  37.    Random randomizer = new Random();
  38.    boolean randomize;
  39.    static final int MODE_EXPAND = 0;
  40.    static final int MODE_SPIN_OUT = 1;
  41.    static final int MODE_OPEN_BLINDS_LEFT = 2;
  42.    static final int MODE_OPEN_BLINDS_RIGHT = 3;
  43.    static final int MODE_OPEN_BLINDS_DOWN = 4;
  44.    static final int MODE_OPEN_BLINDS_UP = 5;
  45.    static final int MODE_MOVE_DOWN = 6;
  46.    static final int MODE_MOVE_UP = 7;
  47.    static final int MODE_MOVE_LEFT = 8;
  48.    static final int MODE_MOVE_RIGHT = 9;
  49.    static final int MODE_MOVE_SOUTHEAST = 10;
  50.    static final int MODE_MOVE_SOUTHWEST = 11;
  51.    static final int MODE_MOVE_NORTHEAST = 12;
  52.    static final int MODE_MOVE_NORTHWEST = 13;
  53.    static final int MODE_GROW_INWARD = 14;
  54.    static final int MODE_GROW_DOWN = 15;
  55.    static final int MODE_GROW_UP = 16;
  56.    static final int MODE_GROW_LEFT = 17;
  57.    static final int MODE_GROW_RIGHT = 18;
  58.    static final int MODE_CURTAIN_DOWN = 19;
  59.    static final int MODE_CURTAIN_UP = 20;
  60.    static final int MODE_CURTAIN_LEFT = 21;
  61.    static final int MODE_CURTAIN_RIGHT = 22;
  62.    Color bkColor;
  63.    Image bkImage;
  64.  
  65.    public FlasherCanvas2(Applet var1, int var2) {
  66.       this.GetParameters(var1, var2);
  67.    }
  68.  
  69.    void GetParameters(Applet var1, int var2) {
  70.       String var3 = var1.getParameter("flasherImage" + var2);
  71.       this.theImage = AppletParam2.GetImage(var1, var3);
  72.       var3 = var1.getParameter("flasherIncrement" + var2);
  73.       this.increment = AppletParam2.GetInt(var3, 2);
  74.       var3 = var1.getParameter("flasherDisplayTime" + var2);
  75.       this.displayTime = AppletParam2.GetInt(var3, 5000);
  76.       var3 = var1.getParameter("flasherRandomize" + var2);
  77.       this.randomize = AppletParam2.GetBoolean(var3, true);
  78.       var3 = var1.getParameter("flasherSpeed" + var2);
  79.       this.speed = AppletParam2.GetInt(var3, 250);
  80.       this.delayTime = this.speed;
  81.       var3 = var1.getParameter("flasherBkColor" + var2);
  82.       this.bkColor = AppletParam2.GetColor(var3, (Color)null);
  83.       if (this.bkColor != null) {
  84.          ((Component)this).setBackground(this.bkColor);
  85.       }
  86.  
  87.    }
  88.  
  89.    public void update(Graphics var1) {
  90.       if (this.osImage == null) {
  91.          this.osImage = ((Component)this).createImage(((Component)this).size().width, ((Component)this).size().height);
  92.          this.osg = this.osImage.getGraphics();
  93.          this.centerX = ((Component)this).size().width / 2;
  94.          this.centerY = ((Component)this).size().height / 2;
  95.          this.blindWidth = ((Component)this).size().width / this.numVertBlinds;
  96.          this.blindHeight = ((Component)this).size().height / this.numHorizBlinds;
  97.          this.SetupNextMode();
  98.       }
  99.  
  100.       if (!this.modeFinished) {
  101.          this.osg.setColor(((Component)this).getBackground());
  102.          this.osg.fillRect(0, 0, ((Component)this).size().width, ((Component)this).size().height);
  103.          switch (this.currMode) {
  104.             case 0:
  105.                this.currentX = ((Component)this).size().width / 2 - this.expandWidth / 2;
  106.                this.currentY = ((Component)this).size().height / 2 - this.expandHeight / 2;
  107.                this.osg.drawImage(this.theImage, this.currentX, this.currentY, this.expandWidth, this.expandHeight, this);
  108.                break;
  109.             case 1:
  110.                this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
  111.                this.osg.setColor(((Component)this).getBackground());
  112.                if (this.currentY == 0 && this.currentX > 0) {
  113.                   Polygon var18 = new Polygon();
  114.                   var18.addPoint(this.centerX, this.centerY);
  115.                   var18.addPoint(this.currentX, -1);
  116.                   var18.addPoint(0, 0);
  117.                   var18.addPoint(0, ((Component)this).size().height);
  118.                   var18.addPoint(((Component)this).size().width, ((Component)this).size().height);
  119.                   var18.addPoint(((Component)this).size().width, 0);
  120.                   var18.addPoint(this.centerX, this.centerY);
  121.                   this.osg.fillPolygon(var18);
  122.                }
  123.  
  124.                if (this.currentX == 0 && this.currentY > 0) {
  125.                   Polygon var19 = new Polygon();
  126.                   var19.addPoint(this.centerX, this.centerY);
  127.                   var19.addPoint(-1, this.currentY);
  128.                   var19.addPoint(0, ((Component)this).size().height);
  129.                   var19.addPoint(((Component)this).size().width, ((Component)this).size().height);
  130.                   var19.addPoint(((Component)this).size().width, 0);
  131.                   var19.addPoint(this.centerX, this.centerY);
  132.                   this.osg.fillPolygon(var19);
  133.                }
  134.  
  135.                if (this.currentX > 0 && this.currentY == ((Component)this).size().height - 1) {
  136.                   Polygon var20 = new Polygon();
  137.                   var20.addPoint(this.centerX, this.centerY);
  138.                   var20.addPoint(this.currentX, ((Component)this).size().height);
  139.                   var20.addPoint(((Component)this).size().width, ((Component)this).size().height);
  140.                   var20.addPoint(((Component)this).size().width, 0);
  141.                   var20.addPoint(this.centerX, this.centerY);
  142.                   this.osg.fillPolygon(var20);
  143.                }
  144.  
  145.                if (this.currentX == ((Component)this).size().width - 1 && this.currentY > 0) {
  146.                   Polygon var21 = new Polygon();
  147.                   var21.addPoint(this.centerX, this.centerY);
  148.                   var21.addPoint(((Component)this).size().width, this.currentY);
  149.                   var21.addPoint(((Component)this).size().width, -1);
  150.                   var21.addPoint(this.centerX, this.centerY);
  151.                   this.osg.fillPolygon(var21);
  152.                }
  153.                break;
  154.             case 2:
  155.                this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
  156.  
  157.                for(int var17 = 0; var17 < this.numVertBlinds; ++var17) {
  158.                   this.osg.fillRect(var17 * this.blindWidth + this.blindWidth - this.currentWidth, 0, this.currentWidth, ((Component)this).size().height);
  159.                }
  160.                break;
  161.             case 3:
  162.                this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
  163.  
  164.                for(int var16 = 0; var16 < this.numVertBlinds; ++var16) {
  165.                   this.osg.fillRect(var16 * this.blindWidth, 0, this.currentWidth, ((Component)this).size().height);
  166.                }
  167.                break;
  168.             case 4:
  169.                this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
  170.  
  171.                for(int var15 = 0; var15 < this.numHorizBlinds; ++var15) {
  172.                   this.osg.fillRect(0, var15 * this.blindHeight + this.blindHeight - this.currentHeight, ((Component)this).size().width, this.currentHeight);
  173.                }
  174.                break;
  175.             case 5:
  176.                this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
  177.  
  178.                for(int var14 = 0; var14 < this.numHorizBlinds; ++var14) {
  179.                   this.osg.fillRect(0, var14 * this.blindHeight, ((Component)this).size().width, this.currentHeight);
  180.                }
  181.                break;
  182.             case 6:
  183.                this.osg.drawImage(this.theImage, this.currentX, this.currentY, ((Component)this).size().width, ((Component)this).size().height, this);
  184.                break;
  185.             case 7:
  186.                this.osg.drawImage(this.theImage, this.currentX, this.currentY, ((Component)this).size().width, ((Component)this).size().height, this);
  187.                break;
  188.             case 8:
  189.                this.osg.drawImage(this.theImage, this.currentX, this.currentY, ((Component)this).size().width, ((Component)this).size().height, this);
  190.                break;
  191.             case 9:
  192.                this.osg.drawImage(this.theImage, this.currentX, this.currentY, ((Component)this).size().width, ((Component)this).size().height, this);
  193.                break;
  194.             case 10:
  195.                this.osg.drawImage(this.theImage, this.currentX, this.currentY, ((Component)this).size().width, ((Component)this).size().height, this);
  196.                break;
  197.             case 11:
  198.                this.osg.drawImage(this.theImage, this.currentX, this.currentY, ((Component)this).size().width, ((Component)this).size().height, this);
  199.                break;
  200.             case 12:
  201.                this.osg.drawImage(this.theImage, this.currentX, this.currentY, ((Component)this).size().width, ((Component)this).size().height, this);
  202.                break;
  203.             case 13:
  204.                this.osg.drawImage(this.theImage, this.currentX, this.currentY, ((Component)this).size().width, ((Component)this).size().height, this);
  205.                break;
  206.             case 14:
  207.                this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
  208.                this.osg.fillRect(this.currentX, this.currentY, this.currentWidth, this.currentHeight);
  209.                break;
  210.             case 15:
  211.                this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
  212.                this.osg.fillRect(this.currentX, this.currentY, ((Component)this).size().width, ((Component)this).size().height);
  213.                break;
  214.             case 16:
  215.                this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
  216.                this.osg.fillRect(this.currentX, this.currentY, ((Component)this).size().width, ((Component)this).size().height);
  217.                break;
  218.             case 17:
  219.                this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
  220.                this.osg.fillRect(this.currentX, this.currentY, ((Component)this).size().width, ((Component)this).size().height);
  221.                break;
  222.             case 18:
  223.                this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
  224.                this.osg.fillRect(this.currentX, this.currentY, ((Component)this).size().width, ((Component)this).size().height);
  225.                break;
  226.             case 19:
  227.                this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
  228.                if (this.currentY == ((Component)this).size().height) {
  229.                   Polygon var11 = new Polygon();
  230.                   var11.addPoint(this.centerX, this.centerY);
  231.                   var11.addPoint(this.currentX, this.currentY);
  232.                   var11.addPoint(-1, ((Component)this).size().height);
  233.                   var11.addPoint(-1, -1);
  234.                   var11.addPoint(((Component)this).size().width, -1);
  235.                   var11.addPoint(((Component)this).size().width, ((Component)this).size().height);
  236.                   var11.addPoint(((Component)this).size().width / 2 + ((Component)this).size().width / 2 - this.currentX, this.currentY);
  237.                   var11.addPoint(this.centerX, this.centerY);
  238.                   this.osg.fillPolygon(var11);
  239.                }
  240.  
  241.                if (this.currentX == -1) {
  242.                   Polygon var12 = new Polygon();
  243.                   var12.addPoint(this.centerX, this.centerY);
  244.                   var12.addPoint(this.currentX, this.currentY);
  245.                   var12.addPoint(-1, -1);
  246.                   var12.addPoint(((Component)this).size().width, -1);
  247.                   var12.addPoint(((Component)this).size().width, this.currentY);
  248.                   var12.addPoint(this.centerX, this.centerY);
  249.                   this.osg.fillPolygon(var12);
  250.                }
  251.  
  252.                if (this.currentY == -1) {
  253.                   Polygon var13 = new Polygon();
  254.                   var13.addPoint(this.centerX, this.centerY);
  255.                   var13.addPoint(this.currentX, this.currentY);
  256.                   var13.addPoint(((Component)this).size().width / 2 + ((Component)this).size().width / 2 - this.currentX, this.currentY);
  257.                   var13.addPoint(this.centerX, this.centerY);
  258.                   this.osg.fillPolygon(var13);
  259.                }
  260.                break;
  261.             case 20:
  262.                this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
  263.                if (this.currentY == -1) {
  264.                   Polygon var8 = new Polygon();
  265.                   var8.addPoint(this.centerX, this.centerY);
  266.                   var8.addPoint(this.currentX, this.currentY);
  267.                   var8.addPoint(-1, -1);
  268.                   var8.addPoint(-1, ((Component)this).size().height);
  269.                   var8.addPoint(((Component)this).size().width, ((Component)this).size().height);
  270.                   var8.addPoint(((Component)this).size().width, -1);
  271.                   var8.addPoint(((Component)this).size().width / 2 + ((Component)this).size().width / 2 - this.currentX, this.currentY);
  272.                   var8.addPoint(this.centerX, this.centerY);
  273.                   this.osg.fillPolygon(var8);
  274.                }
  275.  
  276.                if (this.currentX == -1) {
  277.                   Polygon var9 = new Polygon();
  278.                   var9.addPoint(this.centerX, this.centerY);
  279.                   var9.addPoint(this.currentX, this.currentY);
  280.                   var9.addPoint(-1, ((Component)this).size().height);
  281.                   var9.addPoint(((Component)this).size().width, ((Component)this).size().height);
  282.                   var9.addPoint(((Component)this).size().width, this.currentY);
  283.                   var9.addPoint(this.centerX, this.centerY);
  284.                   this.osg.fillPolygon(var9);
  285.                }
  286.  
  287.                if (this.currentY == ((Component)this).size().height) {
  288.                   Polygon var10 = new Polygon();
  289.                   var10.addPoint(this.centerX, this.centerY);
  290.                   var10.addPoint(this.currentX, this.currentY);
  291.                   var10.addPoint(((Component)this).size().width / 2 + ((Component)this).size().width / 2 - this.currentX, this.currentY);
  292.                   var10.addPoint(this.centerX, this.centerY);
  293.                   this.osg.fillPolygon(var10);
  294.                }
  295.                break;
  296.             case 21:
  297.                this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
  298.                if (this.currentX == -1) {
  299.                   Polygon var5 = new Polygon();
  300.                   var5.addPoint(this.centerX, this.centerY);
  301.                   var5.addPoint(this.currentX, this.currentY);
  302.                   var5.addPoint(-1, -1);
  303.                   var5.addPoint(((Component)this).size().width, -1);
  304.                   var5.addPoint(((Component)this).size().width, ((Component)this).size().height);
  305.                   var5.addPoint(-1, ((Component)this).size().height);
  306.                   var5.addPoint(-1, ((Component)this).size().height / 2 + ((Component)this).size().height / 2 - this.currentY);
  307.                   var5.addPoint(this.centerX, this.centerY);
  308.                   this.osg.fillPolygon(var5);
  309.                }
  310.  
  311.                if (this.currentY == -1) {
  312.                   Polygon var6 = new Polygon();
  313.                   var6.addPoint(this.centerX, this.centerY);
  314.                   var6.addPoint(this.currentX, this.currentY);
  315.                   var6.addPoint(((Component)this).size().width, -1);
  316.                   var6.addPoint(((Component)this).size().width, ((Component)this).size().height);
  317.                   var6.addPoint(this.currentX, ((Component)this).size().height);
  318.                   var6.addPoint(this.centerX, this.centerY);
  319.                   this.osg.fillPolygon(var6);
  320.                }
  321.  
  322.                if (this.currentX == ((Component)this).size().width) {
  323.                   Polygon var7 = new Polygon();
  324.                   var7.addPoint(this.centerX, this.centerY);
  325.                   var7.addPoint(this.currentX, this.currentY);
  326.                   var7.addPoint(this.currentX, ((Component)this).size().height / 2 + ((Component)this).size().height / 2 - this.currentY);
  327.                   var7.addPoint(this.centerX, this.centerY);
  328.                   this.osg.fillPolygon(var7);
  329.                }
  330.                break;
  331.             case 22:
  332.                this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
  333.                if (this.currentX == ((Component)this).size().width) {
  334.                   Polygon var2 = new Polygon();
  335.                   var2.addPoint(this.centerX, this.centerY);
  336.                   var2.addPoint(this.currentX, this.currentY);
  337.                   var2.addPoint(((Component)this).size().width, -1);
  338.                   var2.addPoint(-1, -1);
  339.                   var2.addPoint(-1, ((Component)this).size().height);
  340.                   var2.addPoint(((Component)this).size().width, ((Component)this).size().height);
  341.                   var2.addPoint(this.currentX, ((Component)this).size().height / 2 + ((Component)this).size().height / 2 - this.currentY);
  342.                   var2.addPoint(this.centerX, this.centerY);
  343.                   this.osg.fillPolygon(var2);
  344.                }
  345.  
  346.                if (this.currentY == -1) {
  347.                   Polygon var3 = new Polygon();
  348.                   var3.addPoint(this.centerX, this.centerY);
  349.                   var3.addPoint(this.currentX, this.currentY);
  350.                   var3.addPoint(-1, -1);
  351.                   var3.addPoint(-1, ((Component)this).size().height);
  352.                   var3.addPoint(this.currentX, ((Component)this).size().height);
  353.                   var3.addPoint(this.centerX, this.centerY);
  354.                   this.osg.fillPolygon(var3);
  355.                }
  356.  
  357.                if (this.currentX == -1) {
  358.                   Polygon var4 = new Polygon();
  359.                   var4.addPoint(this.centerX, this.centerY);
  360.                   var4.addPoint(this.currentX, this.currentY);
  361.                   var4.addPoint(-1, ((Component)this).size().height / 2 + ((Component)this).size().height / 2 - this.currentY);
  362.                   var4.addPoint(this.centerX, this.centerY);
  363.                   this.osg.fillPolygon(var4);
  364.                }
  365.          }
  366.  
  367.          this.UpdateMode();
  368.       } else {
  369.          this.osg.drawImage(this.theImage, 0, 0, ((Component)this).size().width, ((Component)this).size().height, this);
  370.          this.SetupNextMode();
  371.       }
  372.  
  373.       var1.drawImage(this.osImage, 0, 0, (ImageObserver)null);
  374.    }
  375.  
  376.    void SetupNextMode() {
  377.       this.modeFinished = false;
  378.       this.delayTime = this.speed;
  379.       if (this.randomize) {
  380.          this.currMode = Math.abs(this.randomizer.nextInt()) % this.numModes;
  381.       } else {
  382.          ++this.currMode;
  383.          if (this.currMode > this.numModes - 1) {
  384.             this.currMode = 0;
  385.          }
  386.       }
  387.  
  388.       this.modeFinished = false;
  389.       switch (this.currMode) {
  390.          case 0:
  391.             this.expandWidth = 2;
  392.             this.expandHeight = 2;
  393.             return;
  394.          case 1:
  395.             this.currentX = ((Component)this).size().width - 1;
  396.             this.currentY = 0;
  397.             return;
  398.          case 2:
  399.             this.currentWidth = this.blindWidth;
  400.             return;
  401.          case 3:
  402.             this.currentWidth = this.blindWidth;
  403.             return;
  404.          case 4:
  405.             this.currentHeight = this.blindHeight;
  406.             return;
  407.          case 5:
  408.             this.currentHeight = this.blindHeight;
  409.             return;
  410.          case 6:
  411.             this.currentX = 0;
  412.             this.currentY = -((Component)this).size().height;
  413.             return;
  414.          case 7:
  415.             this.currentX = 0;
  416.             this.currentY = ((Component)this).size().height;
  417.             return;
  418.          case 8:
  419.             this.currentX = ((Component)this).size().width;
  420.             this.currentY = 0;
  421.             return;
  422.          case 9:
  423.             this.currentX = -((Component)this).size().width;
  424.             this.currentY = 0;
  425.             return;
  426.          case 10:
  427.             this.currentX = -((Component)this).size().height;
  428.             this.currentY = -((Component)this).size().height;
  429.             return;
  430.          case 11:
  431.             this.currentX = ((Component)this).size().height;
  432.             this.currentY = -((Component)this).size().height;
  433.             return;
  434.          case 12:
  435.             this.currentX = -((Component)this).size().height;
  436.             this.currentY = ((Component)this).size().height;
  437.             return;
  438.          case 13:
  439.             this.currentX = ((Component)this).size().height;
  440.             this.currentY = ((Component)this).size().height;
  441.             return;
  442.          case 14:
  443.             this.currentX = 0;
  444.             this.currentY = 0;
  445.             this.currentWidth = ((Component)this).size().width;
  446.             this.currentHeight = ((Component)this).size().height;
  447.             return;
  448.          case 15:
  449.             this.currentX = 0;
  450.             this.currentY = 0;
  451.             return;
  452.          case 16:
  453.             this.currentX = 0;
  454.             this.currentY = 0;
  455.             return;
  456.          case 17:
  457.             this.currentX = 0;
  458.             this.currentY = 0;
  459.             return;
  460.          case 18:
  461.             this.currentX = 0;
  462.             this.currentY = 0;
  463.             return;
  464.          case 19:
  465.             this.currentX = ((Component)this).size().width / 2;
  466.             this.currentY = ((Component)this).size().height;
  467.             return;
  468.          case 20:
  469.             this.currentX = ((Component)this).size().width / 2;
  470.             this.currentY = -1;
  471.             return;
  472.          case 21:
  473.             this.currentX = -1;
  474.             this.currentY = ((Component)this).size().height / 2;
  475.             return;
  476.          case 22:
  477.             this.currentX = ((Component)this).size().width;
  478.             this.currentY = ((Component)this).size().height / 2;
  479.             return;
  480.          default:
  481.       }
  482.    }
  483.  
  484.    void UpdateMode() {
  485.       switch (this.currMode) {
  486.          case 0:
  487.             this.expandWidth += this.increment;
  488.             this.expandHeight += this.increment;
  489.             if (this.expandWidth > ((Component)this).size().width) {
  490.                this.expandWidth = ((Component)this).size().width;
  491.             }
  492.  
  493.             if (this.expandHeight > ((Component)this).size().height) {
  494.                this.expandHeight = ((Component)this).size().height;
  495.             }
  496.  
  497.             if (this.expandWidth == ((Component)this).size().width && this.expandHeight == ((Component)this).size().height) {
  498.                this.modeFinished = true;
  499.                this.delayTime = this.displayTime;
  500.                return;
  501.             }
  502.             break;
  503.          case 1:
  504.             if (this.currentY == 0 && this.currentX > 0) {
  505.                this.currentX -= this.increment;
  506.                if (this.currentX < 0) {
  507.                   this.currentX = 0;
  508.                }
  509.             }
  510.  
  511.             if (this.currentX == 0 && this.currentY > 0) {
  512.                this.currentY += this.increment;
  513.                if (this.currentY > ((Component)this).size().height - 1) {
  514.                   this.currentY = ((Component)this).size().height - 1;
  515.                }
  516.             }
  517.  
  518.             if (this.currentX > 0 && this.currentY == ((Component)this).size().height - 1) {
  519.                this.currentX += this.increment;
  520.                if (this.currentX > ((Component)this).size().width - 1) {
  521.                   this.currentX = ((Component)this).size().width - 1;
  522.                }
  523.             }
  524.  
  525.             if (this.currentX == ((Component)this).size().width - 1 && this.currentY > 0) {
  526.                this.currentY -= this.increment;
  527.                if (this.currentY < 0) {
  528.                   this.currentY = 0;
  529.                }
  530.             }
  531.  
  532.             if (this.currentX == 0 && this.currentY == 0) {
  533.                this.currentY += this.increment;
  534.             }
  535.  
  536.             if (this.currentX == 0 && this.currentY == ((Component)this).size().height - 1) {
  537.                this.currentX += this.increment;
  538.             }
  539.  
  540.             if (this.currentX == ((Component)this).size().width - 1 && this.currentY == ((Component)this).size().height - 1) {
  541.                this.currentY -= this.increment;
  542.             }
  543.  
  544.             if (this.currentX == ((Component)this).size().width - 1 && this.currentY == 0) {
  545.                this.modeFinished = true;
  546.                this.delayTime = this.displayTime;
  547.                return;
  548.             }
  549.             break;
  550.          case 2:
  551.             --this.currentWidth;
  552.             if (this.currentWidth <= 0) {
  553.                this.modeFinished = true;
  554.                this.delayTime = this.displayTime;
  555.                return;
  556.             }
  557.             break;
  558.          case 3:
  559.             --this.currentWidth;
  560.             if (this.currentWidth <= 0) {
  561.                this.modeFinished = true;
  562.                this.delayTime = this.displayTime;
  563.                return;
  564.             }
  565.             break;
  566.          case 4:
  567.             --this.currentHeight;
  568.             if (this.currentHeight <= 0) {
  569.                this.modeFinished = true;
  570.                this.delayTime = this.displayTime;
  571.                return;
  572.             }
  573.             break;
  574.          case 5:
  575.             --this.currentHeight;
  576.             if (this.currentHeight <= 0) {
  577.                this.modeFinished = true;
  578.                this.delayTime = this.displayTime;
  579.                return;
  580.             }
  581.             break;
  582.          case 6:
  583.             this.currentY += this.increment;
  584.             if (this.currentY > 0) {
  585.                this.currentY = 0;
  586.             }
  587.  
  588.             if (this.currentY == 0) {
  589.                this.modeFinished = true;
  590.                this.delayTime = this.displayTime;
  591.                return;
  592.             }
  593.             break;
  594.          case 7:
  595.             this.currentY -= this.increment;
  596.             if (this.currentY < 0) {
  597.                this.currentY = 0;
  598.             }
  599.  
  600.             if (this.currentY == 0) {
  601.                this.modeFinished = true;
  602.                this.delayTime = this.displayTime;
  603.                return;
  604.             }
  605.             break;
  606.          case 8:
  607.             this.currentX -= this.increment;
  608.             if (this.currentX < 0) {
  609.                this.currentX = 0;
  610.             }
  611.  
  612.             if (this.currentX == 0) {
  613.                this.modeFinished = true;
  614.                this.delayTime = this.displayTime;
  615.                return;
  616.             }
  617.             break;
  618.          case 9:
  619.             this.currentX += this.increment;
  620.             if (this.currentX > 0) {
  621.                this.currentX = 0;
  622.             }
  623.  
  624.             if (this.currentX == 0) {
  625.                this.modeFinished = true;
  626.                this.delayTime = this.displayTime;
  627.                return;
  628.             }
  629.             break;
  630.          case 10:
  631.             this.currentX += this.increment;
  632.             this.currentY += this.increment;
  633.             if (this.currentX > 0) {
  634.                this.currentX = 0;
  635.             }
  636.  
  637.             if (this.currentY > 0) {
  638.                this.currentY = 0;
  639.             }
  640.  
  641.             if (this.currentX == 0 && this.currentY == 0) {
  642.                this.modeFinished = true;
  643.                this.delayTime = this.displayTime;
  644.                return;
  645.             }
  646.             break;
  647.          case 11:
  648.             this.currentX -= this.increment;
  649.             this.currentY += this.increment;
  650.             if (this.currentX < 0) {
  651.                this.currentX = 0;
  652.             }
  653.  
  654.             if (this.currentY > 0) {
  655.                this.currentY = 0;
  656.             }
  657.  
  658.             if (this.currentX == 0 && this.currentY == 0) {
  659.                this.modeFinished = true;
  660.                this.delayTime = this.displayTime;
  661.                return;
  662.             }
  663.             break;
  664.          case 12:
  665.             this.currentX += this.increment;
  666.             this.currentY -= this.increment;
  667.             if (this.currentX > 0) {
  668.                this.currentX = 0;
  669.             }
  670.  
  671.             if (this.currentY < 0) {
  672.                this.currentY = 0;
  673.             }
  674.  
  675.             if (this.currentX == 0 && this.currentY == 0) {
  676.                this.modeFinished = true;
  677.                this.delayTime = this.displayTime;
  678.                return;
  679.             }
  680.             break;
  681.          case 13:
  682.             this.currentX -= this.increment;
  683.             this.currentY -= this.increment;
  684.             if (this.currentX < 0) {
  685.                this.currentX = 0;
  686.             }
  687.  
  688.             if (this.currentY < 0) {
  689.                this.currentY = 0;
  690.             }
  691.  
  692.             if (this.currentX == 0 && this.currentY == 0) {
  693.                this.modeFinished = true;
  694.                this.delayTime = this.displayTime;
  695.                return;
  696.             }
  697.             break;
  698.          case 14:
  699.             this.currentX += this.increment / 2;
  700.             this.currentY += this.increment / 2;
  701.             this.currentWidth -= this.increment;
  702.             this.currentHeight -= this.increment;
  703.             if (this.currentWidth < 0) {
  704.                this.currentWidth = 0;
  705.             }
  706.  
  707.             if (this.currentHeight < 0) {
  708.                this.currentHeight = 0;
  709.             }
  710.  
  711.             if (this.currentWidth == 0 && this.currentHeight == 0) {
  712.                this.modeFinished = true;
  713.                this.delayTime = this.displayTime;
  714.                return;
  715.             }
  716.             break;
  717.          case 15:
  718.             this.currentY += this.increment;
  719.             if (this.currentY > ((Component)this).size().height - 1) {
  720.                this.currentY = ((Component)this).size().height - 1;
  721.             }
  722.  
  723.             if (this.currentY == ((Component)this).size().height - 1) {
  724.                this.modeFinished = true;
  725.                this.delayTime = this.displayTime;
  726.                return;
  727.             }
  728.             break;
  729.          case 16:
  730.             this.currentY -= this.increment;
  731.             if (this.currentY < -(((Component)this).size().height - 1)) {
  732.                this.currentY = -(((Component)this).size().height - 1);
  733.             }
  734.  
  735.             if (this.currentY == -(((Component)this).size().height - 1)) {
  736.                this.modeFinished = true;
  737.                this.delayTime = this.displayTime;
  738.                return;
  739.             }
  740.             break;
  741.          case 17:
  742.             this.currentX -= this.increment;
  743.             if (this.currentX < -(((Component)this).size().width - 1)) {
  744.                this.currentX = -(((Component)this).size().width - 1);
  745.             }
  746.  
  747.             if (this.currentX == -(((Component)this).size().width - 1)) {
  748.                this.modeFinished = true;
  749.                this.delayTime = this.displayTime;
  750.                return;
  751.             }
  752.             break;
  753.          case 18:
  754.             this.currentX += this.increment;
  755.             if (this.currentX > ((Component)this).size().width - 1) {
  756.                this.currentX = ((Component)this).size().width - 1;
  757.             }
  758.  
  759.             if (this.currentX == ((Component)this).size().width - 1) {
  760.                this.modeFinished = true;
  761.                this.delayTime = this.displayTime;
  762.                return;
  763.             }
  764.             break;
  765.          case 19:
  766.             if (this.currentX > -1 && this.currentY == ((Component)this).size().height) {
  767.                this.currentX -= this.increment / 2;
  768.                if (this.currentX < -1) {
  769.                   this.currentX = -1;
  770.                }
  771.             }
  772.  
  773.             if (this.currentX == -1 && this.currentY > -1) {
  774.                this.currentY -= this.increment;
  775.                if (this.currentY < -1) {
  776.                   this.currentY = -1;
  777.                   this.currentX += this.increment / 2;
  778.                }
  779.             }
  780.  
  781.             if (this.currentX > -1 && this.currentY == -1) {
  782.                this.currentX += this.increment / 2;
  783.                if (this.currentX > ((Component)this).size().width / 2) {
  784.                   this.currentX = ((Component)this).size().width / 2;
  785.                }
  786.             }
  787.  
  788.             if (this.currentX == ((Component)this).size().width / 2 && this.currentY == -1) {
  789.                this.modeFinished = true;
  790.                this.delayTime = this.displayTime;
  791.                return;
  792.             }
  793.             break;
  794.          case 20:
  795.             if (this.currentY == -1) {
  796.                this.currentX -= this.increment / 2;
  797.                if (this.currentX < -1) {
  798.                   this.currentX = -1;
  799.                }
  800.             }
  801.  
  802.             if (this.currentX == -1) {
  803.                this.currentY += this.increment;
  804.                if (this.currentY > ((Component)this).size().height) {
  805.                   this.currentY = ((Component)this).size().height;
  806.                }
  807.             }
  808.  
  809.             if (this.currentY == ((Component)this).size().height) {
  810.                this.currentX += this.increment / 2;
  811.                if (this.currentX > ((Component)this).size().width / 2) {
  812.                   this.currentX = ((Component)this).size().width / 2;
  813.                }
  814.             }
  815.  
  816.             if (this.currentY == ((Component)this).size().height && this.currentX == ((Component)this).size().width / 2) {
  817.                this.modeFinished = true;
  818.                this.delayTime = this.displayTime;
  819.                return;
  820.             }
  821.             break;
  822.          case 21:
  823.             if (this.currentX == -1) {
  824.                this.currentY -= this.increment / 2;
  825.                if (this.currentY < -1) {
  826.                   this.currentY = -1;
  827.                }
  828.             }
  829.  
  830.             if (this.currentY == -1) {
  831.                this.currentX += this.increment;
  832.                if (this.currentX > ((Component)this).size().width) {
  833.                   this.currentX = ((Component)this).size().width;
  834.                }
  835.             }
  836.  
  837.             if (this.currentX == ((Component)this).size().width) {
  838.                this.currentY += this.increment / 2;
  839.                if (this.currentY > ((Component)this).size().height / 2) {
  840.                   this.currentY = ((Component)this).size().height / 2;
  841.                }
  842.             }
  843.  
  844.             if (this.currentX == ((Component)this).size().width && this.currentY == ((Component)this).size().height / 2) {
  845.                this.modeFinished = true;
  846.                this.delayTime = this.displayTime;
  847.                return;
  848.             }
  849.             break;
  850.          case 22:
  851.             if (this.currentX == ((Component)this).size().width) {
  852.                this.currentY -= this.increment / 2;
  853.                if (this.currentY < -1) {
  854.                   this.currentY = -1;
  855.                }
  856.             }
  857.  
  858.             if (this.currentY == -1) {
  859.                this.currentX -= this.increment;
  860.                if (this.currentX < -1) {
  861.                   this.currentX = -1;
  862.                }
  863.             }
  864.  
  865.             if (this.currentX == -1) {
  866.                this.currentY += this.increment / 2;
  867.                if (this.currentY > ((Component)this).size().height / 2) {
  868.                   this.currentY = ((Component)this).size().height / 2;
  869.                }
  870.             }
  871.  
  872.             if (this.currentX == -1 && this.currentY == ((Component)this).size().height / 2) {
  873.                this.modeFinished = true;
  874.                this.delayTime = this.displayTime;
  875.                return;
  876.             }
  877.       }
  878.  
  879.    }
  880.  
  881.    public void run() {
  882.       while(true) {
  883.          try {
  884.             ((Component)this).repaint();
  885.             Thread.sleep((long)this.delayTime);
  886.          } catch (InterruptedException var1) {
  887.          }
  888.       }
  889.    }
  890.  
  891.    public void Start() {
  892.       this.theThread = new Thread(this);
  893.       this.theThread.start();
  894.    }
  895.  
  896.    public void Stop() {
  897.       this.theThread.stop();
  898.       this.theThread = null;
  899.    }
  900.  
  901.    public Dimension minimumSize() {
  902.       return new Dimension(10, 10);
  903.    }
  904.  
  905.    public Dimension preferredSize() {
  906.       return new Dimension(10, 10);
  907.    }
  908.  
  909.    public synchronized void reshape(int var1, int var2, int var3, int var4) {
  910.       super.reshape(var1, var2, var3, var4);
  911.       this.osImage = null;
  912.       this.osg = null;
  913.    }
  914. }
  915.