Package pamViewFX.fxNodes.pamDialogFX
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
ConstructorDescriptionCreates a standard dialog.PamDialogFX
(javafx.stage.Window window, String title, javafx.stage.StageStyle style) Creates a PAM settings dialog. -
Method Summary
Modifier and TypeMethodDescriptionabstract T
This is called whenever the dialog is successfully closes.void
pack()
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
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 dialogstatic boolean
Show error dialog with default OK and CANCEL.static boolean
Show error dialog with default OK and CANCEL.static boolean
showMessageDialog
(String title, String content) Show a message dialogstatic boolean
showMessageDialog
(javafx.stage.Window owner, String title, String content) Show a message dialogstatic 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 dialogvoid
Shows a warning message when getParams() returns null.static boolean
showWarning
(String content) static boolean
showWarning
(javafx.stage.Stage guiFrame, String title, String content) Show a warning message dialogMethods 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
-
Constructor Details
-
PamDialogFX
public PamDialogFX()Creates a standard dialog. This does not call getParams() on close. -
PamDialogFX
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 dialogstyle
- - 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
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
Optional function used to set controls in the dialog to the correct setting for input params.- Parameters:
input
- - the input params.
-
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 dialogcontent
- - 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 dialogcontent
- - content of dialogalertType
- - the alert type.
-
showWarning
Show a warning message dialog- Parameters:
title
- - title of message dialogcontent
- - content of dialog
-
showMessageDialog
Show a message dialog- Parameters:
title
- - title of message dialogcontent
- - content of dialog
-
showMessageDialog
Show a message dialog- Parameters:
title
- - title of message dialogcontent
- - 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
-
showError
Show error dialog with default OK and CANCEL.- Parameters:
content
- - the error message.
-
showError
Show error dialog with default OK and CANCEL.- Parameters:
content
- - the error message.
-
showMessageDialog
-