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);
  FX2ContainerWrapper container=new FX2ContainerWrapper(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);
}

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 ) ; FX2ContainerWrapper container = new FX2ContainerWrapper ( 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 ) ; }
checks the parent window / popup if its size is within parameters as set by the lc .
