home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 25 / CDROM25.iso / Share / prog / VJ11 / VJTRIAL.EXE / IE30Java.exe / classd.exe / sun / awt / win32 / MFramePeer.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-01-27  |  2.9 KB  |  131 lines

  1. package sun.awt.win32;
  2.  
  3. import java.awt.Color;
  4. import java.awt.Component;
  5. import java.awt.Event;
  6. import java.awt.Font;
  7. import java.awt.Frame;
  8. import java.awt.Image;
  9. import java.awt.Insets;
  10. import java.awt.MenuBar;
  11. import java.awt.peer.FramePeer;
  12. import java.util.Vector;
  13. import sun.awt.image.ImageRepresentation;
  14.  
  15. class MFramePeer extends MPanelPeer implements FramePeer {
  16.    Insets insets = new Insets(0, 0, 0, 0);
  17.    static Vector allFrames = new Vector();
  18.  
  19.    public void setTitle(String var1) {
  20.       this.pSetTitle(var1);
  21.    }
  22.  
  23.    public void setIconImage(Image var1) {
  24.       ImageRepresentation var2 = ((Win32Image)var1).getImageRep(-1, -1);
  25.       var2.reconstruct(32);
  26.       this.pSetIconImage(var2);
  27.    }
  28.  
  29.    public native void setMenuBar(MenuBar var1);
  30.  
  31.    public native void setResizable(boolean var1);
  32.  
  33.    public native void setCursor(int var1);
  34.  
  35.    native void create(MComponentPeer var1);
  36.  
  37.    native void pSetTitle(String var1);
  38.  
  39.    native void pShow();
  40.  
  41.    native void pHide();
  42.  
  43.    native void pReshape(int var1, int var2, int var3, int var4);
  44.  
  45.    native void pDispose();
  46.  
  47.    native void pSetIconImage(ImageRepresentation var1);
  48.  
  49.    native void setInsets(Insets var1);
  50.  
  51.    MFramePeer(Frame var1) {
  52.       super(var1);
  53.       this.setInsets(this.insets);
  54.       allFrames.addElement(this);
  55.       if (var1.getTitle() != null) {
  56.          this.pSetTitle(var1.getTitle());
  57.       }
  58.  
  59.       Font var2 = ((Component)var1).getFont();
  60.       if (var2 == null) {
  61.          var2 = new Font("Dialog", 0, 12);
  62.          ((Component)var1).setFont(var2);
  63.          ((MComponentPeer)this).setFont(var2);
  64.       }
  65.  
  66.       Color var3 = ((Component)var1).getBackground();
  67.       if (var3 == null) {
  68.          var3 = new Color(this.getWindowBackgroundColor());
  69.          ((Component)var1).setBackground(var3);
  70.          ((MComponentPeer)this).setBackground(var3);
  71.       }
  72.  
  73.       var3 = ((Component)var1).getForeground();
  74.       if (var3 == null) {
  75.          ((Component)var1).setForeground(Color.black);
  76.          ((MComponentPeer)this).setForeground(Color.black);
  77.       }
  78.  
  79.       Image var4 = var1.getIconImage();
  80.       if (var4 != null) {
  81.          this.setIconImage(var4);
  82.       }
  83.  
  84.       if (var1.getCursorType() != 0) {
  85.          this.setCursor(var1.getCursorType());
  86.       }
  87.  
  88.       this.setResizable(var1.isResizable());
  89.    }
  90.  
  91.    public void dispose() {
  92.       allFrames.removeElement(this);
  93.       super.dispose();
  94.    }
  95.  
  96.    public void handleQuit() {
  97.       super.target.postEvent(new Event(super.target, 201, (Object)null));
  98.    }
  99.  
  100.    public void handleIconify() {
  101.       super.target.postEvent(new Event(super.target, 203, (Object)null));
  102.    }
  103.  
  104.    public void handleDeiconify() {
  105.       super.target.postEvent(new Event(super.target, 204, (Object)null));
  106.    }
  107.  
  108.    public void toFront() {
  109.       ((MComponentPeer)this).show();
  110.    }
  111.  
  112.    public void toBack() {
  113.    }
  114.  
  115.    public synchronized void handleMoved(int var1, int var2) {
  116.       super.target.postEvent(new Event(super.target, 0L, 205, var1, var2, 0, 0));
  117.    }
  118.  
  119.    public synchronized void handleResize(int var1, int var2) {
  120.       super.target.invalidate();
  121.       super.target.validate();
  122.       super.target.repaint();
  123.    }
  124.  
  125.    public Insets insets() {
  126.       return this.insets;
  127.    }
  128.  
  129.    public native int getWindowBackgroundColor();
  130. }
  131.