1 50 51 package org.openlaszlo.iv.flash.api.action; 52 53 import java.io.PrintStream ; 54 import org.openlaszlo.iv.flash.util.*; 55 import org.openlaszlo.iv.flash.parser.*; 56 import org.openlaszlo.iv.flash.api.*; 57 import org.openlaszlo.iv.flash.context.Context; 58 59 66 public class DoAction extends FlashObject { 67 68 public Program program; 69 70 public DoAction() {} 71 72 public DoAction( Program program ) { 73 this.program = program; 74 } 75 76 public int getTag() { 77 return Tag.DOACTION; 78 } 79 80 public Program getProgram() { 81 return program; 82 } 83 84 public void setProgram( Program program ) { 85 this.program = program; 86 } 87 88 public static DoAction parse( Parser p ) { 89 DoAction o = new DoAction(); 90 o.program = new Program(p.getBuf(), p.getPos(), p.getTagEndPos()); 91 return o; 92 } 93 94 public void write( FlashOutput fob ) { 95 fob.writeTag(Tag.DOACTION, program.getLength()); 96 program.write(fob); 97 } 98 99 public void printContent( PrintStream out, String indent ) { 100 out.println( indent+"DoAction:" ); 101 program.printContent( out, indent+" " ); 102 } 104 105 public void apply( Context context ) { 106 super.apply( context ); 107 program.apply(context); 108 } 109 110 protected boolean _isConstant() { 111 return program.isConstant(); 112 } 113 114 protected FlashItem copyInto( FlashItem item, ScriptCopier copier ) { 115 super.copyInto( item, copier ); 116 ((DoAction)item).program = (Program) program.getCopy(copier); 117 return item; 118 } 119 120 public FlashItem getCopy( ScriptCopier copier ) { 121 return copyInto( new DoAction(), copier ); 122 } 123 124 } 125 126 | Popular Tags |