diff --git a/src/fxHarakka/LuoProjekti.fxml b/src/fxHarakka/LuoProjekti.fxml index 5346720b126983cdd3d4782a7c9ca3da3f995048..5aceb73ae261f2c07e2e84b406a3659805676557 100644 --- a/src/fxHarakka/LuoProjekti.fxml +++ b/src/fxHarakka/LuoProjekti.fxml @@ -1,14 +1,52 @@ <?xml version="1.0" encoding="UTF-8"?> -<?import java.lang.*?> -<?import java.util.*?> -<?import javafx.scene.*?> -<?import javafx.scene.control.*?> -<?import javafx.scene.layout.*?> +<?import javafx.scene.control.Button?> +<?import javafx.scene.control.TextField?> +<?import javafx.scene.layout.AnchorPane?> +<?import javafx.scene.layout.ColumnConstraints?> +<?import javafx.scene.layout.GridPane?> +<?import javafx.scene.layout.RowConstraints?> +<?import javafx.scene.text.Font?> +<?import javafx.scene.text.Text?> -<AnchorPane xmlns="http://javafx.com/javafx" - xmlns:fx="http://javafx.com/fxml" - fx:controller="fxHarakka.LuoProjekti" - prefHeight="400.0" prefWidth="600.0"> +<AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fxHarakka.LuoProjektiController"> + <children> + <GridPane layoutX="136.0" layoutY="144.0" prefHeight="400.0" prefWidth="600.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> + <columnConstraints> + <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> + <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 vgrow="SOMETIMES" /> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + </rowConstraints> + <children> + <TextField fx:id="projektiNimi" onKeyTyped="#setNimi" promptText="Syötä nimi" GridPane.columnIndex="1" GridPane.rowIndex="1" /> + <TextField fx:id="projektiAihe" onKeyTyped="#setAihe" promptText="Syötä aihe" GridPane.columnIndex="1" GridPane.rowIndex="2" /> + <Text strokeType="OUTSIDE" strokeWidth="0.0" text="Projektin nimi" textAlignment="RIGHT" GridPane.rowIndex="1"> + <font> + <Font size="22.0" /> + </font> + </Text> + <Text strokeType="OUTSIDE" strokeWidth="0.0" text="Aihe" GridPane.rowIndex="2"> + <font> + <Font size="22.0" /> + </font> + </Text> + <Text strokeType="OUTSIDE" strokeWidth="0.0" text="Kesto" GridPane.rowIndex="3"> + <font> + <Font size="22.0" /> + </font> + </Text> + <TextField fx:id="projektiKesto" onKeyTyped="#setKesto" promptText="Viikoissa (esim 4 tai 5)" GridPane.columnIndex="1" GridPane.rowIndex="3" /> + <Button fx:id="luoProjekti" mnemonicParsing="false" onAction="#luoProjekti" text="Luo Projekti" GridPane.columnIndex="2" GridPane.rowIndex="4" /> + <Button fx:id="hylkaaProjekti" mnemonicParsing="false" onAction="#HylkaaProjekti" text="Hylkää muutokset" GridPane.columnIndex="1" GridPane.rowIndex="4" /> + </children> + </GridPane> + </children> </AnchorPane> diff --git a/src/fxHarakka/LuoProjektiController.java b/src/fxHarakka/LuoProjektiController.java index 366fc6582083b69d045e1228d8f2c0dfacd3f867..16e68f8eea89ac2a80c35d9fe3eeea5d990a2c51 100644 --- a/src/fxHarakka/LuoProjektiController.java +++ b/src/fxHarakka/LuoProjektiController.java @@ -1,4 +1,51 @@ package fxHarakka; +import javafx.event.ActionEvent; +import javafx.fxml.FXML; +import javafx.scene.control.Button; +import javafx.scene.control.TextField; +import javafx.scene.input.KeyEvent; + public class LuoProjektiController { -} + + @FXML + private Button hylkaaProjekti; + + @FXML + private Button luoProjekti; + + @FXML + private TextField projektiAihe; + + @FXML + private TextField projektiKesto; + + @FXML + private TextField projektiNimi; + + @FXML + void HylkaaProjekti(ActionEvent event) { + + } + + @FXML + void luoProjekti(ActionEvent event) { + + } + + @FXML + void setAihe(KeyEvent event) { + + } + + @FXML + void setKesto(KeyEvent event) { + + } + + @FXML + void setNimi(KeyEvent event) { + + } + +} \ No newline at end of file diff --git a/src/fxHarakka/Oksa.fxml b/src/fxHarakka/Oksa.fxml index c6cf891bba761f380bac008c5bf8aaefe6a103db..4ced796d9cecce284f4075532d4e5ffe9e13a5fb 100644 --- a/src/fxHarakka/Oksa.fxml +++ b/src/fxHarakka/Oksa.fxml @@ -15,7 +15,7 @@ <?import javafx.scene.layout.Pane?> <?import javafx.scene.layout.RowConstraints?> -<SplitPane dividerPositions="0.5, 0.510590015128593" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="445.0" prefWidth="663.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1"> +<SplitPane dividerPositions="0.5, 0.510590015128593" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="445.0" prefWidth="663.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fxHarakka.OksaController"> <items> <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0"> <children> diff --git a/src/fxHarakka/OksaController.java b/src/fxHarakka/OksaController.java index 77b20f4031d472b9f092424d252c8a61e1366758..b433576e0715101053f1fd0ff89d7467ee98fb03 100644 --- a/src/fxHarakka/OksaController.java +++ b/src/fxHarakka/OksaController.java @@ -1,4 +1,22 @@ package fxHarakka; +import javafx.event.ActionEvent; +import javafx.fxml.FXML; +import javafx.scene.control.Button; + public class OksaController { + + @FXML + private Button Tallenna; + + @FXML + void HylkaaTehtava(ActionEvent event) { + + } + + @FXML + void Tallenna(ActionEvent event) { + + } + }