sciview icon indicating copy to clipboard operation
sciview copied to clipboard

Support window dimension setters and automatic dimension adjustment on toggleVRRendering

Open smlpt opened this issue 1 year ago • 1 comments

Allow sciview to set custom width/height via API. This would be essential for rendering the exact resolutions required by VR headsets, as they simply mirror the sciview window.

smlpt avatar Jan 24 '25 13:01 smlpt

I've addressed all the feedback from the PR review and CI errors:

Fixes Applied:

  1. Fixed CI Build Error: Updated scijava-common version from 2.98.0 to 2.99.0 (the latest available version) to resolve the Maven dependency resolution issue.

  2. Added Test Documentation: Added comprehensive JavaDoc documentation to the testWindowSizing() method explaining what the test validates.

  3. Fixed Exception Handling: Changed from catching generic Exception to catching specific exceptions:

    • java.awt.HeadlessException for headless environments
    • UnsupportedOperationException for when display is not available
  4. Added Missing API: Added the SciView.create(width, height) static factory method overload to support creating SciView with custom window dimensions, which is essential for VR headsets.

The window sizing API now includes:

  • SciView.create(width, height) - Create SciView with custom dimensions
  • setWindowSize(width, height) - Dynamically resize the window
  • getWindowSize() - Get current window dimensions

All changes have been pushed to the add-window-size-api branch.

kephale avatar Aug 25 '25 00:08 kephale