View Javadoc

1   // Copyright 2001, FreeHEP.
2   package org.freehep.graphicsio.swf;
3   
4   import java.awt.Color;
5   import java.io.IOException;
6   
7   /**
8    * SetBackgroundColor TAG.
9    * 
10   * @author Mark Donszelmann
11   * @author Charles Loomis
12   * @version $Id: SetBackgroundColor.java 8584 2006-08-10 23:06:37Z duns $
13   */
14  public class SetBackgroundColor extends ControlTag {
15  
16      private Color color;
17  
18      public SetBackgroundColor(Color color) {
19          this();
20          this.color = color;
21      }
22  
23      public SetBackgroundColor() {
24          super(9, 1);
25      }
26  
27      public SWFTag read(int tagID, SWFInputStream swf, int len)
28              throws IOException {
29  
30          SetBackgroundColor tag = new SetBackgroundColor();
31          tag.color = swf.readColor(false);
32  
33          return tag;
34      }
35  
36      public void write(int tagID, SWFOutputStream swf) throws IOException {
37          swf.writeColor(color, false);
38      }
39  
40      public String toString() {
41          return super.toString() + "\n" + "  bkg.color=" + color;
42      }
43  }