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

  1. package sun.awt.windows;
  2.  
  3. import java.awt.Color;
  4. import java.awt.Component;
  5. import java.awt.Font;
  6. import java.awt.Window;
  7. import java.awt.peer.WindowPeer;
  8. import java.util.Vector;
  9.  
  10. class WWindowPeer extends WContainerPeer implements WindowPeer {
  11.    static Vector allWindows = new Vector();
  12.  
  13.    native void create(WComponentPeer var1);
  14.  
  15.    public synchronized native void toFront();
  16.  
  17.    public native void toBack();
  18.  
  19.    WWindowPeer(Window var1) {
  20.       super(var1);
  21.       allWindows.addElement(this);
  22.       if (super.applet != null) {
  23.          super.applet.addTopLevelWindow(var1);
  24.       }
  25.  
  26.       Font var2 = ((Component)var1).getFont();
  27.       if (var2 == null) {
  28.          var2 = new Font("Dialog", 0, 12);
  29.          ((Component)var1).setFont(var2);
  30.          ((WComponentPeer)this).setFont(var2);
  31.       }
  32.  
  33.       Color var3 = ((Component)var1).getBackground();
  34.       if (var3 == null) {
  35.          ((Component)var1).setBackground(Color.lightGray);
  36.          ((WComponentPeer)this).setBackground(Color.lightGray);
  37.       }
  38.  
  39.       var3 = ((Component)var1).getForeground();
  40.       if (var3 == null) {
  41.          ((Component)var1).setForeground(Color.black);
  42.          ((WComponentPeer)this).setForeground(Color.black);
  43.       }
  44.  
  45.    }
  46.  
  47.    public void dispose() {
  48.       allWindows.removeElement(this);
  49.       if (super.applet != null) {
  50.          super.applet.removeTopLevelWindow((Window)super.target);
  51.       }
  52.  
  53.       super.dispose();
  54.    }
  55. }
  56.