Skip to content
Snippets Groups Projects
Commit f99878a8 authored by Eilert Tunheim's avatar Eilert Tunheim
Browse files

Merge branch 'Eilerts_branch' into 'master'

Updated GUI with some scalability

See merge request mesji/bacheloroppgave_2022!6
parents 6435967f 6980cbc5
No related branches found
No related tags found
No related merge requests found
...@@ -26,7 +26,7 @@ public class Main extends Application { ...@@ -26,7 +26,7 @@ public class Main extends Application {
public void start(Stage primaryStage) throws Exception { public void start(Stage primaryStage) throws Exception {
// Loading the GUI-fxml file from resources // Loading the GUI-fxml file from resources
Parent root = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/com.application/test.fxml"))); Parent root = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/com.application/graphical_user_interface.fxml")));
// Sets the scene and defines boundaries // Sets the scene and defines boundaries
Scene scene = new Scene(root, 1200, 600); Scene scene = new Scene(root, 1200, 600);
......
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.chart.CategoryAxis?>
<?import javafx.scene.chart.LineChart?>
<?import javafx.scene.chart.NumberAxis?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Menu?>
<?import javafx.scene.control.MenuBar?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="700.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1">
<left>
<VBox prefHeight="200.0" prefWidth="150.0" BorderPane.alignment="CENTER">
<children>
<Label prefHeight="17.0" prefWidth="150.0" text="Tree Species" />
<TextField />
<Label prefHeight="17.0" prefWidth="150.0" text="Width x Height" />
<TextField />
<Label prefHeight="17.0" prefWidth="150.0" text="Sawsett" />
<TextField />
<Label prefHeight="17.0" prefWidth="150.0" text="Desired moisture level" />
<TextField />
<Button mnemonicParsing="false" prefHeight="25.0" prefWidth="150.0" text="Finish" />
</children>
</VBox>
</left>
<center>
<LineChart BorderPane.alignment="CENTER">
<xAxis>
<CategoryAxis label="Time" side="BOTTOM" />
</xAxis>
<yAxis>
<NumberAxis label="Kwh" side="LEFT" upperBound="25000.0">
<tickLabelFont>
<Font name="Arial" size="10.0" />
</tickLabelFont>
</NumberAxis>
</yAxis>
</LineChart>
</center>
<top>
<BorderPane prefHeight="80.0" prefWidth="700.0" BorderPane.alignment="CENTER">
<center>
<AnchorPane prefHeight="78.0" prefWidth="700.0" style="-fx-background-color: rgba(12, 76, 81, 1);" BorderPane.alignment="CENTER">
<children>
<BorderPane prefHeight="50.0" prefWidth="700.0">
<left>
<ImageView fitHeight="50.0" fitWidth="50.0" pickOnBounds="true" preserveRatio="true" translateX="5.0" BorderPane.alignment="CENTER">
<image>
<Image url="@moelven_logo_m.jpg" />
</image>
</ImageView>
</left>
<center>
<ImageView fitHeight="30.0" fitWidth="125.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@moelven_logo_tittle.jpg" />
</image>
</ImageView>
</center>
</BorderPane>
</children>
</AnchorPane>
</center>
<top>
<MenuBar prefHeight="25.0" prefWidth="700.0" BorderPane.alignment="CENTER">
<menus>
<Menu mnemonicParsing="false" text="File">
<items>
<MenuItem mnemonicParsing="false" text="Close" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Edit">
<items>
<MenuItem mnemonicParsing="false" text="Delete" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Help">
<items>
<MenuItem mnemonicParsing="false" text="About" />
</items>
</Menu>
</menus>
</MenuBar>
</top>
</BorderPane>
</top>
</BorderPane>
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.chart.CategoryAxis?>
<?import javafx.scene.chart.LineChart?>
<?import javafx.scene.chart.NumberAxis?>
<?import javafx.scene.control.Menu?>
<?import javafx.scene.control.MenuBar?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.SeparatorMenuItem?>
<?import javafx.scene.control.SplitPane?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.VBox?>
<VBox prefHeight="1080.0" prefWidth="1920.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1">
<children>
<MenuBar VBox.vgrow="NEVER">
<menus>
<Menu mnemonicParsing="false" text="File">
<items>
<MenuItem mnemonicParsing="false" text="New" />
<MenuItem mnemonicParsing="false" text="Open…" />
<Menu mnemonicParsing="false" text="Open Recent" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Close" />
<MenuItem mnemonicParsing="false" text="Save" />
<MenuItem mnemonicParsing="false" text="Save As…" />
<MenuItem mnemonicParsing="false" text="Revert" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Preferences…" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Quit" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Edit">
<items>
<MenuItem mnemonicParsing="false" text="Undo" />
<MenuItem mnemonicParsing="false" text="Redo" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Cut" />
<MenuItem mnemonicParsing="false" text="Copy" />
<MenuItem mnemonicParsing="false" text="Paste" />
<MenuItem mnemonicParsing="false" text="Delete" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Select All" />
<MenuItem mnemonicParsing="false" text="Unselect All" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Help">
<items>
<MenuItem mnemonicParsing="false" text="About MyHelloApp" />
</items>
</Menu>
</menus>
</MenuBar>
<SplitPane focusTraversable="true" prefHeight="-1.0" prefWidth="-1.0">
<items>
<AnchorPane prefHeight="170.0" prefWidth="1920.0" style="-fx-background-color: rgba(12, 76, 81, 1);">
<children>
<ImageView fitHeight="155.0" fitWidth="246.0" layoutX="5.0" layoutY="5.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="/com.application/moelven_logo_m.jpg" />
</image>
</ImageView>
<ImageView fitHeight="170.0" fitWidth="700.0" layoutX="610.0" pickOnBounds="true" preserveRatio="true" y="10.0">
<image>
<Image url="/com.application/moelven_logo_tittle.jpg" />
</image>
</ImageView>
</children>
</AnchorPane>
</items>
</SplitPane>
<SplitPane dividerPositions="0.2083333333" prefHeight="885.0" prefWidth="1920.0">
<items>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0" />
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0">
<children>
<LineChart prefHeight="885.0" prefWidth="1520.0">
<xAxis>
<CategoryAxis side="BOTTOM" />
</xAxis>
<yAxis>
<NumberAxis side="LEFT" />
</yAxis>
</LineChart>
</children>
</AnchorPane>
</items>
</SplitPane>
</children>
</VBox>
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.chart.CategoryAxis?>
<?import javafx.scene.chart.LineChart?>
<?import javafx.scene.chart.NumberAxis?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Menu?>
<?import javafx.scene.control.MenuBar?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="700.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1">
<left>
<VBox prefHeight="200.0" prefWidth="150.0" BorderPane.alignment="CENTER">
<children>
<Label prefHeight="17.0" prefWidth="150.0" text="Tree Species" />
<TextField />
<Label prefHeight="17.0" prefWidth="150.0" text="Width x Height" />
<TextField />
<Label prefHeight="17.0" prefWidth="150.0" text="Sawsett" />
<TextField />
<Label prefHeight="17.0" prefWidth="150.0" text="Desired moisture level" />
<TextField />
<Button mnemonicParsing="false" prefHeight="25.0" prefWidth="150.0" text="Finish" />
</children>
</VBox>
</left>
<center>
<LineChart BorderPane.alignment="CENTER">
<xAxis>
<CategoryAxis label="Time" side="BOTTOM" />
</xAxis>
<yAxis>
<NumberAxis label="Kwh" side="LEFT" upperBound="25000.0">
<tickLabelFont>
<Font name="Arial" size="10.0" />
</tickLabelFont>
</NumberAxis>
</yAxis>
</LineChart>
</center>
<top>
<BorderPane prefHeight="80.0" prefWidth="700.0" BorderPane.alignment="CENTER">
<center>
<AnchorPane prefHeight="78.0" prefWidth="700.0" style="-fx-background-color: rgba(12, 76, 81, 1);" BorderPane.alignment="CENTER">
<children>
<BorderPane prefHeight="50.0" prefWidth="700.0">
<left>
<ImageView fitHeight="50.0" fitWidth="50.0" pickOnBounds="true" preserveRatio="true" translateX="5.0" BorderPane.alignment="CENTER">
<image>
<Image url="@moelven_logo_m.jpg" />
</image>
</ImageView>
</left>
<center>
<ImageView fitHeight="30.0" fitWidth="125.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@moelven_logo_tittle.jpg" />
</image>
</ImageView>
</center>
</BorderPane>
</children>
</AnchorPane>
</center>
<top>
<MenuBar prefHeight="25.0" prefWidth="700.0" BorderPane.alignment="CENTER">
<menus>
<Menu mnemonicParsing="false" text="File">
<items>
<MenuItem mnemonicParsing="false" text="Close" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Edit">
<items>
<MenuItem mnemonicParsing="false" text="Delete" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Help">
<items>
<MenuItem mnemonicParsing="false" text="About" />
</items>
</Menu>
</menus>
</MenuBar>
</top>
</BorderPane>
</top>
</BorderPane>
target/classes/com.application/moelven_logo_m.jpg

80.6 KiB

target/classes/com.application/moelven_logo_tittle.jpg

373 KiB

<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.chart.CategoryAxis?>
<?import javafx.scene.chart.LineChart?>
<?import javafx.scene.chart.NumberAxis?>
<?import javafx.scene.control.Menu?>
<?import javafx.scene.control.MenuBar?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.SeparatorMenuItem?>
<?import javafx.scene.control.SplitPane?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.VBox?>
<VBox prefHeight="1080.0" prefWidth="1920.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1">
<children>
<MenuBar VBox.vgrow="NEVER">
<menus>
<Menu mnemonicParsing="false" text="File">
<items>
<MenuItem mnemonicParsing="false" text="New" />
<MenuItem mnemonicParsing="false" text="Open…" />
<Menu mnemonicParsing="false" text="Open Recent" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Close" />
<MenuItem mnemonicParsing="false" text="Save" />
<MenuItem mnemonicParsing="false" text="Save As…" />
<MenuItem mnemonicParsing="false" text="Revert" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Preferences…" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Quit" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Edit">
<items>
<MenuItem mnemonicParsing="false" text="Undo" />
<MenuItem mnemonicParsing="false" text="Redo" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Cut" />
<MenuItem mnemonicParsing="false" text="Copy" />
<MenuItem mnemonicParsing="false" text="Paste" />
<MenuItem mnemonicParsing="false" text="Delete" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Select All" />
<MenuItem mnemonicParsing="false" text="Unselect All" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Help">
<items>
<MenuItem mnemonicParsing="false" text="About MyHelloApp" />
</items>
</Menu>
</menus>
</MenuBar>
<SplitPane focusTraversable="true" prefHeight="-1.0" prefWidth="-1.0">
<items>
<AnchorPane prefHeight="170.0" prefWidth="1920.0" style="-fx-background-color: rgba(12, 76, 81, 1);">
<children>
<ImageView fitHeight="155.0" fitWidth="246.0" layoutX="5.0" layoutY="5.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="/com.application/moelven_logo_m.jpg" />
</image>
</ImageView>
<ImageView fitHeight="170.0" fitWidth="700.0" layoutX="610.0" pickOnBounds="true" preserveRatio="true" y="10.0">
<image>
<Image url="/com.application/moelven_logo_tittle.jpg" />
</image>
</ImageView>
</children>
</AnchorPane>
</items>
</SplitPane>
<SplitPane dividerPositions="0.2083333333" prefHeight="885.0" prefWidth="1920.0">
<items>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0" />
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0">
<children>
<LineChart prefHeight="885.0" prefWidth="1520.0">
<xAxis>
<CategoryAxis side="BOTTOM" />
</xAxis>
<yAxis>
<NumberAxis side="LEFT" />
</yAxis>
</LineChart>
</children>
</AnchorPane>
</items>
</SplitPane>
</children>
</VBox>
No preview for this file type
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