Class Dialogs

java.lang.Object
qupath.lib.gui.dialogs.Dialogs

@Deprecated public class Dialogs extends Object
Deprecated.
since v0.5.0.
Legacy class, deprecated since v0.5.0. Replaced by Dialogs and FileChoosers.
  • Constructor Details

    • Dialogs

      public Dialogs()
      Deprecated.
  • Method Details

    • showConfirmDialog

      public static boolean showConfirmDialog(String title, String text)
      Deprecated.
      Show a confirm dialog (OK/Cancel).
      Parameters:
      title -
      text -
      Returns:
    • showMessageDialog

      public static boolean showMessageDialog(String title, Node node)
      Deprecated.
      Show a message dialog (OK button only), with the content contained within a Node.
      Parameters:
      title -
      node -
      Returns:
    • showMessageDialog

      public static boolean showMessageDialog(String title, String message)
      Deprecated.
      Show a standard message dialog.
      Parameters:
      title -
      message -
      Returns:
    • showConfirmDialog

      public static boolean showConfirmDialog(String title, Node node)
      Deprecated.
      Show a confirm dialog (OK/Cancel).
      Parameters:
      title -
      node -
      Returns:
    • showYesNoDialog

      public static boolean showYesNoDialog(String title, String text)
      Deprecated.
      Show a Yes/No dialog.
      Parameters:
      title -
      text -
      Returns:
    • showYesNoCancelDialog

      public static Dialogs.DialogButton showYesNoCancelDialog(String title, String text)
      Deprecated.
      Show a Yes/No/Cancel dialog.
      Parameters:
      title - dialog box title
      text - prompt message
      Returns:
      a Dialogs.DialogButton indicating the response (YES, NO, CANCEL)
    • showParameterDialog

      public static boolean showParameterDialog(String title, ParameterList params)
      Deprecated.
      Show a (modal) dialog for a specified ParameterList.
      Parameters:
      title -
      params -
      Returns:
      False if the user pressed 'cancel', true otherwise
    • showInputDialog

      public static Double showInputDialog(String title, String message, Double initialInput)
      Deprecated.
      Show an input dialog requesting a numeric value. Only scientific notation and digits with/without a decimal separator (e.g. ".") are permitted.
      Parameters:
      title -
      message -
      initialInput -
      Returns:
      Number input by the user, or NaN if no valid number was entered, or null if cancel was pressed.
    • showInputDialog

      public static String showInputDialog(String title, String message, String initialInput)
      Deprecated.
      Show an input dialog requesting a String input.
      Parameters:
      title -
      message -
      initialInput -
      Returns:
    • showChoiceDialog

      public static <T> T showChoiceDialog(String title, String message, T[] choices, T defaultChoice)
      Deprecated.
      Show a choice dialog with an array of choices (selection from ComboBox or similar).
      Type Parameters:
      T -
      Parameters:
      title - dialog title
      message - dialog prompt
      choices - array of available options
      defaultChoice - initial selected option
      Returns:
      chosen option, or null if the user cancels the dialog
    • showChoiceDialog

      public static <T> T showChoiceDialog(String title, String message, Collection<T> choices, T defaultChoice)
      Deprecated.
      Show a choice dialog with a collection of choices (selection from ComboBox or similar).
      Type Parameters:
      T -
      Parameters:
      title - dialog title
      message - dialog prompt
      choices - list of available options
      defaultChoice - initial selected option
      Returns:
      chosen option, or null if the user cancels the dialog
    • showErrorMessage

      public static void showErrorMessage(String title, Throwable e)
      Deprecated.
      Show an error message, displaying the localized message of a Throwable.
      Parameters:
      title -
      e -
    • showErrorNotification

      public static void showErrorNotification(String title, Throwable e)
      Deprecated.
      Show an error notification, displaying the localized message of a Throwable.
      Parameters:
      title -
      e -
    • showErrorNotification

      public static void showErrorNotification(String title, String message)
      Deprecated.
      Show an error notification.
      Parameters:
      title -
      message -
    • showWarningNotification

      public static void showWarningNotification(String title, String message)
      Deprecated.
      Show a warning notification.
      Parameters:
      title -
      message -
    • showInfoNotification

      public static void showInfoNotification(String title, String message)
      Deprecated.
      Show an info notification.
      Parameters:
      title -
      message -
    • showPlainNotification

      public static void showPlainNotification(String title, String message)
      Deprecated.
      Show a plain notification.
      Parameters:
      title -
      message -
    • showNoImageError

      public static void showNoImageError(String title)
      Deprecated.
      Show an error message that no image is available. This is included to help standardize the message throughout the software.
      Parameters:
      title -
    • showNoProjectError

      public static void showNoProjectError(String title)
      Deprecated.
      Show an error message that no project is available. This is included to help standardize the message throughout the software.
      Parameters:
      title -
    • showErrorMessage

      public static void showErrorMessage(String title, String message)
      Deprecated.
      Show an error message.
      Parameters:
      title -
      message -
    • showErrorMessage

      public static void showErrorMessage(String title, Node node)
      Deprecated.
      Show an error message, with the content defined within a Node.
      Parameters:
      title -
      node -
    • showPlainMessage

      public static void showPlainMessage(String title, String message)
      Deprecated.
      Show a plain message.
      Parameters:
      title -
      message -
    • showTextWindow

      public static void showTextWindow(Window owner, String title, String contents, Modality modality, boolean isEditable)
      Deprecated.
      Show a window containing plain text, with the specified properties.
      Parameters:
      owner -
      title -
      contents -
      modality -
      isEditable -
    • promptForMultipleFiles

      public static List<File> promptForMultipleFiles(String title, File dirBase, String filterDescription, String... exts)
      Deprecated.
      Prompt to open a list of files.
      Parameters:
      title -
      dirBase -
      filterDescription -
      exts -
      Returns:
    • promptForDirectory

      public static File promptForDirectory(File dirBase)
      Deprecated.
      Prompt user to select a directory.
      Parameters:
      dirBase - base directory to display; if null or not an existing directory, the value under getLastDirectory() should be used
      Returns:
      selected directory, or null if no directory was selected
    • promptForDirectory

      public static File promptForDirectory(String title, File dirBase)
      Deprecated.
      Prompt user to select a directory.
      Parameters:
      title - the title to display for the dialog (may be null to use default)
      dirBase - base directory to display; if null or not an existing directory, the value under getLastDirectory() should be used
      Returns:
      selected directory, or null if no directory was selected
    • promptForFile

      public static File promptForFile(String title, File dirBase, String filterDescription, String... exts)
      Deprecated.
      Prompt the user for a file with some kind of file dialog.
      Parameters:
      title - the title to display for the dialog (may be null to use default)
      dirBase - base directory to display; if null or not an existing directory, the value under getLastDirectory() should be used
      filterDescription - description to (possibly) show for the file name filter (may be null if no filter should be used)
      exts - optional array of file extensions if filterDescription is not null
      Returns:
      the File selected by the user, or null if the dialog was cancelled
    • promptForFile

      public static File promptForFile(File dirBase)
      Deprecated.
      Prompt user to select a file.
      Parameters:
      dirBase - base directory to display; if null or not an existing directory, the value under getLastDirectory() should be used
      Returns:
      the File selected by the user, or null if the dialog was cancelled
    • promptToSaveFile

      public static File promptToSaveFile(String title, File dirBase, String defaultName, String filterName, String ext)
      Deprecated.
      Prompt user to select a file path to save.
      Parameters:
      title - the title to display for the dialog (may be null)
      dirBase - the base directory to display; if null or not an existing directory, the value under getLastDirectory() should be used
      defaultName - default file name
      filterName - description to show for the file name filter (may be null if no filter should be used)
      ext - extension that should be used for the saved file (may be empty or null if not specified)
      Returns:
      the File selected by the user, or null if the dialog was cancelled
    • promptToSaveFile

      public static File promptToSaveFile(String title, File dirBase, String defaultName, Map<String,String> filters)
      Deprecated.
      Prompt user to select a file path to save, providing zero or more file extensions as an option.
      Parameters:
      title - the title to display for the dialog (may be null)
      dirBase - the base directory to display; if null or not an existing directory, the value under getLastDirectory() should be used
      defaultName - default file name
      filters - map of file type descriptions (keys) and file extensions (values); may be empty if an 'all files' filter should be used
      Returns:
      the File selected by the user, or null if the dialog was cancelled
      Since:
      v0.4.0
    • promptForFilePathOrURL

      public static String promptForFilePathOrURL(String title, String defaultPath, File dirBase, String filterDescription, String... exts)
      Deprecated.
      Prompt user to select a file or input a URL.
      Parameters:
      title - dialog title
      defaultPath - default path to display - may be null
      dirBase - base directory to display; if null or not an existing directory, the value under getLastDirectory() should be used
      filterDescription - description to (possibly) show for the file name filter (may be null if no filter should be used)
      exts - optional array of file extensions if filterDescription is not null
      Returns:
      the path to the file or URL, or null if no path was provided.
    • getChooser

      public static qupath.lib.gui.dialogs.QuPathChooser getChooser(Window window)
      Deprecated.
      Get a QuPathChooser instance linked to a specific window. This may both influence the display of the chooser (by setting the parent window) and the starting directory (by remembering the last known directory for the chooser).
      Parameters:
      window -
      Returns:
      a QuPathChooser associated with the specified window.
    • builder

      public static Dialogs.Builder builder()
      Deprecated.
      Create a new builder to generate a custom dialog.
      Returns: