From 92360ad6070d615f7e458c6fab6354e70f8934ee Mon Sep 17 00:00:00 2001 From: schrom01 Date: Fri, 13 May 2022 22:41:42 +0200 Subject: [PATCH] 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();