Exemplo n.º 1
0
 @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);
       }
     }
   }
 }
Exemplo n.º 2
0
 @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);
   }
 }
Exemplo n.º 3
0
  @Override
  void initialize() {
    super.initialize();

    Frame target = (Frame) this.target;

    if (target.getTitle() != null) {
      setTitle(target.getTitle());
    }
    setResizable(target.isResizable());
    setState(target.getExtendedState());
  }