1 50 51 package org.openlaszlo.iv.flash.api; 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.commands.*; 57 58 65 public class SetBackgroundColor extends FlashObject { 66 67 protected Color color; 68 69 public SetBackgroundColor() {} 70 71 public SetBackgroundColor( Color color ) { 72 this.color = color; 73 } 74 75 public int getTag() { 76 return Tag.SETBKGCOLOR; 77 } 78 79 public void setColor( Color color ) { 80 this.color = color; 81 } 82 83 public Color getColor() { 84 return color; 85 } 86 87 public static SetBackgroundColor parse( Parser p ) { 88 SetBackgroundColor o = new SetBackgroundColor(); 89 o.color = Color.parseRGB(p); 90 return o; 91 } 92 93 public void write( FlashOutput fob ) { 94 fob.writeTag( getTag(), 3 ); 95 color.writeRGB(fob); 96 } 97 98 public void printContent( PrintStream out, String indent ) { 99 out.println( indent+"SetBackgroundColor:" ); 100 color.printContent(out, indent+" "); 101 } 102 103 public boolean isConstant() { 104 return true; 105 } 106 107 protected FlashItem copyInto( FlashItem item, ScriptCopier copier ) { 108 super.copyInto( item, copier ); 109 ((SetBackgroundColor)item).color = (Color) color.getCopy(copier); 110 return item; 111 } 112 113 public FlashItem getCopy( ScriptCopier copier ) { 114 return copyInto( new SetBackgroundColor(), copier ); 115 } 116 } 117 | Popular Tags |