home *** CD-ROM | disk | FTP | other *** search
- import java.awt.image.MemoryImageSource;
-
- public class RotateTransition extends BannerTransition {
- static final double SIN_45_DEGREES = 0.707106781;
- int rotateAmount;
- int location;
- double currentAngle;
- double angleIncrease;
- double perpen;
-
- public RotateTransition() {
- super.numOfFrames = 8;
- }
-
- public void finishInit() {
- super.delay = 200;
- this.angleIncrease = (Math.PI / 2D) * ((double)1.0F / (double)(super.numOfFrames + 1));
- this.currentAngle = this.angleIncrease;
- this.perpen = (double)super.imageHeight / (double)2.0F * 0.707106781;
-
- for(int var1 = 0; var1 < super.numOfFrames; ++var1) {
- try {
- Thread.sleep(100L);
- } catch (InterruptedException var3) {
- }
-
- this.Rotate();
-
- try {
- Thread.sleep(100L);
- } catch (InterruptedException var2) {
- }
-
- super.frames[var1] = super.owner.createImage(new MemoryImageSource(super.imageWidth, super.imageHeight, super.workPixels, 0, super.imageWidth));
- super.owner.prepareImage(super.frames[var1], super.owner);
- this.currentAngle += this.angleIncrease;
- }
-
- super.workPixels = null;
- }
-
- final void Rotate() {
- double var1 = (double)super.imageHeight / (double)2.0F * Math.sin((Math.PI / 2D) - this.currentAngle) + (double)super.imageHeight / (double)2.0F;
- double var3 = (double)super.imageHeight / (double)2.0F * Math.sin(this.currentAngle) + (double)super.imageHeight / (double)2.0F;
- int var5 = super.imageHeight - (int)(var3 * Math.sin(this.currentAngle));
- float var6 = (float)var1 / (float)var5;
- float var7 = (float)super.imageHeight - (float)var1 + var6 - 1.0F;
-
- for(int var8 = 0; var8 < var5; ++var8) {
- System.arraycopy(super.owner.banners[super.owner.currentBanner].imagePixels, (int)var7 * super.imageWidth, super.workPixels, var8 * super.imageWidth, super.imageWidth);
- var7 += var6;
- }
-
- var6 = (float)var3 / (float)(super.imageHeight - var5);
- var7 = 0.0F;
-
- for(int var9 = var5; var9 < super.imageHeight; ++var9) {
- System.arraycopy(super.owner.banners[super.owner.nextBanner].imagePixels, (int)var7 * super.imageWidth, super.workPixels, var9 * super.imageWidth, super.imageWidth);
- var7 += var6;
- }
-
- }
- }
-