home *** CD-ROM | disk | FTP | other *** search
- package java.awt;
-
- import java.awt.peer.DialogPeer;
-
- public class Dialog extends Window {
- boolean resizable;
- boolean modal;
- String title;
- private static final String base = "dialog";
- private static int nameCounter;
- private static final long serialVersionUID = 5920926903803293709L;
-
- public Dialog(Frame var1) {
- this(var1, "", false);
- }
-
- public Dialog(Frame var1, boolean var2) {
- this(var1, "", var2);
- }
-
- public Dialog(Frame var1, String var2) {
- this(var1, var2, false);
- }
-
- public Dialog(Frame var1, String var2, boolean var3) {
- super(var1);
- this.resizable = true;
- if (var1 == null) {
- throw new IllegalArgumentException("null parent frame");
- } else {
- super.name = "dialog" + nameCounter++;
- this.title = var2;
- this.modal = var3;
- }
- }
-
- public void addNotify() {
- if (super.peer == null) {
- super.peer = ((Window)this).getToolkit().createDialog(this);
- }
-
- super.addNotify();
- }
-
- public boolean isModal() {
- return this.modal;
- }
-
- public void setModal(boolean var1) {
- this.modal = var1;
- }
-
- public String getTitle() {
- return this.title;
- }
-
- public synchronized void setTitle(String var1) {
- this.title = var1;
- DialogPeer var2 = (DialogPeer)super.peer;
- if (var2 != null) {
- var2.setTitle(var1);
- }
-
- }
-
- public void show() {
- Object var1 = ((Component)this).getTreeLock();
- synchronized(var1){}
-
- try {
- if (super.parent != null && super.parent.getPeer() == null) {
- super.parent.addNotify();
- }
-
- if (super.peer == null) {
- this.addNotify();
- }
- } catch (Throwable var3) {
- throw var3;
- }
-
- ((Container)this).validate();
- if (super.visible) {
- ((Window)this).toFront();
- } else {
- super.visible = true;
- if (this.isModal()) {
- EventDispatchThread var4 = null;
- if (Thread.currentThread() instanceof EventDispatchThread) {
- var4 = new EventDispatchThread("AWT-Dispatch-Proxy", Toolkit.getEventQueue());
- ((Thread)var4).start();
- }
-
- if ((super.state & 1) == 0) {
- ((Window)this).postWindowEvent(200);
- super.state |= 1;
- }
-
- super.peer.show();
- if (var4 != null) {
- var4.stopDispatching();
- return;
- }
- } else {
- super.peer.show();
- if ((super.state & 1) == 0) {
- ((Window)this).postWindowEvent(200);
- super.state |= 1;
- }
- }
-
- }
- }
-
- public boolean isResizable() {
- return this.resizable;
- }
-
- public synchronized void setResizable(boolean var1) {
- this.resizable = var1;
- DialogPeer var2 = (DialogPeer)super.peer;
- if (var2 != null) {
- var2.setResizable(var1);
- }
-
- }
-
- protected String paramString() {
- String var1 = super.paramString() + (this.modal ? ",modal" : ",modeless");
- if (this.title != null) {
- var1 = var1 + ",title=" + this.title;
- }
-
- return var1;
- }
- }
-