1 50 51 package org.openlaszlo.iv.flash.commands; 52 53 import java.io.*; 54 import java.awt.geom.*; 55 56 import org.openlaszlo.iv.flash.parser.*; 57 import org.openlaszlo.iv.flash.api.*; 58 import org.openlaszlo.iv.flash.util.*; 59 60 import org.openlaszlo.iv.flash.context.Context; 61 62 public class TickerCommand extends GeneralListCommand { 63 64 public TickerCommand() {} 65 66 public void doCommand( FlashFile file, Context context, Script parent, int frameNum ) throws IVException { 67 initParms( context ); 68 69 int stepsize = getIntParameter( context, "stepsize", 4 ) * 20; 70 71 Script listScript = makeList( file, context, parent, frameNum ); 72 73 Script myScript = getInstance().copyScript(); 74 75 int scrollFrames = stepsize==0?1:(listSize+Math.abs(stepsize)-1)/Math.abs(stepsize); 76 77 int current = 0; 78 for( int i=0; i<scrollFrames; i++ ) { 79 Frame scrollFrame = myScript.newFrame(); 80 AffineTransform m; 81 82 if( isVertical ) 83 m = AffineTransform.getTranslateInstance(0,current); 84 else 85 m = AffineTransform.getTranslateInstance(current,0); 86 87 if( i==0 ) scrollFrame.addInstance(listScript, 1, m, null, "contents" ); 88 else scrollFrame.addInstance(1, m); 89 90 if( isVertical ) 91 m = AffineTransform.getTranslateInstance(0,current+listSize); 92 else 93 m = AffineTransform.getTranslateInstance(current+listSize,0); 94 95 if( i==0 ) scrollFrame.addInstance(listScript, 2, m, null, "contents2" ); 96 else scrollFrame.addInstance(2, m); 97 current -= stepsize; 98 } 99 100 addMask( parent, frameNum ); 101 } 102 103 } 104 | Popular Tags |