fixed functionality Places Formular
This commit is contained in:
parent
c323ab5759
commit
f3495d28d6
|
@ -1,6 +1,8 @@
|
||||||
package ch.zhaw.projekt2.turnierverwaltung;
|
package ch.zhaw.projekt2.turnierverwaltung;
|
||||||
|
|
||||||
public class Place {
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class Place implements Serializable {
|
||||||
private final String NAME_MATCHING_REGEX = "[a-zA-Z0-9]{1,20}";
|
private final String NAME_MATCHING_REGEX = "[a-zA-Z0-9]{1,20}";
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
@ -18,4 +20,13 @@ public class Place {
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString(){
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean equals(Place place){
|
||||||
|
return name.equals(place.getName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@ public class Tournament implements Serializable {
|
||||||
setName(name);
|
setName(name);
|
||||||
setType(type);
|
setType(type);
|
||||||
participants = new ArrayList<>();
|
participants = new ArrayList<>();
|
||||||
|
places = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addParticipant(Participant newParticipant) throws ParticipantExistsException {
|
public void addParticipant(Participant newParticipant) throws ParticipantExistsException {
|
||||||
|
|
|
@ -18,21 +18,9 @@ public class PlacesFormularController extends FXController {
|
||||||
@FXML
|
@FXML
|
||||||
private Button addBtn;
|
private Button addBtn;
|
||||||
|
|
||||||
@FXML
|
|
||||||
private Label birthDateLabel;
|
|
||||||
|
|
||||||
@FXML
|
|
||||||
private TextField birthDateTextField;
|
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private VBox changeBtn;
|
private VBox changeBtn;
|
||||||
|
|
||||||
@FXML
|
|
||||||
private Label firstNameLabel;
|
|
||||||
|
|
||||||
@FXML
|
|
||||||
private TextField firstNameTextField;
|
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private GridPane grid;
|
private GridPane grid;
|
||||||
|
|
||||||
|
@ -58,12 +46,6 @@ public class PlacesFormularController extends FXController {
|
||||||
@FXML
|
@FXML
|
||||||
private TextField placeNameTextField;
|
private TextField placeNameTextField;
|
||||||
|
|
||||||
@FXML
|
|
||||||
private Label phoneNumberLabel;
|
|
||||||
|
|
||||||
@FXML
|
|
||||||
private TextField phoneNumberTextField;
|
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private Button saveBtn;
|
private Button saveBtn;
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,11 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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.ListView?>
|
|
||||||
<?import javafx.scene.control.Separator?>
|
|
||||||
<?import javafx.scene.control.TextField?>
|
|
||||||
<?import javafx.scene.layout.ColumnConstraints?>
|
|
||||||
<?import javafx.scene.layout.GridPane?>
|
|
||||||
<?import javafx.scene.layout.HBox?>
|
|
||||||
<?import javafx.scene.layout.RowConstraints?>
|
|
||||||
<?import javafx.scene.layout.VBox?>
|
|
||||||
<?import javafx.scene.text.Font?>
|
|
||||||
|
|
||||||
<HBox alignment="CENTER" VBox.vgrow="ALWAYS" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/17" fx:controller="ch.zhaw.projekt2.turnierverwaltung.main.placesAddFormular.PlacesFormularController">
|
<?import javafx.geometry.*?>
|
||||||
|
<?import javafx.scene.control.*?>
|
||||||
|
<?import javafx.scene.layout.*?>
|
||||||
|
<?import javafx.scene.text.*?>
|
||||||
|
|
||||||
|
<HBox alignment="CENTER" VBox.vgrow="ALWAYS" xmlns="http://javafx.com/javafx/11.0.2" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ch.zhaw.projekt2.turnierverwaltung.main.placesAddFormular.PlacesFormularController">
|
||||||
<children>
|
<children>
|
||||||
<VBox alignment="TOP_CENTER" prefHeight="331.0" prefWidth="308.0" HBox.hgrow="ALWAYS">
|
<VBox alignment="TOP_CENTER" prefHeight="331.0" prefWidth="308.0" HBox.hgrow="ALWAYS">
|
||||||
<children>
|
<children>
|
||||||
|
@ -55,7 +48,7 @@
|
||||||
</Separator>
|
</Separator>
|
||||||
<VBox fx:id="changeBtn" alignment="TOP_CENTER" prefHeight="331.0" prefWidth="308.0" HBox.hgrow="ALWAYS">
|
<VBox fx:id="changeBtn" alignment="TOP_CENTER" prefHeight="331.0" prefWidth="308.0" HBox.hgrow="ALWAYS">
|
||||||
<children>
|
<children>
|
||||||
<Label fx:id="newplaceFormularTitle" text="Teilnehmer ändern/erstellen">
|
<Label fx:id="newplaceFormularTitle" text="Ort ändern/erstellen">
|
||||||
<font>
|
<font>
|
||||||
<Font name="System Bold" size="21.0" />
|
<Font name="System Bold" size="21.0" />
|
||||||
</font>
|
</font>
|
||||||
|
@ -86,16 +79,6 @@
|
||||||
<Insets />
|
<Insets />
|
||||||
</GridPane.margin>
|
</GridPane.margin>
|
||||||
</TextField>
|
</TextField>
|
||||||
<Label fx:id="firstNameLabel" styleClass="lableGrid" text="Vorname" GridPane.rowIndex="1">
|
|
||||||
<GridPane.margin>
|
|
||||||
<Insets />
|
|
||||||
</GridPane.margin>
|
|
||||||
</Label>
|
|
||||||
<TextField fx:id="firstNameTextField" GridPane.columnIndex="1" GridPane.rowIndex="1" />
|
|
||||||
<TextField fx:id="phoneNumberTextField" GridPane.columnIndex="1" GridPane.rowIndex="2" />
|
|
||||||
<TextField fx:id="birthDateTextField" GridPane.columnIndex="1" GridPane.rowIndex="3" />
|
|
||||||
<Label fx:id="phoneNumberLabel" text="Telefonnummer" GridPane.rowIndex="2" />
|
|
||||||
<Label fx:id="birthDateLabel" text="Geb. Datum" GridPane.rowIndex="3" />
|
|
||||||
</children>
|
</children>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
<Separator prefWidth="200.0" />
|
<Separator prefWidth="200.0" />
|
||||||
|
|
Loading…
Reference in New Issue