1 50 51 package org.openlaszlo.iv.flash.api.button; 52 53 import java.io.PrintStream ; 54 import org.openlaszlo.iv.flash.parser.*; 55 import org.openlaszlo.iv.flash.util.*; 56 import org.openlaszlo.iv.flash.api.*; 57 58 61 public class ButtonCXForm extends FlashObject { 62 63 protected Button button; 64 protected CXForm cxform; 65 66 public ButtonCXForm() {} 67 68 public int getTag() { 69 return Tag.DEFINEBUTTONCXFORM; 70 } 71 72 public void setButton( Button button ) { 73 this.button = button; 74 } 75 76 public static ButtonCXForm parse( Parser p ) { 77 ButtonCXForm o = new ButtonCXForm(); 78 o.button = (Button) p.getDef( p.getUWord() ); 79 o.cxform = CXForm.parse(p, false); 80 o.button.setButtonCXForm(o); 81 return o; 82 } 83 84 public void write( FlashOutput fob ) { 85 int pos = fob.getPos(); 86 fob.skip(2); 87 fob.writeDefID( button ); 88 cxform.write(fob); 89 fob.writeShortTagAt(getTag(), fob.getPos()-pos-2, pos); 90 } 91 92 public void printContent( PrintStream out, String indent ) { 93 out.println( indent+"ButtonCXForm:" ); 94 cxform.printContent(out, indent+" "); 95 } 96 97 104 105 protected FlashItem copyInto( FlashItem item, ScriptCopier copier ) { 106 super.copyInto( item, copier ); 107 ((ButtonCXForm)item).cxform = (CXForm) cxform.getCopy(copier); 108 return item; 111 } 112 113 public FlashItem getCopy( ScriptCopier copier ) { 114 return copyInto( new ButtonCXForm(), copier ); 115 } 116 } 117 | Popular Tags |