Skip to content
Snippets Groups Projects
Commit c0367ca5 authored by Harry Linrui XU's avatar Harry Linrui XU
Browse files

Raw press of edit and expense buttons will not refresh pie charts

parent b82e6c1b
No related branches found
No related tags found
5 merge requests!43Merging frontend-testing into master,!38"Made progressbar dynamic in accordance to spending. Added balance field....,!37Made the sub progress bars respond to changes in expense,!32Added input validation to add dialog boxes.,!31Added input validation to tableviews
......@@ -209,14 +209,21 @@ public class IncomeExpenseController implements FinanceController {
*/
@Override
public void handleAddBtn(javafx.event.ActionEvent event) {
int sizeBf = (expenseRegister.getItems().size() + incomeRegister.getItems().size());
if (event.getSource() == addIncome) {
handleAddIncome();
} else if (event.getSource() == addExpense){
handleAddExpense();
}
refreshTableView();
refreshPieCharts();
refreshProgress();
int sizeAf = (expenseRegister.getItems().size() + incomeRegister.getItems().size());
if (sizeAf != sizeBf) {
refreshTableView();
refreshPieCharts();
refreshProgress();
}
}
/**
......@@ -234,14 +241,14 @@ public class IncomeExpenseController implements FinanceController {
handleEditIncome(chosenIncome);
} else if (chosenExpense != null) {
handleEditExpense(chosenExpense);
}
} else return;
} else if (event.getSource() == deleteBtn) {
if (chosenIncome != null) {
handleDeleteIncome(chosenIncome);
} else if (chosenExpense != null) {
handleDeleteExpense(chosenExpense);
}
} else return;
} else return;
}
//Updates the tableview and pie chart using the register
refreshTableView();
refreshPieCharts();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment