1 50 51 package org.openlaszlo.iv.flash.api.button; 52 53 import java.awt.geom.AffineTransform ; 54 import java.io.PrintStream ; 55 import org.openlaszlo.iv.flash.util.*; 56 import org.openlaszlo.iv.flash.parser.*; 57 import org.openlaszlo.iv.flash.api.*; 58 59 public class ButtonRecord extends FlashItem { 60 61 public static final int HitTest = 0x08; 62 public static final int Down = 0x04; 63 public static final int Over = 0x02; 64 public static final int Up = 0x01; 65 66 private int states; 67 private FlashDef def; 68 private int layer; 69 private AffineTransform matrix; 70 private CXForm cxform; 71 72 public ButtonRecord() {} 73 74 public ButtonRecord( int states, FlashDef def, int layer, AffineTransform matrix, CXForm cxform ) { 75 setStates( states ); 76 setDef( def ); 77 setLayer( layer ); 78 setMatrix( matrix ); 79 setCXForm( cxform ); 80 } 81 82 public void setStates( int states ) { this.states = states; } 83 public void setDef( FlashDef def ) { this.def = def; } 84 public void setLayer( int layer ) { this.layer = layer; } 85 public void setMatrix( AffineTransform matrix ) { this.matrix = matrix; } 86 public void setCXForm( CXForm cxform ) { this.cxform = cxform; } 87 88 public int getStates() { return states; } 89 public FlashDef getDef() { return def; } 90 public int getLayer() { return layer; } 91 public AffineTransform getMatrix() { return matrix; } 92 public CXForm getCXForm() { return cxform; } 93 94 public void write( FlashOutput fob ) { 95 fob.writeByte( states ); 96 fob.writeDefID( def ); 97 fob.writeWord( layer ); 98 fob.write( matrix ); 99 cxform.write( fob ); 100 } 101 102 public void printContent( PrintStream out, String indent ) { 103 out.println( indent+" ButtonRecord: charID="+def.getID()+" states="+states+" layer="+layer ); 104 } 105 106 public FlashItem getCopy( ScriptCopier copier ) { 107 ButtonRecord br = new ButtonRecord(); 108 br.states = states; 109 br.def = copier.copy(def); 110 br.layer = layer; 111 br.matrix = (AffineTransform ) matrix.clone(); 112 br.cxform = (CXForm) cxform.getCopy(copier); 113 return br; 114 } 115 116 } 117 118 | Popular Tags |