From d4362f99f501e0db29b18bf5635e225b1db743b7 Mon Sep 17 00:00:00 2001 From: Sigurd Spook <sigursp@stud.ntnu.no> Date: Tue, 21 May 2024 15:54:59 +0200 Subject: [PATCH] Updated javadoc CommandLineInterface.java --- .../navigation/NavigationController.java | 35 +++++++++---------- .../group6/view/CommandLineInterface.java | 2 +- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/ChaosGame/src/main/java/edu/ntnu/idatt2003/group6/controller/navigation/NavigationController.java b/ChaosGame/src/main/java/edu/ntnu/idatt2003/group6/controller/navigation/NavigationController.java index 282c58e..6ab0693 100644 --- a/ChaosGame/src/main/java/edu/ntnu/idatt2003/group6/controller/navigation/NavigationController.java +++ b/ChaosGame/src/main/java/edu/ntnu/idatt2003/group6/controller/navigation/NavigationController.java @@ -26,12 +26,13 @@ public class NavigationController implements FileControllerObserver { private static NavigationController instance = null; private final HomePage view; private final NavigationModel model; + @SuppressWarnings("unused") private ChaosGameController gameController; private final FileModel fileModel = FileModel.getInstance(); /** * Constructor for NavigationController. A singleton class. - * Creates a new NavigationController with a reference to the HomePage and NavigationModel. + * Create a new NavigationController with a reference to the HomePage and NavigationModel. * * @param view The HomePage to bind the navigation to. * @param model The NavigationModel to bind the navigation to. @@ -129,24 +130,22 @@ public class NavigationController implements FileControllerObserver { */ public void selectGameFiles() { //Gets the buttons for each file made by the FileController - view.getButtonBoxFiles().getFileButtons().forEach(button -> { - button.setOnAction(e -> { - try { - ChaosGameDescription game = fileModel.getFile(button.getText()); - if (game.getGameType().equals(GameType.JULIA)) { - startGameJulia(new ChaosGame(game, 700, 700)); - } else { - startGameAffine(new ChaosGame(game, 700, 700)); - } - } catch (Exception ex) { - String message = ex.getMessage().split("@")[0]; - String description = ex.getMessage().split("@")[1]; - AlertError alertError = new AlertError(message, description); - alertError.showAlertError(); - e.consume(); + view.getButtonBoxFiles().getFileButtons().forEach(button -> button.setOnAction(e -> { + try { + ChaosGameDescription game = fileModel.getFile(button.getText()); + if (game.getGameType().equals(GameType.JULIA)) { + startGameJulia(new ChaosGame(game, 700, 700)); + } else { + startGameAffine(new ChaosGame(game, 700, 700)); } - }); - }); + } catch (Exception ex) { + String message = ex.getMessage().split("@")[0]; + String description = ex.getMessage().split("@")[1]; + AlertError alertError = new AlertError(message, description); + alertError.showAlertError(); + e.consume(); + } + })); } /** diff --git a/ChaosGame/src/main/java/edu/ntnu/idatt2003/group6/view/CommandLineInterface.java b/ChaosGame/src/main/java/edu/ntnu/idatt2003/group6/view/CommandLineInterface.java index 9a38049..c35db60 100644 --- a/ChaosGame/src/main/java/edu/ntnu/idatt2003/group6/view/CommandLineInterface.java +++ b/ChaosGame/src/main/java/edu/ntnu/idatt2003/group6/view/CommandLineInterface.java @@ -143,7 +143,7 @@ public class CommandLineInterface { System.out.println("No file chosen. Returning to main menu."); } else { description = readChaosGameDescriptionFromFile(file); - chaosGame = new ChaosGame(description, 100, 30); + chaosGame = new ChaosGame(description, 50, 50); System.out.println("Chaos Game Description loaded successfully!"); } } -- GitLab