Skip to content
Snippets Groups Projects
Commit 906e7e7e authored by mvholmsy's avatar mvholmsy
Browse files

Vaihe 3 valmis

parent 42e1ca78
No related branches found
No related tags found
No related merge requests found
Showing
with 315 additions and 95 deletions
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="create_run_jar" name="Create Runnable Jar for Project hiihtorekisteri">
<!--this file was created by Eclipse Runnable JAR Export Wizard-->
<!--ANT 1.7 is required -->
<!--define folder properties-->
<property name="dir.buildfile" value="."/>
<property name="dir.workspace" value="C:/MyTemp/ohj2/ws"/>
<property name="dir.jarfile" value="${dir.buildfile}"/>
<target name="create_run_jar">
<jar destfile="${dir.jarfile}/Hiihtorekisteri.jar" filesetmanifest="mergewithoutmain">
<manifest>
<attribute name="Main-Class" value="fxHiihtorekisteri.HiihtorekisteriMain"/>
<attribute name="Class-Path" value="."/>
</manifest>
<fileset dir="${dir.jarfile}/bin"/>
<zipfileset excludes="META-INF/*.SF" src="C:/devel/jar/Ali.jar"/>
<zipfileset excludes="META-INF/*.SF" src="C:/devel/jar/fxgui.jar"/>
<zipfileset excludes="META-INF/*.SF" src="C:/devel/jar/Graphics.jar"/>
<zipfileset excludes="META-INF/*.SF" src="C:/devel/jar/Music.jar"/>
</jar>
</target>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.BorderPane?>
<BorderPane prefHeight="164.0" prefWidth="316.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fxHiihtorekisteri.HiihtorekisteriGUIController">
<center>
<Label text="Hakemaasi nimeä ei löydy!" BorderPane.alignment="CENTER" />
</center>
<bottom>
<Button mnemonicParsing="false" text="OK" BorderPane.alignment="CENTER">
<BorderPane.margin>
<Insets bottom="5.0" />
</BorderPane.margin>
</Button>
</bottom>
</BorderPane>
package fxHiihtorekisteri; package fxHiihtorekisteri;
import fi.jyu.mit.fxgui.Dialogs;
import fi.jyu.mit.fxgui.ModalController; import fi.jyu.mit.fxgui.ModalController;
import javafx.event.ActionEvent; import javafx.event.ActionEvent;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.control.Button; import javafx.scene.control.Button;
import javafx.scene.control.MenuItem;
import javafx.scene.control.TextField;
/** /**
* @author pohjo * @author JPo ja MHo
* @version 13.1.2020 * @version 13.1.2020
* *
*/ */
public class HiihtorekisteriGUIController { public class HiihtorekisteriGUIController {
@FXML
private TextField Hakukentta;
@FXML @FXML
private Button nappiLisaaHiihto; private Button nappiLisaaHiihto;
...@@ -21,19 +27,75 @@ public class HiihtorekisteriGUIController { ...@@ -21,19 +27,75 @@ public class HiihtorekisteriGUIController {
@FXML @FXML
private Button nappiTulosta; private Button nappiTulosta;
@FXML
private MenuItem ylanappiTallenna;
@FXML
private MenuItem ylanappiTulosta;
@FXML
private MenuItem ylanappiLisaaHiihtaja;
@FXML
private MenuItem ylanappiPoistaHiihtaja;
@FXML
private MenuItem ylanappiLopeta;
@FXML
private MenuItem ylanappiKayttoOhje;
@FXML
private MenuItem ylanappiTietoja;
@FXML
void handleHaku() {
//
}
@FXML
void handleLisaaHiihto() {
ModalController.showModal(HiihtorekisteriGUIController.class.getResource("LisaaHiihto.fxml"), "Hiihto", null, "");
}
@FXML @FXML
void handleMuokkaa() { void handleMuokkaa() {
ModalController.showModal(HiihtorekisteriGUIController.class.getResource("Muokkaa.fxml"), "Hiihtaja", null, ""); ModalController.showModal(HiihtorekisteriGUIController.class.getResource("Muokkaa.fxml"), "Hiihtaja", null, "");
} }
@FXML @FXML
void handleLisaaHiihto(ActionEvent event) { void handleTulosta() {
// ModalController.showModal(HiihtorekisteriGUIController.class.getResource("Tulosta.fxml"), "Tulosta", null, "");
}
@FXML
void handleLisaaHiihtaja() {
ModalController.showModal(HiihtorekisteriGUIController.class.getResource("LisaaHiihtaja.fxml"), "Hiihtaja", null, "");
}
@FXML
void handlePoistaHiihtaja() {
Dialogs.showMessageDialog("Poisto ei vielä toimi");
} }
@FXML @FXML
void handleTulosta(ActionEvent event) { void handleTallenna() {
// Dialogs.showMessageDialog("Tallennus ei toimi vielä");
}
@FXML
void handleLopeta() {
Dialogs.showMessageDialog("Tallentaa tiedot ja lopettaa ohjelman. Tallennus ei toimi vielä.");
}
@FXML
void handleKayttoOhje() {
ModalController.showModal(HiihtorekisteriGUIController.class.getResource("Ohje.fxml"), "Ohje", null, "");
}
@FXML
void handleTietoja() {
ModalController.showModal(HiihtorekisteriGUIController.class.getResource("Tietoja.fxml"), "Tietoja", null, "");
} }
} }
\ No newline at end of file
...@@ -11,15 +11,15 @@ ...@@ -11,15 +11,15 @@
<?import javafx.scene.layout.HBox?> <?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.RowConstraints?> <?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"> <BorderPane xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fxHiihtorekisteri.LisaaHiihtajaGUIController">
<bottom> <bottom>
<HBox spacing="10.0" BorderPane.alignment="CENTER"> <HBox spacing="10.0" BorderPane.alignment="CENTER">
<BorderPane.margin> <BorderPane.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</BorderPane.margin> </BorderPane.margin>
<children> <children>
<Button text="Tallenna" /> <Button fx:id="nappiTallenna" onAction="#handleTallenna" text="Tallenna" />
<Button alignment="CENTER" mnemonicParsing="false" text="Peruuta" /> <Button fx:id="nappiPeruuta" alignment="CENTER" mnemonicParsing="false" onAction="#handlePeruuta" text="Peruuta" />
</children> </children>
</HBox> </HBox>
</bottom> </bottom>
......
package fxHiihtorekisteri;
import fi.jyu.mit.fxgui.Dialogs;
import fi.jyu.mit.fxgui.ModalController;
import fi.jyu.mit.fxgui.ModalControllerInterface;
import javafx.application.Platform;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
/**
* @author pohjo
* @version 13.1.2020
*
*/
public class LisaaHiihtajaGUIController implements ModalControllerInterface<String> {
@FXML
private Button nappiTallenna;
@FXML
private Button nappiPeruuta;
@FXML
void handleTallenna() {
Dialogs.showMessageDialog("Tallennus ei toimi vielä");
}
@FXML
void handlePeruuta() {
ModalController.closeStage(nappiPeruuta);
}
@Override
public String getResult() {
// TODO Auto-generated method stub
return null;
}
@Override
public void handleShown() {
// TODO Auto-generated method stub
}
@Override
public void setDefault(String oletus) {
// TODO Auto-generated method stub
}
//
}
\ No newline at end of file
...@@ -12,18 +12,18 @@ ...@@ -12,18 +12,18 @@
<?import javafx.scene.layout.HBox?> <?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.RowConstraints?> <?import javafx.scene.layout.RowConstraints?>
<BorderPane prefHeight="254.0" prefWidth="307.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fxHiihtorekisteri.HiihtorekisteriGUIController"> <BorderPane prefHeight="254.0" prefWidth="307.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fxHiihtorekisteri.LisaaHiihtoGUIController">
<bottom> <bottom>
<HBox spacing="10.0" BorderPane.alignment="CENTER"> <HBox spacing="10.0" BorderPane.alignment="CENTER">
<BorderPane.margin> <BorderPane.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</BorderPane.margin> </BorderPane.margin>
<children> <children>
<Button text="Tallenna"> <Button fx:id="nappiTallenna" onAction="#handleTallenna" text="Tallenna">
<tooltip> <tooltip>
<Tooltip text="Uuden jäsenen lisääminen" /> <Tooltip text="Uuden jäsenen lisääminen" />
</tooltip></Button> </tooltip></Button>
<Button mnemonicParsing="false" text="Peruuta"> <Button fx:id="nappiPeruuta" mnemonicParsing="false" onAction="#handlePeruuta" text="Peruuta">
<tooltip> <tooltip>
<Tooltip text="Tallenna" /> <Tooltip text="Tallenna" />
</tooltip></Button> </tooltip></Button>
......
...@@ -18,6 +18,9 @@ public class LisaaHiihtoGUIController implements ModalControllerInterface<String ...@@ -18,6 +18,9 @@ public class LisaaHiihtoGUIController implements ModalControllerInterface<String
@FXML @FXML
private Button nappiTallenna; private Button nappiTallenna;
@FXML
private Button nappiPeruuta;
@FXML @FXML
void handleTallenna() { void handleTallenna() {
...@@ -26,7 +29,7 @@ public class LisaaHiihtoGUIController implements ModalControllerInterface<String ...@@ -26,7 +29,7 @@ public class LisaaHiihtoGUIController implements ModalControllerInterface<String
@FXML @FXML
void handlePeruuta() { void handlePeruuta() {
Platform.exit(); ModalController.closeStage(nappiPeruuta);
} }
@Override @Override
......
...@@ -18,6 +18,9 @@ public class MuokkaaGUIController implements ModalControllerInterface<String> { ...@@ -18,6 +18,9 @@ public class MuokkaaGUIController implements ModalControllerInterface<String> {
@FXML @FXML
private Button nappiTallenna; private Button nappiTallenna;
@FXML
private Button nappiPeruuta;
@FXML @FXML
void handleTallenna() { void handleTallenna() {
...@@ -26,7 +29,7 @@ public class MuokkaaGUIController implements ModalControllerInterface<String> { ...@@ -26,7 +29,7 @@ public class MuokkaaGUIController implements ModalControllerInterface<String> {
@FXML @FXML
void handlePeruuta() { void handlePeruuta() {
Platform.exit(); ModalController.closeStage(nappiPeruuta);
} }
@Override @Override
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
<?import javafx.scene.control.TextArea?> <?import javafx.scene.control.TextArea?>
<?import javafx.scene.layout.BorderPane?> <?import javafx.scene.layout.BorderPane?>
<BorderPane xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fxHiihtorekisteri.HiihtorekisteriGUIController"> <BorderPane xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fxHiihtorekisteri.OhjeGUIController">
<bottom> <bottom>
<Button text="Sulje" BorderPane.alignment="CENTER"> <Button fx:id="nappiSulje" onAction="#handleSulje" text="Sulje" BorderPane.alignment="CENTER">
<BorderPane.margin> <BorderPane.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</BorderPane.margin> </BorderPane.margin>
......
package fxHiihtorekisteri;
import fi.jyu.mit.fxgui.Dialogs;
import fi.jyu.mit.fxgui.ModalController;
import fi.jyu.mit.fxgui.ModalControllerInterface;
import javafx.application.Platform;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
/**
* @author pohjo
* @version 13.1.2020
*
*/
public class OhjeGUIController implements ModalControllerInterface<String> {
@FXML
private Button nappiSulje;
@FXML
void handleSulje() {
ModalController.closeStage(nappiSulje);
}
@Override
public String getResult() {
// TODO Auto-generated method stub
return null;
}
@Override
public void handleShown() {
// TODO Auto-generated method stub
}
@Override
public void setDefault(String oletus) {
// TODO Auto-generated method stub
}
//
}
\ No newline at end of file
...@@ -38,20 +38,20 @@ ...@@ -38,20 +38,20 @@
<menus> <menus>
<Menu mnemonicParsing="false" text="Tiedosto"> <Menu mnemonicParsing="false" text="Tiedosto">
<items> <items>
<MenuItem mnemonicParsing="false" text="Tallenna"> <MenuItem fx:id="ylanappiTallenna" mnemonicParsing="false" onAction="#handleTallenna" text="Tallenna">
<accelerator> <accelerator>
<KeyCodeCombination alt="UP" code="S" control="DOWN" meta="UP" shift="UP" shortcut="UP" /> <KeyCodeCombination alt="UP" code="S" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
</accelerator></MenuItem> </accelerator></MenuItem>
<MenuItem mnemonicParsing="false" text="Tulosta" /> <MenuItem fx:id="ylanappiTulosta" mnemonicParsing="false" onAction="#handleTulosta" text="Tulosta" />
<MenuItem mnemonicParsing="false" text="Lisää hiihtäjä" /> <MenuItem fx:id="ylanappiLisaaHiihtaja" mnemonicParsing="false" onAction="#handleLisaaHiihtaja" text="Lisää hiihtäjä" />
<MenuItem mnemonicParsing="false" text="Poista hiihtäjä" /> <MenuItem fx:id="ylanappiPoistaHiihtaja" mnemonicParsing="false" onAction="#handlePoistaHiihtaja" text="Poista hiihtäjä" />
<MenuItem mnemonicParsing="false" text="Lopeta" /> <MenuItem fx:id="ylanappiLopeta" mnemonicParsing="false" onAction="#handleLopeta" text="Lopeta" />
</items> </items>
</Menu> </Menu>
<Menu mnemonicParsing="false" text="Ohje"> <Menu mnemonicParsing="false" text="Ohje">
<items> <items>
<MenuItem mnemonicParsing="false" text="Käyttöohjeet" /> <MenuItem fx:id="ylanappiKayttoOhje" mnemonicParsing="false" onAction="#handleKayttoOhje" text="Käyttöohjeet" />
<MenuItem mnemonicParsing="false" text="Tietoja" /> <MenuItem fx:id="ylanappiTietoja" mnemonicParsing="false" onAction="#handleTietoja" text="Tietoja" />
</items> </items>
</Menu> </Menu>
</menus> </menus>
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
<VBox BorderPane.alignment="CENTER"> <VBox BorderPane.alignment="CENTER">
<children> <children>
<ComboBoxChooser rivit="Nimi&#10;Paikkakunta " /> <ComboBoxChooser rivit="Nimi&#10;Paikkakunta " />
<TextField prefHeight="0.0" prefWidth="200.0" /> <TextField fx:id="Hakukentta" onAction="#handleHaku" onKeyReleased="#handleHaku" prefHeight="0.0" prefWidth="200.0" />
<VBox alignment="TOP_CENTER" prefHeight="200.0" prefWidth="100.0"> <VBox alignment="TOP_CENTER" prefHeight="200.0" prefWidth="100.0">
<children> <children>
<Label contentDisplay="CENTER" text="Hiihtäjät" textAlignment="CENTER" wrapText="true" /> <Label contentDisplay="CENTER" text="Hiihtäjät" textAlignment="CENTER" wrapText="true" />
......
<?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.TextField?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.HBox?>
<BorderPane xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fxHiihtorekisteri.HiihtorekisteriGUIController">
<bottom>
<HBox spacing="20.0" BorderPane.alignment="CENTER">
<children>
<Button mnemonicParsing="false" text="Kyllä">
<HBox.margin>
<Insets left="50.0" />
</HBox.margin>
</Button>
<Button mnemonicParsing="false" text="EI">
<HBox.margin>
<Insets left="80.0" />
</HBox.margin>
</Button>
</children>
<BorderPane.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</BorderPane.margin>
</HBox>
</bottom>
<top>
<Label text="Poistetaanko hiihtäjä?" BorderPane.alignment="CENTER">
<BorderPane.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</BorderPane.margin></Label>
</top>
<center>
<HBox spacing="5.0" BorderPane.alignment="CENTER">
<children>
<TextField text="Juha" />
<TextField text="Mieto" />
</children>
<BorderPane.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</BorderPane.margin>
</HBox>
</center>
</BorderPane>
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
<?import javafx.scene.control.TextArea?> <?import javafx.scene.control.TextArea?>
<?import javafx.scene.layout.BorderPane?> <?import javafx.scene.layout.BorderPane?>
<BorderPane xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fxHiihtorekisteri.HiihtorekisteriGUIController"> <BorderPane xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fxHiihtorekisteri.TietojaGUIController">
<bottom> <bottom>
<Button text="Sulje" BorderPane.alignment="CENTER"> <Button fx:id="nappiSulje" onAction="#handleSulje" text="Sulje" BorderPane.alignment="CENTER">
<BorderPane.margin> <BorderPane.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</BorderPane.margin> </BorderPane.margin>
......
package fxHiihtorekisteri;
import fi.jyu.mit.fxgui.Dialogs;
import fi.jyu.mit.fxgui.ModalController;
import fi.jyu.mit.fxgui.ModalControllerInterface;
import javafx.application.Platform;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
/**
* @author pohjo
* @version 13.1.2020
*
*/
public class TietojaGUIController implements ModalControllerInterface<String> {
@FXML
private Button nappiSulje;
@FXML
void handleSulje() {
ModalController.closeStage(nappiSulje);
}
@Override
public String getResult() {
// TODO Auto-generated method stub
return null;
}
@Override
public void handleShown() {
// TODO Auto-generated method stub
}
@Override
public void setDefault(String oletus) {
// TODO Auto-generated method stub
}
//
}
\ No newline at end of file
...@@ -8,15 +8,15 @@ ...@@ -8,15 +8,15 @@
<?import javafx.scene.layout.HBox?> <?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?> <?import javafx.scene.layout.VBox?>
<BorderPane prefHeight="408.0" prefWidth="684.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fxHiihtorekisteri.HiihtorekisteriGUIController"> <BorderPane prefHeight="408.0" prefWidth="684.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fxHiihtorekisteri.TulostaGUIController">
<bottom> <bottom>
<HBox spacing="50.0" BorderPane.alignment="CENTER"> <HBox spacing="50.0" BorderPane.alignment="CENTER">
<BorderPane.margin> <BorderPane.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</BorderPane.margin> </BorderPane.margin>
<children> <children>
<Button text="Tulosta" /> <Button fx:id="nappiTulosta" onAction="#handleTulosta" text="Tulosta" />
<Button alignment="CENTER" mnemonicParsing="false" text="Peruuta" /> <Button fx:id="nappiPeruuta" alignment="CENTER" mnemonicParsing="false" onAction="#handlePeruuta" text="Peruuta" />
</children> </children>
</HBox> </HBox>
</bottom> </bottom>
......
package fxHiihtorekisteri;
import fi.jyu.mit.fxgui.Dialogs;
import fi.jyu.mit.fxgui.ModalController;
import fi.jyu.mit.fxgui.ModalControllerInterface;
import javafx.application.Platform;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
/**
* @author pohjo
* @version 13.1.2020
*
*/
public class TulostaGUIController implements ModalControllerInterface<String> {
@FXML
private Button nappiTulosta;
@FXML
private Button nappiPeruuta;
@FXML
void handleTulosta() {
Dialogs.showMessageDialog("Tulostus ei toimi vielä");
}
@FXML
void handlePeruuta() {
ModalController.closeStage(nappiPeruuta);
}
@Override
public String getResult() {
// TODO Auto-generated method stub
return null;
}
@Override
public void handleShown() {
// TODO Auto-generated method stub
}
@Override
public void setDefault(String oletus) {
// TODO Auto-generated method stub
}
//
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment