home *** CD-ROM | disk | FTP | other *** search
- package sun.awt.win32;
-
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Dialog;
- import java.awt.Event;
- import java.awt.Font;
- import java.awt.Insets;
- import java.awt.peer.DialogPeer;
- import java.util.Vector;
-
- class MDialogPeer extends MPanelPeer implements DialogPeer {
- Insets insets = new Insets(0, 0, 0, 0);
- static Vector allDialogs = new Vector();
-
- public void setTitle(String var1) {
- this.pSetTitle(var1);
- }
-
- public native void setResizable(boolean var1);
-
- native void create(MComponentPeer var1);
-
- native void pSetTitle(String var1);
-
- native void pShow();
-
- native void pHide();
-
- native void pReshape(int var1, int var2, int var3, int var4);
-
- native void pDispose();
-
- native void setInsets(Insets var1);
-
- MDialogPeer(Dialog var1) {
- super(var1);
- this.setInsets(this.insets);
- allDialogs.addElement(this);
- if (var1.getTitle() != null) {
- this.pSetTitle(var1.getTitle());
- }
-
- Font var2 = ((Component)var1).getFont();
- if (var2 == null) {
- var2 = new Font("Dialog", 1, 10);
- ((Component)var1).setFont(var2);
- ((MComponentPeer)this).setFont(var2);
- }
-
- Color var3 = ((Component)var1).getBackground();
- if (var3 == null) {
- ((Component)var1).setBackground(Color.lightGray);
- ((MComponentPeer)this).setBackground(Color.lightGray);
- }
-
- var3 = ((Component)var1).getForeground();
- if (var3 == null) {
- ((Component)var1).setForeground(Color.black);
- ((MComponentPeer)this).setForeground(Color.black);
- }
-
- this.setResizable(var1.isResizable());
- }
-
- public void dispose() {
- allDialogs.removeElement(this);
- super.dispose();
- }
-
- public synchronized void handleMoved(int var1, int var2) {
- super.target.postEvent(new Event(super.target, 0L, 205, var1, var2, 0, 0));
- }
-
- public void handleQuit() {
- super.target.postEvent(new Event(super.target, 201, (Object)null));
- }
-
- public void handleIconify() {
- super.target.postEvent(new Event(super.target, 203, (Object)null));
- }
-
- public void handleDeiconify() {
- super.target.postEvent(new Event(super.target, 204, (Object)null));
- }
-
- public void show() {
- if (((Dialog)super.target).isModal()) {
- ModalThread var1 = new ModalThread(this);
- synchronized(var1){}
-
- try {
- try {
- ((Thread)var1).start();
- var1.wait();
- } catch (InterruptedException var5) {
- }
- } catch (Throwable var6) {
- throw var6;
- }
- } else {
- this.pShow();
- }
-
- }
-
- public void toFront() {
- this.pShow();
- }
-
- public void toBack() {
- }
-
- public Insets insets() {
- return this.insets;
- }
-
- public synchronized void handleResize(int var1, int var2) {
- super.target.invalidate();
- super.target.validate();
- super.target.repaint();
- }
- }
-