Skip to content

Commit

Permalink
towards fixing #5
Browse files Browse the repository at this point in the history
  • Loading branch information
rbouckaert committed Sep 4, 2022
1 parent 8c05624 commit 6aad9c7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<property name="openjreMac" value="../../Downloads/zulu17.34.19-ca-fx-jre17.0.3-macosx_x64"/>
<property name="openjreWin" value="../../Downloads/zulu17.34.19-ca-fx-jre17.0.3-win_x64/"/>
<property name="openjreWin" value="../../Downloads/zulu17.34.19-ca-fx-jre17.0.3-linux_x64/"/>
<property name="openjreLnx" value="../../Downloads/zulu17.34.19-ca-fx-jre17.0.3-linux_x64/"/>

<path id="classpath">
<fileset dir="${libFX}" includes="jam.jar"/>
Expand Down
14 changes: 6 additions & 8 deletions src/beastfx/app/inputeditor/FastaImporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,12 @@ public List<BEASTInterface> loadFile(File file) {
i++;
}
}
ComboBox<String> jcb = new ComboBox<>();
for (String s : new String[]{"aminoacid", "nucleotide", "all are aminoacid", "all are nucleotide"}) {
jcb.getItems().add(s);
}
jcb.setEditable(true);
jcb.setValue(datatype);
Alert.showMessageDialog(null, jcb, "Choose the datatype of alignment " + alignment.getID(), Alert.QUESTION_MESSAGE);
String selectedType = (String) jcb.getValue();
String [] providers = new String[]{"aminoacid", "nucleotide", "all are aminoacid", "all are nucleotide"};
String selectedType = (String) Alert.showInputDialog(null, "Choose the datatype of alignment " + alignment.getID(),
"Add partition",
Alert.QUESTION_MESSAGE, null, providers,
providers[0]);

switch (selectedType) {
case "aminoacid": datatype = "aminoacid"; totalCount = 20; break;
case "nucleotide": datatype = "nucleotide"; totalCount = 4; break;
Expand Down
10 changes: 9 additions & 1 deletion src/beastfx/app/util/Alert.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import javax.swing.ImageIcon;

import beast.base.core.BEASTInterface;
import beastfx.app.beauti.ThemeProvider;
import javafx.embed.swing.SwingFXUtils;
import javafx.geometry.Insets;
import javafx.scene.Node;
Expand Down Expand Up @@ -85,6 +86,7 @@ public static void showMessageDialog(Parent parent, String message) {
alert.setX(node.getX() + node.getWidth()/2);
alert.setY(node.getY() + node.getHeight()/2);
}
// ThemeProvider.loadStyleSheet(alert.getDialogPane().getScene());
alert.showAndWait();
}

Expand All @@ -98,6 +100,7 @@ public static ButtonType showConfirmDialog(Parent parent, String message, String
alert.setX(node.getX() + node.getWidth()/2);
alert.setY(node.getY() + node.getHeight()/2);
}
// ThemeProvider.loadStyleSheet(alert.getDialogPane().getScene());
Optional<ButtonType> option = alert.showAndWait();
return option.get();
}
Expand All @@ -117,6 +120,7 @@ public static void showMessageDialog(Parent parent, String message, String heade
alert.setX(node.getX() + node.getWidth()/2);
alert.setY(node.getY() + node.getHeight()/2);
}
// ThemeProvider.loadStyleSheet(alert.getDialogPane().getScene());
alert.showAndWait();
}

Expand Down Expand Up @@ -169,6 +173,7 @@ public static void showMessageDialog(Parent parent, Node message, String header,
pane.setPrefHeight(600);
pane.setPrefWidth(600);
alert.setResizable(true);
// ThemeProvider.loadStyleSheet(alert.getDialogPane().getScene());
alert.showAndWait();
}

Expand All @@ -181,7 +186,9 @@ public static Object showInputDialog(Parent parent,
}
ChoiceDialog<?> dlg = new ChoiceDialog<>(valueOf(initialSelectionValue),
values);
dlg.setHeaderText(title);
dlg.setTitle(title);
dlg.setHeaderText(message.toString());
// ThemeProvider.loadStyleSheet(dlg.getDialogPane().getScene());
Optional<?> option = dlg.showAndWait();
if (parent != null) {
Scene node = parent.getScene();
Expand All @@ -207,6 +214,7 @@ public static Object showInputDialog(Parent parent,
Object message, String title, AlertType messageType, String initialSelectionValue) {
TextInputDialog dlg = new TextInputDialog(initialSelectionValue);
dlg.setHeaderText(title);
// ThemeProvider.loadStyleSheet(dlg.getDialogPane().getScene());
Optional<?> option = dlg.showAndWait();
if (parent != null) {
Scene node = parent.getScene();
Expand Down

0 comments on commit 6aad9c7

Please sign in to comment.