kit/src/main/java/com/oracle/javafx/scenebuilder/kit/preview/PreviewWindowController.java
Node updateAutoResizeTransform(Node whatever) {
    Node res = whatever;
    assert editorController.getFxomDocument() != null;

    if (editorController.is3D() && autoResize3DContent) {
      res.getTransforms().clear();
      final Bounds rootBounds = res.getLayoutBounds();
      // Content is 3D.
      // Zoom to get a TARGET_SIZE_3D size.
      final double scaleX = TARGET_SIZE_3D / rootBounds.getWidth();
      final double scaleY = TARGET_SIZE_3D / rootBounds.getHeight();
      final double scaleZ = TARGET_SIZE_3D / rootBounds.getDepth();
      final double scale = Math.min(scaleX, Math.min(scaleY, scaleZ));
      final double tX = -rootBounds.getMinX();
      final double tY = -rootBounds.getMinY();
      final double tZ = -rootBounds.getMinZ();
      res.getTransforms().add(new Scale(scale, scale, scale));
      res.getTransforms().add(new Translate(tX, tY, tZ));

      // Set the scene camera to PerspectiveCamera, to see 3D nodes correctly.
      setCameraType(CameraType.PERSPECTIVE);
    } else {
      setCameraType(CameraType.PARALLEL);
    }

    return res;
  }
// camera to become able to display it.
camera to become able to display it.
camera to become able to display it .
Node updateAutoResizeTransform(Node whatever) {
    Node res = whatever;
    assert editorController.getFxomDocument() != null;
    if (editorController.is3D() && autoResize3DContent) {
      res.getTransforms().clear();
      final Bounds rootBounds = res.getLayoutBounds();
      final double scaleX = TARGET_SIZE_3D / rootBounds.getWidth();
      final double scaleY = TARGET_SIZE_3D / rootBounds.getHeight();
      final double scaleZ = TARGET_SIZE_3D / rootBounds.getDepth();
      final double scale = Math.min(scaleX, Math.min(scaleY, scaleZ));
      final double tX = -rootBounds.getMinX();
      final double tY = -rootBounds.getMinY();
      final double tZ = -rootBounds.getMinZ();
      res.getTransforms().add(new Scale(scale, scale, scale));
      res.getTransforms().add(new Translate(tX, tY, tZ));
      setCameraType(CameraType.PERSPECTIVE);
    } else {
      setCameraType(CameraType.PARALLEL);
    }
    return res;
  }
Node updateAutoResizeTransform ( Node whatever ) { Node res = whatever ; assert editorController . getFxomDocument ( ) != null ; if ( editorController . is3D ( ) && autoResize3DContent ) { res . getTransforms ( ) . clear ( ) ; final Bounds rootBounds = res . getLayoutBounds ( ) ; final double scaleX = TARGET_SIZE_3D / rootBounds . getWidth ( ) ; final double scaleY = TARGET_SIZE_3D / rootBounds . getHeight ( ) ; final double scaleZ = TARGET_SIZE_3D / rootBounds . getDepth ( ) ; final double scale = Math . min ( scaleX , Math . min ( scaleY , scaleZ ) ) ; final double tX = - rootBounds . getMinX ( ) ; final double tY = - rootBounds . getMinY ( ) ; final double tZ = - rootBounds . getMinZ ( ) ; res . getTransforms ( ) . add ( new Scale ( scale , scale , scale ) ) ; res . getTransforms ( ) . add ( new Translate ( tX , tY , tZ ) ) ; setCameraType ( CameraType . PERSPECTIVE ) ; } else { setCameraType ( CameraType . PARALLEL ) ; } return res ; }
camera to become able to display it.
camera to become able to display it .
// Content is 3D. // Zoom to get a TARGET_SIZE_3D size. // Set the scene camera to PerspectiveCamera, to see 3D nodes correctly.