From aee3549669c20877a2a7b8ccbd1756285e448404 Mon Sep 17 00:00:00 2001 From: schrom01 Date: Fri, 13 May 2022 22:08:20 +0200 Subject: [PATCH 1/5] uploaded ClassDiagram.png --- ClassDiagram.png | Bin 0 -> 11799 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 ClassDiagram.png diff --git a/ClassDiagram.png b/ClassDiagram.png new file mode 100644 index 0000000000000000000000000000000000000000..79eaa8afdd32cdd3c91f371a9c93e3ba1da1a0dc GIT binary patch literal 11799 zcmaiaWk40$60UR!DBWzjq`SMjOPWo0H_{~`9ZH9EcL_*$OLun)Qg7ouzI%?x``-Qm zA2VysH*40+EYKlS5D}wgq+@|6Ti+O+glA>|FaT@~E#P^0=w*O5rcP!6PG)9idNFe= zC!hnpn3aJOPy}dXYYgP$b98b58d$@-eVo?ujK<}3c=F{Fg}CkQ@QB|oCKR*#!q=h; zbL~-m(2Vd3#*b%`fM)N*HmUn}3_-pR{GHy76$DmQTC|1QIUikI!Q?9?ANtD3i^D~$ zZjy@2mvvK!C*|f2kB+7<>eZh-u9Auu`R&|YPQrLB%VqLVz^mtrqt$)ev~&v(lW0CY zM9|;psq>v&O}9UZr!RSgR=;~6a>K1|8sE>Xs&B9XpRb)CDTp(e>+}I|KN*ps;!=MW z>Gw42dMeNbLCNLVR#Eyu_|DZ?qV^+`7$aqTe4)bm#x#sqG|$~xH@2X!e=v?2rQcoR z9o?n;%8&X}-rWFSLboEOoQR31kzGxjs`~W2Y94htQ(N1zbT1!Py=Cvz6;{3SL_!SL zjG2ogi-&q&uRA@0$(=hnj+f>R`q|Vb?&E^n7(~9wEBEyf!Z_7(`TggXlu)?2Y0vU zY2Cvvm0BaS?R1ftF*U42>Wmuya*>x zY^qi%N~3S@`4+XyGkl-cr{z~7yY0G%M8^xTH@Ytf^?Yx=!_Ufhn1p+T8>mNRz(g(c zwQ^Zr(UDQww&T>Fe!;vvWQw}9J`!gir=8Gxo#-1AlNG426b*q>Tqe!m5Q#p(ML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2022 22:35:05 +0200 Subject: [PATCH 2/5] java docs in Factory.java --- .../projekt2/turnierverwaltung/Factory.java | 59 ++++++++++++++++--- .../turnierverwaltung/FactoryDecorator.java | 8 +-- 2 files changed, 55 insertions(+), 12 deletions(-) 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 04fcef3..991d7d3 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Factory.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Factory.java @@ -13,7 +13,7 @@ import java.io.IOException; import java.util.logging.Logger; /** - * + * Class to load the views from FXML Files and switch between the views. */ public class Factory { private TournamentDecorator tournamentDecorator; @@ -21,16 +21,29 @@ public class Factory { private static final Logger logger = Logger.getLogger(Factory.class.getCanonicalName()); + /** + * Contructor to create Factory instance. + * @param fileIO the fileIO instance which saves and reads the tournament from files. + * @param tournamentDecorator the touramanetDecorator class to access the tournament. + */ public Factory(FileIO fileIO, TournamentDecorator tournamentDecorator) { this.fileIO = fileIO; this.tournamentDecorator = tournamentDecorator; } + /** + * Setter Method of tournament + * @param tournament the new tournament Object. + */ public void setTournament(Tournament tournament) { this.tournamentDecorator.setTournament(tournament); } + /** + * Method to load the main Window (without the content in the center) + * @return the boarder Pane which is loaded. + */ public BorderPane loadMainWindow() { FXMLLoader loader = new FXMLLoader(getClass().getResource("mainWindow.fxml")); try { @@ -42,6 +55,11 @@ public class Factory { return null; } + /** + * Class which loads all views of Enum View + * @param factoryDecorator the FactoryDecorator which is used to setup the controller. + * @param pane the pane where the loaded view will be visible + */ public void loadAllViews(FactoryDecorator factoryDecorator, BorderPane pane){ for(View view : View.values()){ try { @@ -53,32 +71,57 @@ public class Factory { } } - public void showTournamentList(BorderPane pane, FactoryDecorator factoryDecorator) { + /** + * Method to show the view TournamentList + * @param pane the Pane where the View will be visible + */ + public void showTournamentList(BorderPane pane) { tournamentDecorator.setTournament(null); setCenterOfBorderPane(pane, View.tournamentList); } - //Can be used to Open new Scene in same Stage. - //This way possible to later give object to Controller - public void showParticipantFormular(BorderPane pane, FactoryDecorator factoryDecorator) { + /** + * Method to show the view ParticipantFormular + * @param pane the Pane where the View will be visible + */ + public void showParticipantFormular(BorderPane pane) { setCenterOfBorderPane(pane, View.participantFormular); } - public void showPlacesFormular(BorderPane pane, FactoryDecorator factoryDecorator) { + /** + * Method to show the view PlacesFormular + * @param pane the Pane where the View will be visible + */ + public void showPlacesFormular(BorderPane pane) { setCenterOfBorderPane(pane, View.placesFormular); } - public void showGameScheduler(BorderPane pane, FactoryDecorator factoryDecorator) { + /** + * Method to show the view GameScheduler + * @param pane the Pane where the View will be visible + */ + public void showGameScheduler(BorderPane pane) { setCenterOfBorderPane(pane, View.gameScheduler); } + /** + * Method to change the view in the center of the boarder pane in the mainWindow + * @param pane the Pane where the View will be visible + * @param view the view which should be visible + */ private void setCenterOfBorderPane(BorderPane pane, View view) { FXController controller = null; pane.setCenter(view.getPane()); resetFooter(pane, true); } - + /** + * Method to load a Game View + * @param box the box where the game view should be added. + * @param gameDecorator the gameDecorator instance of the game. + * @param factoryDecorator + * @return + */ public GameController loadGameView(VBox box, GameDecorator gameDecorator, FactoryDecorator factoryDecorator) { try { FXMLLoader loader = new FXMLLoader(getClass().getResource("gameScheduleView/Game.fxml")); 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 bcb7b5f..ae8173e 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/FactoryDecorator.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/FactoryDecorator.java @@ -116,7 +116,7 @@ public class FactoryDecorator implements IsObservable { */ public void openTournamentList() { logger.fine("Showing TournamentList view"); - factory.showTournamentList((BorderPane) pane, this); + factory.showTournamentList((BorderPane) pane); informListener(); } @@ -125,7 +125,7 @@ public class FactoryDecorator implements IsObservable { */ public void openParticipantForm() { logger.fine("Showing participant form view"); - factory.showParticipantFormular((BorderPane) pane, this); + factory.showParticipantFormular((BorderPane) pane); informListener(); } @@ -134,12 +134,12 @@ public class FactoryDecorator implements IsObservable { */ public void openPlacesForm() { logger.fine("Showing places form view"); - factory.showPlacesFormular((BorderPane) pane, this); + factory.showPlacesFormular((BorderPane) pane); informListener(); } public void openScheduleView() { - factory.showGameScheduler((BorderPane) pane, this); + factory.showGameScheduler((BorderPane) pane); informListener(); } From 92360ad6070d615f7e458c6fab6354e70f8934ee Mon Sep 17 00:00:00 2001 From: schrom01 Date: Fri, 13 May 2022 22:41:42 +0200 Subject: [PATCH 3/5] finished javadocs in Factory.java --- .../projekt2/turnierverwaltung/Factory.java | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) 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 991d7d3..bb1d264 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Factory.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Factory.java @@ -119,8 +119,8 @@ public class Factory { * Method to load a Game View * @param box the box where the game view should be added. * @param gameDecorator the gameDecorator instance of the game. - * @param factoryDecorator - * @return + * @param factoryDecorator the factoryDecorator instance. + * @return the controller of the GameView */ public GameController loadGameView(VBox box, GameDecorator gameDecorator, FactoryDecorator factoryDecorator) { try { @@ -136,6 +136,12 @@ public class Factory { return null; } + /** + * Method to print information for the user to the footer of mainwindow. + * @param pane the pane where the footer should be shown. + * @param msg the text to show. + * @param error true if it's a error message. + */ public void printMessageToFooter(BorderPane pane, String msg, boolean error) { VBox bottom = (VBox) pane.getBottom(); Label label = new Label(); @@ -164,9 +170,9 @@ public class Factory { } /** - * - * @param pane - * @param error + * Method to remove the messages in the footer. + * @param pane the pane were the footer should be reseted + * @param error true if the error message should be cleared. */ public void resetFooter(BorderPane pane,boolean error) { VBox bottom = (VBox) pane.getBottom(); @@ -181,7 +187,7 @@ public class Factory { } /** - * Enum for keeping the different fxml form views + * Enum of all views which can be set to the center of the mainwindow. */ public enum View { tournamentList("tournamentList/tournamentList.fxml"), @@ -192,6 +198,10 @@ public class Factory { private String fxmlFileName; private Pane pane; + /** + * Constructor of View + * @param fxmlFileName The name of the FXML File to load. + */ private View(String fxmlFileName) { this.fxmlFileName = fxmlFileName; } @@ -200,6 +210,14 @@ public class Factory { return pane; } + /** + * Method to laod the view + * @param tournamentDecorator the tournamentDecorator object which will be passed to the controller. + * @param fileIO the fileIO object which will be passed to the controller. + * @param factoryDecorator the factoryDecorator object which will be passed to the controller. + * @param borderPane the borderPane object which will be passed to the controller. + * @throws IOException if the fxml file is not found or can not be loaded correctly. + */ public void loadView(TournamentDecorator tournamentDecorator, FileIO fileIO, FactoryDecorator factoryDecorator, BorderPane borderPane) throws IOException { FXMLLoader loader = new FXMLLoader(getClass().getResource(fxmlFileName)); this.pane = loader.load(); From 52b79ed50188db3ab7cccd43b5c0c5642c56e486 Mon Sep 17 00:00:00 2001 From: Leonardo Brandenberger Date: Fri, 13 May 2022 22:42:51 +0200 Subject: [PATCH 4/5] PlacesFormularController JavaDoc and Logger --- .../PlacesFormularController.java | 48 +++++++++++++++---- 1 file changed, 38 insertions(+), 10 deletions(-) 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 b2a031a..d17a36b 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 @@ -2,18 +2,20 @@ package ch.zhaw.projekt2.turnierverwaltung.main.placesAddFormular; import ch.zhaw.projekt2.turnierverwaltung.FXController; import ch.zhaw.projekt2.turnierverwaltung.Place; -import ch.zhaw.projekt2.turnierverwaltung.Player; import ch.zhaw.projekt2.turnierverwaltung.Tournament; -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; import javafx.scene.layout.VBox; +import java.util.logging.Logger; + +/** + * Controller of the places form, in charge of its functionality. + */ public class PlacesFormularController extends FXController { @FXML @@ -50,37 +52,63 @@ public class PlacesFormularController extends FXController { @FXML private Button saveBtn; + private static final Logger logger = Logger.getLogger(PlacesFormularController.class.getCanonicalName()); + + /** + * Selects an item (place) from the List view + */ @FXML - void changedSelection(MouseEvent event){ + void changedSelection() { Place place = placeListView.getSelectionModel().getSelectedItems().get(0); + logger.finer("Selected new Place from list: " + place); placeNameTextField.setText(place.getName()); } + /** + * Saves the name of a new place into the list and clears the form + */ @FXML - void savePlace(ActionEvent event) { + void savePlace() { getTournamentDecorator().savePlace(placeNameTextField.getText()); - clearFormular(); + logger.fine("Saved " + placeNameTextField + " to the list of places"); + clearForm(); } - private void clearFormular() { + /** + * Method clears the input field + */ + private void clearForm() { + logger.finer("Clearing input text field"); placeNameTextField.clear(); } + /** + * Method deletes the currently selected place from the list. + */ @FXML - void delete(ActionEvent event) { + void delete() { Place place = placeListView.getSelectionModel().getSelectedItems().get(0); + logger.fine("Deleting " + place + "from place list"); getTournamentDecorator().deletePlace(place); } + /** + * Closes the current Place view, going back to previous view + */ @FXML - void close(ActionEvent event) { + void close() { + logger.fine("Closing place form"); getFactoryDecorator().openScheduleView(); } + /** + * Loads the already saved places and displays them on the places list. + */ @Override public void loadContent() { + logger.fine("Getting the Saved tournaments into the Places list"); Tournament tournament = getTournamentDecorator().getTournament(); - if(tournament != null){ + if (tournament != null) { placeListView.setItems(tournament.getPlaces()); } else { placeListView.getItems().clear(); From 71140976015893dd758aa8986a1a206a49ee59cc Mon Sep 17 00:00:00 2001 From: schrom01 Date: Fri, 13 May 2022 22:53:49 +0200 Subject: [PATCH 5/5] fixed merge problem. --- .../projekt2/turnierverwaltung/main/MainWindowController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/MainWindowController.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/MainWindowController.java index 06d9da9..1931fa9 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/MainWindowController.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/MainWindowController.java @@ -34,12 +34,12 @@ public class MainWindowController extends FXController { * Method changes the language Setting to german */ @FXML - void changeLangToGerman(ActionEvent event) { + void changeLangToGerman() { getLanguageConfigurator().changeLanguage(LanguageConfigurator.Language.GERMAN); } @FXML - void changeLangToEnglish(ActionEvent event) { + void changeLangToEnglish() { getLanguageConfigurator().changeLanguage(LanguageConfigurator.Language.ENGLISH); }