/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
* Jalview is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
*
* Jalview is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
* The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.appletgui;
-import java.awt.*;
-import java.awt.event.*;
-
-import jalview.analysis.*;
-import jalview.datamodel.*;
-import jalview.io.*;
+import jalview.analysis.NJTree;
+import jalview.api.analysis.ScoreModelI;
+import jalview.api.analysis.ViewBasedAnalysisI;
+import jalview.datamodel.Alignment;
+import jalview.datamodel.AlignmentView;
+import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.SequenceI;
+import jalview.io.NewickFile;
+import jalview.schemes.ResidueProperties;
+import jalview.util.MessageManager;
+
+import java.awt.BorderLayout;
+import java.awt.CheckboxMenuItem;
+import java.awt.Color;
+import java.awt.Menu;
+import java.awt.MenuBar;
+import java.awt.MenuItem;
+import java.awt.ScrollPane;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
public class TreePanel extends EmbmenuFrame implements ActionListener,
ItemListener
{
int start, end;
SequenceI[] seqs;
- boolean selview = (av.getSelectionGroup() != null)
- && (av.getSelectionGroup().getSize() > 1);
+ boolean selview = av.getSelectionGroup() != null
+ && av.getSelectionGroup().getSize() > 1;
AlignmentView seqStrings = av.getAlignmentView(selview);
if (!selview)
{
seqs = av.getSelectionGroup().getSequencesInOrder(
av.getAlignment());
}
-
- tree = new NJTree(seqs, seqStrings, type, pwtype, start, end);
+ ScoreModelI sm = ResidueProperties.getScoreModel(pwtype);
+ if (sm instanceof ViewBasedAnalysisI)
+ {
+ try
+ {
+ sm = sm.getClass().newInstance();
+ ((ViewBasedAnalysisI) sm)
+ .configureFromAlignmentView(treeCanvas.ap);
+ } catch (Exception q)
+ {
+ System.err.println("Couldn't create a scoremodel instance for "
+ + sm.getName());
+ q.printStackTrace();
+ }
+ tree = new NJTree(seqs, seqStrings, type, pwtype, sm, start, end);
+ }
+ else
+ {
+ tree = new NJTree(seqs, seqStrings, type, pwtype, null, start,
+ end);
+ }
}
tree.reCount(tree.getTopNode());
setLayout(borderLayout1);
this.setBackground(Color.white);
this.setFont(new java.awt.Font("Verdana", 0, 12));
- jMenu2.setLabel("View");
- fontSize.setLabel("Font...");
+ jMenu2.setLabel(MessageManager.getString("action.view"));
+ fontSize.setLabel(MessageManager.getString("action.font"));
fontSize.addActionListener(this);
- bootstrapMenu.setLabel("Show Bootstrap Values");
+ bootstrapMenu.setLabel(MessageManager
+ .getString("label.show_bootstrap_values"));
bootstrapMenu.addItemListener(this);
- distanceMenu.setLabel("Show Distances");
+ distanceMenu.setLabel(MessageManager.getString("label.show_distances"));
distanceMenu.addItemListener(this);
- placeholdersMenu.setLabel("Mark Unassociated Leaves");
+ placeholdersMenu.setLabel(MessageManager
+ .getString("label.mark_unassociated_leaves"));
placeholdersMenu.addItemListener(this);
fitToWindow.setState(true);
- fitToWindow.setLabel("Fit To Window");
+ fitToWindow.setLabel(MessageManager.getString("label.fit_to_window"));
fitToWindow.addItemListener(this);
- fileMenu.setLabel("File");
- newickOutput.setLabel("Newick Format");
+ fileMenu.setLabel(MessageManager.getString("action.file"));
+ newickOutput.setLabel(MessageManager.getString("label.newick_format"));
newickOutput.addActionListener(this);
- inputData.setLabel("Input Data...");
+ inputData.setLabel(MessageManager.getString("label.input_data"));
add(scrollPane, BorderLayout.CENTER);
jMenuBar1.add(fileMenu);