Edited Session Message as Importer Error messages
This commit is contained in:
@@ -130,7 +130,7 @@ public class App extends Application
|
|||||||
fileIn.close();
|
fileIn.close();
|
||||||
}catch(IOException e){
|
}catch(IOException e){
|
||||||
session = new Session();
|
session = new Session();
|
||||||
e.printStackTrace();
|
System.out.println("New Session File Created");
|
||||||
}catch(ClassNotFoundException e){
|
}catch(ClassNotFoundException e){
|
||||||
System.out.println("Missing Session Class");
|
System.out.println("Missing Session Class");
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
|
|||||||
@@ -26,32 +26,33 @@ public class Importer{
|
|||||||
"Text & .csv", "*.txt", "*.csv");
|
"Text & .csv", "*.txt", "*.csv");
|
||||||
chooser.getExtensionFilters().add(filter);
|
chooser.getExtensionFilters().add(filter);
|
||||||
File file = chooser.showOpenDialog(primaryStage);
|
File file = chooser.showOpenDialog(primaryStage);
|
||||||
if (scene == SceneCode.AIRLINE_RAW_DATA){
|
if (file != null) {
|
||||||
|
if (scene == SceneCode.AIRLINE_RAW_DATA) {
|
||||||
try {
|
try {
|
||||||
showSuccessAlert(parent.getCurrentDataset().importAirline(file.getPath()));
|
showSuccessAlert(parent.getCurrentDataset().importAirline(file.getPath()));
|
||||||
} catch (DataException e) {
|
} catch (DataException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}else if (scene == SceneCode.AIRPORT_RAW_DATA){
|
} else if (scene == SceneCode.AIRPORT_RAW_DATA) {
|
||||||
try {
|
try {
|
||||||
showSuccessAlert(parent.getCurrentDataset().importAirport(file.getPath()));
|
showSuccessAlert(parent.getCurrentDataset().importAirport(file.getPath()));
|
||||||
} catch (DataException e) {
|
} catch (DataException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}else if (scene == SceneCode.ROUTE_RAW_DATA){
|
} else if (scene == SceneCode.ROUTE_RAW_DATA) {
|
||||||
try {
|
try {
|
||||||
showSuccessAlert(parent.getCurrentDataset().importRoute(file.getPath()));
|
showSuccessAlert(parent.getCurrentDataset().importRoute(file.getPath()));
|
||||||
} catch (DataException e) {
|
} catch (DataException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}else if (scene == SceneCode.FLIGHT_RAW_DATA){
|
} else if (scene == SceneCode.FLIGHT_RAW_DATA) {
|
||||||
try {
|
try {
|
||||||
showSuccessAlert(parent.getCurrentDataset().importFlight(file.getPath()));
|
showSuccessAlert(parent.getCurrentDataset().importFlight(file.getPath()));
|
||||||
} catch (DataException e) {
|
} catch (DataException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showSuccessAlert(String message){
|
public void showSuccessAlert(String message){
|
||||||
|
|||||||
Reference in New Issue
Block a user