Class PamDialogFX<T>

java.lang.Object
javafx.scene.control.Dialog<T>
pamViewFX.fxNodes.pamDialogFX.PamDialogFX<T>
All Implemented Interfaces:
javafx.event.EventTarget
Direct Known Subclasses:
PamSettingsDialogFX, SettingsDialog

public abstract class PamDialogFX<T> extends javafx.scene.control.Dialog<T>
Creates a dialog with some useful PAMGUARD customisation.
Author:
Jamie Macaulay
  • Property Summary

    Properties inherited from class javafx.scene.control.Dialog

    contentText, dialogPane, graphic, headerText, height, onCloseRequest, onHidden, onHiding, onShowing, onShown, resizable, resultConverter, result, showing, title, width, x, y
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a standard dialog.
    PamDialogFX(javafx.stage.Window window, String title, javafx.stage.StageStyle style)
    Creates a PAM settings dialog.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract T
    This is called whenever the dialog is successfully closes.
    void
    Pack the dialog.
    void
    setContent(javafx.scene.Node content)
    Convenience class to set dialog.
    void
    setExpandableContent(javafx.scene.Node content)
    Set expandable content.
    void
    setOpeningLocation(javafx.geometry.Point2D p2d)
    Set the opening location of the dialog.
    abstract void
    setParams(T input)
    Optional function used to set controls in the dialog to the correct setting for input params.
    showDialog(T input, javafx.geometry.Point2D p2d)
    Convenience class to show dialog
    static boolean
    showError(String content)
    Show error dialog with default OK and CANCEL.
    static boolean
    showError(String title, String content)
    Show error dialog with default OK and CANCEL.
    static boolean
    showMessageDialog(String title, String content)
    Show a message dialog
    static boolean
    showMessageDialog(javafx.stage.Window owner, String title, String content)
    Show a message dialog
    static boolean
    showMessageDialog(javafx.stage.Window owner, String title, String content, javafx.scene.control.Alert.AlertType alertType)
    Show a message dialog with default OK and Close buttons.
    static boolean
    showMessageDialog(javafx.stage.Window owner, String string, String string2, javafx.scene.control.ButtonType yes, javafx.scene.control.ButtonType cancel)
     
    static boolean
    showMessageDialog(javafx.stage.Window owner, String title, String content, javafx.scene.control.ButtonType yesButton, javafx.scene.control.ButtonType noButton, javafx.scene.control.Alert.AlertType alertType)
    Show a message dialog
    void
    Shows a warning message when getParams() returns null.
    static boolean
     
    static boolean
    showWarning(javafx.stage.Stage guiFrame, String title, String content)
    Show a warning message dialog

    Methods inherited from class javafx.scene.control.Dialog

    addEventFilter, addEventHandler, buildEventDispatchChain, close, contentTextProperty, dialogPaneProperty, getContentText, getDialogPane, getGraphic, getHeaderText, getHeight, getModality, getOnCloseRequest, getOnHidden, getOnHiding, getOnShowing, getOnShown, getOwner, getResult, getResultConverter, getTitle, getWidth, getX, getY, graphicProperty, headerTextProperty, heightProperty, hide, initModality, initOwner, initStyle, isResizable, isShowing, onCloseRequestProperty, onHiddenProperty, onHidingProperty, onShowingProperty, onShownProperty, removeEventFilter, removeEventHandler, resizableProperty, resultConverterProperty, resultProperty, setContentText, setDialogPane, setGraphic, setHeaderText, setHeight, setOnCloseRequest, setOnHidden, setOnHiding, setOnShowing, setOnShown, setResizable, setResult, setResultConverter, setTitle, setWidth, setX, setY, show, showAndWait, showingProperty, titleProperty, widthProperty, xProperty, yProperty

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PamDialogFX

      public PamDialogFX()
      Creates a standard dialog. This does not call getParams() on close.
    • PamDialogFX

      public PamDialogFX(javafx.stage.Window window, String title, javafx.stage.StageStyle style)
      Creates a PAM settings dialog. On closing the dialog will call getParams(). If getParams()==null then the dialog assumes an error has occurred and will close.
      Parameters:
      window - - the owner window.
      title - - title of dialog
      style - - style of dialog
  • Method Details

    • showParamsWarning

      public void showParamsWarning()
      Shows a warning message when getParams() returns null. Can be overriden to show specific error message
    • showDialog

      public T showDialog(T input, javafx.geometry.Point2D p2d)
      Convenience class to show dialog
      Parameters:
      input - -input class- usually contains params for the dialog.
      p2d - - point on the screen in pixels to open dialog (not point within owner)
      Returns:
    • setParams

      public abstract void setParams(T input)
      Optional function used to set controls in the dialog to the correct setting for input params.
      Parameters:
      input - - the input params.
    • getParams

      public abstract T getParams()
      This is called whenever the dialog is successfully closes.
      Returns:
      the new params
    • setContent

      public void setContent(javafx.scene.Node content)
      Convenience class to set dialog. et the content main content node.
      Parameters:
      content - - content for main content node.
    • setExpandableContent

      public void setExpandableContent(javafx.scene.Node content)
      Set expandable content. This lies in a hiding pane below the main content pane and can be expanded by user.
      Parameters:
      content - . Node to sit in expanded content node.
    • setOpeningLocation

      public void setOpeningLocation(javafx.geometry.Point2D p2d)
      Set the opening location of the dialog.
      Parameters:
      p2D - . The opening location of the top left corner of the dialog in screen co-ordinates. Set null for default behaviour.
    • showMessageDialog

      public static boolean showMessageDialog(javafx.stage.Window owner, String title, String content, javafx.scene.control.ButtonType yesButton, javafx.scene.control.ButtonType noButton, javafx.scene.control.Alert.AlertType alertType)
      Show a message dialog
      Parameters:
      title - - title of message dialog
      content - - content of dialog
    • showMessageDialog

      public static boolean showMessageDialog(javafx.stage.Window owner, String title, String content, javafx.scene.control.Alert.AlertType alertType)
      Show a message dialog with default OK and Close buttons.
      Parameters:
      title - - title of message dialog
      content - - content of dialog
      alertType - - the alert type.
    • showWarning

      public static boolean showWarning(javafx.stage.Stage guiFrame, String title, String content)
      Show a warning message dialog
      Parameters:
      title - - title of message dialog
      content - - content of dialog
    • showMessageDialog

      public static boolean showMessageDialog(javafx.stage.Window owner, String title, String content)
      Show a message dialog
      Parameters:
      title - - title of message dialog
      content - - content of dialog
    • showMessageDialog

      public static boolean showMessageDialog(String title, String content)
      Show a message dialog
      Parameters:
      title - - title of message dialog
      content - - content of dialog
    • pack

      public void pack()
      Pack the dialog. This may not be necessary in future releases of fx and is a bit clumsy really.
    • showWarning

      public static boolean showWarning(String content)
    • showError

      public static boolean showError(String content)
      Show error dialog with default OK and CANCEL.
      Parameters:
      content - - the error message.
    • showError

      public static boolean showError(String title, String content)
      Show error dialog with default OK and CANCEL.
      Parameters:
      content - - the error message.
    • showMessageDialog

      public static boolean showMessageDialog(javafx.stage.Window owner, String string, String string2, javafx.scene.control.ButtonType yes, javafx.scene.control.ButtonType cancel)