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

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