home *** CD-ROM | disk | FTP | other *** search
- package sun.awt.windows;
-
- import java.awt.Component;
- import java.awt.Dialog;
- import java.awt.Event;
- import java.awt.peer.DialogPeer;
-
- class WDialogPeer extends WWindowPeer implements DialogPeer {
- boolean notify = false;
-
- native void create(WComponentPeer var1);
-
- public native void setTitle(String var1);
-
- public native void setResizable(boolean var1);
-
- public native void showModal(boolean var1);
-
- public native void hideModal();
-
- WDialogPeer(Dialog target) {
- super(target);
- if (target.getTitle() != null) {
- this.setTitle(target.getTitle());
- }
-
- this.setResizable(target.isResizable());
- }
-
- public void dispose() {
- this.hide();
- super.dispose();
- }
-
- public void show() {
- if (((Dialog)super.target).isModal()) {
- if (((WToolkit)((WComponentPeer)this).getToolkit()).getCallbackThread() == Thread.currentThread()) {
- this.showModal(true);
- } else {
- this.showModal(false);
- Component var1 = super.target;
- synchronized(var1){}
-
- try {
- this.notify = true;
-
- try {
- super.target.wait(0L);
- } catch (InterruptedException var4) {
- }
- } catch (Throwable var5) {
- throw var5;
- }
-
- }
- } else {
- super.show();
- }
- }
-
- public void hide() {
- if (((Dialog)super.target).isModal()) {
- if (this.notify) {
- Component var1 = super.target;
- synchronized(var1){}
-
- try {
- this.notify = false;
-
- try {
- super.target.notifyAll();
- } catch (IllegalMonitorStateException var4) {
- }
- } catch (Throwable var5) {
- throw var5;
- }
- }
-
- this.hideModal();
- } else {
- super.hide();
- }
- }
-
- public synchronized void handleMoved(long when, int data, int x, int y) {
- super.target.postEvent(new Event(super.target, 0L, 205, x, y, 0, 0));
- }
-
- public void handleIconify(long when) {
- super.target.postEvent(new Event(super.target, 203, (Object)null));
- }
-
- public void handleDeiconify(long when) {
- super.target.postEvent(new Event(super.target, 204, (Object)null));
- }
-
- protected void handleResize(long when, int u1, int width, int height, int u4, int u5) {
- super.target.invalidate();
- super.target.validate();
- super.target.repaint();
- }
- }
-