Class FinanceController

java.lang.Object
no.ntnu.idatt1002.demo.controller.FinanceController
Direct Known Subclasses:
BudgetController, IncomeExpenseController

public abstract class FinanceController extends Object
Abstract class for controllers that control scenes with finance tableviews.
Since:
29.3.2023
Author:
Harry Linrui Xu
  • Constructor Details

    • FinanceController

      public FinanceController()
  • Method Details

    • showConfirmationDialog

      public Optional<javafx.scene.control.ButtonType> showConfirmationDialog(String title, String header, String content)
      Returns an optional, which is a popup alert box, asking for confirmation for deleting an entry.
      Parameters:
      title - The dialog box title.
      header - The dialog box header.
      content - The dialog box content.
      Returns:
      An alert box, asking for confirmation for deleting the selected entry of the tableview.
    • showErrorDialogBox

      public void showErrorDialogBox(String title, String header, String content)
      Displays an error message dialog box with a customizable title, header and content.
      Parameters:
      title - The dialog title.
      header - The dialog header.
      content - The dialog content.
    • loadBudgetDataFromFile

      public GeneralBudget loadBudgetDataFromFile(String fileDestination) throws IOException
      Method that either reads data from a file with which it fills a budget register, if this is an old budget, or instantiates a budget register if this is a new budget.
      Parameters:
      fileDestination - The name of the file that is being read from.
      Returns:
      An object of type GeneralBudget.
      Throws:
      IOException - If an error occurs while reading from the file.
    • loadIncomeDataFromFile

      public IncomeRegister loadIncomeDataFromFile(String fileDestination)
      Method that either reads data from a file with which it fills an income register, if older changes exist, or instantiates an income register if the file is empty.
      Parameters:
      fileDestination - The name of the file that is being read from.
      Returns:
      An object of type IncomeRegister.
    • loadExpenseDataFromFile

      public ExpenseRegister loadExpenseDataFromFile(String fileDestination)
      Method that either reads data from a file with which it fills an expense register, if older changes exist, or instantiates an expense register if the file is empty.
      Parameters:
      fileDestination - The name of the file that is being read from.
      Returns:
      An object of type IncomeRegister.