label.mark_unassociated_leaves = Mark Unassociated Leaves
label.fit_to_window = Fit To Window
label.newick_format = Newick Format
-label.select_newick_like_tree_file = Select a newick-like tree file
+label.select_tree_file = Select a tree file
label.colours = Colours
label.view_mapping = View Mapping
label.wireframe = Wireframe
label.problem_reading_tree_file = Problem reading tree file
label.possible_problem_with_tree_file = Possible problem with tree file
label.tree_url_example = Please enter a complete URL, \"for example http://purl.org/phylo/treebase/phylows/study/TB2:S15480?format=nexus\"
+label.from_database = From Database...
label.load_tree_url = Tree from URL
label.select_at_least_three_bases_in_at_least_one_sequence_to_cDNA_translation = Please select at least three bases in at least one sequence in order to perform a cDNA translation.
label.translation_failed = Translation Failed
label.share_data_vamsas_applications = Share data with other vamsas applications
label.connect_to = Connect to
label.join_existing_vamsas_session = Join an existing vamsas session
-label.from_url = from URL
+label.from_url = From URL
label.any_trees_calculated_or_loaded_alignment_automatically_sort = When selected, any trees calculated or loaded onto the alignment will automatically sort the alignment
label.sort_with_new_tree = Sort With New Tree
-label.from_textbox = from Textbox
+label.from_textbox = From Textbox
label.window = Window
label.preferences = Preferences
label.tools = Tools
}
return seqs;
}
-public void chooseTreeFile() {
- // Pick the tree file
- JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
- chooser.setFileView(new JalviewFileView());
- chooser.setDialogTitle(
- MessageManager.getString("label.select_newick_like_tree_file")); // modify
- chooser.setToolTipText(
- MessageManager.getString("label.load_tree_for_sequence_set"));
- for (SupportedTreeFileFilter treeFormat : SupportedTreeFileFilter
- .values())
+
+ /**
+ * DOCUMENT ME!
+ *
+ * @param e
+ * DOCUMENT ME!
+ */
+ @Override
+ protected void loadTreeMenuItem_actionPerformed(ActionEvent e)
+ {
+ chooseTreeFile();
+ }
+
+ @Override
+ protected void loadTreeUrlItem_actionPerformed(ActionEvent e)
{
- chooser.setFileFilter(treeFormat.getTreeFilter());
+ chooseTreeUrl();
}
- int value = chooser.showOpenDialog(null);
+ @Override
+ protected void loadTreeDbItem_actionPerformed(ActionEvent e)
+ {
+ chooseTreeDb();
+ }
- if (value == JalviewFileChooser.APPROVE_OPTION)
+ public void chooseTreeFile()
{
- String filePath = chooser.getSelectedFile().getPath();
- Cache.setProperty("LAST_DIRECTORY", filePath);
+ // Pick the tree file
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
+ chooser.setFileView(new JalviewFileView());
+ chooser.setDialogTitle(
+ MessageManager.getString("label.select_tree_file")); // modify
+ chooser.setToolTipText(
+ MessageManager.getString("label.load_tree_for_sequence_set"));
+ for (SupportedTreeFileFilter treeFormat : SupportedTreeFileFilter
+ .values())
+ {
+ chooser.setFileFilter(treeFormat.getTreeFilter());
+ }
+
+ int value = chooser.showOpenDialog(null);
+
+ if (value == JalviewFileChooser.APPROVE_OPTION)
+ {
+ String filePath = chooser.getSelectedFile().getPath();
+ Cache.setProperty("LAST_DIRECTORY", filePath);
TreeParser treeParser = new TreeParser(filePath);
treeParser.loadTree(viewport);
}
/**
- * Move to TreeParser?
+ * Break up and move to TreeParser?
*/
public void chooseTreeUrl()
{
StringTokenizer st;
if (historyItems != null)
- {
+ {
st = new StringTokenizer(historyItems, "\t");
while (st.hasMoreTokens())
{
history.addItem(st.nextToken());
}
- }
+ }
int reply = JvOptionPane.showInternalConfirmDialog(this, panel,
MessageManager.getString("label.load_tree_url"),
treeUrl = new URL(urlString);
AptxInit.createInstanceFromUrl(treeUrl, viewport);
- } catch (IOException e)
+ } catch (IOException | RuntimeException e)
{
- JvOptionPane.showMessageDialog(this,
- MessageManager.formatMessage(
- "exception.failed_to_read_data_from_source",
- new String[]
- { urlString }),
- MessageManager.getString("label.url_not_found")
- , JvOptionPane.ERROR_MESSAGE);
+ JvOptionPane.showMessageDialog(this, MessageManager.formatMessage(
+ "exception.failed_to_read_data_from_source", new String[]
+ { urlString }),
+ MessageManager.getString("label.url_not_found"),
+ JvOptionPane.ERROR_MESSAGE);
e.printStackTrace();
}
}
{
}
-
-
-
-
- // final String url_string = JOptionPane
- // .showInputDialog( this,
- // message,
- // "Use URL/webservice to obtain a phylogeny",
- // JOptionPane.QUESTION_MESSAGE );
- // boolean nhx_or_nexus = false;
- // if ( ( url_string != null ) && ( url_string.length() > 0 ) ) {
- // try {
- // url = new URL( url_string );
}
- /**
- * DOCUMENT ME!
- *
- * @param e
- * DOCUMENT ME!
- */
- @Override
- protected void loadTreeMenuItem_actionPerformed(ActionEvent e)
+ public void chooseTreeDb()
{
- chooseTreeFile();
- }
- @Override
- protected void loadTreeUrlItem_actionPerformed(ActionEvent e)
- {
- chooseTreeUrl();
- }
-
- @Override
- protected void loadTreeDbItem_actionPerformed(ActionEvent e)
- {
}