diff --git a/.classpath b/.classpath new file mode 100644 index 0000000000000000000000000000000000000000..71271194014e62be3b8a9df584328f858b37efbc --- /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 0000000000000000000000000000000000000000..b8388414ec6ff6a50c75070931fef0160a6cd76d --- /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 0000000000000000000000000000000000000000..a49678929960b39b84e4c639aaac96430dac9a11 --- /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 0a95565321c734c9de6d53583200aabfd760cf66..49c8ab9dbee1e5276e82e229fe8d01dc21f7d3e9 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 0000000000000000000000000000000000000000..9d08a9ba0076a08277fdbb10c1c4ac810d262ded --- /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 0000000000000000000000000000000000000000..28ba0c9c6d4ab2a77bd73b421207554a52f6eb4f --- /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 0000000000000000000000000000000000000000..e05d8abfb1325f4b476b581db6baf04cfa009566 --- /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 0000000000000000000000000000000000000000..83d6f3343843c65d5dfaf3fedb97b6494c19113d --- /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