From e169118c3a06b9ece422b5686c7135f28fc0cdbb Mon Sep 17 00:00:00 2001 From: law39 Date: Fri, 1 May 2020 12:30:34 +0100 Subject: [PATCH] Removed depreciated no longer used code from Screen Switch class Removed depreciated code from Screen Switch class related to the code method of switching scene from the Application Class --- .../cs221/group20/javafx/ScreenSwitch.java | 31 +------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs221/group20/javafx/ScreenSwitch.java b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs221/group20/javafx/ScreenSwitch.java index 2ef37b1..20b6cd5 100644 --- a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs221/group20/javafx/ScreenSwitch.java +++ b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs221/group20/javafx/ScreenSwitch.java @@ -37,36 +37,7 @@ public class ScreenSwitch extends SharedCodeController { stage.show(); ScreenSwitch.stage = stage; } - - /** - * This method should only be used by Application. - * This provides legacy support for the old way of screen switching by continuing to allow Application to access scene. - * It should be removed before release. - * - * @Deprecated This is depreciated pending removal of all legacy screen switches - * @see Application - * @return This returns the currently displayed scene for purposes of screen switching - */ - public static void setLegacyScene(String fxmlFile){ - System.err.println("Switching Scene with legacy method, you should change to ScreenSwitch"); - String fileInclExtension = fxmlFile + ".fxml"; - Parent root = null; - - try{ - root = FXMLLoader.load(new URL("file:src/main/resources/uk/ac/aber/cs22120/group20/" + fileInclExtension)); - - }catch (IOException e){ // If an error occurs, print out error message on STDIO and crash gracefully - System.err.print("Loading the FXML file "); - System.err.print(fileInclExtension); - System.err.println(" failed!"); - System.err.println("Using depreciated method, shame!"); - e.printStackTrace(System.err); - System.exit(-1); - } - scene.setRoot(root); - - } - + /** * Method that is responsible for the switching between * JavaFX, with it taking the new scene’s name as an enum as a parameter.