home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 September / PCO_0998.ISO / browser / ns405lyc / nav40.z / java40.jar / sun / awt / windows / WDrawingSurfaceInfo.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-03-24  |  1.5 KB  |  75 lines

  1. package sun.awt.windows;
  2.  
  3. import java.awt.Rectangle;
  4. import java.awt.Shape;
  5. import java.awt.image.ColorModel;
  6. import sun.awt.DrawingSurfaceInfo;
  7. import sun.awt.PhysicalDrawingSurface;
  8. import sun.awt.Win32DrawingSurface;
  9. import sun.awt.image.ImageRepresentation;
  10.  
  11. class WDrawingSurfaceInfo implements DrawingSurfaceInfo, Win32DrawingSurface {
  12.    private int pData;
  13.    int state;
  14.    // $FF: renamed from: w int
  15.    int field_0;
  16.    // $FF: renamed from: h int
  17.    int field_1;
  18.    WComponentPeer peer;
  19.    ImageRepresentation imgrep;
  20.  
  21.    WDrawingSurfaceInfo(WComponentPeer var1) {
  22.       this.peer = var1;
  23.    }
  24.  
  25.    WDrawingSurfaceInfo(ImageRepresentation var1) {
  26.       this.imgrep = var1;
  27.    }
  28.  
  29.    protected void finalize() {
  30.       this.dispose();
  31.    }
  32.  
  33.    native void dispose();
  34.  
  35.    public native int lock();
  36.  
  37.    public native void unlock();
  38.  
  39.    public Rectangle getBounds() {
  40.       Rectangle var1;
  41.       if (this.peer != null) {
  42.          var1 = this.peer.target.bounds();
  43.          var1.setLocation(0, 0);
  44.       } else {
  45.          var1 = new Rectangle(0, 0, this.imgrep.width, this.imgrep.height);
  46.       }
  47.  
  48.       return var1;
  49.    }
  50.  
  51.    public PhysicalDrawingSurface getSurface() {
  52.       return this;
  53.    }
  54.  
  55.    public Shape getClip() {
  56.       return this.getBounds();
  57.    }
  58.  
  59.    public native int getHWnd();
  60.  
  61.    public native int getHBitmap();
  62.  
  63.    public native int getPBits();
  64.  
  65.    public native int getHDC();
  66.  
  67.    public native int getDepth();
  68.  
  69.    public native int getHPalette();
  70.  
  71.    public ColorModel getColorModel() {
  72.       return WToolkit.getStaticColorModel();
  73.    }
  74. }
  75.