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

Merge branch 'fx-test-branch' of...

Merge branch 'fx-test-branch' of gitlab.stud.idi.ntnu.no:andreksv/idatt-1002-2023-9 into fx-test-branch

# Conflicts:
#	pom.xml
#	src/main/java/no/ntnu/idatt1002/demo/view/MyApp.java
#	src/main/java/no/ntnu/idatt1002/demo/view/sceneController.java
parents 6dfc26f0 6f8678a6
No related branches found
No related tags found
1 merge request!6Merging the frontend baseline to get up to date with the progress
Showing with 77 additions and 86 deletions
......@@ -88,7 +88,7 @@ loadScripts(document, 'script');</script>
<h1 title="Class MyApp" class="title">Class MyApp</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
<div class="inheritance">no.ntnu.idatt1002.demo.MyApp</div>
<div class="inheritance">no.ntnu.idatt1002.demo.view.MyApp</div>
</div>
<section class="class-description" id="class-description">
<hr>
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<!-- Generated by javadoc (19) on Thu Feb 02 10:19:17 CET 2023 -->
<title>Uses of Class no.ntnu.idatt1002.demo.MyApp (demo 1.0-SNAPSHOT API)</title>
<title>Uses of Class no.ntnu.idatt1002.demo.view.MyApp (demo 1.0-SNAPSHOT API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2023-02-02">
......@@ -50,9 +50,9 @@ loadScripts(document, 'script');</script>
<div class="flex-content">
<main role="main">
<div class="header">
<h1 title="Uses of Class no.ntnu.idatt1002.demo.MyApp" class="title">Uses of Class<br>no.ntnu.idatt1002.demo.MyApp</h1>
<h1 title="Uses of Class no.ntnu.idatt1002.demo.view.MyApp" class="title">Uses of Class<br>no.ntnu.idatt1002.demo.view.MyApp</h1>
</div>
No usage of no.ntnu.idatt1002.demo.MyApp</main>
No usage of no.ntnu.idatt1002.demo.view.MyApp</main>
<footer role="contentinfo">
<hr>
<p class="legal-copy"><small>Copyright &#169; 2023. All rights reserved.</small></p>
......
......@@ -15,7 +15,7 @@
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>5.8.1</junit.version>
<javafx.version>17.0.6</javafx.version>
<javafx.version>17.0.1</javafx.version>
</properties>
<repositories>
......@@ -152,7 +152,7 @@
<archive>
<manifest>
<mainClass>
no.ntnu.idatt1002.demo.MyApp
no.ntnu.idatt1002.demo.view.MyApp
</mainClass>
</manifest>
</archive>
......@@ -172,8 +172,7 @@
<!-- Default configuration for running with: mvn clean javafx:run -->
<id>default-cli</id>
<configuration>
<mainClass>no.ntnu.idatt1002.demo.MyApp</mainClass>
<executable>C:\Program Files\Java\jdk-17\bin\java.exe</executable>
<mainClass>no.ntnu.idatt1002.demo/no.ntnu.idatt1002.demo.view.MyApp</mainClass>
<launcher>app</launcher>
<jlinkZipName>app</jlinkZipName>
<jlinkImageName>app</jlinkImageName>
......
package no.ntnu.idatt1002.demo;
package no.ntnu.idatt1002.demo.view;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
......@@ -6,21 +6,17 @@ import javafx.stage.Stage;
import javafx.scene.Parent;
import javafx.scene.Scene;
import java.util.Objects;
import java.io.IOException;
public class MyApp extends Application {
@Override
public void start(Stage stage) {
try {
Parent root = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("FirstMenu.fxml")));
@Override
public void start(Stage stage) throws IOException {
FXMLLoader loader = new FXMLLoader(getClass().getResource("/view/FirstMenu.fxml"));
Parent root = loader.load();
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
} catch(Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
launch(args);
......
<?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.view.NewBudget"
prefHeight="400.0" prefWidth="600.0">
</AnchorPane>
package no.ntnu.idatt1002.demo;
package no.ntnu.idatt1002.demo.view;
import java.io.IOException;
import java.util.Objects;
import javafx.event.ActionEvent;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
......@@ -16,18 +15,18 @@ public class sceneController {
private Scene scene;
private Parent root;
public void switchStartMenu(ActionEvent event) throws IOException {
root = FXMLLoader.load(
Objects.requireNonNull(getClass().getResource("view/StartMenu.fxml")));
FXMLLoader loader = new FXMLLoader(getClass().getResource("/view/FirstMenu.fxml"));
root = loader.load();
stage = (Stage)((Node)event.getSource()).getScene().getWindow();
scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
public void switchNewBudget(ActionEvent event) throws IOException {
root = FXMLLoader.load(
Objects.requireNonNull(getClass().getResource("view/NewBudget.fxml")));
FXMLLoader loader = new FXMLLoader(sceneController.class.getResource("/view/NewBudget.fxml"));
Parent root = loader.load();
stage = (Stage)((Node)event.getSource()).getScene().getWindow();
scene = new Scene(root);
stage.setScene(scene);
......
.label {
-fx-font-size: 60px;
}
.outline.label .text {
-fx-fill: white;
-fx-stroke: black;
-fx-stroke-width: 2px;
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.text.Font?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" 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.sceneController">
<children>
<ImageView fitHeight="412.0" fitWidth="614.0" layoutX="-7.0" layoutY="-6.0" pickOnBounds="true" smooth="false">
<image>
<Image url="@../Defaults/backgroundMini.jpg" />
</image>
</ImageView>
<Label alignment="CENTER" contentDisplay="CENTER" layoutX="73.0" layoutY="113.0" lineSpacing="1.0" text="Welcome to BudgetBuddy!" textAlignment="CENTER" textOverrun="LEADING_ELLIPSIS" wrapText="true">
<font>
<Font name="Verdana" size="34.0" />
</font>
</Label>
<Label ellipsisString="" layoutX="147.0" layoutY="171.0" lineSpacing="1.0" text="Please choose one of the options:" textAlignment="CENTER">
<font>
<Font name="Verdana" size="18.0" />
</font>
</Label>
<Button layoutX="69.0" layoutY="212.0" mnemonicParsing="false" text="New Budget">
<font>
<Font size="24.0" />
</font>
</Button>
<Button layoutX="380.0" layoutY="212.0" mnemonicParsing="false" text="Old Budget">
<font>
<Font size="24.0" />
</font>
</Button>
</children>
</AnchorPane>
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?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">
<ImageView fitHeight="412.0" fitWidth="614.0" layoutX="-7.0" layoutY="-6.0" pickOnBounds="true" smooth="false">
<Image url="@../Images/backgroundMini.jpg" />
</ImageView>
<Label alignment="CENTER" contentDisplay="CENTER" layoutX="73.0" layoutY="113.0" lineSpacing="1.0" text="Welcome to BudgetBuddy!" textAlignment="CENTER" textOverrun="LEADING_ELLIPSIS" wrapText="true">
<font>
<Font name="Verdana" size="34.0" />
</font>
</Label>
<Label ellipsisString="" layoutX="147.0" layoutY="171.0" lineSpacing="1.0" text="Please choose one of the options:" textAlignment="CENTER">
<font>
<Font name="Verdana" size="18.0" />
</font>
</Label>
<Button layoutX="69.0" layoutY="212.0" mnemonicParsing="false" onAction="#switchNewBudget" text="New Budget">
<font>
<Font size="24.0" />
</font>
</Button>
<Button layoutX="380.0" layoutY="212.0" mnemonicParsing="false" text="Old Budget">
<font>
<Font size="24.0" />
</font>
</Button>
</AnchorPane>
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ListView?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?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">
<children>
<ImageView fitHeight="400.0" fitWidth="600.0" pickOnBounds="true">
<image>
<Image url="@../Images/backgroundMini.jpg" />
</image>
</ImageView>
<ListView layoutX="133.0" layoutY="145.0" prefHeight="233.0" prefWidth="313.0" />
<TextArea layoutX="133.0" layoutY="97.0" prefHeight="39.0" prefWidth="276.0" />
<Button layoutX="409.0" layoutY="97.0" mnemonicParsing="false" prefHeight="39.0" prefWidth="38.0" text="+" />
<Text layoutX="133.0" layoutY="84.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Write your income here:" />
<Button layoutX="14.0" layoutY="14.0" mnemonicParsing="false" onAction="#switchStartMenu" text="Back" />
</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