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
This commit is contained in:
law39 2020-05-01 12:30:34 +01:00
parent 76fce85de7
commit e169118c3a

View file

@ -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 scenes name as an enum as a parameter.