java.lang.Object
edu.ntnu.stud.controller.framecontroller.dialogboxes.DialogBox
Direct Known Subclasses:
AddIngredientDialog, ConfirmAddRecipeDialog, ConfirmDeleteDialog, ConfirmGetDialog, ConfirmSaveDialog, ErrorDialog

public class DialogBox extends Object
Abstract class for creating dialog boxes. Contains methods for setting the style of the dialog box.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    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.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected javafx.scene.control.Alert
    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
    Method to set the style of the dialog box.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.