Skip to content

Commit

Permalink
Remove the alert for folder conversion as it will be implemented in t…
Browse files Browse the repository at this point in the history
…he alert system (Issue #8)
  • Loading branch information
Irina Balaur committed Mar 13, 2019
1 parent d5a8907 commit f8ef68c
Showing 1 changed file with 4 additions and 41 deletions.
45 changes: 4 additions & 41 deletions src/main/java/fr/eisbm/GRAPHML2SBGNML/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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);
Expand All @@ -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;
}
};
Expand All @@ -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);
Expand All @@ -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;
}
};
Expand Down

0 comments on commit f8ef68c

Please sign in to comment.