home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 25 / CDROM25.iso / Share / prog / VJ11 / VJTRIAL.EXE / IE30Java.exe / classd.exe / sun / awt / win32 / MWindowPeer.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-01-27  |  2.3 KB  |  87 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.Insets;
  8. import java.awt.Window;
  9. import java.awt.peer.WindowPeer;
  10. import java.util.Vector;
  11.  
  12. class MWindowPeer extends MPanelPeer implements WindowPeer {
  13.    Insets insets = new Insets(0, 0, 0, 0);
  14.    static Vector allWindows = new Vector();
  15.  
  16.    native void create(MComponentPeer var1);
  17.  
  18.    native void pShow();
  19.  
  20.    native void pHide();
  21.  
  22.    native void pReshape(int var1, int var2, int var3, int var4);
  23.  
  24.    native void setInsets(Insets var1);
  25.  
  26.    native void pDispose();
  27.  
  28.    MWindowPeer(Window var1) {
  29.       super(var1);
  30.       this.setInsets(this.insets);
  31.       allWindows.addElement(this);
  32.       Font var2 = ((Component)var1).getFont();
  33.       if (var2 == null) {
  34.          var2 = new Font("Dialog", 0, 10);
  35.          ((Component)var1).setFont(var2);
  36.          ((MComponentPeer)this).setFont(var2);
  37.       }
  38.  
  39.       Color var3 = ((Component)var1).getBackground();
  40.       if (var3 == null) {
  41.          ((Component)var1).setBackground(Color.lightGray);
  42.          ((MComponentPeer)this).setBackground(Color.lightGray);
  43.       }
  44.  
  45.       var3 = ((Component)var1).getForeground();
  46.       if (var3 == null) {
  47.          ((Component)var1).setForeground(Color.black);
  48.          ((MComponentPeer)this).setForeground(Color.black);
  49.       }
  50.  
  51.    }
  52.  
  53.    public void dispose() {
  54.       allWindows.removeElement(this);
  55.       super.dispose();
  56.    }
  57.  
  58.    public void toFront() {
  59.       ((MComponentPeer)this).show();
  60.    }
  61.  
  62.    public void toBack() {
  63.    }
  64.  
  65.    public Insets insets() {
  66.       return this.insets;
  67.    }
  68.  
  69.    public void handleQuit() {
  70.       super.target.postEvent(new Event(super.target, 201, (Object)null));
  71.    }
  72.  
  73.    public void handleIconify() {
  74.       super.target.postEvent(new Event(super.target, 203, (Object)null));
  75.    }
  76.  
  77.    public void handleDeiconify() {
  78.       super.target.postEvent(new Event(super.target, 204, (Object)null));
  79.    }
  80.  
  81.    public synchronized void handleResize(int var1, int var2) {
  82.       super.target.invalidate();
  83.       super.target.validate();
  84.       super.target.repaint();
  85.    }
  86. }
  87.