home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 April / DPPCPRO0499.ISO / April / Notes / 50b2wic.exe / DATA1.CAB / NotesProgramFilesJavaSupport / rt.jar / sun / awt / windows / WFramePeer.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-04-23  |  2.1 KB  |  59 lines

  1. package sun.awt.windows;
  2.  
  3. import java.awt.Component;
  4. import java.awt.Cursor;
  5. import java.awt.Dimension;
  6. import java.awt.Frame;
  7. import java.awt.Image;
  8. import java.awt.MenuBar;
  9. import java.awt.peer.FramePeer;
  10. import sun.awt.image.ImageRepresentation;
  11.  
  12. class WFramePeer extends WWindowPeer implements FramePeer {
  13.    public Dimension minimumSize() {
  14.       int var1 = ((Frame)super.target).getMenuBar() != null ? 45 : 30;
  15.       return new Dimension(30, var1);
  16.    }
  17.  
  18.    public void setIconImage(Image var1) {
  19.       ImageRepresentation var2 = ((WImage)var1).getImageRep();
  20.       var2.reconstruct(32);
  21.       this._setIconImage(var2);
  22.    }
  23.  
  24.    public void setMenuBar(MenuBar var1) {
  25.       WMenuBarPeer var2 = (WMenuBarPeer)WToolkit.targetToPeer(var1);
  26.       this.setMenuBar0(var2);
  27.       ((WWindowPeer)this).updateInsets(super.insets_);
  28.    }
  29.  
  30.    private native void setMenuBar0(WMenuBarPeer var1);
  31.  
  32.    WFramePeer(Frame var1) {
  33.       super(var1);
  34.    }
  35.  
  36.    native void create(WComponentPeer var1);
  37.  
  38.    void initialize() {
  39.       super.initialize();
  40.       Frame var1 = (Frame)super.target;
  41.       if (var1.getTitle() != null) {
  42.          ((WWindowPeer)this).setTitle(var1.getTitle());
  43.       }
  44.  
  45.       ((WWindowPeer)this).setResizable(var1.isResizable());
  46.       Image var2 = var1.getIconImage();
  47.       if (var2 != null) {
  48.          this.setIconImage(var2);
  49.       }
  50.  
  51.       if (!((Component)var1).getCursor().equals(Cursor.getDefaultCursor())) {
  52.          ((WComponentPeer)this).setCursor(((Component)var1).getCursor());
  53.       }
  54.  
  55.    }
  56.  
  57.    native void _setIconImage(ImageRepresentation var1);
  58. }
  59.