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

Deleted old expense file

parent 1d69730e
No related branches found
No related tags found
6 merge requests!43Merging frontend-testing into master,!38"Made progressbar dynamic in accordance to spending. Added balance field....,!37Made the sub progress bars respond to changes in expense,!32Added input validation to add dialog boxes.,!30Redesigned scenes,!29Redesigned scenes
Pipeline #214064 passed
......@@ -267,9 +267,7 @@ public class IncomeController {
//Always saving the data when switching scenes
saveDataToFile("Income");
FXMLLoader loader = new FXMLLoader();
if (event.getSource() == expenseBtn) {
loader.setLocation(SceneController.class.getResource("/view/Expenses.fxml"));
} else if (event.getSource() == overviewBtn) {
if (event.getSource() == overviewBtn) {
loader.setLocation(SceneController.class.getResource("/view/Overview.fxml"));
} else if (event.getSource() == returnBtn) {
loader.setLocation(SceneController.class.getResource("/view/FirstMenu.fxml"));
......
......@@ -102,11 +102,8 @@ public class MainMenuController {
@FXML
public void switchScene(ActionEvent event) throws IOException {
FXMLLoader loader = new FXMLLoader();
if (event.getSource() == addExpenseBtn) {
loader.setLocation(SceneController.class.getResource("/view/Expenses.fxml"));
} else if (event.getSource() == overviewBtn) {
loader.setLocation(SceneController.class.getResource("/view/Budget.fxml"));
}
loader.setLocation(SceneController.class.getResource("/view/Budget.fxml"));
Parent root = loader.load();
Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow();
......
......@@ -41,15 +41,6 @@ public class SceneController {
stage.show();
}
public void switchExpenses(ActionEvent event) throws IOException {
FXMLLoader loader = new FXMLLoader(SceneController.class.getResource("/view/Expenses.fxml"));
Parent root = loader.load();
stage = (Stage)((Node)event.getSource()).getScene().getWindow();
scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
public void switchOverview(ActionEvent event) throws IOException {
FXMLLoader loader = new FXMLLoader(SceneController.class.getResource("/view/Overview.fxml"));
Parent root = loader.load();
......
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.Cursor?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Region?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.shape.Rectangle?>
<?import javafx.scene.text.Font?>
<?import javafx.scene.text.Text?>
<AnchorPane prefHeight="695.0" prefWidth="1100.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="no.ntnu.idatt1002.demo.controller.ExpensesController">
<children>
<ImageView fitHeight="695.0" fitWidth="1100.0" pickOnBounds="true">
<image>
<Image url="@../Images/backgroundMini.jpg" />
</image>
<cursor>
<Cursor fx:constant="DEFAULT" />
</cursor>
</ImageView>
<BorderPane prefHeight="400.0" prefWidth="600.0">
<top>
<HBox BorderPane.alignment="CENTER">
<children>
<Button fx:id="returnBtn" mnemonicParsing="false" onAction="#switchScene" text="Return ">
<opaqueInsets>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</opaqueInsets>
</HBox>
</center>
</BorderPane>
</top>
<center>
<GridPane BorderPane.alignment="CENTER">
<BorderPane.margin>
<Insets bottom="40.0" left="40.0" right="40.0" />
</BorderPane.margin>
<columnConstraints>
<ColumnConstraints hgrow="ALWAYS" maxWidth="485.3333231608073" minWidth="10.0" prefWidth="427.33335367838544" />
<ColumnConstraints hgrow="ALWAYS" maxWidth="111.33333333333331" minWidth="10.0" prefWidth="92.66664632161456" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="65.33334064483643" minHeight="10.0" prefHeight="65.33334064483643" vgrow="SOMETIMES" />
<RowConstraints maxHeight="298.66665744781494" minHeight="10.0" prefHeight="214.00004069010413" vgrow="SOMETIMES" />
<RowConstraints maxHeight="298.66665744781494" minHeight="10.0" prefHeight="29.999959309895814" vgrow="SOMETIMES" />
<RowConstraints maxHeight="298.66665744781494" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<HBox alignment="BOTTOM_LEFT" prefWidth="410.0" spacing="5.0">
<children>
<Button fx:id="addBtn" alignment="TOP_CENTER" mnemonicParsing="false" onAction="#handleAddButton" text="Add" textAlignment="CENTER">
<graphic>
<ImageView fitHeight="19.0" fitWidth="16.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../Images/add_image.png" />
</image>
</ImageView>
</graphic></Button>
<Button fx:id="editBtn" alignment="TOP_CENTER" mnemonicParsing="false" onAction="#handleEditButton" text="Edit" textAlignment="CENTER">
<graphic>
<ImageView fitHeight="19.0" fitWidth="16.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../Images/edit.png" />
</image>
</ImageView>
</graphic></Button>
<Button fx:id="deleteBtn" alignment="TOP_CENTER" mnemonicParsing="false" onAction="#handleDeleteBtn" text="Delete" textAlignment="CENTER">
<graphic>
<ImageView fitHeight="19.0" fitWidth="16.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../Images/delete.png" />
</image>
</ImageView>
</graphic></Button>
</children>
<opaqueInsets>
<Insets />
</opaqueInsets>
<padding>
<Insets bottom="5.0" />
</padding>
</HBox>
<VBox alignment="BOTTOM_LEFT" prefHeight="200.0" prefWidth="100.0" spacing="5.0" GridPane.columnIndex="1">
<children>
<ComboBox fx:id="show" prefWidth="150.0" promptText="Show">
<opaqueInsets>
<Insets />
</opaqueInsets>
<VBox.margin>
<Insets bottom="5.0" />
</VBox.margin>
</ComboBox>
</children>
</VBox>
<HBox prefHeight="100.0" prefWidth="200.0" GridPane.columnSpan="2" GridPane.rowIndex="3">
<children>
<Button fx:id="incomeBtn" mnemonicParsing="false" onAction="#switchScene" text="Income" />
<Button fx:id="budgetBtn" mnemonicParsing="false" onAction="#switchScene" text="Budget" />
<Button disable="true" mnemonicParsing="false" text="Expenses" />
<Button mnemonicParsing="false" onAction="#switchScene" text="Next">
<HBox.margin>
<Insets left="170.0" />
</HBox.margin></Button>
</children>
<padding>
<Insets top="10.0" />
</padding>
<GridPane.margin>
<Insets top="5.0" />
</GridPane.margin>
</HBox>
<TableView fx:id="expenseTableView" prefHeight="260.0" prefWidth="485.0" GridPane.columnSpan="2" GridPane.rowIndex="1">
<columns>
<TableColumn fx:id="dateColumn" prefWidth="75.0" text="Date" />
<TableColumn fx:id="amountColumn" prefWidth="75.0" text="Amount" />
<TableColumn fx:id="categoryColumn" prefWidth="75.0" text="Category" />
<TableColumn fx:id="descriptionColumn" prefWidth="75.0" text="Description" />
<TableColumn fx:id="recurringColumn" prefWidth="75.0" text="Recurring" />
</columns>
<columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
</columnResizePolicy>
</TableView>
<StackPane GridPane.rowIndex="2">
<children>
<Rectangle arcHeight="5.0" arcWidth="5.0" fill="#f8f8f8" height="18.0" stroke="#d9cccc" strokeType="INSIDE" width="209.0" StackPane.alignment="CENTER_LEFT" />
<HBox prefHeight="18.0" prefWidth="517.0">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Sum: ">
<HBox.margin>
<Insets left="2.0" />
</HBox.margin>
</Text>
<Region prefHeight="18.0" prefWidth="74.0" />
<Text fx:id="sum" strokeType="OUTSIDE" strokeWidth="0.0" text="Text" />
</children>
</HBox>
</children>
</StackPane>
</children>
</GridPane>
</center>
<opaqueInsets>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</opaqueInsets>
<left>
<Region prefHeight="330.0" prefWidth="1.0" BorderPane.alignment="CENTER" />
</left>
<right>
<Region prefHeight="357.0" prefWidth="0.0" BorderPane.alignment="CENTER" />
</right>
<bottom>
<Region prefHeight="0.0" prefWidth="600.0" BorderPane.alignment="CENTER" />
</bottom>
</BorderPane>
</children>
<opaqueInsets>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</opaqueInsets>
</AnchorPane>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment