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 282c58e4b031f0a84cfe7b03e67a0df69ecd7b43..6ab0693dd781bf27212e71d1096c0c0e7bf27c2d 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 9a38049d7e9dc590a58932660f7a2abea5a3bfe0..c35db60fdd1cacd0f389eeb0e32c86c2693e563a 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!"); } }