@Override public void run() { Window dialog = previewPane.getScene().getWindow(); double currWidth = dialog.getWidth(); double currHeight = dialog.getHeight(); dialog.setWidth(Math.max(currWidth, 20 + previewPane.getLayoutX() + previewPane.getPrefWidth())); dialog.setHeight(20 + currHeight + previewPane.getPrefHeight()); updatePreview(); }
/** Checks the parent window/popup if its size is within parameters as set by the LC. */ private void adjustWindowSize() { BoundSize wBounds = layoutConstraints.getPackWidth(); BoundSize hBounds = layoutConstraints.getPackHeight(); Scene scene = getScene(); Window window = scene != null ? scene.getWindow() : null; if (window == null || wBounds == BoundSize.NULL_SIZE && hBounds == BoundSize.NULL_SIZE) return; Parent root = scene.getRoot(); double winWidth = window.getWidth(); double winHeight = window.getHeight(); double prefWidth = root.prefWidth(-1); double prefHeight = root.prefHeight(-1); FXContainerWrapper container = new FXContainerWrapper(root); double horIns = winWidth - scene.getWidth(); double verIns = winHeight - scene.getHeight(); double targetW = constrain(container, winWidth, prefWidth, wBounds) + horIns; double targetH = constrain(container, winHeight, prefHeight, hBounds) + verIns; double x = window.getX() - ((targetW - winWidth) * (1 - layoutConstraints.getPackWidthAlign())); double y = window.getY() - ((targetH - winHeight) * (1 - layoutConstraints.getPackHeightAlign())); window.setX(x); window.setY(y); window.setWidth(targetW); window.setHeight(targetH); }
if( getScene() != null && getScene().getWindow() != null ) { Window w = getScene().getWindow(); getScene().getWindow().setHeight(Util.unsignedConstraintValue(w.getHeight(), getMinHeight(), getMaxHeight()));
if( getScene() != null && getScene().getWindow() != null ) { Window w = getScene().getWindow(); getScene().getWindow().setHeight(Util.unsignedConstraintValue(w.getHeight(), getMinHeight(), getMaxHeight()));