diff --git a/Bachelor_application.iml b/Bachelor_application.iml index 57ba6a43e542300777b947534967e221e81d0dd0..fcfaf11c6b95722bb2d62ab6eb3b133442da2dd5 100644 --- a/Bachelor_application.iml +++ b/Bachelor_application.iml @@ -5,6 +5,7 @@ <output-test url="file://$MODULE_DIR$/target/test-classes" /> <content url="file://$MODULE_DIR$"> <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> <excludeFolder url="file://$MODULE_DIR$/target" /> </content> <orderEntry type="inheritedJdk" /> diff --git a/src/main/java/com/application/Main.java b/src/main/java/com/application/Main.java index aeeaadf247f320ba55f9a7fccdbe4cbf47318554..c1c7cecf9dbbcf57c4641036a77bc190213c58fb 100644 --- a/src/main/java/com/application/Main.java +++ b/src/main/java/com/application/Main.java @@ -1,10 +1,12 @@ package com.application; import javafx.application.Application; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.control.Button; -import javafx.scene.layout.StackPane; import javafx.stage.Stage; +import java.util.Objects; public class Main extends Application { Button button; @@ -23,19 +25,14 @@ public class Main extends Application { @Override public void start(Stage primaryStage) throws Exception { - // Sett title in top left of the stage - primaryStage.setTitle("Moelven Drying Application"); + // Loading the GUI-fxml file from resources + Parent root = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/com.application/test.fxml"))); - // Creates a button - button = new Button(); - button.setText("Click me"); - button.setOnAction(e->System.out.println("Button was clicked")); - - // Creates a stackpane, attaches the button to the - StackPane layout = new StackPane(); - layout.getChildren().add(button); - - Scene scene = new Scene(layout, 300, 250); + // Sets the scene and defines boundaries + Scene scene = new Scene(root, 1200, 600); + primaryStage.setMaximized(true); + primaryStage.setMinHeight(600); + primaryStage.setMinWidth(1200); primaryStage.setScene(scene); primaryStage.show(); } diff --git a/src/main/resources/com.application/test.fxml b/src/main/resources/com.application/test.fxml new file mode 100644 index 0000000000000000000000000000000000000000..3b32926dda06f56a9bcd046eb780532f0754d288 --- /dev/null +++ b/src/main/resources/com.application/test.fxml @@ -0,0 +1,128 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<?import javafx.geometry.Insets?> +<?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.ScrollPane?> +<?import javafx.scene.control.SeparatorMenuItem?> +<?import javafx.scene.control.SplitPane?> +<?import javafx.scene.layout.AnchorPane?> +<?import javafx.scene.layout.HBox?> +<?import javafx.scene.layout.Pane?> +<?import javafx.scene.layout.VBox?> +<?import javafx.scene.paint.Color?> +<?import javafx.scene.text.Font?> + +<VBox prefHeight="600.0" prefWidth="900.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> + <children> + <Label alignment="CENTER" layoutX="14.0" layoutY="14.0" minWidth="60.0" prefWidth="-1.0" style=" " text="Master" textAlignment="CENTER" wrapText="false"> + <font> + <Font size="18.0" fx:id="x11" /> + </font> + <textFill> + <Color blue="0.624" green="0.624" red="0.624" fx:id="x21" /> + </textFill> + </Label> + <Button layoutX="238.0" layoutY="8.0" mnemonicParsing="false" text="Button" /> + </children> + </AnchorPane> + </items> + </SplitPane> + <SplitPane dividerPositions="0.2505567928730512, 0.7505567928730512" focusTraversable="true" prefHeight="-1.0" prefWidth="-1.0" VBox.vgrow="ALWAYS"> + <items> + <AnchorPane> + <children> + <Label alignment="CENTER" layoutX="14.0" layoutY="14.0" minWidth="60.0" prefWidth="-1.0" style=" " text="Master" textAlignment="CENTER" wrapText="false"> + <font> + <Font size="18.0" fx:id="x1" /> + </font> + <textFill> + <Color blue="0.624" green="0.624" red="0.624" fx:id="x2" /> + </textFill> + </Label> + <Button layoutX="95.0" layoutY="126.0" mnemonicParsing="false" text="Button" /> + </children> + </AnchorPane> + <ScrollPane prefHeight="-1.0" prefWidth="-1.0"> + <content> + <AnchorPane id="Content" minHeight="-1.0" minWidth="-1.0" prefHeight="545.0" prefWidth="430.0"> + <children> + <Label alignment="CENTER" font="$x1" layoutX="14.0" layoutY="14.0" style=" " text="View" textAlignment="CENTER" textFill="$x2" wrapText="false" /> + <Button layoutX="120.0" layoutY="182.0" mnemonicParsing="false" text="Button" /> + </children> + </AnchorPane> + </content> + </ScrollPane> + <AnchorPane> + <children> + <Label alignment="CENTER" font="$x1" layoutX="14.0" layoutY="14.0" style=" " text="Details" textAlignment="CENTER" textFill="$x2" wrapText="false" /> + <Button layoutX="26.0" layoutY="171.0" mnemonicParsing="false" text="Button" /> + </children> + </AnchorPane> + </items> + </SplitPane> + <HBox id="HBox" alignment="CENTER_LEFT" spacing="5.0" VBox.vgrow="NEVER"> + <children> + <Label maxHeight="1.7976931348623157E308" maxWidth="-1.0" text="Left status" HBox.hgrow="ALWAYS"> + <font> + <Font size="11.0" fx:id="x3" /> + </font> + <textFill> + <Color blue="0.625" green="0.625" red="0.625" fx:id="x4" /> + </textFill> + </Label> + <Pane prefHeight="-1.0" prefWidth="-1.0" HBox.hgrow="ALWAYS" /> + <Label font="$x3" maxWidth="-1.0" text="Right status" textFill="$x4" HBox.hgrow="NEVER" /> + </children> + <padding> + <Insets bottom="3.0" left="3.0" right="3.0" top="3.0" /> + </padding> + </HBox> + </children> +</VBox> diff --git a/target/classes/com.application/test.fxml b/target/classes/com.application/test.fxml new file mode 100644 index 0000000000000000000000000000000000000000..3b32926dda06f56a9bcd046eb780532f0754d288 --- /dev/null +++ b/target/classes/com.application/test.fxml @@ -0,0 +1,128 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<?import javafx.geometry.Insets?> +<?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.ScrollPane?> +<?import javafx.scene.control.SeparatorMenuItem?> +<?import javafx.scene.control.SplitPane?> +<?import javafx.scene.layout.AnchorPane?> +<?import javafx.scene.layout.HBox?> +<?import javafx.scene.layout.Pane?> +<?import javafx.scene.layout.VBox?> +<?import javafx.scene.paint.Color?> +<?import javafx.scene.text.Font?> + +<VBox prefHeight="600.0" prefWidth="900.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> + <children> + <Label alignment="CENTER" layoutX="14.0" layoutY="14.0" minWidth="60.0" prefWidth="-1.0" style=" " text="Master" textAlignment="CENTER" wrapText="false"> + <font> + <Font size="18.0" fx:id="x11" /> + </font> + <textFill> + <Color blue="0.624" green="0.624" red="0.624" fx:id="x21" /> + </textFill> + </Label> + <Button layoutX="238.0" layoutY="8.0" mnemonicParsing="false" text="Button" /> + </children> + </AnchorPane> + </items> + </SplitPane> + <SplitPane dividerPositions="0.2505567928730512, 0.7505567928730512" focusTraversable="true" prefHeight="-1.0" prefWidth="-1.0" VBox.vgrow="ALWAYS"> + <items> + <AnchorPane> + <children> + <Label alignment="CENTER" layoutX="14.0" layoutY="14.0" minWidth="60.0" prefWidth="-1.0" style=" " text="Master" textAlignment="CENTER" wrapText="false"> + <font> + <Font size="18.0" fx:id="x1" /> + </font> + <textFill> + <Color blue="0.624" green="0.624" red="0.624" fx:id="x2" /> + </textFill> + </Label> + <Button layoutX="95.0" layoutY="126.0" mnemonicParsing="false" text="Button" /> + </children> + </AnchorPane> + <ScrollPane prefHeight="-1.0" prefWidth="-1.0"> + <content> + <AnchorPane id="Content" minHeight="-1.0" minWidth="-1.0" prefHeight="545.0" prefWidth="430.0"> + <children> + <Label alignment="CENTER" font="$x1" layoutX="14.0" layoutY="14.0" style=" " text="View" textAlignment="CENTER" textFill="$x2" wrapText="false" /> + <Button layoutX="120.0" layoutY="182.0" mnemonicParsing="false" text="Button" /> + </children> + </AnchorPane> + </content> + </ScrollPane> + <AnchorPane> + <children> + <Label alignment="CENTER" font="$x1" layoutX="14.0" layoutY="14.0" style=" " text="Details" textAlignment="CENTER" textFill="$x2" wrapText="false" /> + <Button layoutX="26.0" layoutY="171.0" mnemonicParsing="false" text="Button" /> + </children> + </AnchorPane> + </items> + </SplitPane> + <HBox id="HBox" alignment="CENTER_LEFT" spacing="5.0" VBox.vgrow="NEVER"> + <children> + <Label maxHeight="1.7976931348623157E308" maxWidth="-1.0" text="Left status" HBox.hgrow="ALWAYS"> + <font> + <Font size="11.0" fx:id="x3" /> + </font> + <textFill> + <Color blue="0.625" green="0.625" red="0.625" fx:id="x4" /> + </textFill> + </Label> + <Pane prefHeight="-1.0" prefWidth="-1.0" HBox.hgrow="ALWAYS" /> + <Label font="$x3" maxWidth="-1.0" text="Right status" textFill="$x4" HBox.hgrow="NEVER" /> + </children> + <padding> + <Insets bottom="3.0" left="3.0" right="3.0" top="3.0" /> + </padding> + </HBox> + </children> +</VBox> diff --git a/target/classes/com/application/Main.class b/target/classes/com/application/Main.class index df1fc0cf8c2acaa89640bbfb70fa972a1c245e31..93001873b5b9c3703d766598c63974f8421b2f26 100644 Binary files a/target/classes/com/application/Main.class and b/target/classes/com/application/Main.class differ