Skip to content
Snippets Groups Projects
Commit b7d8e8a9 authored by thmustap's avatar thmustap
Browse files

Otteluikkunat päivitetty

parent 2429308f
No related branches found
No related tags found
No related merge requests found
......@@ -15,9 +15,9 @@
<GridPane gridLinesVisible="true" BorderPane.alignment="CENTER">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="186.0" minWidth="10.0" prefWidth="111.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="224.0" minWidth="10.0" prefWidth="160.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="190.0" minWidth="10.0" prefWidth="94.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="209.0" minWidth="10.0" prefWidth="116.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="150.0" minWidth="10.0" prefWidth="150.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="120.0" minWidth="10.0" prefWidth="120.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="150.0" minWidth="10.0" prefWidth="150.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="132.0" minWidth="10.0" prefWidth="79.0" />
</columnConstraints>
<rowConstraints>
......@@ -40,17 +40,12 @@
<Font size="16.0" />
</font>
</Label>
<Label alignment="CENTER" prefHeight="25.0" prefWidth="136.0" text="Osallistujien ID:t" GridPane.columnIndex="1" GridPane.rowIndex="1">
<Label alignment="CENTER" prefHeight="25.0" prefWidth="136.0" text="Joukkue 1" GridPane.columnIndex="1" GridPane.rowIndex="1">
<font>
<Font size="16.0" />
</font>
</Label>
<Label alignment="CENTER" prefHeight="25.0" prefWidth="111.0" text="Osal. määrä" GridPane.columnIndex="2" GridPane.rowIndex="1">
<font>
<Font size="16.0" />
</font>
</Label>
<Label alignment="CENTER" prefHeight="17.0" prefWidth="80.0" text="Voittajat" GridPane.columnIndex="3" GridPane.rowIndex="1">
<Label alignment="CENTER" prefHeight="17.0" prefWidth="80.0" text="Tulos" GridPane.columnIndex="2" GridPane.rowIndex="1">
<font>
<Font size="16.0" />
</font>
......@@ -62,21 +57,20 @@
</Label>
<TextField GridPane.rowIndex="2" />
<TextField prefHeight="25.0" prefWidth="118.0" text="31.1.2024" GridPane.rowIndex="2" />
<TextField GridPane.rowIndex="3" />
<TextField fx:id="paivamaara" GridPane.rowIndex="3" />
<TextField GridPane.rowIndex="4" />
<TextField GridPane.rowIndex="5" />
<TextField text="1, 2, 3, 4" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="3" />
<TextField text="Aku Ankka, Teppo Tulppu" GridPane.columnIndex="1" GridPane.rowIndex="2">
<font>
<Font size="10.0" />
</font></TextField>
<TextField fx:id="joukkue1" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="4" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="5" />
<TextField text="4" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<TextField GridPane.columnIndex="2" GridPane.rowIndex="3" />
<TextField alignment="CENTER" text="2 - 6, 6 - 3, 1 - 6" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="2" />
<TextField fx:id="lopputulos" GridPane.columnIndex="2" GridPane.rowIndex="3" />
<TextField GridPane.columnIndex="2" GridPane.rowIndex="4" />
<TextField GridPane.columnIndex="2" GridPane.rowIndex="5" />
<TextField text="1, 2" GridPane.columnIndex="3" GridPane.rowIndex="2" />
<TextField GridPane.columnIndex="3" GridPane.rowIndex="3" />
<TextField GridPane.columnIndex="3" GridPane.rowIndex="4" />
<TextField GridPane.columnIndex="3" GridPane.rowIndex="5" />
<Button alignment="CENTER" minWidth="50.0" mnemonicParsing="false" text="X" GridPane.columnIndex="4" GridPane.halignment="CENTER" GridPane.rowIndex="2" />
<Button alignment="CENTER" minWidth="50.0" mnemonicParsing="false" text="X" GridPane.columnIndex="4" GridPane.halignment="CENTER" GridPane.rowIndex="3" />
<Button alignment="CENTER" minWidth="50.0" mnemonicParsing="false" text="X" GridPane.columnIndex="4" GridPane.halignment="CENTER" GridPane.rowIndex="4" />
......@@ -85,7 +79,17 @@
<TextField GridPane.rowIndex="6" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="6" />
<TextField GridPane.columnIndex="2" GridPane.rowIndex="6" />
<TextField GridPane.columnIndex="3" GridPane.rowIndex="6" />
<Label alignment="CENTER" prefHeight="25.0" prefWidth="136.0" text="Joukkue 2" GridPane.columnIndex="3" GridPane.rowIndex="1">
<font>
<Font size="16.0" />
</font>
</Label>
<TextField text="Repe Sorsa, Hannu Hanhi" GridPane.columnIndex="3" GridPane.rowIndex="2">
<font>
<Font size="10.0" />
</font>
</TextField>
<TextField fx:id="joukkue2" GridPane.columnIndex="3" GridPane.rowIndex="3" />
</children>
</GridPane>
</top>
......
package HT.fx;
import fi.jyu.mit.fxgui.CheckBoxChooser;
import fi.jyu.mit.fxgui.ComboBoxChooser;
import fi.jyu.mit.fxgui.Dialogs;
import fi.jyu.mit.fxgui.ModalControllerInterface;
......@@ -13,15 +14,32 @@ import javafx.stage.Stage;
public class PadelLisaaOtteluGUIController implements ModalControllerInterface<String> {
@FXML private Button OKButton;
@FXML
private Button OKButton;
@FXML private DatePicker otteluPvm;
@FXML
private ComboBoxChooser<String> menuOsallistuja1;
@FXML private ComboBoxChooser<?> menuOsallistujat;
@FXML
private ComboBoxChooser<String> menuOsallistuja2;
@FXML private ComboBoxChooser<?> menuVoittajat;
@FXML private TextField textLopputulos;
@FXML
private ComboBoxChooser<String> menuOsallistuja3;
@FXML
private ComboBoxChooser<String> menuOsallistuja4;
@FXML
private ComboBoxChooser<String> menuVoittaja1;
@FXML
private ComboBoxChooser<String> menuVoittaja2;
@FXML
private DatePicker otteluPvm;
@FXML
private TextField textLopputulos;
@FXML void handleOk() {
......@@ -30,17 +48,16 @@ public class PadelLisaaOtteluGUIController implements ModalControllerInterface<S
Stage stage = (Stage) OKButton.getScene().getWindow();
stage.close();
}
public void kasitteleOk() {
//String pvm = datesyntaika.getValue().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
int PelaajaNro1 = menuOsallistujat.getSelectedIndex();
int PelaajaNro2 = menuOsallistujat.getSelectedIndex();
int PelaajaNro3 = menuOsallistujat.getSelectedIndex();
int PelaajaNro4 = menuOsallistujat.getSelectedIndex();
int VoittajaNro1 = menuVoittajat.getSelectedIndex();
int VoittajaNro2 = menuVoittajat.getSelectedIndex();
int PelaajaNro1 = menuOsallistuja1.getSelectedIndex();
int PelaajaNro2 = menuOsallistuja2.getSelectedIndex();
int PelaajaNro3 = menuOsallistuja3.getSelectedIndex();
int PelaajaNro4 = menuOsallistuja4.getSelectedIndex();
int VoittajaNro1 = menuVoittaja1.getSelectedIndex();
int VoittajaNro2 = menuVoittaja2.getSelectedIndex();
String lopputulos = textLopputulos.toString();
......@@ -53,7 +70,12 @@ public class PadelLisaaOtteluGUIController implements ModalControllerInterface<S
@FXML void handlePoista() {
alusta();
alusta(menuOsallistuja1);
alusta(menuOsallistuja2);
alusta(menuOsallistuja3);
alusta(menuOsallistuja4);
alusta(menuVoittaja1);
alusta(menuVoittaja2);
Dialogs.showMessageDialog("Ei osata vielä");
}
......@@ -77,13 +99,13 @@ public class PadelLisaaOtteluGUIController implements ModalControllerInterface<S
//=======================================================
private void alusta() {
menuOsallistujat.clear();
private void alusta(ComboBoxChooser<String> menu) {
menu.clear();
int i = 0;
int lukumaara = PadelMainGUIController.getKarkelo().getPelaajia();
while(i< lukumaara) {
menuOsallistujat.add(PadelMainGUIController.getKarkelo().annaPelaaja(i).getNimi(), null);
menu.add(PadelMainGUIController.getKarkelo().annaPelaaja(i).getNimi(), null);
i++;
}
}
......
......@@ -22,18 +22,31 @@
<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 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>
<children>
<Label text="Päivämäärä:" GridPane.halignment="CENTER" />
<Label text="Osallistujat:" GridPane.halignment="CENTER" GridPane.rowIndex="1" />
<Label text="Voittajat:" GridPane.halignment="CENTER" GridPane.rowIndex="2" />
<Label text="Osallistuja 2:" GridPane.halignment="CENTER" GridPane.rowIndex="2" />
<Label text="Voittaja 1:" GridPane.halignment="CENTER" GridPane.rowIndex="5" />
<DatePicker fx:id="otteluPvm" prefHeight="25.0" prefWidth="90.0" GridPane.columnIndex="1" GridPane.halignment="CENTER" />
<ComboBoxChooser fx:id="menuOsallistujat" prefHeight="25.0" prefWidth="90.0" promptText="Valitse" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="1" />
<ComboBoxChooser fx:id="menuVoittajat" prefHeight="25.0" prefWidth="90.0" promptText="Valitse" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="2" />
<Label text="Lopputulos:" GridPane.halignment="CENTER" GridPane.rowIndex="3" />
<TextField fx:id="textLopputulos" maxWidth="90.0" prefWidth="90.0" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="3" />
<Label text="Lopputulos:" GridPane.halignment="CENTER" GridPane.rowIndex="7" />
<TextField fx:id="textLopputulos" maxWidth="90.0" prefWidth="90.0" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="7" />
<ComboBoxChooser fx:id="menuOsallistuja1" maxWidth="90.0" prefWidth="90.0" promptText="Valitse" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="1" />
<ComboBoxChooser fx:id="menuVoittaja1" maxWidth="90.0" prefWidth="90.0" promptText="Valitse" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="5" />
<Label GridPane.rowIndex="4" />
<Label text="Osallistuja 1:" GridPane.halignment="CENTER" GridPane.rowIndex="1" />
<Label text="Osallistuja 3:" GridPane.halignment="CENTER" GridPane.rowIndex="3" />
<Label text="Osallistuja 4:" GridPane.halignment="CENTER" GridPane.rowIndex="4" />
<ComboBoxChooser fx:id="menuOsallistuja2" maxWidth="90.0" prefWidth="90.0" promptText="Valitse" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="2" />
<ComboBoxChooser fx:id="menuOsallistuja3" maxWidth="90.0" prefWidth="90.0" promptText="Valitse" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="3" />
<ComboBoxChooser fx:id="menuOsallistuja4" maxWidth="90.0" prefWidth="90.0" promptText="Valitse" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="4" />
<Label text="Voittaja 2:" GridPane.halignment="CENTER" GridPane.rowIndex="6" />
<ComboBoxChooser fx:id="menuVoittaja2" maxWidth="90.0" prefWidth="90.0" promptText="Valitse" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="6" />
</children>
</GridPane>
</center>
......
......@@ -131,12 +131,7 @@ public class PadelMainGUIController {
public static void LisaaOttelu(Ottelu uusi) {
uusi.rekisteroi();
try {
karkelo.lisaa(uusi);
} catch (SailoException e) {
Dialogs.showMessageDialog("Ongelmia uuden luomisessa " + e.getMessage());
return;
}
karkelo.lisaa(uusi);
}
/**
......
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