diff --git a/src/main/java/no/ntnu/idatt1002/demo/budgeting/FutureBudgetingController.java b/src/main/java/no/ntnu/idatt1002/demo/budgeting/FutureBudgetingController.java index 23d10110c629759722f8268ec18ac94932a3ec36..5185ce2e9a9d411a66b78bc35204374208683c7e 100644 --- a/src/main/java/no/ntnu/idatt1002/demo/budgeting/FutureBudgetingController.java +++ b/src/main/java/no/ntnu/idatt1002/demo/budgeting/FutureBudgetingController.java @@ -13,6 +13,7 @@ import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; import javafx.scene.Node; +import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.control.ChoiceBox; import javafx.scene.control.TextField; @@ -25,7 +26,8 @@ import javafx.stage.Stage; * Controller for future budgeting GUI. */ public class FutureBudgetingController implements Initializable { - + private Stage stage; + private Scene scene; @FXML public TextField firstExpected; @@ -86,7 +88,7 @@ public class FutureBudgetingController implements Initializable { public void setFirstDiff() { String difference; difference = String.valueOf((Integer.parseInt(firstExpected.getText()) - - Integer.parseInt(firstActual.getText()))); + - Integer.parseInt(firstActual.getText()))); firstDiff.setText(difference); } @@ -96,7 +98,7 @@ public class FutureBudgetingController implements Initializable { public void setSecondDiff() { String difference; difference = String.valueOf((Integer.parseInt(secondExpected.getText()) - - Integer.parseInt(secondActual.getText()))); + - Integer.parseInt(secondActual.getText()))); secondDiff.setText(difference); } @@ -106,7 +108,7 @@ public class FutureBudgetingController implements Initializable { public void setThirdDiff() { String difference; difference = String.valueOf((Integer.parseInt(thirdExpected.getText()) - - Integer.parseInt(thirdActual.getText()))); + - Integer.parseInt(thirdActual.getText()))); thirdDiff.setText(difference); } @@ -116,7 +118,7 @@ public class FutureBudgetingController implements Initializable { public void setFourthDiff() { String difference; difference = String.valueOf((Integer.parseInt(fourthExpected.getText()) - - Integer.parseInt(fourthActual.getText()))); + - Integer.parseInt(fourthActual.getText()))); fourthDiff.setText(difference); } @@ -126,7 +128,7 @@ public class FutureBudgetingController implements Initializable { public void setFifthDiff() { String difference; difference = String.valueOf((Integer.parseInt(fifthExpected.getText()) - - Integer.parseInt(fifthActual.getText()))); + - Integer.parseInt(fifthActual.getText()))); fifthDiff.setText(difference); } @@ -136,7 +138,7 @@ public class FutureBudgetingController implements Initializable { public void setSixthDiff() { String difference; difference = String.valueOf((Integer.parseInt(sixthExpected.getText()) - - Integer.parseInt(sixthActual.getText()))); + - Integer.parseInt(sixthActual.getText()))); sixthDiff.setText(difference); } @@ -185,24 +187,88 @@ public class FutureBudgetingController implements Initializable { } } + @Override + public void initialize (URL url, ResourceBundle resourceBundle){ + categoryInitiator(); + } + /** - * Home button. + * Button to go to home page of application. - * @param event mouse click on button. - * @throws IOException if wrong input is detected. + * @param event when button is pressed with mouse. + * @throws IOException if input is invalid. */ public void goHome(ActionEvent event) throws IOException { - BorderPane rootGoHome = (FXMLLoader.load(Objects.requireNonNull( - getClass().getResource("/SpendWiseHomePage.fxml")))); - + BorderPane rootGoHome = (FXMLLoader.load(Objects.requireNonNull(getClass().getResource( + "/SpendWiseHomePage.fxml")))); Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); Scene scene = new Scene(rootGoHome); stage.setScene(scene); stage.show(); } - @Override - public void initialize (URL url, ResourceBundle resourceBundle) { - categoryInitiator(); + /** + * Button that takes user to income. + + * @param event mouse click. + * @throws IOException if wrong input detected. + */ + public void switchToIncome(ActionEvent event) throws IOException { + Scene rootSwitchToIncome = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/Income.fxml")))); + + stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + stage.setScene(rootSwitchToIncome); + stage.show(); + } + + /** + * Button that takes user to recurring transactions. + + * @param event mouse click. + * @throws IOException if wrong input detected. + */ + public void switchToRecurringTransactions(ActionEvent event) throws IOException { + BorderPane rootSwitchToRecurringTrans = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/RecurringTransactions.fxml")))); + + stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + scene = new Scene(rootSwitchToRecurringTrans); + stage.setScene(scene); + stage.show(); } -} + + + /** + * Button that takes user to edit income. + + * @param event mouse click. + * @throws IOException if wrong input detected. + */ + public void switchToEditIncome(ActionEvent event) throws IOException { + BorderPane rootSwitchToEditIncome = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/EditIncome.fxml")))); + + stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + scene = new Scene(rootSwitchToEditIncome); + stage.setScene(scene); + stage.show(); + } + + /** + * A button that opens the help option menu. + * @param event - mouse click + * @throws IOException - if wrong input detected + */ + public void openHelpOption(ActionEvent event) throws IOException { + FXMLLoader rootSwitchToHelpOption = new FXMLLoader(getClass().getResource("/HelpScenes/HelpBudgeting.fxml")); + Parent rootHelp = (Parent) rootSwitchToHelpOption.load(); + Stage stage = new Stage(); + stage.setScene(new Scene(rootHelp)); + stage.show(); + } + + } + + + diff --git a/src/main/java/no/ntnu/idatt1002/demo/expenses/EditExpenseController.java b/src/main/java/no/ntnu/idatt1002/demo/expenses/EditExpenseController.java index 2f12f6bd38949deb188fe071b74b75e62152b4d6..fd7065495b008699d8c26d505244014c933f70c1 100644 --- a/src/main/java/no/ntnu/idatt1002/demo/expenses/EditExpenseController.java +++ b/src/main/java/no/ntnu/idatt1002/demo/expenses/EditExpenseController.java @@ -13,6 +13,7 @@ import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; import javafx.scene.Node; +import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.control.*; import javafx.scene.control.cell.PropertyValueFactory; @@ -29,6 +30,8 @@ import no.ntnu.idatt1002.demo.exceptions.DuplicateNameException; */ public class EditExpenseController implements Initializable { + private Scene scene; + private Stage stage; @FXML private GridPane gridPane; @FXML @@ -127,22 +130,6 @@ public class EditExpenseController implements Initializable { fillTableView(); } - /** - * Method for handling button that is used to go to the home page. - * - * @param event The ActionEvent that triggered the method - * @throws IOException If SpendWiseHomePage.fxml is not found in resources - */ - - public void goHome(ActionEvent event) throws IOException { - BorderPane rootGoHome = (FXMLLoader.load(Objects.requireNonNull( - getClass().getResource("/SpendWiseHomePage.fxml")))); - Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); - Scene scene = new Scene(rootGoHome); - stage.setScene(scene); - stage.show(); - } - @Override public void initialize(URL url, ResourceBundle resourceBundle) { categoryBox.getItems().addAll(categories); @@ -169,4 +156,100 @@ public class EditExpenseController implements Initializable { private boolean isDateNotChosen() { return (datePicker.getValue() == null); } + + + + /** + * Method for handling button that is used to go to the home page. + * + * @param event The ActionEvent that triggered the method + * @throws IOException If SpendWiseHomePage.fxml is not found in resources + */ + + public void goHome(ActionEvent event) throws IOException { + BorderPane rootGoHome = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/SpendWiseHomePage.fxml")))); + Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + Scene scene = new Scene(rootGoHome); + stage.setScene(scene); + stage.show(); + } + + /** + * Button that takes user to income. + + * @param event mouse click. + * @throws IOException if wrong input detected. + */ + public void switchToIncome(ActionEvent event) throws IOException { + Scene rootSwitchToIncome = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/Income.fxml")))); + + stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + stage.setScene(rootSwitchToIncome); + stage.show(); + } + + /** + * Button that takes user to recurring transactions. + + * @param event mouse click. + * @throws IOException if wrong input detected. + */ + public void switchToRecurringTransactions(ActionEvent event) throws IOException { + BorderPane rootSwitchToRecurringTrans = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/RecurringTransactions.fxml")))); + + stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + scene = new Scene(rootSwitchToRecurringTrans); + stage.setScene(scene); + stage.show(); + } + + /** + * Button that takes user to edit income. + + * @param event mouse click. + * @throws IOException if wrong input detected. + */ + public void switchToEditIncome(ActionEvent event) throws IOException { + BorderPane rootSwitchToEditIncome = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/EditIncome.fxml")))); + + stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + scene = new Scene(rootSwitchToEditIncome); + stage.setScene(scene); + stage.show(); + } + + /** + * Button that takes user to future budgeting. + + * @param event mouse click. + * @throws IOException if wrong input detected. + */ + public void switchToFutureBudgeting(ActionEvent event) throws IOException { + BorderPane rootSwitchToFutureBudgeting = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/FutureBudgeting.fxml")))); + + stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + scene = new Scene(rootSwitchToFutureBudgeting); + stage.setScene(scene); + stage.show(); + } + + /** + * A button that opens the help option menu. + * @param event - mouse click + * @throws IOException - if wrong input detected + */ + public void openHelpEdit(ActionEvent event) throws IOException { + FXMLLoader rootSwitchToHelpOption = new FXMLLoader(getClass().getResource("/HelpScenes/HelpEdit.fxml")); + Parent rootHelp = (Parent) rootSwitchToHelpOption.load(); + Stage stage = new Stage(); + stage.setScene(new Scene(rootHelp)); + stage.show(); + } + + } diff --git a/src/main/java/no/ntnu/idatt1002/demo/expenses/Expenses.java b/src/main/java/no/ntnu/idatt1002/demo/expenses/Expenses.java index a7da568f74b2176b4763614e76d9a571bbadb18a..399143d280cc8f81d1c941c4e603106efb4cb224 100644 --- a/src/main/java/no/ntnu/idatt1002/demo/expenses/Expenses.java +++ b/src/main/java/no/ntnu/idatt1002/demo/expenses/Expenses.java @@ -1,14 +1,12 @@ package no.ntnu.idatt1002.demo.expenses; -import java.net.URL; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Scene; import javafx.stage.Stage; -/** - * Loader for the Expenses.fxml window. - */ +import java.net.URL; + public class Expenses extends Application { @Override @@ -24,6 +22,4 @@ public class Expenses extends Application { Application.launch(args); } - } - diff --git a/src/main/java/no/ntnu/idatt1002/demo/expenses/ExpensesController.java b/src/main/java/no/ntnu/idatt1002/demo/expenses/ExpensesController.java index 83453a759f81cb1c033c8659a7841b3697c53d92..604ede6832c325f21639dec67f0aecc778ff62bb 100644 --- a/src/main/java/no/ntnu/idatt1002/demo/expenses/ExpensesController.java +++ b/src/main/java/no/ntnu/idatt1002/demo/expenses/ExpensesController.java @@ -1,20 +1,17 @@ package no.ntnu.idatt1002.demo.expenses; +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.scene.Node; +import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.chart.PieChart; -import javafx.scene.control.Button; import javafx.scene.control.CheckBox; import javafx.scene.control.DatePicker; import javafx.scene.layout.BorderPane; -import java.time.LocalDate; -import javafx.collections.FXCollections; -import javafx.collections.ObservableList; -import javafx.fxml.Initializable; -import javafx.scene.layout.GridPane; import javafx.scene.layout.VBox; import javafx.stage.Stage; import no.ntnu.idatt1002.demo.data.Category; @@ -23,47 +20,115 @@ import no.ntnu.idatt1002.demo.data.RegisterController; import java.io.IOException; import java.net.URL; +import java.time.LocalDate; import java.util.ArrayList; import java.util.Objects; import java.util.ResourceBundle; -public class ExpensesController implements Initializable { + +/** + * GUI controller for the expenses. + */ +public class ExpensesController { @FXML private VBox categoryCheckBoxes; @FXML private DatePicker fromDate; @FXML private DatePicker toDate; - @FXML private PieChart pieChart; private Register register; - private Scene rootSwitchToIncome; + private Stage stage; + + private Scene scene; + + public void goHome(ActionEvent event) throws IOException { + BorderPane rootGoHome = (FXMLLoader.load( + Objects.requireNonNull(getClass().getResource("/SpendWiseHomePage.fxml")))); + Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + Scene scene = new Scene(rootGoHome); + stage.setScene(scene); + stage.show(); - public void editCategoryButtonPushed() { - System.out.println("The category button has been pushed"); } - public void editExpensesButtonPushed() { - System.out.println("The edit expenses button has been pushed"); + /** + * Button that takes user to income. + * + * @param event mouse click. + * @throws IOException if wrong input detected. + */ + public void switchToIncome(ActionEvent event) throws IOException { + Scene rootSwitchToIncome = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/Income.fxml")))); + + stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + stage.setScene(rootSwitchToIncome); + stage.show(); } - public void viewIncomeButtonPushed() { - System.out.println("The view income button has been pushed"); + /** + * Button that takes user to recurring transactions. + * + * @param event mouse click. + * @throws IOException if wrong input detected. + */ + public void switchToRecurringTransactions(ActionEvent event) throws IOException { + BorderPane rootSwitchToRecurringTrans = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/RecurringTransactions.fxml")))); + + stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + scene = new Scene(rootSwitchToRecurringTrans); + stage.setScene(scene); + stage.show(); } - public void changeToBarGraphButtonPushed() { - System.out.println("The change to bar graph button has been pushed"); + /** + * Button that takes user to edit income. + * + * @param event mouse click. + * @throws IOException if wrong input detected. + */ + public void switchToEditIncome(ActionEvent event) throws IOException { + BorderPane rootSwitchToEditIncome = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/EditIncome.fxml")))); + + stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + scene = new Scene(rootSwitchToEditIncome); + stage.setScene(scene); + stage.show(); } - public void goHome(ActionEvent event) throws IOException { - BorderPane rootGoHome = (FXMLLoader.load( - Objects.requireNonNull(getClass().getResource("/SpendWiseHomePage.fxml")))); - Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); - Scene scene = new Scene(rootGoHome); + /** + * Button that takes user to future budgeting. + * + * @param event mouse click. + * @throws IOException if wrong input detected. + */ + public void switchToFutureBudgeting(ActionEvent event) throws IOException { + BorderPane rootSwitchToFutureBudgeting = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/FutureBudgeting.fxml")))); + + stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + scene = new Scene(rootSwitchToFutureBudgeting); stage.setScene(scene); stage.show(); } + /** + * A button that opens the help option menu. + * + * @param event - mouse click + * @throws IOException - if wrong input detected + */ + public void openHelpOption(ActionEvent event) throws IOException { + FXMLLoader rootSwitchToHelpOption = new FXMLLoader(getClass().getResource("/HelpScenes/HelpExpenses.fxml")); + Parent rootHelp = (Parent) rootSwitchToHelpOption.load(); + Stage stage = new Stage(); + stage.setScene(new Scene(rootHelp)); + stage.show(); + } + /** * Initializes the controller class. * @@ -156,19 +221,10 @@ public class ExpensesController implements Initializable { piechartData.add(new PieChart.Data(category.getName(), sum)); } + pieChart.setData(piechartData); + pieChart.setLegendVisible(true); } - pieChart.setData(piechartData); - pieChart.setLegendVisible(true); - } - - public void switchToIncome(ActionEvent event) throws IOException { - rootSwitchToIncome = (FXMLLoader.load(Objects.requireNonNull( - getClass().getResource("/Income.fxml")))); - - Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); - stage.setScene(rootSwitchToIncome); - stage.show(); } } diff --git a/src/main/java/no/ntnu/idatt1002/demo/expenses/Outcome.java b/src/main/java/no/ntnu/idatt1002/demo/expenses/Outcome.java deleted file mode 100644 index f16a108ee2e2120a3e0828a739fc91dca2a11575..0000000000000000000000000000000000000000 --- a/src/main/java/no/ntnu/idatt1002/demo/expenses/Outcome.java +++ /dev/null @@ -1,25 +0,0 @@ -package no.ntnu.idatt1002.demo.expenses; - -import javafx.application.Application; -import javafx.fxml.FXMLLoader; -import javafx.scene.Scene; -import javafx.stage.Stage; - -import java.net.URL; - -public class Outcome extends Application { - - @Override - public void start(Stage primaryStage) throws Exception { - URL fxmlUrl = getClass().getResource("/Outcome.fxml"); - primaryStage.setTitle("Outcome"); - Scene scene = FXMLLoader.load(fxmlUrl); - primaryStage.setScene(scene); - primaryStage.show(); - } - - public static void main(String[] args) { - Application.launch(args); - } - -} diff --git a/src/main/java/no/ntnu/idatt1002/demo/expenses/OutcomeController.java b/src/main/java/no/ntnu/idatt1002/demo/expenses/OutcomeController.java deleted file mode 100644 index 76b5f8117ef81d541e55147cbd3b926dea6b4fee..0000000000000000000000000000000000000000 --- a/src/main/java/no/ntnu/idatt1002/demo/expenses/OutcomeController.java +++ /dev/null @@ -1,214 +0,0 @@ -package no.ntnu.idatt1002.demo.expenses; - -import javafx.event.ActionEvent; -import javafx.fxml.FXML; -import javafx.fxml.FXMLLoader; -import javafx.scene.Node; -import javafx.scene.Parent; -import javafx.scene.Scene; -import javafx.scene.chart.PieChart; -import javafx.scene.control.Button; -import javafx.scene.control.CheckBox; -import javafx.scene.control.DatePicker; -import javafx.scene.layout.BorderPane; -import javafx.scene.layout.GridPane; -import javafx.scene.layout.VBox; -import javafx.stage.Stage; -import no.ntnu.idatt1002.demo.data.Category; -import no.ntnu.idatt1002.demo.data.Register; -import no.ntnu.idatt1002.demo.data.RegisterController; - -import java.io.IOException; -import java.net.URL; -import java.time.LocalDate; -import java.util.ArrayList; -import java.util.Objects; -import java.util.ResourceBundle; - -/** - * GUI controller for the expenses. - */ -public class OutcomeController { - @FXML - private VBox categoryCheckBoxes; - @FXML - private DatePicker fromDate; - @FXML - private DatePicker toDate; - @FXML - private Button changeToIncome; - @FXML - private PieChart pieChart; - @FXML - private GridPane gridPane; - private Register register; - private Stage stage; - - private Scene scene; - - public void goHome(ActionEvent event) throws IOException { - BorderPane rootGoHome = (FXMLLoader.load( - Objects.requireNonNull(getClass().getResource("/SpendWiseHomePage.fxml")))); - Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); - Scene scene = new Scene(rootGoHome); - stage.setScene(scene); - stage.show(); - - } - - /** - * Button that takes user to income. - * - * @param event mouse click. - * @throws IOException if wrong input detected. - */ - public void switchToIncome(ActionEvent event) throws IOException { - Scene rootSwitchToIncome = (FXMLLoader.load(Objects.requireNonNull( - getClass().getResource("/Income.fxml")))); - - stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); - stage.setScene(rootSwitchToIncome); - stage.show(); - } - - /** - * Button that takes user to recurring transactions. - * - * @param event mouse click. - * @throws IOException if wrong input detected. - */ - public void switchToRecurringTransactions(ActionEvent event) throws IOException { - BorderPane rootSwitchToRecurringTrans = (FXMLLoader.load(Objects.requireNonNull( - getClass().getResource("/RecurringTransactions.fxml")))); - - stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); - scene = new Scene(rootSwitchToRecurringTrans); - stage.setScene(scene); - stage.show(); - } - - /** - * Button that takes user to edit income. - * - * @param event mouse click. - * @throws IOException if wrong input detected. - */ - public void switchToEditIncome(ActionEvent event) throws IOException { - GridPane rootSwitchToEditIncome = (FXMLLoader.load(Objects.requireNonNull( - getClass().getResource("/EditIncome.fxml")))); - - stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); - scene = new Scene(rootSwitchToEditIncome); - stage.setScene(scene); - stage.show(); - } - - /** - * Button that takes user to future budgeting. - * - * @param event mouse click. - * @throws IOException if wrong input detected. - */ - public void switchToFutureBudgeting(ActionEvent event) throws IOException { - BorderPane rootSwitchToFutureBudgeting = (FXMLLoader.load(Objects.requireNonNull( - getClass().getResource("/FutureBudgeting.fxml")))); - - stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); - scene = new Scene(rootSwitchToFutureBudgeting); - stage.setScene(scene); - stage.show(); - } - - /** - * A button that opens the help option menu. - * - * @param event - mouse click - * @throws IOException - if wrong input detected - */ - public void openHelpOption(ActionEvent event) throws IOException { - FXMLLoader rootSwitchToHelpOption = new FXMLLoader(getClass().getResource("/HelpScenes/HelpOption.fxml")); - Parent rootHelp = (Parent) rootSwitchToHelpOption.load(); - Stage stage = new Stage(); - stage.setScene(new Scene(rootHelp)); - stage.show(); - } - - /////// - - - /** - * Initializes the controller class. - * - * @param url The location used to resolve relative paths for the root object, or null if the location is not known. - * @param resourceBundle The resources used to localize the root object, or null if the root object was not localized. - */ - public void initialize(URL url, ResourceBundle resourceBundle) { - - /* - ObservableList<PieChart.Data> piechartData = FXCollections.observableArrayList( - new PieChart.Data("Food", 13), - new PieChart.Data("Housing", 25), - new PieChart.Data("Fixed Expenses", 10), - new PieChart.Data("Travel", 22), - new PieChart.Data("Other", 30) - ); - pieChart.setData(piechartData);*/ - - try { - register = RegisterController.readData(Objects.requireNonNull( - getClass().getClassLoader().getResource("database/register.json"))); - } catch (Exception e) { - e.printStackTrace(); - return; - } - - ArrayList<Category> categories = register.getCategories(); - for (Category category : categories) { - // Only add expense categories to the list - if (category.isExpenseCategory()) { - CheckBox checkBox = new CheckBox(category.getName()); - checkBox.setSelected(false); - categoryCheckBoxes.getChildren().add(checkBox); - } - } - } - - - @FXML - private String timeInterval() { //TODO: optimize... - String result = null; - if (fromDate.isManaged() || toDate.isManaged()) { - LocalDate startDate = fromDate.getValue(); - LocalDate stopDate = toDate.getValue(); - if (toDate == null) { - toDate = fromDate; - result = ("(" + startDate + ")"); - } else if (stopDate.isAfter(startDate)) { - result = ("(" + startDate + "->" + stopDate + ")"); - } else if (startDate.isAfter(stopDate)) { - startDate = toDate.getValue(); - stopDate = fromDate.getValue(); - result = ("(" + startDate + "->" + stopDate + ")"); - } - } - return result; - } - - /** - * Trigger for the go button - * - * @param actionEvent The ActionEvent that triggered the method - */ - public void goButtonPushed(ActionEvent actionEvent) { - // If the user has not selected both dates - if (fromDate.getValue() == null || toDate.getValue() == null) { - return; - } - // If the user has made a wrong selection - // TODO: maybe make more user friendly (error message) - if (fromDate.getValue().isAfter(toDate.getValue())) { - return; - } - - } -} diff --git a/src/main/java/no/ntnu/idatt1002/demo/help/Help.java b/src/main/java/no/ntnu/idatt1002/demo/help/Help.java index afaa4ff63d910c78f06b21a4aaa4b0c7ff73dc6a..047615d12f008acd39edd28d7d3f7072351ed409 100644 --- a/src/main/java/no/ntnu/idatt1002/demo/help/Help.java +++ b/src/main/java/no/ntnu/idatt1002/demo/help/Help.java @@ -14,7 +14,7 @@ public class Help extends Application { @Override public void start(Stage primaryStage) throws Exception { - URL fxmlUrl = getClass().getResource("/HelpScenes/HelpOption.fxml"); + URL fxmlUrl = getClass().getResource("/HelpScenes/HelpHome.fxml"); primaryStage.setTitle("Help"); Scene scene = FXMLLoader.load(fxmlUrl); primaryStage.setScene(scene); diff --git a/src/main/java/no/ntnu/idatt1002/demo/home/HomePageController.java b/src/main/java/no/ntnu/idatt1002/demo/home/HomePageController.java index ae1d0300f7370920173e69a7e445d8555edc15c1..e353fb9b3e79a0f0f5049925170c71d37aba558e 100644 --- a/src/main/java/no/ntnu/idatt1002/demo/home/HomePageController.java +++ b/src/main/java/no/ntnu/idatt1002/demo/home/HomePageController.java @@ -8,7 +8,6 @@ import javafx.scene.Node; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.layout.BorderPane; -import javafx.scene.layout.GridPane; import javafx.stage.Stage; /** @@ -18,25 +17,6 @@ public class HomePageController { private Stage stage; private Scene scene; - private BorderPane rootSwitchToOutcome; - private Scene rootSwitchToExpenses; - private Scene rootSwitchToIncome; - private BorderPane rootSwitchToRecurringTrans; - private GridPane rootSwitchToAddExpense; - private GridPane rootSwitchToEditIncome; - private BorderPane rootSwitchToFutureBudgeting; - - private FXMLLoader rootSwitchToHelpOption; - - public void rootSwitchToOutcome(ActionEvent event) throws IOException { - rootSwitchToOutcome = (FXMLLoader.load(Objects.requireNonNull( - getClass().getResource("/Outcome.fxml")))); - - stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); - scene = new Scene(rootSwitchToOutcome); - stage.setScene(scene); - stage.show(); - } /** * Button that takes user to expenses. @@ -44,11 +24,12 @@ public class HomePageController { * @throws IOException if wrong input detected. */ public void switchToExpenses(ActionEvent event) throws IOException { - rootSwitchToExpenses = (FXMLLoader.load(Objects.requireNonNull( - getClass().getResource("/Expenses.fxml")))); + BorderPane rootSwitchToOutcome = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/Expenses.fxml")))); stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); - stage.setScene(rootSwitchToExpenses); + scene = new Scene(rootSwitchToOutcome); + stage.setScene(scene); stage.show(); } @@ -59,8 +40,8 @@ public class HomePageController { * @throws IOException if wrong input detected. */ public void switchToIncome(ActionEvent event) throws IOException { - rootSwitchToIncome = (FXMLLoader.load(Objects.requireNonNull( - getClass().getResource("/Income.fxml")))); + Scene rootSwitchToIncome = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/Income.fxml")))); stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); stage.setScene(rootSwitchToIncome); @@ -74,8 +55,8 @@ public class HomePageController { * @throws IOException if wrong input detected. */ public void switchToRecurringTransactions(ActionEvent event) throws IOException { - rootSwitchToRecurringTrans = (FXMLLoader.load(Objects.requireNonNull( - getClass().getResource("/RecurringTransactions.fxml")))); + BorderPane rootSwitchToRecurringTrans = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/RecurringTransactions.fxml")))); stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); scene = new Scene(rootSwitchToRecurringTrans); @@ -84,49 +65,49 @@ public class HomePageController { } /** - * Button that takes user to edit expenses. + * Button that takes user to future budgeting. * @param event mouse click. * @throws IOException if wrong input detected. */ - public void switchToEditExpenses(ActionEvent event) throws IOException { - rootSwitchToAddExpense = (FXMLLoader.load(Objects.requireNonNull( - getClass().getResource("/EditExpense.fxml")))); + public void switchToFutureBudgeting(ActionEvent event) throws IOException { + BorderPane rootSwitchToFutureBudgeting = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/FutureBudgeting.fxml")))); stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); - scene = new Scene(rootSwitchToAddExpense); + scene = new Scene(rootSwitchToFutureBudgeting); stage.setScene(scene); stage.show(); } /** - * Button that takes user to edit income. + * Button that takes user to edit expenses. * @param event mouse click. * @throws IOException if wrong input detected. */ - public void switchToEditIncome(ActionEvent event) throws IOException { - rootSwitchToEditIncome = (FXMLLoader.load(Objects.requireNonNull( - getClass().getResource("/EditIncome.fxml")))); + public void switchToEditExpenses(ActionEvent event) throws IOException { + BorderPane rootSwitchToAddExpense = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/EditExpense.fxml")))); stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); - scene = new Scene(rootSwitchToEditIncome); + scene = new Scene(rootSwitchToAddExpense); stage.setScene(scene); stage.show(); } /** - * Button that takes user to future budgeting. + * Button that takes user to edit income. * @param event mouse click. * @throws IOException if wrong input detected. */ - public void switchToFutureBudgeting(ActionEvent event) throws IOException { - rootSwitchToFutureBudgeting = (FXMLLoader.load(Objects.requireNonNull( - getClass().getResource("/FutureBudgeting.fxml")))); + public void switchToEditIncome(ActionEvent event) throws IOException { + BorderPane rootSwitchToEditIncome = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/EditIncome.fxml")))); stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); - scene = new Scene(rootSwitchToFutureBudgeting); + scene = new Scene(rootSwitchToEditIncome); stage.setScene(scene); stage.show(); } @@ -137,7 +118,7 @@ public class HomePageController { * @throws IOException - if wrong input detected */ public void openHelpOption(ActionEvent event) throws IOException { - rootSwitchToHelpOption = new FXMLLoader(getClass().getResource("/HelpScenes/HelpOption.fxml")); + FXMLLoader rootSwitchToHelpOption = new FXMLLoader(getClass().getResource("/HelpScenes/HelpHome.fxml")); Parent rootHelp = (Parent) rootSwitchToHelpOption.load(); Stage stage = new Stage(); stage.setScene(new Scene(rootHelp)); diff --git a/src/main/java/no/ntnu/idatt1002/demo/income/EditIncomeController.java b/src/main/java/no/ntnu/idatt1002/demo/income/EditIncomeController.java index 038afdffbd7c579847027ed1ed07af330dd26248..7c2b6c8095938028107417ab222033fd25a646cc 100644 --- a/src/main/java/no/ntnu/idatt1002/demo/income/EditIncomeController.java +++ b/src/main/java/no/ntnu/idatt1002/demo/income/EditIncomeController.java @@ -15,6 +15,7 @@ import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; import javafx.scene.Node; +import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.control.*; import javafx.scene.control.cell.PropertyValueFactory; @@ -30,6 +31,9 @@ import no.ntnu.idatt1002.demo.exceptions.DuplicateNameException; * GUI controller for edit income page. */ public class EditIncomeController implements Initializable { + private Stage stage; + private Scene scene; + @FXML private GridPane gridPane; @FXML @@ -143,33 +147,111 @@ public class EditIncomeController implements Initializable { tableView.setItems(transactionObservableList); } + private boolean isNameEmpty() { + return ((incomeName.getText() == null) || (incomeName.getText().isEmpty())); + } + private boolean isAmountEmpty() { + return ((amount.getText() == null) || (amount).getText().isEmpty()); + } + private boolean isCategoryBoxEmpty() { + return categoryBox.getSelectionModel().isEmpty(); + } + private boolean isDateNotChosen() { + return (datePicker.getValue() == null); + } + + + /** - * Home button. + * Button to go to home page. - * @param event mouse click. + * @param event mouse click * @throws IOException if invalid input is detected. */ public void goHome(ActionEvent event) throws IOException { BorderPane rootGoHome = (FXMLLoader.load(Objects.requireNonNull( - getClass().getResource("/SpendWiseHomePage.fxml")))); + getClass().getResource("/SpendWiseHomePage.fxml")))); Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); - Scene scene = new Scene(rootGoHome); stage.setScene(scene); stage.show(); } - private boolean isNameEmpty() { - return ((incomeName.getText() == null) || (incomeName.getText().isEmpty())); + /** + * Button that takes user to income. + + * @param event mouse click. + * @throws IOException if wrong input detected. + */ + public void switchToIncome(ActionEvent event) throws IOException { + Scene rootSwitchToIncome = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/Income.fxml")))); + + stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + stage.setScene(rootSwitchToIncome); + stage.show(); } - private boolean isAmountEmpty() { - return ((amount.getText() == null) || (amount).getText().isEmpty()); + + /** + * Button that takes user to recurring transactions. + + * @param event mouse click. + * @throws IOException if wrong input detected. + */ + public void switchToRecurringTransactions(ActionEvent event) throws IOException { + BorderPane rootSwitchToRecurringTrans = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/RecurringTransactions.fxml")))); + + stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + scene = new Scene(rootSwitchToRecurringTrans); + stage.setScene(scene); + stage.show(); } - private boolean isCategoryBoxEmpty() { - return categoryBox.getSelectionModel().isEmpty(); + + /** + * Button that takes user to future budgeting. + + * @param event mouse click. + * @throws IOException if wrong input detected. + */ + public void switchToFutureBudgeting(ActionEvent event) throws IOException { + BorderPane rootSwitchToFutureBudgeting = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/FutureBudgeting.fxml")))); + + stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + scene = new Scene(rootSwitchToFutureBudgeting); + stage.setScene(scene); + stage.show(); } - private boolean isDateNotChosen() { - return (datePicker.getValue() == null); + + /** + * Button that takes user to edit expenses. + + * @param event mouse click. + * @throws IOException if wrong input detected. + */ + public void switchToEditExpenses(ActionEvent event) throws IOException { + BorderPane rootSwitchToAddExpense = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/EditExpense.fxml")))); + + stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + scene = new Scene(rootSwitchToAddExpense); + stage.setScene(scene); + stage.show(); } + + /** + * A button that opens the help option menu. + * @param event - mouse click + * @throws IOException - if wrong input detected + */ + public void openHelpEdit(ActionEvent event) throws IOException { + FXMLLoader rootSwitchToHelpOption = new FXMLLoader(getClass().getResource("/HelpScenes/HelpEdit.fxml")); + Parent rootHelp = (Parent) rootSwitchToHelpOption.load(); + Stage stage = new Stage(); + stage.setScene(new Scene(rootHelp)); + stage.show(); + } + } diff --git a/src/main/java/no/ntnu/idatt1002/demo/income/IncomeController.java b/src/main/java/no/ntnu/idatt1002/demo/income/IncomeController.java index ca1ae3fdcb850c18470e33adfc27fe1d82a44d27..f157d6a5940b5a096878376d5818b3346b29ac13 100644 --- a/src/main/java/no/ntnu/idatt1002/demo/income/IncomeController.java +++ b/src/main/java/no/ntnu/idatt1002/demo/income/IncomeController.java @@ -12,11 +12,13 @@ import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; import javafx.scene.Node; +import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.chart.PieChart; import javafx.scene.control.CheckBox; import javafx.scene.control.DatePicker; import javafx.scene.layout.BorderPane; +import javafx.scene.layout.GridPane; import javafx.scene.layout.VBox; import javafx.stage.Stage; import no.ntnu.idatt1002.demo.data.Category; @@ -27,7 +29,8 @@ import no.ntnu.idatt1002.demo.data.RegisterController; * GUI controller for income class. */ public class IncomeController implements Initializable { - + private Stage stage; + private Scene scene; @FXML private VBox categoryCheckBoxes; @FXML @@ -54,20 +57,6 @@ public class IncomeController implements Initializable { System.out.println("The change to bar graph button has been pushed"); } - /** - * Button to go to home page. - - * @param event mouse click - * @throws IOException if invalid input is detected. - */ - public void goHome(ActionEvent event) throws IOException { - BorderPane rootGoHome = (FXMLLoader.load(Objects.requireNonNull( - getClass().getResource("/SpendWiseHomePage.fxml")))); - Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); - Scene scene = new Scene(rootGoHome); - stage.setScene(scene); - stage.show(); - } /** * Making comment to make checkstyle go away. TODO: comment for real. @@ -135,17 +124,90 @@ public class IncomeController implements Initializable { pieChart.setLegendVisible(true); } + /** - * Button to go to expenses. + * Button to go to home page. - * @param event mouse click on button. - * @throws IOException if wrong input is detected. + * @param event mouse click + * @throws IOException if invalid input is detected. */ - public void goToExpenses(ActionEvent event) throws IOException { - Scene goExpenses = (FXMLLoader.load(Objects.requireNonNull( - getClass().getResource("/Expenses.fxml")))); + public void goHome(ActionEvent event) throws IOException { + BorderPane rootGoHome = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/SpendWiseHomePage.fxml")))); Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); - stage.setScene(goExpenses); + Scene scene = new Scene(rootGoHome); + stage.setScene(scene); + stage.show(); + } + + public void switchToExpenses(ActionEvent event) throws IOException { + BorderPane rootSwitchToOutcome = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/Expenses.fxml")))); + + stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + scene = new Scene(rootSwitchToOutcome); + stage.setScene(scene); + stage.show(); + } + + /** + * Button that takes user to recurring transactions. + + * @param event mouse click. + * @throws IOException if wrong input detected. + */ + public void switchToRecurringTransactions(ActionEvent event) throws IOException { + BorderPane rootSwitchToRecurringTrans = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/RecurringTransactions.fxml")))); + + stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + scene = new Scene(rootSwitchToRecurringTrans); + stage.setScene(scene); + stage.show(); + } + + /** + * Button that takes user to future budgeting. + + * @param event mouse click. + * @throws IOException if wrong input detected. + */ + public void switchToFutureBudgeting(ActionEvent event) throws IOException { + BorderPane rootSwitchToFutureBudgeting = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/FutureBudgeting.fxml")))); + + stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + scene = new Scene(rootSwitchToFutureBudgeting); + stage.setScene(scene); + stage.show(); + } + + /** + * Button that takes user to edit expenses. + + * @param event mouse click. + * @throws IOException if wrong input detected. + */ + public void switchToEditExpenses(ActionEvent event) throws IOException { + BorderPane rootSwitchToAddExpense = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/EditExpense.fxml")))); + + stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + scene = new Scene(rootSwitchToAddExpense); + stage.setScene(scene); + stage.show(); + } + + /** + * A button that opens the help option menu. + * @param event - mouse click + * @throws IOException - if wrong input detected + */ + public void openHelpEdit(ActionEvent event) throws IOException { + FXMLLoader rootSwitchToHelpOption = new FXMLLoader(getClass().getResource("/HelpScenes/HelpEdit.fxml")); + Parent rootHelp = (Parent) rootSwitchToHelpOption.load(); + Stage stage = new Stage(); + stage.setScene(new Scene(rootHelp)); stage.show(); } diff --git a/src/main/java/no/ntnu/idatt1002/demo/recurring/RecurringTransactionsController.java b/src/main/java/no/ntnu/idatt1002/demo/recurring/RecurringTransactionsController.java index 33bc1ab26c51861eabc84675ae7e7e8d049e2ce1..3a6a4fa1a922b8e0bbfcbf68739f83ed0d8732f2 100644 --- a/src/main/java/no/ntnu/idatt1002/demo/recurring/RecurringTransactionsController.java +++ b/src/main/java/no/ntnu/idatt1002/demo/recurring/RecurringTransactionsController.java @@ -7,6 +7,7 @@ import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; import javafx.scene.Node; +import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.chart.PieChart; import javafx.scene.control.*; @@ -39,6 +40,8 @@ import java.util.ResourceBundle; * Controller for recurring transactions FXML. */ public class RecurringTransactionsController implements Initializable { + private Stage stage; + private Scene scene; @FXML private Label monthName; @FXML @@ -91,6 +94,16 @@ public class RecurringTransactionsController implements Initializable { ); pieChart.setData(pieChartData); } +/* +@FXML + public void listData() { + List<String> transactionStringList = new ArrayList<>(); + transactionStringList.add("Cats"); + transactionStringList.add("Bottle"); + ObservableList<String> observableList = FXCollections.observableList(transactionStringList); + recurringTransactions.setItems(observableList); + } +*/ /** * Button to go to home page of application. @@ -100,22 +113,73 @@ public class RecurringTransactionsController implements Initializable { */ public void goHome(ActionEvent event) throws IOException { BorderPane rootGoHome = (FXMLLoader.load(Objects.requireNonNull(getClass().getResource( - "/SpendWiseHomePage.fxml")))); + "/SpendWiseHomePage.fxml")))); Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); Scene scene = new Scene(rootGoHome); stage.setScene(scene); stage.show(); } -} -/* -@FXML - public void listData() { - List<String> transactionStringList = new ArrayList<>(); - transactionStringList.add("Cats"); - transactionStringList.add("Bottle"); - ObservableList<String> observableList = FXCollections.observableList(transactionStringList); - recurringTransactions.setItems(observableList); + /** + * Button that takes user to income. + + * @param event mouse click. + * @throws IOException if wrong input detected. + */ + public void switchToIncome(ActionEvent event) throws IOException { + Scene rootSwitchToIncome = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/Income.fxml")))); + + stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + stage.setScene(rootSwitchToIncome); + stage.show(); } -*/ + + + /** + * Button that takes user to future budgeting. + + * @param event mouse click. + * @throws IOException if wrong input detected. + */ + public void switchToFutureBudgeting(ActionEvent event) throws IOException { + BorderPane rootSwitchToFutureBudgeting = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/FutureBudgeting.fxml")))); + + stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + scene = new Scene(rootSwitchToFutureBudgeting); + stage.setScene(scene); + stage.show(); + } + + /** + * Button that takes user to edit income. + + * @param event mouse click. + * @throws IOException if wrong input detected. + */ + public void switchToEditIncome(ActionEvent event) throws IOException { + BorderPane rootSwitchToEditIncome = (FXMLLoader.load(Objects.requireNonNull( + getClass().getResource("/EditIncome.fxml")))); + + stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + scene = new Scene(rootSwitchToEditIncome); + stage.setScene(scene); + stage.show(); + } + + /** + * A button that opens the help option menu. + * @param event - mouse click + * @throws IOException - if wrong input detected + */ + public void openHelpOption(ActionEvent event) throws IOException { + FXMLLoader rootSwitchToHelpOption = new FXMLLoader(getClass().getResource("/HelpScenes/HelpRecTrans.fxml")); + Parent rootHelp = (Parent) rootSwitchToHelpOption.load(); + Stage stage = new Stage(); + stage.setScene(new Scene(rootHelp)); + stage.show(); + } + +} diff --git a/src/main/resources/EditExpense.fxml b/src/main/resources/EditExpense.fxml index 08adcb640f40404ea39991145317003f7b413851..b69666f5de901e42ce8dfa5875bfa2b00283751b 100644 --- a/src/main/resources/EditExpense.fxml +++ b/src/main/resources/EditExpense.fxml @@ -1,102 +1,197 @@ <?xml version="1.0" encoding="UTF-8"?> -<?import javafx.geometry.*?> -<?import javafx.scene.control.*?> -<?import javafx.scene.image.*?> -<?import javafx.scene.layout.*?> -<?import javafx.scene.text.*?> +<?import javafx.geometry.Insets?> +<?import javafx.scene.control.Button?> +<?import javafx.scene.control.ComboBox?> +<?import javafx.scene.control.DatePicker?> +<?import javafx.scene.control.Label?> +<?import javafx.scene.control.TableColumn?> +<?import javafx.scene.control.TableView?> +<?import javafx.scene.control.TextField?> +<?import javafx.scene.control.ToolBar?> +<?import javafx.scene.image.Image?> +<?import javafx.scene.image.ImageView?> +<?import javafx.scene.layout.BorderPane?> +<?import javafx.scene.layout.ColumnConstraints?> +<?import javafx.scene.layout.GridPane?> +<?import javafx.scene.layout.HBox?> +<?import javafx.scene.layout.RowConstraints?> +<?import javafx.scene.layout.VBox?> +<?import javafx.scene.text.Font?> -<GridPane fx:id="gridPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" style="-fx-background-color: F5E1B9;" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="no.ntnu.idatt1002.demo.expenses.EditExpenseController"> - <columnConstraints> - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> - </columnConstraints> - <rowConstraints> - <RowConstraints maxHeight="87.0" minHeight="10.0" prefHeight="46.0" vgrow="SOMETIMES" /> - <RowConstraints maxHeight="347.0" minHeight="10.0" prefHeight="347.0" vgrow="SOMETIMES" /> - </rowConstraints> - <children> - <AnchorPane prefHeight="53.0" prefWidth="107.0" GridPane.columnIndex="1"> - <children> - <Label layoutX="-16.0" layoutY="29.0" text="Add Expense:" textFill="#8e7d69"> +<BorderPane prefHeight="800.0" prefWidth="1400.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="no.ntnu.idatt1002.demo.expenses.EditExpenseController"> + <center> + <BorderPane> + <center> + <HBox alignment="CENTER" spacing="50.0"> + <children> + <VBox alignment="CENTER" prefHeight="515.0" prefWidth="464.0" spacing="20.0"> + <children> + <TableView fx:id="tableView" prefHeight="396.0" prefWidth="464.0"> + <columns> + <TableColumn fx:id="nameColumn" prefWidth="121.83334350585938" text="Name" /> + <TableColumn fx:id="amountColumn" prefWidth="159.50003051757812" text="Amount" /> + <TableColumn fx:id="categoryColumn" prefWidth="182.99996948242188" text="Category" /> + </columns> + </TableView> + <Button fx:id="deleteExpense" mnemonicParsing="false" onAction="#deleteExpensePressed" style="-fx-background-color: D8AF7F;" text="Delete chosen income" textFill="#495635"> + <font> + <Font name="Arial" size="15.0" /> + </font> + <padding> + <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> + </padding> + </Button> + </children> + <HBox.margin> + <Insets bottom="20.0" top="20.0" /> + </HBox.margin> + </VBox> + <VBox prefHeight="475.0" prefWidth="419.0"> + <HBox.margin> + <Insets bottom="40.0" top="10.0" /> + </HBox.margin> + <children> + <HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0" spacing="20.0"> + <children> + <Label prefHeight="25.0" prefWidth="162.0" text="Add Expense" textFill="#8e7d69"> + <font> + <Font name="Arial Bold" size="25.0" /> + </font> + </Label> + <DatePicker fx:id="datePicker" prefHeight="25.0" prefWidth="161.0" promptText="Choose date" style="-fx-border-color: D8AF7F;" /> + </children> + </HBox> + <GridPane alignment="CENTER" hgap="10.0" prefHeight="420.0" prefWidth="428.0"> + <columnConstraints> + <ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> + <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> + </columnConstraints> + <rowConstraints> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + </rowConstraints> + <children> + <Label text="Expense name:" textFill="#8e7d69"> + <font> + <Font name="Arial" size="16.0" /> + </font> + </Label> + <TextField fx:id="expenseName" prefHeight="25.0" prefWidth="150.0" promptText="Write here" style="-fx-border-color: D8AF7F;" GridPane.columnIndex="1"> + <font> + <Font name="Arial" size="12.0" /> + </font> + </TextField> + <Label text="Amount:" textFill="#8e7d69" GridPane.rowIndex="1"> + <font> + <Font name="Arial" size="16.0" /> + </font> + </Label> + <TextField fx:id="amount" prefHeight="27.0" prefWidth="150.0" promptText="Write here" GridPane.columnIndex="1" GridPane.rowIndex="1"> + <font> + <Font name="Arial" size="12.0" /> + </font> + </TextField> + <Label text="Category:" textFill="#8e7d69" GridPane.rowIndex="2"> + <font> + <Font name="Arial" size="16.0" /> + </font> + </Label> + <ComboBox fx:id="categoryBox" editable="true" prefWidth="150.0" promptText="Choose category" GridPane.columnIndex="1" GridPane.rowIndex="2" /> + <Button fx:id="addExpense" mnemonicParsing="false" onAction="#addExpensePressed" style="-fx-background-color: D8AF7F;" text="Add expense" textFill="#495635" GridPane.columnIndex="1" GridPane.rowIndex="4"> + <font> + <Font name="Arial" size="15.0" /> + </font> + </Button> + <VBox prefHeight="200.0" prefWidth="100.0" spacing="5.0" GridPane.columnIndex="1" GridPane.rowIndex="3"> + <children> + <Label text="Notes:" textFill="#8e7d69"> + <font> + <Font name="Arial" size="15.0" /> + </font> + </Label> + <TextField fx:id="notes" alignment="TOP_LEFT" prefHeight="105.0" prefWidth="268.0" promptText="Write notes here" style="-fx-border-color: D8AF7F;"> + <font> + <Font name="Arial" size="12.0" /> + </font> + </TextField> + </children> + </VBox> + </children> + <padding> + <Insets bottom="40.0" right="40.0" top="40.0" /> + </padding> + </GridPane> + </children> + </VBox> + </children> + <padding> + <Insets bottom="20.0" left="20.0" right="20.0" top="20.0" /> + </padding> + </HBox> + </center> + <top> + <ToolBar prefHeight="40.0" prefWidth="200.0" BorderPane.alignment="CENTER"> + <items> + <Button mnemonicParsing="false" onAction="#switchToIncome" text="Overview" /> + <Button mnemonicParsing="false" onAction="#switchToRecurringTransactions" text="Recurring transactions" /> + <Button mnemonicParsing="false" onAction="#switchToFutureBudgeting" text="Budgeting" /> + <Button mnemonicParsing="false" onAction="#switchToEditIncome" prefHeight="33.0" prefWidth="44.0" text="Edit" /> + </items> + </ToolBar> + </top> + </BorderPane> + </center> + <top> + <BorderPane prefHeight="165.0" prefWidth="140.0" BorderPane.alignment="CENTER"> + <left> + <Button mnemonicParsing="false" onAction="#goHome" BorderPane.alignment="CENTER"> + <graphic> + <ImageView fitHeight="100.0" fitWidth="100.0" pickOnBounds="true" preserveRatio="true"> + <image> + <Image url="@Icons/SpendwiseIcon.png" /> + </image> + </ImageView> + </graphic> + </Button> + </left> + <right> + <VBox alignment="CENTER" prefHeight="200.0" prefWidth="78.0" spacing="16.0" BorderPane.alignment="CENTER"> + <children> + <Button mnemonicParsing="false"> + <graphic> + <ImageView fitHeight="30.0" fitWidth="30.0" pickOnBounds="true" preserveRatio="true"> + <image> + <Image url="@Icons/Settings.png" /> + </image> + </ImageView> + </graphic> + </Button> + <Button mnemonicParsing="false" onAction="#openHelpEdit"> + <graphic> + <ImageView fitHeight="30.0" fitWidth="30.0" pickOnBounds="true" preserveRatio="true"> + <image> + <Image url="@Icons/HelpIcon.png" /> + </image> + </ImageView> + </graphic> + </Button> + </children> + </VBox> + </right> + <center> + <Label text="Edit Expenses" BorderPane.alignment="CENTER"> <font> - <Font name="Arial" size="21.0" /> + <Font name="Arial Bold" size="40.0" /> </font> </Label> - <DatePicker fx:id="datePicker" layoutX="125.0" layoutY="28.0" prefHeight="25.0" prefWidth="161.0" promptText="Choose date" style="-fx-border-color: D8AF7F;" /> - </children></AnchorPane> - <AnchorPane prefHeight="200.0" prefWidth="200.0"> - <children> - <Label layoutX="72.0" layoutY="27.0" text="Edit Expenses" textFill="#495635"> - <font> - <Font name="Arial" size="27.0" /> - </font> - </Label> - <Button layoutX="6.0" layoutY="14.0" mnemonicParsing="false" onAction="#goHome" style="-fx-background-color: transparent;" /> - <ImageView fitHeight="50.0" fitWidth="50.0" layoutX="20.0" layoutY="14.0" pickOnBounds="true" preserveRatio="true"> - <image> - <Image url="@logo.png" /> - </image> - </ImageView> - </children> - </AnchorPane> - <AnchorPane prefHeight="372.0" prefWidth="294.0" GridPane.columnIndex="1" GridPane.rowIndex="1"> - <children> - <TextField fx:id="expenseName" layoutX="127.0" layoutY="27.0" prefHeight="25.0" prefWidth="150.0" promptText="Write here" style="-fx-border-color: D8AF7F;"> - <font> - <Font name="Arial" size="12.0" /> - </font></TextField> - <TextField fx:id="amount" layoutX="127.0" layoutY="62.0" prefHeight="27.0" prefWidth="150.0" promptText="Write here"> - <font> - <Font name="Arial" size="12.0" /> - </font></TextField> - <ComboBox fx:id="categoryBox" editable="true" layoutX="127.0" layoutY="109.0" prefWidth="150.0" promptText="Choose category" /> - <TextField fx:id="notes" alignment="TOP_LEFT" layoutX="13.0" layoutY="196.0" prefHeight="105.0" prefWidth="268.0" promptText="Write notes here" style="-fx-border-color: D8AF7F;"> - <font> - <Font name="Arial" size="12.0" /> - </font></TextField> - <Label layoutX="2.0" layoutY="30.0" text="Expense name:" textFill="#8e7d69"> - <font> - <Font name="Arial" size="16.0" /> - </font> - </Label> - <Label layoutX="51.0" layoutY="66.0" text="Amount:" textFill="#8e7d69"> - <font> - <Font name="Arial" size="16.0" /> - </font> - </Label> - <Label layoutX="46.0" layoutY="112.0" text="Category:" textFill="#8e7d69"> - <font> - <Font name="Arial" size="16.0" /> - </font> - </Label> - <Label layoutX="14.0" layoutY="177.0" text="Notes:" textFill="#8e7d69"> - <font> - <Font name="Arial" size="15.0" /> - </font> - </Label> - <Button fx:id="addExpense" layoutX="180.0" layoutY="307.0" mnemonicParsing="false" onAction="#addExpensePressed" style="-fx-background-color: D8AF7F;" text="Add expense" textFill="#495635"> - <font> - <Font name="Arial" size="15.0" /> - </font></Button> - </children> - <GridPane.margin> - <Insets bottom="3.0" left="3.0" right="3.0" top="3.0" /> - </GridPane.margin> - </AnchorPane> - <AnchorPane prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="1"> - <children> - <TableView fx:id="tableView" layoutX="17.0" layoutY="24.0" prefHeight="264.0" prefWidth="268.0"> - <columns> - <TableColumn fx:id="nameColumn" prefWidth="93.0" text="Name" /> - <TableColumn fx:id="amountColumn" prefWidth="84.0" text="Amount" /> - <TableColumn fx:id="categoryColumn" prefWidth="90.0" text="Category" /> - </columns> - </TableView> - <Button fx:id="deleteExpense" layoutX="17.0" layoutY="306.0" mnemonicParsing="false" onAction="#deleteExpensePressed" style="-fx-background-color: D8AF7F;" text="Delete chosen income" textFill="#495635"> - <font> - <Font name="Arial" size="15.0" /> - </font></Button> - </children></AnchorPane> - </children> -</GridPane> + </center> + <padding> + <Insets bottom="20.0" left="20.0" right="20.0" top="20.0" /> + </padding> + </BorderPane> + </top> +</BorderPane> diff --git a/src/main/resources/EditIncome.fxml b/src/main/resources/EditIncome.fxml index 4651e87f8bee9e020a0ed670ef3dc93d0b8df91d..886e2993474ae15441a1e45164c560d7e3525fd3 100644 --- a/src/main/resources/EditIncome.fxml +++ b/src/main/resources/EditIncome.fxml @@ -1,106 +1,183 @@ <?xml version="1.0" encoding="UTF-8"?> -<?import javafx.geometry.*?> -<?import javafx.scene.control.*?> -<?import javafx.scene.image.*?> -<?import javafx.scene.layout.*?> -<?import javafx.scene.text.*?> +<?import javafx.geometry.Insets?> +<?import javafx.scene.control.Button?> +<?import javafx.scene.control.ComboBox?> +<?import javafx.scene.control.DatePicker?> +<?import javafx.scene.control.Label?> +<?import javafx.scene.control.TableColumn?> +<?import javafx.scene.control.TableView?> +<?import javafx.scene.control.TextField?> +<?import javafx.scene.control.ToolBar?> +<?import javafx.scene.image.Image?> +<?import javafx.scene.image.ImageView?> +<?import javafx.scene.layout.BorderPane?> +<?import javafx.scene.layout.ColumnConstraints?> +<?import javafx.scene.layout.GridPane?> +<?import javafx.scene.layout.HBox?> +<?import javafx.scene.layout.RowConstraints?> +<?import javafx.scene.layout.VBox?> +<?import javafx.scene.text.Font?> -<GridPane fx:id="gridPane" prefHeight="400.0" prefWidth="600.0" style="-fx-background-color: F5E1B9;" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="no.ntnu.idatt1002.demo.income.EditIncomeController"> - <columnConstraints> - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> - </columnConstraints> - <rowConstraints> - <RowConstraints maxHeight="87.0" minHeight="10.0" prefHeight="46.0" vgrow="SOMETIMES" /> - <RowConstraints maxHeight="347.0" minHeight="10.0" prefHeight="347.0" vgrow="SOMETIMES" /> - </rowConstraints> - <children> - <AnchorPane prefHeight="53.0" prefWidth="107.0" GridPane.columnIndex="1"> - <children> - <Label layoutY="28.0" text="Add Income:" textFill="#8e7d69"> - <font> - <Font name="Arial" size="21.0" /> - </font> - </Label> - <DatePicker fx:id="datePicker" layoutX="125.0" layoutY="27.0" prefHeight="25.0" prefWidth="161.0" promptText="Choose date" style="-fx-background-color: D8AF7F;" /> - </children></AnchorPane> - <AnchorPane prefHeight="200.0" prefWidth="200.0"> - <children> - <Label layoutX="70.0" layoutY="26.0" text="Edit Income" textFill="#495635"> - <font> - <Font name="Arial" size="27.0" /> - </font> - </Label> - <Button layoutY="14.0" mnemonicParsing="false" onAction="#goHome" style="-fx-background-color: transparent;"> + +<BorderPane prefHeight="800.0" prefWidth="1400.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="no.ntnu.idatt1002.demo.income.EditIncomeController"> + <center> + <BorderPane> + <center> + <HBox alignment="CENTER"> + <children> + <VBox alignment="CENTER" prefHeight="560.0" prefWidth="382.0" spacing="20.0"> + <children> + <TableView fx:id="tableView" editable="true" prefHeight="271.0" prefWidth="268.0"> + <columns> + <TableColumn fx:id="nameColumn" prefWidth="96.0" text="Name" /> + <TableColumn fx:id="amountColumn" prefWidth="139.0" text="Amount" /> + <TableColumn fx:id="categoryColumn" prefWidth="146.0" text="Category" /> + </columns> + </TableView> + <Button fx:id="deleteIncome" mnemonicParsing="false" onAction="#deleteIncomePressed" prefHeight="27.0" prefWidth="170.0" style="-fx-background-color: D8AF7F;" text="Delete chosen income" textFill="#495635"> + <font> + <Font name="Arial" size="15.0" /> + </font> + </Button> + </children> + </VBox> + <VBox alignment="TOP_CENTER" prefHeight="560.0" prefWidth="332.0" spacing="30.0"> + <children> + <HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0" spacing="20.0"> + <children> + <Label text="Add Income" textFill="#8e7d69"> + <font> + <Font name="Arial Bold" size="21.0" /> + </font> + </Label> + <DatePicker fx:id="datePicker" prefHeight="25.0" prefWidth="161.0" promptText="Choose date" style="-fx-background-color: D8AF7F;" /> + </children> + </HBox> + <GridPane hgap="10.0" prefHeight="234.0" prefWidth="324.0"> + <columnConstraints> + <ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> + <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> + </columnConstraints> + <rowConstraints> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + </rowConstraints> + <children> + <Label text="Income name:" textFill="#8e7d69"> + <font> + <Font name="Arial" size="16.0" /> + </font> + </Label> + <TextField fx:id="incomeName" prefHeight="25.0" prefWidth="150.0" promptText="Write here" style="-fx-border-color: D8AF7F;" GridPane.columnIndex="1"> + <font> + <Font name="Arial" size="12.0" /> + </font> + </TextField> + <Label text="Amount:" textFill="#8e7d69" GridPane.rowIndex="1"> + <font> + <Font name="Arial" size="16.0" /> + </font> + </Label> + <TextField fx:id="amount" promptText="Write here" style="-fx-border-color: D8AF7F;" GridPane.columnIndex="1" GridPane.rowIndex="1"> + <font> + <Font name="Arial" size="12.0" /> + </font> + </TextField> + <Label text="Category:" textFill="#8e7d69" GridPane.rowIndex="2"> + <font> + <Font name="Arial" size="16.0" /> + </font> + </Label> + <ComboBox fx:id="categoryBox" prefWidth="150.0" style="-fx-background-color: D8AF7F;" GridPane.columnIndex="1" GridPane.rowIndex="2" /> + <Button fx:id="addIncome" mnemonicParsing="false" onAction="#addIncomePressed" style="-fx-background-color: D8AF7F;" text="Add income" textFill="#495635" GridPane.columnIndex="1" GridPane.rowIndex="4"> + <font> + <Font name="Arial" size="15.0" /> + </font> + </Button> + <VBox prefHeight="200.0" prefWidth="100.0" GridPane.columnIndex="1" GridPane.rowIndex="3"> + <children> + <Label text="Notes:" textFill="#8e7d69"> + <font> + <Font name="Arial" size="15.0" /> + </font> + </Label> + <TextField fx:id="notes" alignment="TOP_LEFT" prefHeight="105.0" prefWidth="268.0" promptText="Write notes here" style="-fx-border-color: D8AF7F;"> + <font> + <Font name="Arial" size="12.0" /> + </font> + </TextField> + </children> + </VBox> + </children> + </GridPane> + </children> + </VBox> + </children> + </HBox> + </center> + <top> + <ToolBar prefHeight="40.0" prefWidth="200.0" BorderPane.alignment="CENTER"> + <items> + <Button mnemonicParsing="false" onAction="#switchToIncome" text="Overview" /> + <Button mnemonicParsing="false" onAction="#switchToRecurringTransactions" text="Recurring transactions" /> + <Button mnemonicParsing="false" onAction="#switchToFutureBudgeting" text="Budgeting" /> + <Button mnemonicParsing="false" onAction="#switchToEditExpenses" text="Edit" /> + </items> + </ToolBar> + </top> + </BorderPane> + </center> + <top> + <BorderPane prefHeight="100.0" prefWidth="1400.0" BorderPane.alignment="CENTER"> + <left> + <Button mnemonicParsing="false" onAction="#goHome" BorderPane.alignment="CENTER"> <graphic> - <ImageView fitHeight="50.0" fitWidth="50.0" pickOnBounds="true" preserveRatio="true"> + <ImageView fitHeight="100.0" fitWidth="100.0" pickOnBounds="true" preserveRatio="true"> <image> - <Image url="@logo.png" /> + <Image url="@Icons/SpendwiseIcon.png" /> </image> </ImageView> - </graphic></Button> - </children> - </AnchorPane> - <AnchorPane prefHeight="372.0" prefWidth="294.0" GridPane.columnIndex="1" GridPane.rowIndex="1"> - <children> - <TextField fx:id="incomeName" layoutX="126.0" layoutY="49.0" prefHeight="25.0" prefWidth="150.0" promptText="Write here" style="-fx-border-color: D8AF7F;"> - <font> - <Font name="Arial" size="12.0" /> - </font></TextField> - <TextField fx:id="amount" layoutX="127.0" layoutY="87.0" promptText="Write here" style="-fx-border-color: D8AF7F;"> - <font> - <Font name="Arial" size="12.0" /> - </font></TextField> - <ComboBox fx:id="categoryBox" layoutX="127.0" layoutY="127.0" prefWidth="150.0" style="-fx-background-color: D8AF7F;" /> - <TextField fx:id="notes" alignment="TOP_LEFT" layoutX="13.0" layoutY="197.0" prefHeight="105.0" prefWidth="268.0" promptText="Write notes here" style="-fx-border-color: D8AF7F;"> - <font> - <Font name="Arial" size="12.0" /> - </font></TextField> - <Label layoutX="13.0" layoutY="53.0" text="Income name:" textFill="#8e7d69"> - <font> - <Font name="Arial" size="16.0" /> - </font> - </Label> - <Label layoutX="55.0" layoutY="91.0" text="Amount:" textFill="#8e7d69"> - <font> - <Font name="Arial" size="16.0" /> - </font> - </Label> - <Label layoutX="45.0" layoutY="130.0" text="Category:" textFill="#8e7d69"> - <font> - <Font name="Arial" size="16.0" /> - </font> - </Label> - <Label layoutX="14.0" layoutY="177.0" text="Notes:" textFill="#8e7d69"> + </graphic> + </Button> + </left> + <center> + <Label text="Edit Income" textFill="#495635" BorderPane.alignment="CENTER"> <font> - <Font name="Arial" size="15.0" /> + <Font name="Arial Bold" size="40.0" /> </font> </Label> - <Button fx:id="addIncome" layoutX="192.0" layoutY="308.0" mnemonicParsing="false" onAction="#addIncomePressed" style="-fx-background-color: D8AF7F;" text="Add income" textFill="#495635"> - <font> - <Font name="Arial" size="15.0" /> - </font></Button> - </children> - <GridPane.margin> - <Insets bottom="3.0" left="3.0" right="3.0" top="3.0" /> - </GridPane.margin> - </AnchorPane> - <AnchorPane prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="1"> - <children> - <TableView fx:id="tableView" editable="true" layoutX="21.0" layoutY="20.0" prefHeight="271.0" prefWidth="268.0"> - <columns> - <TableColumn fx:id="nameColumn" prefWidth="96.0" text="Name" /> - <TableColumn fx:id="amountColumn" prefWidth="82.0" text="Amount" /> - <TableColumn fx:id="categoryColumn" prefWidth="89.0" text="Category" /> - </columns> - </TableView> - <Button fx:id="deleteIncome" layoutX="34.0" layoutY="308.0" mnemonicParsing="false" onAction="#deleteIncomePressed" prefHeight="27.0" prefWidth="170.0" style="-fx-background-color: D8AF7F;" text="Delete chosen income" textFill="#495635"> - <font> - <Font name="Arial" size="15.0" /> - </font> - </Button> - </children> - </AnchorPane> - </children> -</GridPane> + </center> + <right> + <VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0" spacing="16.0"> + <children> + <Button mnemonicParsing="false"> + <graphic> + <ImageView fitHeight="30.0" fitWidth="30.0" pickOnBounds="true" preserveRatio="true"> + <image> + <Image url="@Icons/Settings.png" /> + </image> + </ImageView> + </graphic> + </Button> + <Button mnemonicParsing="false" onAction="#openHelpEdit"> + <graphic> + <ImageView fitHeight="30.0" fitWidth="30.0" pickOnBounds="true" preserveRatio="true"> + <image> + <Image url="@Icons/HelpIcon.png" /> + </image> + </ImageView> + </graphic> + </Button> + </children> + </VBox> + </right> + <padding> + <Insets bottom="20.0" left="20.0" right="20.0" top="20.0" /> + </padding> + </BorderPane> + </top> +</BorderPane> diff --git a/src/main/resources/Expenses.fxml b/src/main/resources/Expenses.fxml index e2087acb9f3b02a329fdd561016804d591eeca50..a8ab0b4a80c7a2cac890e0afce947df4bb6616d0 100644 --- a/src/main/resources/Expenses.fxml +++ b/src/main/resources/Expenses.fxml @@ -1,39 +1,190 @@ <?xml version="1.0" encoding="UTF-8"?> -<?import javafx.scene.*?> -<?import javafx.scene.chart.*?> -<?import javafx.scene.control.*?> -<?import javafx.scene.layout.*?> +<?import javafx.geometry.Insets?> +<?import javafx.scene.chart.PieChart?> +<?import javafx.scene.control.Button?> +<?import javafx.scene.control.CheckBox?> +<?import javafx.scene.control.CheckMenuItem?> +<?import javafx.scene.control.DatePicker?> +<?import javafx.scene.control.Label?> +<?import javafx.scene.control.Menu?> +<?import javafx.scene.control.MenuBar?> +<?import javafx.scene.control.ToolBar?> +<?import javafx.scene.image.Image?> +<?import javafx.scene.image.ImageView?> +<?import javafx.scene.layout.BorderPane?> +<?import javafx.scene.layout.HBox?> +<?import javafx.scene.layout.Region?> +<?import javafx.scene.layout.VBox?> +<?import javafx.scene.text.Font?> -<Scene xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="no.ntnu.idatt1002.demo.expenses.ExpensesController"> - <GridPane> - <columnConstraints> - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" /> - </columnConstraints> - <rowConstraints> - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> - </rowConstraints> - <children> - <AnchorPane prefHeight="459.0" prefWidth="587.0"> - <children> - <PieChart fx:id="pieChart" layoutX="35.0" layoutY="85.0" prefHeight="220.0" prefWidth="229.0" title="Expenses graph" /> - <DatePicker fx:id="fromDate" layoutX="275.0" layoutY="36.0" onAction="#goButtonPushed" prefHeight="26.0" prefWidth="120.0" promptText="Enter date to view from" /> - <DatePicker fx:id="toDate" layoutX="408.0" layoutY="36.0" onAction="#goButtonPushed" prefHeight="26.0" prefWidth="120.0" promptText="Enter date to view to" /> - <!--CheckBox fx:id="groceriesChecked" layoutX="276.0" layoutY="103.0" mnemonicParsing="false" onAction="#groceriesChecked" text="Groceries" /> - <CheckBox fx:id="housingChecked" layoutX="276.0" layoutY="145.0" mnemonicParsing="false" onAction="#housingChecked" text="Housing" /> - <CheckBox fx:id="fixedExpensesChecked" layoutX="276.0" layoutY="186.0" mnemonicParsing="false" onAction="#fixedExpensesChecked" text="Fixed expenses" /> - <CheckBox fx:id="travelChecked" layoutX="276.0" layoutY="221.0" mnemonicParsing="false" onAction="#travelChecked" text="Travel" /> - <CheckBox fx:id="entertainmentChecked" layoutX="276.0" layoutY="257.0" mnemonicParsing="false" onAction="#entertainmentChecked" text="Entertainment" /> - <CheckBox fx:id="otherChecked" layoutX="276.0" layoutY="296.0" mnemonicParsing="false" onAction="#otherChecked" text="Other" /--> - <VBox fx:id="categoryCheckBoxes" layoutX="276.0" layoutY="103.0" prefHeight="220.0" prefWidth="120.0" /> - <Button fx:id="editCategory" layoutX="423.0" layoutY="133.0" mnemonicParsing="false" onAction="#editCategoryButtonPushed" prefHeight="26.0" prefWidth="107.0" text="Edit categories" /> - <Button fx:id="editExpenses" layoutX="424.0" layoutY="182.0" mnemonicParsing="false" onAction="#editExpensesButtonPushed" prefHeight="26.0" prefWidth="107.0" text="Edit expenses" /> - <Button fx:id="viewIncome" layoutX="423.0" layoutY="233.0" mnemonicParsing="false" onAction="#viewIncomeButtonPushed" prefHeight="26.0" prefWidth="107.0" text="View income" /> - <Button fx:id="changeToBarGraph" layoutX="422.0" layoutY="283.0" mnemonicParsing="false" onAction="#changeToBarGraphButtonPushed" prefHeight="26.0" prefWidth="137.0" text="Change to bar graph" /> - <Button layoutX="14.0" layoutY="14.0" mnemonicParsing="false" onAction="#goHome" text="Home" /> - <Button fx:id="goButton" layoutX="540.0" layoutY="37.0" mnemonicParsing="false" onAction="#goButtonPushed" prefHeight="25.0" prefWidth="38.0" text="Go" /> - </children> - </AnchorPane> - </children> - </GridPane> -</Scene> +<BorderPane prefHeight="800.0" prefWidth="1400.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="no.ntnu.idatt1002.demo.expenses.ExpensesController"> + <top> + <BorderPane prefHeight="100.0" prefWidth="1400.0" style="-fx-background-color: EC84E2;" BorderPane.alignment="CENTER"> + <left> + <Button mnemonicParsing="false" onAction="#goHome" style="-fx-background-color: translucent;" BorderPane.alignment="CENTER"> + <graphic> + <ImageView fitHeight="100.0" fitWidth="100.0" pickOnBounds="true" preserveRatio="true"> + <image> + <Image url="@Icons/SpendwiseIcon.png" /> + </image> + </ImageView> + </graphic> + </Button> + </left> + <right> + <VBox alignment="CENTER" prefHeight="108.0" prefWidth="54.0" spacing="16.0" BorderPane.alignment="CENTER"> + <children> + <Button mnemonicParsing="false" style="-fx-background-color: translucent;"> + <graphic> + <ImageView fitHeight="30.0" fitWidth="30.0" pickOnBounds="true" preserveRatio="true"> + <image> + <Image url="@Icons/Settings.png" /> + </image> + </ImageView> + </graphic> + </Button> + <Button mnemonicParsing="false" onAction="#openHelpOption" style="-fx-background-color: translucent;"> + <graphic> + <ImageView fitHeight="30.0" fitWidth="30.0" pickOnBounds="true" preserveRatio="true"> + <image> + <Image url="@Icons/HelpIcon.png" /> + </image> + </ImageView> + </graphic> + </Button> + </children> + </VBox> + </right> + <center> + <Label text="Expense Overview" textFill="#382119" BorderPane.alignment="CENTER"> + <font> + <Font name="Arial Bold" size="40.0" /> + </font> + </Label> + </center> + <padding> + <Insets bottom="20.0" left="20.0" right="20.0" top="20.0" /> + </padding> + </BorderPane> + </top> + <center> + <BorderPane prefHeight="200.0" prefWidth="200.0" BorderPane.alignment="CENTER"> + <top> + <ToolBar prefHeight="40.0" prefWidth="200.0" style="-fx-border-color: #382119; -fx-background-color: EC84E2;" BorderPane.alignment="CENTER"> + <items> + <Button mnemonicParsing="false" onAction="#switchToIncome" style="-fx-background-color: translucent;" text="Overview" textFill="#382119"> + <font> + <Font name="Arial" size="15.0" /> + </font> + </Button> + <Button mnemonicParsing="false" onAction="#switchToRecurringTransactions" style="-fx-background-color: translucent;" text="Recurring transactions" textFill="#382119"> + <font> + <Font name="Arial Bold" size="15.0" /> + </font> + </Button> + <Button mnemonicParsing="false" onAction="#switchToFutureBudgeting" style="-fx-background-color: translucent;" text="Budgeting" textFill="#382119"> + <font> + <Font name="Arial Bold" size="15.0" /> + </font> + </Button> + <Button mnemonicParsing="false" onAction="#switchToEditIncome" style="-fx-background-color: translucent;" text="Edit" textFill="#382119"> + <font> + <Font name="Arial Bold" size="15.0" /> + </font> + </Button> + </items> + <padding> + <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> + </padding> + </ToolBar> + </top> + <center> + <HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0" BorderPane.alignment="CENTER"> + <children> + <VBox alignment="CENTER" prefHeight="560.0" prefWidth="376.0" spacing="10.0"> + <children> + <Label text="Expense graph" textFill="#382119"> + <font> + <Font name="Arial" size="20.0" /> + </font> + </Label> + <PieChart fx:id="pieChart" prefHeight="400.0" prefWidth="328.0" /> + </children> + </VBox> + <VBox fx:id="categoryCheckBoxes" alignment="CENTER" prefHeight="560.0" prefWidth="118.0"> + <children> + <CheckBox mnemonicParsing="false" text="CheckBox" /> + <CheckBox layoutX="33.0" layoutY="270.0" mnemonicParsing="false" text="CheckBox" /> + <MenuBar prefHeight="42.0" prefWidth="200.0" style="-fx-border-color: #382119;"> + <menus> + <Menu mnemonicParsing="false" text="Categories"> + <items> + <CheckMenuItem id="Loan" mnemonicParsing="false" text="Unspecified Action" /> + <CheckMenuItem id="Food" mnemonicParsing="false" text="Unspecified Action" /> + </items> + </Menu> + </menus> + <padding> + <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> + </padding> + <VBox.margin> + <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> + </VBox.margin> + </MenuBar> + </children> + </VBox> + <Region prefHeight="200.0" prefWidth="200.0" /> + <VBox alignment="CENTER" prefHeight="603.0" prefWidth="293.0" spacing="10.0"> + <children> + <HBox prefHeight="26.0" prefWidth="293.0"> + <children> + <DatePicker fx:id="fromDate" onAction="#goButtonPushed" /> + <DatePicker fx:id="toDate" onAction="#goButtonPushed" /> + </children> + </HBox> + <Button fx:id="goButton" mnemonicParsing="false" onAction="#goButtonPushed" text="Button" /> + <Region prefHeight="200.0" prefWidth="293.0" /> + <Button mnemonicParsing="false" onAction="#switchToIncome" prefHeight="30.0" prefWidth="250.0" text="Income Overview" textFill="#382119"> + <VBox.margin> + <Insets bottom="10.0" /> + </VBox.margin> + <font> + <Font name="Arial" size="20.0" /> + </font> + <padding> + <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> + </padding> + </Button> + <Button mnemonicParsing="false" prefHeight="30.0" prefWidth="250.0" text="Edit categories" textFill="#382119"> + <font> + <Font name="Arial" size="20.0" /> + </font> + <padding> + <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> + </padding> + </Button> + <Button mnemonicParsing="false" prefHeight="30.0" prefWidth="250.0" text="Edit outcome"> + <font> + <Font name="Arial" size="20.0" /> + </font> + <padding> + <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> + </padding> + </Button> + <Button mnemonicParsing="false" prefHeight="30.0" prefWidth="250.0" text="Change to bar graph"> + <font> + <Font name="Arial" size="20.0" /> + </font> + <padding> + <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> + </padding> + </Button> + </children> + </VBox> + </children> + </HBox> + </center> + </BorderPane> + </center> +</BorderPane> diff --git a/src/main/resources/FutureBudgeting.fxml b/src/main/resources/FutureBudgeting.fxml index a6c9965a2d452e51176a388b8defa9efa2928f82..cc19ae223e74929c8110fc5659468c667ec95aaf 100644 --- a/src/main/resources/FutureBudgeting.fxml +++ b/src/main/resources/FutureBudgeting.fxml @@ -20,11 +20,11 @@ <top> <ToolBar prefHeight="40.0" prefWidth="200.0" style="-fx-background-color: EC84E2; -fx-border-color: #382119;" BorderPane.alignment="CENTER"> <items> - <Button mnemonicParsing="false" style="-fx-background-color: translucent;" text="Overview" textFill="#382119"> + <Button mnemonicParsing="false" onAction="#switchToIncome" style="-fx-background-color: translucent;" text="Overview" textFill="#382119"> <font> <Font name="Arial Bold" size="15.0" /> </font></Button> - <Button mnemonicParsing="false" style="-fx-background-color: translucent;" text="Recurring Transactions" textFill="#382119"> + <Button mnemonicParsing="false" onAction="#switchToRecurringTransactions" style="-fx-background-color: translucent;" text="Recurring Transactions" textFill="#382119"> <font> <Font name="Arial Bold" size="15.0" /> </font></Button> @@ -32,7 +32,7 @@ <font> <Font name="Arial" size="15.0" /> </font></Button> - <Button mnemonicParsing="false" style="-fx-background-color: translucent;" text="Edit" textFill="#382119"> + <Button mnemonicParsing="false" onAction="#switchToEditIncome" style="-fx-background-color: translucent;" text="Edit" textFill="#382119"> <font> <Font name="Arial Bold" size="15.0" /> </font></Button> @@ -199,7 +199,7 @@ </ImageView> </graphic> </Button> - <Button mnemonicParsing="false" style="-fx-background-color: translucent;"> + <Button mnemonicParsing="false" onAction="#openHelpOption" style="-fx-background-color: translucent;"> <graphic> <ImageView fitHeight="30.0" fitWidth="30.0" pickOnBounds="true" preserveRatio="true"> <image> diff --git a/src/main/resources/HelpScenes/HelpBudgeting.fxml b/src/main/resources/HelpScenes/HelpBudgeting.fxml new file mode 100644 index 0000000000000000000000000000000000000000..1799d793f6a50fed0d0b92dab983e9ee0301ebc0 --- /dev/null +++ b/src/main/resources/HelpScenes/HelpBudgeting.fxml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<?import java.lang.*?> +<?import java.util.*?> +<?import javafx.scene.*?> +<?import javafx.scene.control.*?> +<?import javafx.scene.layout.*?> + +<AnchorPane xmlns="http://javafx.com/javafx" + xmlns:fx="http://javafx.com/fxml" + fx:controller="no.ntnu.idatt1002.demo.help.HelpController" + prefHeight="400.0" prefWidth="600.0"> + +</AnchorPane> diff --git a/src/main/resources/HelpScenes/HelpEdit.fxml b/src/main/resources/HelpScenes/HelpEdit.fxml new file mode 100644 index 0000000000000000000000000000000000000000..1799d793f6a50fed0d0b92dab983e9ee0301ebc0 --- /dev/null +++ b/src/main/resources/HelpScenes/HelpEdit.fxml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<?import java.lang.*?> +<?import java.util.*?> +<?import javafx.scene.*?> +<?import javafx.scene.control.*?> +<?import javafx.scene.layout.*?> + +<AnchorPane xmlns="http://javafx.com/javafx" + xmlns:fx="http://javafx.com/fxml" + fx:controller="no.ntnu.idatt1002.demo.help.HelpController" + prefHeight="400.0" prefWidth="600.0"> + +</AnchorPane> diff --git a/src/main/resources/HelpScenes/HelpExpenses.fxml b/src/main/resources/HelpScenes/HelpExpenses.fxml new file mode 100644 index 0000000000000000000000000000000000000000..1799d793f6a50fed0d0b92dab983e9ee0301ebc0 --- /dev/null +++ b/src/main/resources/HelpScenes/HelpExpenses.fxml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<?import java.lang.*?> +<?import java.util.*?> +<?import javafx.scene.*?> +<?import javafx.scene.control.*?> +<?import javafx.scene.layout.*?> + +<AnchorPane xmlns="http://javafx.com/javafx" + xmlns:fx="http://javafx.com/fxml" + fx:controller="no.ntnu.idatt1002.demo.help.HelpController" + prefHeight="400.0" prefWidth="600.0"> + +</AnchorPane> diff --git a/src/main/resources/HelpScenes/HelpOption.fxml b/src/main/resources/HelpScenes/HelpHome.fxml similarity index 100% rename from src/main/resources/HelpScenes/HelpOption.fxml rename to src/main/resources/HelpScenes/HelpHome.fxml diff --git a/src/main/resources/HelpScenes/HelpIncome.fxml b/src/main/resources/HelpScenes/HelpIncome.fxml new file mode 100644 index 0000000000000000000000000000000000000000..1799d793f6a50fed0d0b92dab983e9ee0301ebc0 --- /dev/null +++ b/src/main/resources/HelpScenes/HelpIncome.fxml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<?import java.lang.*?> +<?import java.util.*?> +<?import javafx.scene.*?> +<?import javafx.scene.control.*?> +<?import javafx.scene.layout.*?> + +<AnchorPane xmlns="http://javafx.com/javafx" + xmlns:fx="http://javafx.com/fxml" + fx:controller="no.ntnu.idatt1002.demo.help.HelpController" + prefHeight="400.0" prefWidth="600.0"> + +</AnchorPane> diff --git a/src/main/resources/HelpScenes/HelpRecTrans.fxml b/src/main/resources/HelpScenes/HelpRecTrans.fxml new file mode 100644 index 0000000000000000000000000000000000000000..1799d793f6a50fed0d0b92dab983e9ee0301ebc0 --- /dev/null +++ b/src/main/resources/HelpScenes/HelpRecTrans.fxml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<?import java.lang.*?> +<?import java.util.*?> +<?import javafx.scene.*?> +<?import javafx.scene.control.*?> +<?import javafx.scene.layout.*?> + +<AnchorPane xmlns="http://javafx.com/javafx" + xmlns:fx="http://javafx.com/fxml" + fx:controller="no.ntnu.idatt1002.demo.help.HelpController" + prefHeight="400.0" prefWidth="600.0"> + +</AnchorPane> diff --git a/src/main/resources/Income.fxml b/src/main/resources/Income.fxml index a3a9efba00d1b22d61a3eb6e95e18baaf089c01d..0b898da5646547386393ccbe575fb38e7055ddfe 100644 --- a/src/main/resources/Income.fxml +++ b/src/main/resources/Income.fxml @@ -24,7 +24,7 @@ <!--Could the goButtonPushed be applied to the checkboxes as well?--> <Button fx:id="editCategory" layoutX="423.0" layoutY="133.0" mnemonicParsing="false" onAction="#editCategoryButtonPushed" prefHeight="26.0" prefWidth="107.0" text="Edit categories" /> <Button fx:id="editExpenses" layoutX="424.0" layoutY="182.0" mnemonicParsing="false" onAction="#editIncomeButtonPushed" prefHeight="26.0" prefWidth="107.0" text="Edit expenses" /> - <Button fx:id="viewExpense" layoutX="423.0" layoutY="233.0" mnemonicParsing="false" onAction="#goToExpenses" prefHeight="26.0" prefWidth="107.0" text="View income" /> + <Button fx:id="viewExpense" layoutX="423.0" layoutY="233.0" mnemonicParsing="false" onAction="#switchToExpenses" prefHeight="26.0" prefWidth="107.0" text="View income" /> <Button fx:id="changeToBarGraph" layoutX="422.0" layoutY="283.0" mnemonicParsing="false" prefHeight="26.0" prefWidth="137.0" text="Change to bar graph" /> <Button layoutX="14.0" layoutY="14.0" mnemonicParsing="false" onAction="#goHome" text="Home" /> <Button fx:id="goButton" layoutX="540.0" layoutY="37.0" mnemonicParsing="false" onAction="#goButtonPushed" prefHeight="25.0" prefWidth="38.0" text="Go" /> diff --git a/src/main/resources/Outcome.fxml b/src/main/resources/Outcome.fxml deleted file mode 100644 index e854fbfcd1376c426184be61d84219e85a4fc87f..0000000000000000000000000000000000000000 --- a/src/main/resources/Outcome.fxml +++ /dev/null @@ -1,190 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<?import javafx.geometry.Insets?> -<?import javafx.scene.chart.PieChart?> -<?import javafx.scene.control.Button?> -<?import javafx.scene.control.CheckBox?> -<?import javafx.scene.control.CheckMenuItem?> -<?import javafx.scene.control.DatePicker?> -<?import javafx.scene.control.Label?> -<?import javafx.scene.control.Menu?> -<?import javafx.scene.control.MenuBar?> -<?import javafx.scene.control.ToolBar?> -<?import javafx.scene.image.Image?> -<?import javafx.scene.image.ImageView?> -<?import javafx.scene.layout.BorderPane?> -<?import javafx.scene.layout.HBox?> -<?import javafx.scene.layout.Region?> -<?import javafx.scene.layout.VBox?> -<?import javafx.scene.text.Font?> - -<BorderPane prefHeight="800.0" prefWidth="1400.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="no.ntnu.idatt1002.demo.expenses.OutcomeController"> - <top> - <BorderPane prefHeight="100.0" prefWidth="1400.0" style="-fx-background-color: EC84E2;" BorderPane.alignment="CENTER"> - <left> - <Button mnemonicParsing="false" onAction="#goHome" style="-fx-background-color: translucent;" BorderPane.alignment="CENTER"> - <graphic> - <ImageView fitHeight="100.0" fitWidth="100.0" pickOnBounds="true" preserveRatio="true"> - <image> - <Image url="@Icons/SpendwiseIcon.png" /> - </image> - </ImageView> - </graphic> - </Button> - </left> - <right> - <VBox alignment="CENTER" prefHeight="108.0" prefWidth="54.0" spacing="16.0" BorderPane.alignment="CENTER"> - <children> - <Button mnemonicParsing="false" style="-fx-background-color: translucent;"> - <graphic> - <ImageView fitHeight="30.0" fitWidth="30.0" pickOnBounds="true" preserveRatio="true"> - <image> - <Image url="@Icons/Settings.png" /> - </image> - </ImageView> - </graphic> - </Button> - <Button mnemonicParsing="false" onAction="#openHelpOption" style="-fx-background-color: translucent;"> - <graphic> - <ImageView fitHeight="30.0" fitWidth="30.0" pickOnBounds="true" preserveRatio="true"> - <image> - <Image url="@Icons/HelpIcon.png" /> - </image> - </ImageView> - </graphic> - </Button> - </children> - </VBox> - </right> - <center> - <Label text="Expense Overview" textFill="#382119" BorderPane.alignment="CENTER"> - <font> - <Font name="Arial Bold" size="40.0" /> - </font> - </Label> - </center> - <padding> - <Insets bottom="20.0" left="20.0" right="20.0" top="20.0" /> - </padding> - </BorderPane> - </top> - <center> - <BorderPane prefHeight="200.0" prefWidth="200.0" BorderPane.alignment="CENTER"> - <top> - <ToolBar prefHeight="40.0" prefWidth="200.0" style="-fx-border-color: #382119; -fx-background-color: EC84E2;" BorderPane.alignment="CENTER"> - <items> - <Button mnemonicParsing="false" onAction="#switchToIncome" style="-fx-background-color: translucent;" text="Overview" textFill="#382119"> - <font> - <Font name="Arial" size="15.0" /> - </font> - </Button> - <Button mnemonicParsing="false" onAction="#switchToRecurringTransactions" style="-fx-background-color: translucent;" text="Recurring transactions" textFill="#382119"> - <font> - <Font name="Arial Bold" size="15.0" /> - </font> - </Button> - <Button mnemonicParsing="false" onAction="#switchToFutureBudgeting" style="-fx-background-color: translucent;" text="Budgeting" textFill="#382119"> - <font> - <Font name="Arial Bold" size="15.0" /> - </font> - </Button> - <Button mnemonicParsing="false" onAction="#switchToEditIncome" style="-fx-background-color: translucent;" text="Edit" textFill="#382119"> - <font> - <Font name="Arial Bold" size="15.0" /> - </font> - </Button> - </items> - <padding> - <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> - </padding> - </ToolBar> - </top> - <center> - <HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0" BorderPane.alignment="CENTER"> - <children> - <VBox alignment="CENTER" prefHeight="560.0" prefWidth="376.0" spacing="10.0"> - <children> - <Label text="Expense graph" textFill="#382119"> - <font> - <Font name="Arial" size="20.0" /> - </font> - </Label> - <PieChart fx:id="pieChart" prefHeight="400.0" prefWidth="328.0" /> - </children> - </VBox> - <VBox fx:id="categoryCheckBoxes" alignment="CENTER" prefHeight="560.0" prefWidth="118.0"> - <children> - <CheckBox mnemonicParsing="false" text="CheckBox" /> - <CheckBox layoutX="33.0" layoutY="270.0" mnemonicParsing="false" text="CheckBox" /> - <MenuBar prefHeight="42.0" prefWidth="200.0" style="-fx-border-color: #382119;"> - <menus> - <Menu mnemonicParsing="false" text="Categories"> - <items> - <CheckMenuItem id="Loan" mnemonicParsing="false" text="Unspecified Action" /> - <CheckMenuItem id="Food" mnemonicParsing="false" text="Unspecified Action" /> - </items> - </Menu> - </menus> - <padding> - <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> - </padding> - <VBox.margin> - <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> - </VBox.margin> - </MenuBar> - </children> - </VBox> - <Region prefHeight="200.0" prefWidth="200.0" /> - <VBox alignment="CENTER" prefHeight="603.0" prefWidth="293.0" spacing="10.0"> - <children> - <HBox prefHeight="26.0" prefWidth="293.0"> - <children> - <DatePicker fx:id="fromDate" onAction="#goButtonPushed" /> - <DatePicker fx:id="toDate" onAction="#goButtonPushed" /> - </children> - </HBox> - <Button fx:id="goButton" mnemonicParsing="false" onAction="#goButtonPushed" text="Button" /> - <Region prefHeight="200.0" prefWidth="293.0" /> - <Button mnemonicParsing="false" onAction="#switchToIncome" prefHeight="30.0" prefWidth="250.0" text="Income Overview" textFill="#382119"> - <VBox.margin> - <Insets bottom="10.0" /> - </VBox.margin> - <font> - <Font name="Arial" size="20.0" /> - </font> - <padding> - <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> - </padding> - </Button> - <Button mnemonicParsing="false" prefHeight="30.0" prefWidth="250.0" text="Edit categories" textFill="#382119"> - <font> - <Font name="Arial" size="20.0" /> - </font> - <padding> - <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> - </padding> - </Button> - <Button mnemonicParsing="false" prefHeight="30.0" prefWidth="250.0" text="Edit outcome"> - <font> - <Font name="Arial" size="20.0" /> - </font> - <padding> - <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> - </padding> - </Button> - <Button mnemonicParsing="false" prefHeight="30.0" prefWidth="250.0" text="Change to bar graph"> - <font> - <Font name="Arial" size="20.0" /> - </font> - <padding> - <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> - </padding> - </Button> - </children> - </VBox> - </children> - </HBox> - </center> - </BorderPane> - </center> -</BorderPane> diff --git a/src/main/resources/RecurringTransactions.fxml b/src/main/resources/RecurringTransactions.fxml index a5811d1e9f81d05970f5fe0a712625c5ca473bb1..b5fe6b22b5d356f16bdf132bb9ba32cfc9a9406c 100644 --- a/src/main/resources/RecurringTransactions.fxml +++ b/src/main/resources/RecurringTransactions.fxml @@ -35,7 +35,7 @@ </ImageView> </graphic> </Button> - <Button mnemonicParsing="false" style="-fx-background-color: translucent;"> + <Button mnemonicParsing="false" onAction="#openHelpOption" style="-fx-background-color: translucent;"> <graphic> <ImageView fitHeight="30.0" fitWidth="30.0" pickOnBounds="true" preserveRatio="true"> <image> @@ -95,7 +95,7 @@ <top> <ToolBar prefHeight="40.0" prefWidth="1400.0" style="-fx-background-color: EC84E2; -fx-border-color: #382119;" BorderPane.alignment="CENTER"> <items> - <Button mnemonicParsing="false" style="-fx-background-color: translucent;" text="Overview" textFill="#382119"> + <Button mnemonicParsing="false" onAction="#switchToIncome" style="-fx-background-color: translucent;" text="Overview" textFill="#382119"> <font> <Font name="Arial Bold" size="15.0" /> </font> @@ -105,12 +105,12 @@ <Font name="Arial" size="15.0" /> </font> </Button> - <Button mnemonicParsing="false" style="-fx-background-color: translucent;" text="Budgeting" textFill="#382119"> + <Button mnemonicParsing="false" onAction="#switchToFutureBudgeting" style="-fx-background-color: translucent;" text="Budgeting" textFill="#382119"> <font> <Font name="Arial Bold" size="15.0" /> </font> </Button> - <Button mnemonicParsing="false" style="-fx-background-color: translucent;" text="Edit" textFill="#382119"> + <Button mnemonicParsing="false" onAction="#switchToEditIncome" style="-fx-background-color: translucent;" text="Edit" textFill="#382119"> <font> <Font name="Arial Bold" size="15.0" /> </font> diff --git a/src/main/resources/SpendWiseHomePage.fxml b/src/main/resources/SpendWiseHomePage.fxml index 7101cb7794227a56e280b8fd7a4b4a6e66fc0b8c..92776d2ed77195347dc02637c479c87e113586a1 100644 --- a/src/main/resources/SpendWiseHomePage.fxml +++ b/src/main/resources/SpendWiseHomePage.fxml @@ -102,7 +102,7 @@ <RowConstraints maxHeight="294.6666564941406" minHeight="10.0" prefHeight="294.6666564941406" vgrow="SOMETIMES" /> </rowConstraints> <children> - <Button alignment="CENTER" contentDisplay="RIGHT" mnemonicParsing="false" onAction="#rootSwitchToOutcome" prefHeight="100.0" prefWidth="360.0" style="-fx-background-color: F5793A;" text="Expense overview " textFill="#382119" GridPane.columnIndex="1"> + <Button alignment="CENTER" contentDisplay="RIGHT" mnemonicParsing="false" onAction="#switchToExpenses" prefHeight="100.0" prefWidth="360.0" style="-fx-background-color: F5793A;" text="Expense overview " textFill="#382119" GridPane.columnIndex="1"> <font> <Font name="Arial" size="22.0" /> </font>