home *** CD-ROM | disk | FTP | other *** search
/ PC-X 1997 June / pcx11_9706.iso / shutils / internet / browser / p32e40b5.exe / nav40.z / java40.jar / sun / awt / motif / MWindowPeer.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-05-23  |  2.3 KB  |  98 lines

  1. package sun.awt.motif;
  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 pDispose();
  25.  
  26.    MWindowPeer(Window var1) {
  27.       super(var1);
  28.       allWindows.addElement(this);
  29.       Font var2 = ((Component)var1).getFont();
  30.       if (var2 == null) {
  31.          var2 = new Font("Dialog", 0, 12);
  32.          ((Component)var1).setFont(var2);
  33.          ((MComponentPeer)this).setFont(var2);
  34.       }
  35.  
  36.       Color var3 = ((Component)var1).getBackground();
  37.       if (var3 == null) {
  38.          ((Component)var1).setBackground(Color.lightGray);
  39.          ((MComponentPeer)this).setBackground(Color.lightGray);
  40.       }
  41.  
  42.       var3 = ((Component)var1).getForeground();
  43.       if (var3 == null) {
  44.          ((Component)var1).setForeground(Color.black);
  45.          ((MComponentPeer)this).setForeground(Color.black);
  46.       }
  47.  
  48.    }
  49.  
  50.    public void dispose() {
  51.       allWindows.removeElement(this);
  52.       super.dispose();
  53.    }
  54.  
  55.    public void toFront() {
  56.       this.pShow();
  57.    }
  58.  
  59.    public native void toBack();
  60.  
  61.    public Insets insets() {
  62.       return this.insets;
  63.    }
  64.  
  65.    public void handleQuit() {
  66.       if (super.applet != null) {
  67.          XEvent var1 = new XEvent(new Event(super.target, 201, (Object)null), this);
  68.          super.applet.sendGUIEvent(var1);
  69.       } else {
  70.          super.target.postEvent(new Event(super.target, 201, (Object)null));
  71.       }
  72.    }
  73.  
  74.    public void handleIconify() {
  75.       if (super.applet != null) {
  76.          XEvent var1 = new XEvent(new Event(super.target, 203, (Object)null), this);
  77.          super.applet.sendGUIEvent(var1);
  78.       } else {
  79.          super.target.postEvent(new Event(super.target, 203, (Object)null));
  80.       }
  81.    }
  82.  
  83.    public void handleDeiconify() {
  84.       if (super.applet != null) {
  85.          XEvent var1 = new XEvent(new Event(super.target, 204, (Object)null), this);
  86.          super.applet.sendGUIEvent(var1);
  87.       } else {
  88.          super.target.postEvent(new Event(super.target, 204, (Object)null));
  89.       }
  90.    }
  91.  
  92.    public synchronized void handleResize(int var1, int var2) {
  93.       super.target.invalidate();
  94.       super.target.validate();
  95.       super.target.repaint();
  96.    }
  97. }
  98.