Class MaterializeRegionDialog

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class MaterializeRegionDialog extends JDialog
An interactive prompt for SNTUI's "Materialize Region" command (Stream mode only): lets the user define the crop's size, center, and padding, with a live dimension/RAM estimate, then resolves the whole configuration into one BoundingBox for SNT.materializeDisplayCanvas(BoundingBox).
See Also:
  • Field Details

    • LARGE_MATERIALIZATION_WARN_BYTES

      public static final long LARGE_MATERIALIZATION_WARN_BYTES
      See Also:
    • LARGE_MATERIALIZATION_WARN_BYTES_STRING

      public static final String LARGE_MATERIALIZATION_WARN_BYTES_STRING
      See Also:
  • Constructor Details

    • MaterializeRegionDialog

      public MaterializeRegionDialog(SNTUI ui, SNT plugin)
  • Method Details

    • succeeded

      public boolean succeeded()
      Returns:
      true if the user confirmed the dialog (clicked "Materialize" with a valid configuration), false if canceled/dismissed
    • getResolvedBoundingBox

      public BoundingBox getResolvedBoundingBox()
      Returns:
      the resolved region, in world/calibrated units, ready for SNT.materializeDisplayCanvas(BoundingBox). Only valid if succeeded().
    • isSecondaryLayerScope

      public boolean isSecondaryLayerScope()
      Returns:
      true if "Scope" is set to the secondary (filtered) image, false for the main streamed source (the default, and the only option when no secondary image is loaded).
    • getEstimatedBytes

      public long getEstimatedBytes()
      Returns:
      the estimated size, in bytes, of the region returned by getResolvedBoundingBox() - i.e. exactly what SNT.estimateMaterializationBytes(long, long, long) reported for it the moment "Materialize" was pressed - or -1 if unavailable. Only valid if succeeded(). Callers wanting to warn about a long-running materialization should use this rather than recomputing the estimate themselves.