use of retrospector.fxml.CoreController in project Retrospector by NonlinearFruit.
the class Retrospector method start.
@Override
public void start(final Stage initStage) throws Exception {
final Task<Parent> task = new Task<Parent>() {
@Override
protected Parent call() throws InterruptedException, IOException {
updateProgress(0, 8);
updateMessage("Loading Database . . .");
DataManager.startDB();
updateProgress(1, 8);
updateMessage("Loading Core . . .");
FXMLLoader ldr = new FXMLLoader(getClass().getResource("/retrospector/fxml/Core.fxml"));
Parent root = ldr.load();
CoreController core = ldr.getController();
updateProgress(2, 8);
updateMessage("Loading Search . . .");
FXMLLoader searchldr = new FXMLLoader(getClass().getResource("/retrospector/fxml/search/SearchTab.fxml"));
searchldr.load();
core.setSearchController(searchldr);
updateProgress(3, 8);
updateMessage("Loading Media . . .");
FXMLLoader medialdr = new FXMLLoader(getClass().getResource("/retrospector/fxml/media/MediaTab.fxml"));
medialdr.load();
core.setMediaController(medialdr);
updateProgress(4, 8);
updateMessage("Loading Review . . .");
FXMLLoader reviewldr = new FXMLLoader(getClass().getResource("/retrospector/fxml/ReviewTab.fxml"));
reviewldr.load();
core.setReviewController(reviewldr);
updateProgress(5, 8);
updateMessage("Loading Chart . . .");
FXMLLoader statldr = new FXMLLoader(getClass().getResource("/retrospector/fxml/chart/StatsTab.fxml"));
statldr.load();
core.setStatsController(statldr);
updateProgress(6, 8);
updateMessage("Loading List . . .");
FXMLLoader listldr = new FXMLLoader(getClass().getResource("/retrospector/fxml/ListsTab.fxml"));
listldr.load();
core.setListController(listldr);
updateProgress(7, 8);
updateMessage("Loading Achievements . . .");
FXMLLoader achieveldr = new FXMLLoader(getClass().getResource("/retrospector/fxml/achievements/AchievementTab.fxml"));
achieveldr.load();
core.setAchieveController(achieveldr);
updateProgress(8, 8);
updateMessage("Done!");
return root;
}
};
showSplash(initStage, task, () -> showMainStage(task.valueProperty().get()));
new Thread(task).start();
}
Aggregations