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

Created new window for both income and expenses

parent 1ae1370e
No related branches found
No related tags found
8 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,!28Redesigned scenes,!26Redesigned Main menu and expense/income windows
package no.ntnu.idatt1002.demo.controller;
import java.awt.event.ActionEvent;
import java.util.Optional;
import javafx.scene.control.ButtonType;
public interface FinanceDialogController {
}
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.Cursor?>
<?import javafx.scene.chart.PieChart?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.DatePicker?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ProgressBar?>
<?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.Pane?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" 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.IncomeExpenseController">
<children>
<ImageView fitHeight="695.0" fitWidth="1100.0" pickOnBounds="true">
<image>
<Image url="@../Images/backgroundMini.jpg" />
</image>
<cursor>
<Cursor fx:constant="DEFAULT" />
</cursor>
</ImageView>
<VBox prefHeight="695.0" prefWidth="1100.0">
<children>
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="143.0" prefWidth="1100.0">
<right>
<Pane BorderPane.alignment="CENTER">
<children>
<Label fx:id="daysLeftLbl" layoutX="27.0" layoutY="83.0" text="Days left: 31">
<font>
<Font name="Lucida Console" size="14.0" />
</font>
</Label>
<DatePicker fx:id="date" layoutX="-4.0" layoutY="55.0" prefWidth="175.0" />
</children>
</Pane>
</right>
<left>
<Pane prefWidth="175.0" BorderPane.alignment="CENTER">
<children>
<Button fx:id="returnBtn" alignment="CENTER" layoutX="-2.0" layoutY="58.0" mnemonicParsing="false" onAction="#returnToMainMenu" text="Return to Main Menu">
<font>
<Font name="Lucida Console" size="14.0" />
</font>
</Button>
</children>
</Pane>
</left>
<center>
<Label fx:id="title" text="INCOME AND EXPENSES" textAlignment="CENTER" BorderPane.alignment="CENTER">
<font>
<Font name="Lucida Console" size="48.0" />
</font>
</Label>
</center>
<padding>
<Insets left="15.0" right="15.0" />
</padding>
</BorderPane>
<BorderPane prefHeight="64.0" prefWidth="1100.0">
<left>
<HBox prefHeight="100.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<children>
<Button fx:id="addBtn" mnemonicParsing="false" text="Button">
<font>
<Font name="Lucida Console" size="12.0" />
</font>
</Button>
<Button fx:id="editBtn" mnemonicParsing="false" text="Button">
<font>
<Font name="Lucida Console" size="12.0" />
</font>
</Button>
<Button fx:id="deleteBtn" mnemonicParsing="false" text="Button">
<font>
<Font name="Lucida Console" size="12.0" />
</font>
</Button>
</children>
</HBox>
</left>
<right>
<Pane BorderPane.alignment="CENTER">
<children>
<ProgressBar fx:id="budgetProgress" prefWidth="200.0" progress="0.0" />
</children>
</Pane>
</right>
<opaqueInsets>
<Insets />
</opaqueInsets>
<VBox.margin>
<Insets left="15.0" right="15.0" />
</VBox.margin>
<center>
<Pane BorderPane.alignment="CENTER">
<children>
<ComboBox fx:id="filter" layoutX="169.0" layoutY="2.0" prefWidth="150.0" promptText="Show">
<opaqueInsets>
<Insets />
</opaqueInsets>
</ComboBox>
</children>
</Pane>
</center>
</BorderPane>
<GridPane prefHeight="473.0" prefWidth="1100.0">
<columnConstraints>
<ColumnConstraints 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>
<children>
<GridPane>
<columnConstraints>
<ColumnConstraints hgrow="ALWAYS" maxWidth="485.3333231608073" minWidth="10.0" prefWidth="427.33335367838544" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="298.66665744781494" minHeight="10.0" prefHeight="214.00004069010413" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<VBox>
<children>
<TableView fx:id="incomeTableView" maxHeight="175.0" prefHeight="175.0" prefWidth="264.0">
<columns>
<TableColumn fx:id="inDateCol" prefWidth="75.0" text="Date" />
<TableColumn fx:id="inAmountCol" prefWidth="75.0" text="Amount" />
<TableColumn fx:id="inCategoryCol" prefWidth="75.0" text="Category" />
<TableColumn fx:id="inDescriptionCol" prefWidth="75.0" text="Description" />
<TableColumn fx:id="inRecurringCol" prefWidth="75.0" text="Recurring" />
</columns>
<columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
</columnResizePolicy>
</TableView>
<Label text="Sum: ">
<font>
<Font name="Lucida Console" size="14.0" />
</font>
</Label>
</children>
</VBox>
</children>
</GridPane>
<GridPane GridPane.rowIndex="1">
<columnConstraints>
<ColumnConstraints hgrow="ALWAYS" maxWidth="485.3333231608073" minWidth="10.0" prefWidth="427.33335367838544" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="298.66665744781494" minHeight="10.0" prefHeight="214.00004069010413" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<VBox>
<children>
<TableView fx:id="expenseTableView" maxHeight="175.0" prefHeight="172.0" prefWidth="545.0">
<columns>
<TableColumn fx:id="expDateCol" prefWidth="75.0" text="Date" />
<TableColumn fx:id="expAmountCol" prefWidth="75.0" text="Amount" />
<TableColumn fx:id="expCategoryCol" prefWidth="75.0" text="Category" />
<TableColumn fx:id="expDescriptionCol" prefWidth="75.0" text="Description" />
<TableColumn fx:id="expRecurringCol" prefWidth="75.0" text="Recurring" />
</columns>
<columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
</columnResizePolicy>
</TableView>
<Label text="Sum: ">
<font>
<Font name="Lucida Console" size="14.0" />
</font>
</Label>
</children>
</VBox>
</children>
</GridPane>
<PieChart fx:id="incomePieChart" prefHeight="175.0" prefWidth="175.0" GridPane.columnIndex="1" />
<PieChart fx:id="expensePieChart" prefHeight="175.0" prefWidth="175.0" GridPane.columnIndex="1" GridPane.rowIndex="1" />
</children>
<padding>
<Insets left="10.0" />
</padding>
<VBox.margin>
<Insets left="30.0" right="30.0" />
</VBox.margin>
</GridPane>
</children>
</VBox>
</children>
</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