home *** CD-ROM | disk | FTP | other *** search
- import java.awt.image.MemoryImageSource;
-
- public class ColumnTransition extends BannerTransition {
- static final int WIDTH_INCREMENT = 3;
- static final int MAX_COLUMN_WIDTH = 24;
- int lastMaxColumnsWidth;
- int lastColumnsStart;
- int columnWidth = 3;
-
- public ColumnTransition() {
- super.numOfFrames = 7;
- }
-
- public void finishInit() {
- super.delay = 200;
- this.lastMaxColumnsWidth = super.imageWidth % 24;
- this.lastColumnsStart = super.imageWidth - this.lastMaxColumnsWidth;
- System.arraycopy(super.owner.banners[super.owner.currentBanner].imagePixels, 0, super.workPixels, 0, super.pixelsPerImage);
-
- for(int f = 0; f < super.numOfFrames; ++f) {
- try {
- Thread.sleep(100L);
- } catch (InterruptedException var6) {
- }
-
- this.NextFrame();
-
- try {
- Thread.sleep(150L);
- } catch (InterruptedException var5) {
- }
-
- super.frames[f] = super.owner.createImage(new MemoryImageSource(super.imageWidth, super.imageHeight, super.workPixels, 0, super.imageWidth));
- super.owner.prepareImage(super.frames[f], super.owner);
- this.columnWidth += 3;
- }
-
- super.workPixels = null;
- }
-
- void NextFrame() {
- int old_column_width = 24 - this.columnWidth;
-
- for(int p = super.pixelsPerImage - super.imageWidth; p >= 0; p -= super.imageWidth) {
- for(int x = 0; x < this.lastColumnsStart; x += 24) {
- System.arraycopy(super.owner.banners[super.owner.nextBanner].imagePixels, x + p, super.workPixels, old_column_width + x + p, this.columnWidth);
- }
-
- if (old_column_width <= this.lastMaxColumnsWidth) {
- System.arraycopy(super.owner.banners[super.owner.nextBanner].imagePixels, this.lastColumnsStart + p, super.workPixels, this.lastColumnsStart + old_column_width + p - 1, this.lastMaxColumnsWidth - old_column_width + 1);
- }
- }
-
- }
- }
-