Class DialogBox
java.lang.Object
edu.ntnu.stud.controller.framecontroller.dialogboxes.DialogBox
- Direct Known Subclasses:
AddIngredientDialog
,ConfirmAddRecipeDialog
,ConfirmDeleteDialog
,ConfirmGetDialog
,ConfirmSaveDialog
,ErrorDialog
Abstract class for creating dialog boxes.
Contains methods for setting the style of the dialog box.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DialogBox
(javafx.scene.control.Alert alert, javafx.scene.text.Text headerText, javafx.scene.text.Text contentText, int width, int height) Constructor for the DialogBox class. -
Method Summary
Modifier and TypeMethodDescriptionprotected javafx.scene.control.Alert
getAlert()
Method to get the alert object.protected javafx.scene.text.Text
Method to get the content text of the dialog box.protected javafx.scene.text.Text
Method to get the header text of the dialog box.protected void
setNegativeButtonStyle
(javafx.scene.control.Button button) Method to set the style of the negative button in the dialog box.protected void
setPositiveButtonStyle
(javafx.scene.control.Button button) Method to set the style of the positive button in the dialog box.protected void
setStyle()
Method to set the style of the dialog box.
-
Constructor Details
-
DialogBox
protected DialogBox(javafx.scene.control.Alert alert, javafx.scene.text.Text headerText, javafx.scene.text.Text contentText, int width, int height) Constructor for the DialogBox class. Gets the variables needed to create the dialog box from the subclasses.- Parameters:
alert
- The alert object to be displayed.headerText
- The header text of the dialog box.contentText
- The content text of the dialog box.width
- The width of the dialog box.height
- The height of the dialog box.
-
-
Method Details
-
getAlert
protected javafx.scene.control.Alert getAlert()Method to get the alert object.- Returns:
- The alert object.
-
setStyle
protected void setStyle()Method to set the style of the dialog box. -
setPositiveButtonStyle
protected void setPositiveButtonStyle(javafx.scene.control.Button button) Method to set the style of the positive button in the dialog box. The button with the most importance.- Parameters:
button
- The positive button.
-
setNegativeButtonStyle
protected void setNegativeButtonStyle(javafx.scene.control.Button button) Method to set the style of the negative button in the dialog box. The button with the lesser importance.- Parameters:
button
- The negative button.
-
getHeaderText
protected javafx.scene.text.Text getHeaderText()Method to get the header text of the dialog box.- Returns:
- The header text.
-
getContentText
protected javafx.scene.text.Text getContentText()Method to get the content text of the dialog box.- Returns:
- The content text.
-