From 6ecdb309a1777eab85e9b35588f0d09a79122071 Mon Sep 17 00:00:00 2001 From: Joshua Perry <45966243+jpez-development@users.noreply.github.com> Date: Sun, 5 Feb 2023 21:53:18 +0000 Subject: [PATCH] javadoc --- src/main/java/com/r0r5chach/Manager.java | 55 +++++++++++++++++++----- 1 file changed, 44 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/r0r5chach/Manager.java b/src/main/java/com/r0r5chach/Manager.java index 384fa19..f2e2fa6 100644 --- a/src/main/java/com/r0r5chach/Manager.java +++ b/src/main/java/com/r0r5chach/Manager.java @@ -15,15 +15,32 @@ import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.stage.Stage; import javafx.scene.Scene; - +/** + * Class that contains the main method and starts the GUI + * @author r0r5chach + */ public class Manager extends Application { - + /** + * Attribute that stores the GUI's scene + */ private static Scene scene; + /** + * Attribute that stores the GUI's stage + */ public static Stage stage; + /** + * Attribute that stores the program's competitors + */ private static CompetitorList competitors; - + /** + * Attribute that stores the currently active controller + */ private static Controller controller; - + /** + * Creates the GUI and competitor list, then sets the main View + * @param stage the stage to use for the GUI + * @throws IOException if the scene's FXML file cannot be found + */ @Override public void start(Stage stage) throws IOException { competitors = createList(); @@ -33,7 +50,9 @@ public class Manager extends Application { Manager.stage.setScene(scene); Manager.stage.show(); } - + /** + * Stops the GUI and outputs a report file + */ @Override public void stop() { try { @@ -43,11 +62,20 @@ public class Manager extends Application { createErrorLog(e, "src/main/resources/com/r0r5chach/log.txt"); } } - + /** + * Change the root for the scene + * @param fxml the view to be loaded + * @throws IOException if the view file cannot be found + */ public static void setRoot(String fxml) throws IOException { scene.setRoot(loadFXML(fxml)); } - + /** + * Load an FXML file + * @param fxml the file to be loaded + * @return the root to change the scene to + * @throws IOException if the file cannot be found + */ public static Parent loadFXML(String fxml) throws IOException { FXMLLoader fxmlLoader = new FXMLLoader(Manager.class.getResource(fxml + ".fxml")); Parent root = fxmlLoader.load(); @@ -74,15 +102,20 @@ public class Manager extends Application { break; } - - + return root; } - + /** + * Launch the GUI + * @param args the arguments passed to the program + */ public static void main(String[] args) { launch(); } - + /** + * Create the competitor list + * @return the competitor list + */ private CompetitorList createList() { CompetitorList competitors = null; File valorantPlayers = new File("src/main/resources/com/r0r5chach/valorantPlayers.txt");