Class FinanceController
java.lang.Object
no.ntnu.idatt1002.demo.controller.FinanceController
- Direct Known Subclasses:
BudgetController,IncomeExpenseController
Abstract class for controllers that control scenes with finance tableviews.
- Since:
- 29.3.2023
- Author:
- Harry Linrui Xu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionloadBudgetDataFromFile(String fileDestination) 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.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.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.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.voidshowErrorDialogBox(String title, String header, String content) Displays an error message dialog box with a customizable title, header and content.
-
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
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
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
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
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.
-