From 307754d30b0a5ff5e17875ebe107cde57d62d947 Mon Sep 17 00:00:00 2001 From: Harry Linrui XU <xulr0820@hotmail.com> Date: Fri, 24 Mar 2023 10:41:58 +0100 Subject: [PATCH] "Removed itemMode enums and incomes in AddExpenseController. Changed controller of AddIncome to AddIncomeController" --- .../demo/controller/AddExpenseController.java | 13 ------------- src/main/resources/view/AddIncome.fxml | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/main/java/no/ntnu/idatt1002/demo/controller/AddExpenseController.java b/src/main/java/no/ntnu/idatt1002/demo/controller/AddExpenseController.java index 21d8bc4f..b1a4691a 100644 --- a/src/main/java/no/ntnu/idatt1002/demo/controller/AddExpenseController.java +++ b/src/main/java/no/ntnu/idatt1002/demo/controller/AddExpenseController.java @@ -24,11 +24,6 @@ public class AddExpenseController { Expense chosenExpense = null; //an expense that is meant to track the old state of an expense before editing, in case cancel bugtton is clicked - Income newIncome = null; - - Income chosenIncome = null; - - private ItemMode itemMode; @FXML private Button cancelBtn; @@ -83,14 +78,6 @@ public class AddExpenseController { descriptionField.textProperty().set(expense.getDescription()); amountField.textProperty().setValue(String.valueOf(expense.getAmount())); recurringBox.setValue(expense.isRecurring()); - - //new SimpleStringProperty(datePicker.getValue().toString()).bindBidirectional(new SimpleStringProperty(expense.getDate().toString())); - //Bind this expense's fields with the argument object's fields. If cancel is pressed - do nothing. If ok is pressed, bind the textfields with this expsense - - /*amountField.textProperty().bindBidirectional(expense.amountProperty(), NumberFormat.getNumberInstance()); //TODO AMOUNT IS STORED WITH COMMA, WHICH IS NOT ALLOWED - descriptionField.textProperty().bindBidirectional(expense.descriptionProperty()); - //categoryBox.valueProperty().bindBidirectional(expense.getCategory()); - recurringBox.valueProperty().bindBidirectional(expense.recurringProperty());*/ } @FXML diff --git a/src/main/resources/view/AddIncome.fxml b/src/main/resources/view/AddIncome.fxml index be30573f..abdfe7c2 100644 --- a/src/main/resources/view/AddIncome.fxml +++ b/src/main/resources/view/AddIncome.fxml @@ -12,7 +12,7 @@ <?import javafx.scene.layout.HBox?> <?import javafx.scene.layout.RowConstraints?> -<DialogPane expanded="true" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="no.ntnu.idatt1002.demo.controller.AddExpenseController"> +<DialogPane expanded="true" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="no.ntnu.idatt1002.demo.controller.AddIncomeController"> <content> <GridPane> <columnConstraints> -- GitLab