From f8ef68ce0535549b08dbcbd1d962f856d11cde6b Mon Sep 17 00:00:00 2001 From: Irina Balaur Date: Wed, 13 Mar 2019 18:25:52 +0100 Subject: [PATCH] Remove the alert for folder conversion as it will be implemented in the alert system (Issue #8) --- .../java/fr/eisbm/GRAPHML2SBGNML/App.java | 45 ++----------------- 1 file changed, 4 insertions(+), 41 deletions(-) diff --git a/src/main/java/fr/eisbm/GRAPHML2SBGNML/App.java b/src/main/java/fr/eisbm/GRAPHML2SBGNML/App.java index 6e88bf6..d30867d 100644 --- a/src/main/java/fr/eisbm/GRAPHML2SBGNML/App.java +++ b/src/main/java/fr/eisbm/GRAPHML2SBGNML/App.java @@ -154,15 +154,7 @@ public void start(Stage primaryStage) { } else { directionChoice.setValue(ConvertionChoice.SBGN2GRAPHML.toString()); } - } /*else { - if(results.size() > 0) { - if (results.get(0).contains(".graphml")) { - directionChoice.setValue(ConvertionChoice.GRAPHML2SBGN.toString()); - } else { - directionChoice.setValue(ConvertionChoice.SBGN2GRAPHML.toString()); - } - } - }*/ + } if (directionChoice.getValue().equals(ConvertionChoice.GRAPHML2SBGN.toString())) { System.out.println("Convert button clicked, launch script"); @@ -173,22 +165,18 @@ public Void call() { infoLabel.setText("Running..."); }); - boolean bConvertedFile = false; if (bSingleFileOption) { GraphML2SBGNML.convert(inputFileText.getText()); - bConvertedFile = true; } else { for (String fileName : results) { if (fileName.contains(".graphml")) { GraphML2SBGNML.convert(fileName); - bConvertedFile = true; } } } - if(bConvertedFile) - { + Platform.runLater(() -> { infoLabel.setText("Done"); Alert alert = new Alert(Alert.AlertType.INFORMATION); @@ -197,17 +185,7 @@ public Void call() { alert.setContentText(szFolderName); alert.show(); }); - }else - { - Platform.runLater(() -> { - infoLabel.setText("Invalid conversion"); - Alert alert = new Alert(Alert.AlertType.ERROR); - alert.setTitle("Conversion FAILED"); - alert.setHeaderText("The conversion FAILED."); - alert.setContentText("You chose the "+directionChoice.getValue() +"direction. No input GraphML file was found. Please check the converison direction and/or the type of the file(s) and try again."); - alert.show(); - }); - } + return null; } }; @@ -222,21 +200,16 @@ public Void call() { infoLabel.setText("Running..."); }); - boolean bConvertedFile = false; if (bSingleFileOption) { SBGNML2GraphML.convert(inputFileText.getText()); - bConvertedFile = true; } else { for (String fileName : results) { if ((fileName.contains(".sbgn") || fileName.contains(".xml"))) { SBGNML2GraphML.convert(fileName); - bConvertedFile = true; } } } - if(bConvertedFile) - { Platform.runLater(() -> { infoLabel.setText("Done"); Alert alert = new Alert(Alert.AlertType.INFORMATION); @@ -245,17 +218,7 @@ public Void call() { alert.setContentText(szFolderName); alert.show(); }); - }else - { - Platform.runLater(() -> { - infoLabel.setText("Invalid conversion"); - Alert alert = new Alert(Alert.AlertType.ERROR); - alert.setTitle("Conversion FAILED"); - alert.setHeaderText("The conversion FAILED."); - alert.setContentText("You chose the "+directionChoice.getValue() +"direction. No input SBGN file was found. Please check the converison direction and/or the type of the file(s) and try again."); - alert.show(); - }); - } + return null; } };