- chooser.setDialogTitle(MessageManager
- .getString("label.select_newick_like_tree_file"));
- chooser.setToolTipText(MessageManager.getString("label.load_tree_file"));
-
- int value = chooser.showOpenDialog(null);
-
- if (value == JalviewFileChooser.APPROVE_OPTION)
- {
- String choice = chooser.getSelectedFile().getPath();
- jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice);
- jalview.io.NewickFile fin = null;
- try
- {
- fin = new NewickFile(choice, DataSourceType.FILE);
- viewport.setCurrentTree(ShowNewickTree(fin, choice).getTree());
- } catch (Exception ex)
- {
- JvOptionPane
- .showMessageDialog(
- Desktop.desktop,
- ex.getMessage(),
- MessageManager
- .getString("label.problem_reading_tree_file"),
- JvOptionPane.WARNING_MESSAGE);
- ex.printStackTrace();
- }
- if (fin != null && fin.hasWarningMessage())
- {
- JvOptionPane.showMessageDialog(Desktop.desktop, fin
- .getWarningMessage(), MessageManager
- .getString("label.possible_problem_with_tree_file"),
- JvOptionPane.WARNING_MESSAGE);
- }
- }
- }
+ chooser.setDialogTitle(
+ MessageManager.getString("label.select_newick_like_tree_file"));
+ chooser.setToolTipText(
+ MessageManager.getString("label.load_tree_file"));