@Override
public void actionPerformed(ActionEvent e)
{
- new CalculationChooser(AlignFrame.this);
+ openTreePcaDialog();
}
});
buildColourMenu();
}
else
{
- // are the visible sequences aligned?
- if (!viewport.getAlignment().isAligned(false))
- {
- JvOptionPane
- .showMessageDialog(
- Desktop.desktop,
- MessageManager
- .getString("label.sequences_must_be_aligned_before_creating_tree"),
- MessageManager
- .getString("label.sequences_not_aligned"),
- JvOptionPane.WARNING_MESSAGE);
-
- return;
- }
-
if (viewport.getAlignment().getHeight() < 2)
{
return;
}
if (FileFormat.ScoreMatrix == format)
{
+ // load and register the score matrix
ScoreMatrixFile sm = new ScoreMatrixFile(new FileParse(file,
sourceType));
- sm.parse();
- // todo: i18n this message
- statusBar
- .setText(MessageManager.formatMessage(
- "label.successfully_loaded_matrix",
- sm.getMatrixName()));
+ statusBar.setText(MessageManager.formatMessage(
+ "label.successfully_loaded_file_type",
+ format.getName(), sm.getMatrixName()));
}
else if (FileFormat.Jnet.equals(format))
{
ColourSchemeI colourScheme = viewport.getGlobalColourScheme();
ColourMenuHelper.setColourSelected(colourMenu, colourScheme);
}
+
+ /**
+ * Open a dialog (if not already open) that allows the user to select and
+ * calculate PCA or Tree analysis
+ */
+ protected void openTreePcaDialog()
+ {
+ if (alignPanel.getCalculationDialog() == null)
+ {
+ new CalculationChooser(AlignFrame.this);
+ }
+ }
}
class PrintThread extends Thread