From f3495d28d6701bc8fe141139cd5b578d616e772c Mon Sep 17 00:00:00 2001 From: schrom01 Date: Sun, 1 May 2022 23:35:25 +0200 Subject: [PATCH] fixed functionality Places Formular --- .../projekt2/turnierverwaltung/Place.java | 13 +++++++- .../turnierverwaltung/Tournament.java | 1 + .../PlacesFormularController.java | 18 ----------- .../placesAddFormular/PlacesFormular.fxml | 31 +++++-------------- 4 files changed, 20 insertions(+), 43 deletions(-) diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Place.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Place.java index 04df070..f2e35bd 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Place.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Place.java @@ -1,6 +1,8 @@ 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 String name; @@ -18,4 +20,13 @@ public class Place { public void setName(String name) { this.name = name; } + + @Override + public String toString(){ + return name; + } + + public boolean equals(Place place){ + return name.equals(place.getName()); + } } diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Tournament.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Tournament.java index 36ae2e8..a40585a 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Tournament.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Tournament.java @@ -27,6 +27,7 @@ public class Tournament implements Serializable { setName(name); setType(type); participants = new ArrayList<>(); + places = new ArrayList<>(); } public void addParticipant(Participant newParticipant) throws ParticipantExistsException { diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/placesAddFormular/PlacesFormularController.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/placesAddFormular/PlacesFormularController.java index e5c9ac4..c5534e5 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/placesAddFormular/PlacesFormularController.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/placesAddFormular/PlacesFormularController.java @@ -18,21 +18,9 @@ public class PlacesFormularController extends FXController { @FXML private Button addBtn; - @FXML - private Label birthDateLabel; - - @FXML - private TextField birthDateTextField; - @FXML private VBox changeBtn; - @FXML - private Label firstNameLabel; - - @FXML - private TextField firstNameTextField; - @FXML private GridPane grid; @@ -58,12 +46,6 @@ public class PlacesFormularController extends FXController { @FXML private TextField placeNameTextField; - @FXML - private Label phoneNumberLabel; - - @FXML - private TextField phoneNumberTextField; - @FXML private Button saveBtn; diff --git a/app/src/main/resources/ch/zhaw/projekt2/turnierverwaltung/placesAddFormular/PlacesFormular.fxml b/app/src/main/resources/ch/zhaw/projekt2/turnierverwaltung/placesAddFormular/PlacesFormular.fxml index 4e3bfc5..c000eae 100644 --- a/app/src/main/resources/ch/zhaw/projekt2/turnierverwaltung/placesAddFormular/PlacesFormular.fxml +++ b/app/src/main/resources/ch/zhaw/projekt2/turnierverwaltung/placesAddFormular/PlacesFormular.fxml @@ -1,18 +1,11 @@ - - - - - - - - - - - - - + + + + + + @@ -55,7 +48,7 @@ -