@SuppressWarnings("deprecation") public void setModalBlocked(Dialog dialog, boolean blocked) { synchronized ( ((Component) getTarget()).getTreeLock()) // State lock should always be after awtLock { // use WWindowPeer instead of WDialogPeer because of FileDialogs and PrintDialogs WWindowPeer blockerPeer = (WWindowPeer) dialog.getPeer(); if (blocked) { modalBlocker = blockerPeer; // handle native dialogs separately, as they may have not // got HWND yet; modalEnable/modalDisable is called from // their setHWnd() methods if (blockerPeer instanceof WFileDialogPeer) { ((WFileDialogPeer) blockerPeer).blockWindow(this); } else if (blockerPeer instanceof WPrintDialogPeer) { ((WPrintDialogPeer) blockerPeer).blockWindow(this); } else { modalDisable(dialog, blockerPeer.getHWnd()); } } else { modalBlocker = null; if (blockerPeer instanceof WFileDialogPeer) { ((WFileDialogPeer) blockerPeer).unblockWindow(this); } else if (blockerPeer instanceof WPrintDialogPeer) { ((WPrintDialogPeer) blockerPeer).unblockWindow(this); } else { modalEnable(dialog); } } } }
@Override public void reshape(int x, int y, int width, int height) { if (((Frame) target).isUndecorated()) { super.reshape(x, y, width, height); } else { reshapeFrame(x, y, width, height); } }
@Override void initialize() { super.initialize(); Frame target = (Frame) this.target; if (target.getTitle() != null) { setTitle(target.getTitle()); } setResizable(target.isResizable()); setState(target.getExtendedState()); }