From f996545e30f76793243a50e2b3e81ccec24bb98e Mon Sep 17 00:00:00 2001
From: pohjjuan <jussi.a.pohjola@student.jyu.fi>
Date: Thu, 23 Jan 2020 09:54:35 +0200
Subject: [PATCH] muutoksia hiihdot dataan

---
 .classpath                                    |   8 ++
 .project                                      |  23 ++++
 build.fxbuild                                 |   8 ++
 hollola/hiihdot.dat                           |  14 +--
 .../HiihtorekisteriGUIController.java         |  10 ++
 .../HiihtorekisteriMain.java                  |  35 ++++++
 src/fxHiihtorekisteri/PaaikkunaGUIView.fxml   | 100 ++++++++++++++++++
 src/fxHiihtorekisteri/hiihtorekisteri.css     |   1 +
 8 files changed, 192 insertions(+), 7 deletions(-)
 create mode 100644 .classpath
 create mode 100644 .project
 create mode 100644 build.fxbuild
 create mode 100644 src/fxHiihtorekisteri/HiihtorekisteriGUIController.java
 create mode 100644 src/fxHiihtorekisteri/HiihtorekisteriMain.java
 create mode 100644 src/fxHiihtorekisteri/PaaikkunaGUIView.fxml
 create mode 100644 src/fxHiihtorekisteri/hiihtorekisteri.css

diff --git a/.classpath b/.classpath
new file mode 100644
index 0000000..7127119
--- /dev/null
+++ b/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.fx.ide.jdt.core.JAVAFX_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/ohj2"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/.project b/.project
new file mode 100644
index 0000000..b838841
--- /dev/null
+++ b/.project
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>hiihtorekisteri</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
diff --git a/build.fxbuild b/build.fxbuild
new file mode 100644
index 0000000..a496789
--- /dev/null
+++ b/build.fxbuild
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="ASCII"?>
+<anttasks:AntTask xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:anttasks="http://org.eclipse.fx.ide.jdt/1.0" buildDirectory="${project}/build">
+  <deploy>
+    <application name="hiihtorekisteri"/>
+    <info/>
+  </deploy>
+  <signjar/>
+</anttasks:AntTask>
diff --git a/hollola/hiihdot.dat b/hollola/hiihdot.dat
index 0a95565..49c8ab9 100644
--- a/hollola/hiihdot.dat
+++ b/hollola/hiihdot.dat
@@ -1,7 +1,7 @@
-id  |vuosi  |hiihtokerrat   |kilometrit |lämpötila
-1   |2015   |50             | 500       |-10
-1   |2016   |100            | 1000      |-8
-1   |2017   |150            | 1500      |-2
-2   |2018   |200            | 2000      |+3
-2   |2019   |250            | 2500      |-5
-3   |2020   |300            | 3000      |-6
\ No newline at end of file
+id  |suorituspvm  |matka  |hiihtoaika   |lämpötila |keskisyke |maksimisyke |kalorit
+1   |01.02.2010   |50     |00:30        |+0        |135       |160         |400
+1   |02.03.2011   |40     |00:45        |+2        |125       |170         |500
+1   |03.04.2012   |30     |01:25        |-5        |145       |180         |600
+2   |04.05.2013   |20     |01:45        |-7        |155       |190         |700
+2   |05.06.2014   |10     |02:15        |-10       |115       |155         |800
+3   |06.07.2015   |05     |03:20        |+5        |160       |175         |1000
\ No newline at end of file
diff --git a/src/fxHiihtorekisteri/HiihtorekisteriGUIController.java b/src/fxHiihtorekisteri/HiihtorekisteriGUIController.java
new file mode 100644
index 0000000..9d08a9b
--- /dev/null
+++ b/src/fxHiihtorekisteri/HiihtorekisteriGUIController.java
@@ -0,0 +1,10 @@
+package fxHiihtorekisteri;
+
+/**
+ * @author pohjo
+ * @version 13.1.2020
+ *
+ */
+public class HiihtorekisteriGUIController {
+	//
+}
diff --git a/src/fxHiihtorekisteri/HiihtorekisteriMain.java b/src/fxHiihtorekisteri/HiihtorekisteriMain.java
new file mode 100644
index 0000000..28ba0c9
--- /dev/null
+++ b/src/fxHiihtorekisteri/HiihtorekisteriMain.java
@@ -0,0 +1,35 @@
+package fxHiihtorekisteri;
+	
+import javafx.application.Application;
+import javafx.stage.Stage;
+import javafx.scene.Scene;
+import javafx.scene.layout.BorderPane;
+import javafx.fxml.FXMLLoader;
+
+
+/**
+ * @author pohjo
+ * @version 13.1.2020
+ *
+ */
+public class HiihtorekisteriMain extends Application {
+	@Override
+	public void start(Stage primaryStage) {
+		try {
+			BorderPane root = (BorderPane)FXMLLoader.load(getClass().getResource("HiihtorekisteriGUIView.fxml"));
+			Scene scene = new Scene(root);
+			scene.getStylesheets().add(getClass().getResource("hiihtorekisteri.css").toExternalForm());
+			primaryStage.setScene(scene);
+			primaryStage.show();
+		} catch(Exception e) {
+			e.printStackTrace();
+		}
+	}
+	
+	/**
+	 * @param args ei käytössä
+	 */
+	public static void main(String[] args) {
+		launch(args);
+	}
+}
diff --git a/src/fxHiihtorekisteri/PaaikkunaGUIView.fxml b/src/fxHiihtorekisteri/PaaikkunaGUIView.fxml
new file mode 100644
index 0000000..e05d8ab
--- /dev/null
+++ b/src/fxHiihtorekisteri/PaaikkunaGUIView.fxml
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<?import fi.jyu.mit.fxgui.ListChooser?>
+<?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.TextField?>
+<?import javafx.scene.control.Tooltip?>
+<?import javafx.scene.input.KeyCodeCombination?>
+<?import javafx.scene.layout.BorderPane?>
+<?import javafx.scene.layout.ColumnConstraints?>
+<?import javafx.scene.layout.GridPane?>
+<?import javafx.scene.layout.HBox?>
+<?import javafx.scene.layout.RowConstraints?>
+
+<BorderPane xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fxHiihtorekisteri.HiihtorekisteriGUIController">
+   <bottom>
+      <HBox spacing="10.0" BorderPane.alignment="CENTER">
+         <BorderPane.margin>
+            <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
+         </BorderPane.margin>
+         <children>
+            <Button text="_Uusi jäsen">
+               <tooltip>
+                  <Tooltip text="Uuden jäsenen lisääminen" />
+               </tooltip></Button>
+            <Button mnemonicParsing="false" text="Tallenna">
+               <tooltip>
+                  <Tooltip text="Tallenna" />
+               </tooltip></Button>
+         </children>
+      </HBox>
+   </bottom>
+   <top>
+      <MenuBar BorderPane.alignment="CENTER">
+        <menus>
+          <Menu mnemonicParsing="false" text="File">
+            <items>
+              <MenuItem mnemonicParsing="false" text="Tallenna">
+                     <accelerator>
+                        <KeyCodeCombination alt="UP" code="S" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
+                     </accelerator></MenuItem>
+                  <MenuItem mnemonicParsing="false" text="Lopeta" />
+            </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>
+   <left>
+      <BorderPane prefHeight="200.0" prefWidth="200.0" BorderPane.alignment="CENTER">
+         <top>
+            <Label text="Jäsenet" BorderPane.alignment="CENTER" />
+         </top>
+         <center>
+            <ListChooser BorderPane.alignment="CENTER" />
+         </center>
+      </BorderPane>
+   </left>
+   <center>
+      <ScrollPane fitToWidth="true" prefHeight="200.0" prefWidth="200.0" BorderPane.alignment="CENTER">
+         <content>
+            <GridPane hgap="10.0">
+              <columnConstraints>
+                <ColumnConstraints fillWidth="false" halignment="RIGHT" hgrow="SOMETIMES" minWidth="10.0" />
+                <ColumnConstraints hgrow="ALWAYS" />
+              </columnConstraints>
+              <rowConstraints>
+                <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
+                <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
+                <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
+                  <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
+              </rowConstraints>
+               <padding>
+                  <Insets left="10.0" right="10.0" top="10.0" />
+               </padding>
+               <children>
+                  <TextField GridPane.columnIndex="1" GridPane.hgrow="ALWAYS" />
+                  <TextField GridPane.columnIndex="1" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" />
+                  <TextField GridPane.columnIndex="1" GridPane.hgrow="ALWAYS" GridPane.rowIndex="2" />
+                  <TextField GridPane.columnIndex="1" GridPane.hgrow="ALWAYS" GridPane.rowIndex="3" />
+               </children>
+            </GridPane>
+         </content>
+      </ScrollPane>
+   </center>
+</BorderPane>
diff --git a/src/fxHiihtorekisteri/hiihtorekisteri.css b/src/fxHiihtorekisteri/hiihtorekisteri.css
new file mode 100644
index 0000000..83d6f33
--- /dev/null
+++ b/src/fxHiihtorekisteri/hiihtorekisteri.css
@@ -0,0 +1 @@
+/* JavaFX CSS - Leave this comment until you have at least create one rule which uses -fx-Property */
\ No newline at end of file
-- 
GitLab