2016-08-27 06:34:03 -04:00
|
|
|
package main.welcome_splash;
|
|
|
|
|
|
|
|
import javafx.concurrent.Task;
|
|
|
|
import javafx.fxml.FXMLLoader;
|
|
|
|
import javafx.scene.Parent;
|
|
|
|
import javafx.scene.Scene;
|
|
|
|
import javafx.stage.Stage;
|
2016-08-27 07:07:13 -04:00
|
|
|
import main.TwoWayNode;
|
2016-08-27 06:34:03 -04:00
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Created by Vladimir Eliezer Tokarev on 8/27/2016.
|
2016-08-27 07:07:13 -04:00
|
|
|
* WelcomeSplashLoader creates welcome spalash object and sets its controller
|
2016-08-27 06:34:03 -04:00
|
|
|
*/
|
|
|
|
public class WelcomeSplashLoader {
|
|
|
|
private static final String SPLASH_SCREEN_ON_BOOT_FXML_PATH = "welcome_splash_screen.fxml";
|
|
|
|
|
|
|
|
private Stage currentStage;
|
2016-08-27 07:07:13 -04:00
|
|
|
private FXMLLoader fxmlLoader;
|
2016-08-27 06:34:03 -04:00
|
|
|
|
|
|
|
public WelcomeSplashLoader(Stage primaryStage) throws IOException
|
|
|
|
{
|
2016-08-27 07:07:13 -04:00
|
|
|
// Parent splashScreenOnBootRoot = FXMLLoader.load(getClass().getResource(SPLASH_SCREEN_ON_BOOT_FXML_PATH));
|
|
|
|
fxmlLoader = new FXMLLoader(getClass().getResource(SPLASH_SCREEN_ON_BOOT_FXML_PATH));
|
2016-08-27 06:34:03 -04:00
|
|
|
currentStage = primaryStage;
|
2016-08-27 07:07:13 -04:00
|
|
|
// currentStage.setScene(new Scene(splashScreenOnBootRoot));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates welcome splash parent node and sets it to the controller
|
|
|
|
* @return TwoWayNode
|
|
|
|
* @throws IOException
|
|
|
|
*/
|
|
|
|
public TwoWayNode GetWelcomeSplash() throws IOException {
|
|
|
|
Parent welcomeSplash = fxmlLoader.load();
|
|
|
|
WelcomeSplashController controller = fxmlLoader.getController();
|
|
|
|
|
|
|
|
// set the controller to be functional TwoWayNode
|
|
|
|
controller.SetParent(welcomeSplash);
|
|
|
|
controller.SetStage(currentStage);
|
|
|
|
|
|
|
|
return controller;
|
2016-08-27 06:34:03 -04:00
|
|
|
}
|
|
|
|
}
|