From 4b729484a2751a6da473e51f5f71dc0ad4c8cb6c Mon Sep 17 00:00:00 2001
From: Kiljala Renne Lauri Olavi <renne.l.o.kiljala@student.jyu.fi>
Date: Thu, 20 Mar 2025 19:21:44 +0200
Subject: [PATCH] =?UTF-8?q?lis=C3=A4tty=20k=C3=A4ytt=C3=B6liittym=C3=A4?=
 =?UTF-8?q?=C3=A4n?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/fxHarakka/LuoProjekti.fxml           | 56 ++++++++++++++++++++----
 src/fxHarakka/LuoProjektiController.java | 49 ++++++++++++++++++++-
 src/fxHarakka/Oksa.fxml                  |  2 +-
 src/fxHarakka/OksaController.java        | 18 ++++++++
 4 files changed, 114 insertions(+), 11 deletions(-)

diff --git a/src/fxHarakka/LuoProjekti.fxml b/src/fxHarakka/LuoProjekti.fxml
index 5346720..5aceb73 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 366fc65..16e68f8 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 c6cf891..4ced796 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 77b20f4..b433576 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) {
+
+    }
+
 }
-- 
GitLab