Updated ScreenSwitch corrected JavaDoc. Issue #48
Addressed issue #48 SE.QA.09 5.1 - added notice SE.QA.09 5.2 - added all users to javadoc. SE.QA.09 5.4 - corrected comments.
This commit is contained in:
parent
3574bfca8e
commit
96d073f0cf
1 changed files with 25 additions and 5 deletions
|
@ -1,5 +1,10 @@
|
||||||
package uk.ac.aber.cs221.group20.javafx;
|
package uk.ac.aber.cs221.group20.javafx;
|
||||||
|
/**
|
||||||
|
* @(#) ScreenSwitch.java 0.1 2020/04/07
|
||||||
|
* <p>
|
||||||
|
* Copyright (c) 2020 Aberystwyth University.
|
||||||
|
* All rights reserved.
|
||||||
|
*/
|
||||||
import javafx.fxml.FXMLLoader;
|
import javafx.fxml.FXMLLoader;
|
||||||
import javafx.scene.Parent;
|
import javafx.scene.Parent;
|
||||||
import javafx.scene.Scene;
|
import javafx.scene.Scene;
|
||||||
|
@ -12,7 +17,14 @@ import java.net.URL;
|
||||||
* Class that contains a sub-enumeration containing all scenes and FXML references
|
* Class that contains a sub-enumeration containing all scenes and FXML references
|
||||||
* Also controls the stage, for the purpose of switching to new scenes
|
* Also controls the stage, for the purpose of switching to new scenes
|
||||||
*
|
*
|
||||||
* @author Luke Wybar (LAW39)
|
* @author Brad Corbett [brc9]
|
||||||
|
* @author Henry Dugmore [hjd3]
|
||||||
|
* @author Kain Bryan-Jones [kab74]
|
||||||
|
* @author Luke Wybar [law39]
|
||||||
|
* @author Marcin Jakob [maj83]
|
||||||
|
* @author Oscar Pocock [osp1]
|
||||||
|
* @author Tom Perry [top19]
|
||||||
|
* @author Waylen Watts [ncw]
|
||||||
* @version 0.1
|
* @version 0.1
|
||||||
* @see SceneType
|
* @see SceneType
|
||||||
*/
|
*/
|
||||||
|
@ -58,11 +70,12 @@ public class ScreenSwitch extends SharedCodeController {
|
||||||
*/
|
*/
|
||||||
private static Parent fxmlLoader(SceneType newScene){
|
private static Parent fxmlLoader(SceneType newScene){
|
||||||
Parent root = null;
|
Parent root = null;
|
||||||
|
|
||||||
|
// If an error occurs while loading, print out error message and stack trace on STDIO, then crash gracefully
|
||||||
try{
|
try{
|
||||||
String fxmlName = newScene.getFXML();
|
String fxmlName = newScene.getFXML();
|
||||||
root = FXMLLoader.load(new URL("file:src/main/resources/uk/ac/aber/cs221/group20/" + fxmlName));
|
root = FXMLLoader.load(new URL("file:src/main/resources/uk/ac/aber/cs221/group20/" + fxmlName));
|
||||||
|
}catch (IOException e){
|
||||||
}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("Loading the FXML file ");
|
||||||
System.err.print(newScene.getFXML());
|
System.err.print(newScene.getFXML());
|
||||||
System.err.println(" Failed!");
|
System.err.println(" Failed!");
|
||||||
|
@ -82,7 +95,14 @@ public class ScreenSwitch extends SharedCodeController {
|
||||||
* Following the spirit of those already setup.
|
* Following the spirit of those already setup.
|
||||||
* This file must be located in the resources folder in the package uk.ac.aber.cs22120.group20.
|
* This file must be located in the resources folder in the package uk.ac.aber.cs22120.group20.
|
||||||
*
|
*
|
||||||
* @author Luke Wybar (LAW39)
|
* @author Brad Corbett [brc9]
|
||||||
|
* @author Henry Dugmore [hjd3]
|
||||||
|
* @author Kain Bryan-Jones [kab74]
|
||||||
|
* @author Luke Wybar [law39]
|
||||||
|
* @author Marcin Jakob [maj83]
|
||||||
|
* @author Oscar Pocock [osp1]
|
||||||
|
* @author Tom Perry [top19]
|
||||||
|
* @author Waylen Watts [ncw]
|
||||||
* @version 0.1
|
* @version 0.1
|
||||||
* @see ScreenSwitch
|
* @see ScreenSwitch
|
||||||
*/
|
*/
|
||||||
|
|
Reference in a new issue