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

  1. package netscape.application;
  2.  
  3. import java.awt.Graphics;
  4.  
  5. class GraphicsState implements Cloneable {
  6.    Graphics awtGraphics;
  7.    Font font;
  8.    Color color;
  9.    Rect clipRect;
  10.    Rect absoluteClipRect;
  11.    int xOffset;
  12.    int yOffset;
  13.    Color xorColor;
  14.    int debugOptions;
  15.    static final int LOG_OPTION = 1;
  16.    static final int FLASH_OPTION = 2;
  17.    static final int BUFFERED_OPTION = 4;
  18.    static final int NONE_OPTION = -1;
  19.  
  20.    public Object clone() {
  21.       GraphicsState var1 = null;
  22.  
  23.       try {
  24.          var1 = (GraphicsState)super.clone();
  25.       } catch (Exception var2) {
  26.       }
  27.  
  28.       if (var1 != null) {
  29.          var1.clipRect = null;
  30.          var1.absoluteClipRect = null;
  31.          var1.awtGraphics = null;
  32.       }
  33.  
  34.       return var1;
  35.    }
  36.  
  37.    public String toString() {
  38.       StringBuffer var1 = new StringBuffer();
  39.       var1.append("Font: " + this.font + ", ");
  40.       var1.append("Color: " + this.color + ", ");
  41.       var1.append("Translation: (" + this.xOffset + ", " + this.yOffset + "), ");
  42.       var1.append("xor: " + this.xorColor + ", ");
  43.       var1.append("absoluteClipRect: " + this.absoluteClipRect + ", ");
  44.       var1.append("debugOption: " + this.debugOptions);
  45.       return var1.toString();
  46.    }
  47.  
  48.    boolean debugLog() {
  49.       return (this.debugOptions & 1) == 1;
  50.    }
  51.  
  52.    boolean debugFlash() {
  53.       return (this.debugOptions & 2) == 2;
  54.    }
  55.  
  56.    boolean debugBuffered() {
  57.       return (this.debugOptions & 4) == 4;
  58.    }
  59. }
  60.