diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Factory.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Factory.java index 7b329f4..c89ff8a 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Factory.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Factory.java @@ -46,6 +46,14 @@ public class Factory { setCenterOfBorderPane(pane, getClass().getResource("participantAddFormular/participantFormular.fxml"), factoryDecorator); } + public void loadPlacesFormular(BorderPane pane, FactoryDecorator factoryDecorator) { + setCenterOfBorderPane(pane, getClass().getResource("placesAddFormular/PlacesFormular.fxml"), factoryDecorator); + } + + public void loadGameScheduler(BorderPane pane, FactoryDecorator factoryDecorator) { + setCenterOfBorderPane(pane, getClass().getResource("gameScheduleView/GameSchedule.fxml"), factoryDecorator); + } + private FXController setCenterOfBorderPane(BorderPane pane, URL location, FactoryDecorator factoryDecorator) { FXController controller = null; try { diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/FactoryDecorator.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/FactoryDecorator.java index 6278f10..9364f64 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/FactoryDecorator.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/FactoryDecorator.java @@ -44,7 +44,7 @@ public class FactoryDecorator implements IsObservable{ public void openTournament(FileIO.TournamentFile tournamentFile){ try { factory.setTournament(fileIO.loadTournament(tournamentFile)); - factory.loadParticipantFormular((BorderPane) pane, this); //TODO load TournamentView instead of ParticipantFormular? + factory.loadGameScheduler((BorderPane) pane, this); informListener(); } catch (IOException e) { e.printStackTrace(); @@ -53,6 +53,13 @@ public class FactoryDecorator implements IsObservable{ } //TODO handle and logging } + public void openParticipantFormular() { + factory.loadParticipantFormular((BorderPane) pane, this); + } + + public void openPlacesFormular() { + factory.loadPlacesFormular((BorderPane) pane, this); + } public void informListener() { for(IsObserver observer : listener) { diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/FileIO.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/FileIO.java index 98b6d8b..f708a77 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/FileIO.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/FileIO.java @@ -107,7 +107,7 @@ public class FileIO { ObjectOutputStream out = null; try { - newSave.createNewFile(); + boolean newFile = newSave.createNewFile(); out = new ObjectOutputStream(new FileOutputStream(newSave)); out.writeObject(tournament); System.out.println("Save File" + tournament.getName() + ".txt being saved to " + saves.getAbsolutePath()); diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/gameScheduleView/GameController.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/gameScheduleView/GameController.java new file mode 100644 index 0000000..836c784 --- /dev/null +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/gameScheduleView/GameController.java @@ -0,0 +1,16 @@ +package ch.zhaw.projekt2.turnierverwaltung.main.gameScheduleView; + +import ch.zhaw.projekt2.turnierverwaltung.FXController; +import javafx.fxml.FXML; +import javafx.scene.control.ChoiceBox; + +public class GameController extends FXController { + + @FXML + private ChoiceBox placesChoiceBox; + + @Override + public void loadContent() { + + } +} diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/gameScheduleView/GameScheduleController.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/gameScheduleView/GameScheduleController.java new file mode 100644 index 0000000..ab82179 --- /dev/null +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/gameScheduleView/GameScheduleController.java @@ -0,0 +1,24 @@ +package ch.zhaw.projekt2.turnierverwaltung.main.gameScheduleView; + +import ch.zhaw.projekt2.turnierverwaltung.FXController; +import javafx.event.ActionEvent; +import javafx.fxml.FXML; + +public class GameScheduleController extends FXController { + + @FXML + void openPlacesFormular(ActionEvent event) { + getFactoryDecorator().openPlacesFormular(); + } + + @FXML + void openParticipantFormular(ActionEvent event) { + getFactoryDecorator().openParticipantFormular(); + } + + @Override + public void loadContent() { + + } +} + 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 new file mode 100644 index 0000000..5edac10 --- /dev/null +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/placesAddFormular/PlacesFormularController.java @@ -0,0 +1,66 @@ +package ch.zhaw.projekt2.turnierverwaltung.main.placesAddFormular; + +import ch.zhaw.projekt2.turnierverwaltung.FXController; +import javafx.event.ActionEvent; +import javafx.fxml.FXML; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.ListView; +import javafx.scene.control.TextField; +import javafx.scene.input.MouseEvent; +import javafx.scene.layout.GridPane; + +public class PlacesFormularController extends FXController { + + @FXML + private Label AddListTitle; + + @FXML + private Button closeBtn; + + @FXML + private Button deleteBtn; + + @FXML + private GridPane grid; + + @FXML + private ListView locationListView; + + @FXML + private Label locationNameLabel; + + @FXML + private TextField locationNameTextField; + + @FXML + private Label newLocationFormularTitle; + + @FXML + private Button saveBtn; + + @FXML + void changedSelection(MouseEvent event) { + + } + + @FXML + void closeFormular(ActionEvent event) { + + } + + @FXML + void deleteSelectedPlace(ActionEvent event) { + + } + + @FXML + void saveLocation(ActionEvent event) { + + } + + @Override + public void loadContent() { + + } +} diff --git a/app/src/main/resources/ch/zhaw/projekt2/turnierverwaltung/gameScheduleView/Game.fxml b/app/src/main/resources/ch/zhaw/projekt2/turnierverwaltung/gameScheduleView/Game.fxml new file mode 100644 index 0000000..83fcb91 --- /dev/null +++ b/app/src/main/resources/ch/zhaw/projekt2/turnierverwaltung/gameScheduleView/Game.fxml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + diff --git a/app/src/main/resources/ch/zhaw/projekt2/turnierverwaltung/gameScheduleView/GameSchedule.fxml b/app/src/main/resources/ch/zhaw/projekt2/turnierverwaltung/gameScheduleView/GameSchedule.fxml new file mode 100644 index 0000000..cd88c6a --- /dev/null +++ b/app/src/main/resources/ch/zhaw/projekt2/turnierverwaltung/gameScheduleView/GameSchedule.fxml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/resources/ch/zhaw/projekt2/turnierverwaltung/participantAddFormular/participantFormular.fxml b/app/src/main/resources/ch/zhaw/projekt2/turnierverwaltung/participantAddFormular/participantFormular.fxml index caa919e..0de5bb7 100644 --- a/app/src/main/resources/ch/zhaw/projekt2/turnierverwaltung/participantAddFormular/participantFormular.fxml +++ b/app/src/main/resources/ch/zhaw/projekt2/turnierverwaltung/participantAddFormular/participantFormular.fxml @@ -4,12 +4,8 @@ - - - - @@ -17,7 +13,7 @@ - + @@ -36,7 +32,7 @@ - + + + + +