home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 139 / dpcs0999.iso / Web / CFserver / data1.cab / Java / netscape / application / WindowContentView.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-04-12  |  2.6 KB  |  76 lines

  1. package netscape.application;
  2.  
  3. import netscape.util.ClassInfo;
  4. import netscape.util.CodingException;
  5. import netscape.util.Decoder;
  6. import netscape.util.Encoder;
  7.  
  8. public class WindowContentView extends View {
  9.    Color _color;
  10.    boolean transparent;
  11.    static final String COLOR_KEY = "color";
  12.    static final String TRANSPARENT_KEY = "transparent";
  13.  
  14.    public WindowContentView() {
  15.       this(0, 0, 0, 0);
  16.    }
  17.  
  18.    public WindowContentView(Rect var1) {
  19.       this(var1.x, var1.y, var1.width, var1.height);
  20.    }
  21.  
  22.    public WindowContentView(int var1, int var2, int var3, int var4) {
  23.       super(var1, var2, var3, var4);
  24.       this.transparent = false;
  25.       this._color = Color.lightGray;
  26.    }
  27.  
  28.    public void setColor(Color var1) {
  29.       this.setBackgroundColor(var1);
  30.    }
  31.  
  32.    public void setBackgroundColor(Color var1) {
  33.       this._color = var1;
  34.    }
  35.  
  36.    public Color backgroundColor() {
  37.       return this._color;
  38.    }
  39.  
  40.    public void setTransparent(boolean var1) {
  41.       this.transparent = var1;
  42.    }
  43.  
  44.    public boolean isTransparent() {
  45.       return this.transparent;
  46.    }
  47.  
  48.    public void drawView(Graphics var1) {
  49.       InternalWindow var2 = ((View)this).window();
  50.       if (this._color != null && !this.isTransparent() && !var2.isTransparent()) {
  51.          var1.setColor(this._color);
  52.          int var3 = ((View)this).subviewCount();
  53.          var1.fillRect(0, 0, ((View)this).width(), ((View)this).height());
  54.       }
  55.    }
  56.  
  57.    public void describeClassInfo(ClassInfo var1) {
  58.       super.describeClassInfo(var1);
  59.       var1.addClass("netscape.application.WindowContentView", 1);
  60.       var1.addField("color", (byte)18);
  61.       var1.addField("transparent", (byte)0);
  62.    }
  63.  
  64.    public void encode(Encoder var1) throws CodingException {
  65.       super.encode(var1);
  66.       var1.encodeObject("color", this._color);
  67.       var1.encodeBoolean("transparent", this.transparent);
  68.    }
  69.  
  70.    public void decode(Decoder var1) throws CodingException {
  71.       super.decode(var1);
  72.       this._color = (Color)var1.decodeObject("color");
  73.       this.transparent = var1.decodeBoolean("transparent");
  74.    }
  75. }
  76.