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

Created controller package and moved SceneController to this package

parent b0edb778
No related branches found
No related tags found
1 merge request!6Merging the frontend baseline to get up to date with the progress
package no.ntnu.idatt1002.demo.view;
package no.ntnu.idatt1002.demo.controller;
import java.io.IOException;
......@@ -13,12 +13,12 @@ import javafx.fxml.Initializable;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Tab;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.stage.Stage;
import jdk.jfr.Category;
import no.ntnu.idatt1002.demo.data.Expense;
import no.ntnu.idatt1002.demo.data.ExpenseCategory;
......@@ -28,6 +28,12 @@ public class SceneController implements Initializable {
private Scene scene;
private Parent root;
@FXML
private Button add;
@FXML
private ComboBox<?> show;
@FXML
private TableColumn<Expense, Double> amount;
......
......@@ -19,7 +19,7 @@
<?import javafx.scene.text.Font?>
<?import javafx.scene.text.Text?>
<AnchorPane xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="no.ntnu.idatt1002.demo.view.SceneController">
<AnchorPane xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="no.ntnu.idatt1002.demo.controller.SceneController">
<children>
<ImageView fitHeight="400.0" fitWidth="600.0" pickOnBounds="true">
<image>
......@@ -33,7 +33,7 @@
<top>
<HBox BorderPane.alignment="CENTER">
<children>
<Button mnemonicParsing="false" text="Return ">
<Button mnemonicParsing="false" onAction="#switchStartMenu" text="Return ">
<opaqueInsets>
<Insets left="100.0" />
</opaqueInsets>
......@@ -98,17 +98,6 @@
</ComboBox>
</children>
</VBox>
<TableView prefHeight="260.0" prefWidth="485.0" GridPane.columnSpan="2" GridPane.rowIndex="1">
<columns>
<TableColumn prefWidth="75.0" text="Date" />
<TableColumn prefWidth="75.0" text="Price" />
<TableColumn prefWidth="75.0" text="Category" />
<TableColumn prefWidth="75.0" text="Description" />
</columns>
<columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
</columnResizePolicy>
</TableView>
<HBox prefHeight="100.0" prefWidth="200.0" GridPane.columnSpan="2" GridPane.rowIndex="2">
<children>
<Button mnemonicParsing="false" text="Overview" />
......@@ -120,6 +109,17 @@
<Insets top="10.0" />
</padding>
</HBox>
<TableView fx:id="expenseTableView" prefHeight="260.0" prefWidth="485.0" GridPane.columnSpan="2" GridPane.rowIndex="1">
<columns>
<TableColumn fx:id="date" prefWidth="75.0" text="Date" />
<TableColumn fx:id="amount" prefWidth="75.0" text="Amount" />
<TableColumn fx:id="category" prefWidth="75.0" text="Category" />
<TableColumn fx:id="description" prefWidth="75.0" text="Description" />
</columns>
<columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
</columnResizePolicy>
</TableView>
</children>
</GridPane>
</center>
......
......@@ -7,7 +7,7 @@
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.text.Font?>
<AnchorPane maxHeight="600" maxWidth="607.0" minHeight="406.0" minWidth="600" prefHeight="406.0" prefWidth="607.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="no.ntnu.idatt1002.demo.view.SceneController">
<AnchorPane maxHeight="600" maxWidth="607.0" minHeight="406.0" minWidth="600" prefHeight="406.0" prefWidth="607.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="no.ntnu.idatt1002.demo.controller.SceneController">
<ImageView fitHeight="412.0" fitWidth="614.0" layoutX="-7.0" layoutY="-6.0" pickOnBounds="true" smooth="false">
<Image url="@../Images/backgroundMini.jpg" />
</ImageView>
......
......@@ -8,7 +8,7 @@
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.text.Text?>
<AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="no.ntnu.idatt1002.demo.view.SceneController">
<AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="no.ntnu.idatt1002.demo.controller.SceneController">
<children>
<ImageView fitHeight="400.0" fitWidth="600.0" pickOnBounds="true">
<image>
......
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