1 50 51 package org.openlaszlo.iv.flash.api; 52 53 import org.openlaszlo.iv.flash.parser.*; 54 import org.openlaszlo.iv.flash.util.*; 55 import java.io.PrintStream ; 56 57 66 public final class RemoveObject extends FlashObject { 67 68 public FlashDef def; 69 public int depth; 70 71 public RemoveObject() {} 72 73 public RemoveObject( int depth ) { 74 this.depth = depth; 75 } 76 77 public RemoveObject( int depth, FlashDef def ) { 78 this.depth = depth; 79 this.def = def; 80 } 81 82 public int getTag() { 83 if( def != null ) return Tag.REMOVEOBJECT; 84 return Tag.REMOVEOBJECT2; 85 } 86 87 public static RemoveObject parse( Parser p ) { 88 RemoveObject o = new RemoveObject(); 89 o.def = p.getDef(p.getUWord()); 90 o.depth = p.getUWord(); 91 return o; 92 } 93 94 public static RemoveObject parse2( Parser p ) { 95 RemoveObject o = new RemoveObject(); 96 o.depth = p.getUWord(); 97 return o; 98 } 99 100 public void collectDeps( DepsCollector dc ) { 101 } 104 105 public void write( FlashOutput fob ) { 106 if( def != null ) { 107 fob.writeTag( Tag.REMOVEOBJECT, 4 ); 108 fob.writeDefID( def ); 109 fob.writeWord(depth); 110 } else { 111 fob.writeTag( Tag.REMOVEOBJECT2, 2 ); 112 fob.writeWord(depth); 113 } 114 } 115 116 public void printContent( PrintStream out, String indent ) { 117 out.println( indent+"RemoveObject: depth="+depth+((def==null)?"":(" id="+def.getID())) ); 118 } 119 120 protected FlashItem copyInto( FlashItem item, ScriptCopier copier ) { 121 super.copyInto( item, copier ); 122 ((RemoveObject)item).def = copier.copy(def); 123 ((RemoveObject)item).depth = depth; 124 return item; 125 } 126 127 public FlashItem getCopy( ScriptCopier copier ) { 128 return copyInto( new RemoveObject(), copier ); 129 } 130 } 131 | Popular Tags |