Added Redirection to SUmmary pages after Import.

main
YaFedImYaEatIm 9 years ago
parent 8a4134ae4c
commit a857cfb7af

Binary file not shown.

@ -27,6 +27,7 @@ public class App extends Application
private Stage primaryStage = null;
private VBox mainContainer;
private Session session;
private MenuController menuController;
public static void main( String[] args )
{
@ -53,7 +54,7 @@ public class App extends Application
primaryStage.setResizable(false);
primaryStage.setScene(scene);
primaryStage.sizeToScene();
MenuController menuController = (MenuController) loader.getController();
menuController = (MenuController) loader.getController();
menuController.setApp(this);
in.close();
} catch (Exception e) {
@ -180,6 +181,10 @@ public class App extends Application
return (Initializable) loader.getController();
}
public MenuController getMenuController() {
return menuController;
}
public Dataset getCurrentDataset(){
return currentDataset;
}

@ -30,26 +30,38 @@ public class Importer{
if (scene == SceneCode.AIRLINE_RAW_DATA) {
try {
showSuccessAlert(parent.getCurrentDataset().importAirline(file.getPath()));
parent.getMenuController().replaceSceneContent(SceneCode.AIRLINE_SUMMARY);
} catch (DataException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
} else if (scene == SceneCode.AIRPORT_RAW_DATA) {
try {
showSuccessAlert(parent.getCurrentDataset().importAirport(file.getPath()));
parent.getMenuController().replaceSceneContent(SceneCode.AIRPORT_SUMMARY);
} catch (DataException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
} else if (scene == SceneCode.ROUTE_RAW_DATA) {
try {
showSuccessAlert(parent.getCurrentDataset().importRoute(file.getPath()));
parent.getMenuController().replaceSceneContent(SceneCode.ROUTE_SUMMARY);
} catch (DataException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
} else if (scene == SceneCode.FLIGHT_RAW_DATA) {
try {
showSuccessAlert(parent.getCurrentDataset().importFlight(file.getPath()));
parent.getMenuController().replaceSceneContent(SceneCode.FLIGHT_SUMMARY);
} catch (DataException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
}

Loading…
Cancel
Save