private void onShownHandler(WindowEvent windowEvent) {
   dialogStage.sizeToScene();
   Window parent = dialogStage.getOwner();
   dialogStage.setX(parent.getX() + parent.getWidth() / 2 - dialogStage.getWidth() / 2);
   dialogStage.setY(parent.getY() + parent.getHeight() / 2 - dialogStage.getHeight() / 2);
   dialogStage.requestFocus();
 }
  public ConfigurationsDialogBuilder setOwner(Window owner) {
    if (owner != null) {
      dialog.initOwner(owner);
      dialog.borderPanel.setMaxWidth(owner.getWidth());
      dialog.borderPanel.setMaxHeight(owner.getHeight());
    } else {
      dialog.setWidth(1000);
      dialog.setHeight(700);
    }

    return this;
  }
 /*     */ public WCRectangle getViewBounds() /*     */ {
   /*  71 */ WebView localWebView = this.accessor.getView();
   /*  72 */ Window localWindow = null;
   /*  73 */ if ((localWebView != null)
       && (localWebView.getScene() != null)
       && ((localWindow = localWebView.getScene().getWindow()) != null))
   /*     */ {
     /*  77 */ return new WCRectangle(
         (float) localWindow.getX(),
         (float) localWindow.getY(),
         (float) localWindow.getWidth(),
         (float) localWindow.getHeight());
     /*     */ }
   /*     */
   /*  81 */ return null;
   /*     */ }
Example #4
0
 /** Bounds of Window on Screen. */
 public static Bounds bounds(Window window) {
   return bounds(window.getX(), window.getY(), window.getWidth(), window.getHeight());
 }