1 |
/* Dialog.java -- An AWT dialog box |
/* Dialog.java -- An AWT dialog box |
2 |
Copyright (C) 1999 Free Software Foundation, Inc. |
Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
36 |
* A dialog box widget class. |
* A dialog box widget class. |
37 |
* |
* |
38 |
* @author Aaron M. Renn (arenn@urbanophile.com) |
* @author Aaron M. Renn (arenn@urbanophile.com) |
39 |
|
* @author Tom Tromey <tromey@redhat.com> |
40 |
*/ |
*/ |
41 |
public class Dialog extends Window implements java.io.Serializable |
public class Dialog extends Window implements java.io.Serializable |
42 |
{ |
{ |
143 |
setLayout(new BorderLayout()); |
setLayout(new BorderLayout()); |
144 |
} |
} |
145 |
|
|
146 |
|
public |
147 |
|
Dialog (Dialog owner) |
148 |
|
{ |
149 |
|
this (owner, "", false); |
150 |
|
} |
151 |
|
|
152 |
|
public |
153 |
|
Dialog (Dialog owner, String title) |
154 |
|
{ |
155 |
|
this (owner, title, false); |
156 |
|
} |
157 |
|
|
158 |
|
public |
159 |
|
Dialog (Dialog owner, String title, boolean modal) |
160 |
|
{ |
161 |
|
super (owner); |
162 |
|
this.modal = modal; |
163 |
|
this.title = title; |
164 |
|
setLayout (new BorderLayout ()); |
165 |
|
} |
166 |
|
|
167 |
/*************************************************************************/ |
/*************************************************************************/ |
168 |
|
|
169 |
/* |
/* |
192 |
setTitle(String title) |
setTitle(String title) |
193 |
{ |
{ |
194 |
this.title = title; |
this.title = title; |
195 |
|
if (peer != null) |
196 |
DialogPeer dp = (DialogPeer)getPeer(); |
{ |
197 |
if (dp != null) |
DialogPeer d = (DialogPeer) peer; |
198 |
dp.setTitle(title); |
d.setTitle (title); |
199 |
|
} |
200 |
} |
} |
201 |
|
|
202 |
/*************************************************************************/ |
/*************************************************************************/ |
254 |
setResizable(boolean resizable) |
setResizable(boolean resizable) |
255 |
{ |
{ |
256 |
this.resizable = resizable; |
this.resizable = resizable; |
257 |
|
if (peer != null) |
258 |
DialogPeer dp = (DialogPeer)getPeer(); |
{ |
259 |
if (dp != null) |
DialogPeer d = (DialogPeer) peer; |
260 |
dp.setResizable(resizable); |
d.setResizable (resizable); |
261 |
|
} |
262 |
} |
} |
263 |
|
|
264 |
/*************************************************************************/ |
/*************************************************************************/ |
269 |
public synchronized void |
public synchronized void |
270 |
addNotify() |
addNotify() |
271 |
{ |
{ |
272 |
if (getPeer() == null) |
if (peer == null) |
273 |
setPeer((ComponentPeer)getToolkit().createDialog(this)); |
peer = getToolkit ().createDialog (this); |
274 |
|
super.addNotify (); |
275 |
} |
} |
276 |
|
|
277 |
/*************************************************************************/ |
/*************************************************************************/ |
295 |
protected String |
protected String |
296 |
paramString() |
paramString() |
297 |
{ |
{ |
298 |
return(getClass().getName() + "(title+" + title + ",modal=" + modal + |
return ("title+" + title + ",modal=" + modal + |
299 |
",resizable=" + resizable + ")"); |
",resizable=" + resizable + "," + super.paramString()); |
300 |
} |
} |
301 |
|
|
302 |
} // class Dialog |
} // class Dialog |