| 1 |
|
| 2 |
package org.freehep.graphicsio.swf; |
| 3 |
|
| 4 |
import java.io.IOException; |
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
public class DefineMovie extends DefinitionTag { |
| 14 |
|
| 15 |
private int character; |
| 16 |
|
| 17 |
private String name; |
| 18 |
|
| 19 |
public DefineMovie(int id, String name) { |
| 20 |
this(); |
| 21 |
character = id; |
| 22 |
this.name = name; |
| 23 |
} |
| 24 |
|
| 25 |
public DefineMovie() { |
| 26 |
super(38, 4); |
| 27 |
} |
| 28 |
|
| 29 |
public SWFTag read(int tagID, SWFInputStream swf, int len) |
| 30 |
throws IOException { |
| 31 |
|
| 32 |
DefineMovie tag = new DefineMovie(); |
| 33 |
tag.character = swf.readUnsignedShort(); |
| 34 |
swf.getDictionary().put(tag.character, tag); |
| 35 |
|
| 36 |
tag.name = swf.readString(); |
| 37 |
return tag; |
| 38 |
} |
| 39 |
|
| 40 |
public void write(int tagID, SWFOutputStream swf) throws IOException { |
| 41 |
swf.writeUnsignedShort(character); |
| 42 |
swf.writeString(name); |
| 43 |
} |
| 44 |
|
| 45 |
public String toString() { |
| 46 |
StringBuffer s = new StringBuffer(); |
| 47 |
s.append(super.toString() + "\n"); |
| 48 |
s.append(" character: " + character + "\n"); |
| 49 |
s.append(" name: " + name); |
| 50 |
return s.toString(); |
| 51 |
} |
| 52 |
} |