Vector alignPanels = new Vector();
- TCoffeeScoreFile tcoffeeScoreFile;
-
/**
* Last format used to load or save alignments in this window
*/
if( result == null ) { throw new RuntimeException("The file provided does not match the T-Coffee scores file format"); }
// TODO check that the loaded scores matches the current MSA 'dimension'
- changeColour( new TCoffeeColourScheme(result) );
- tcoffeeScoreFile = result;
- tcoffeeColour.setEnabled(true);
- tcoffeeColour.setSelected(true);
-
+ if (result.annotateAlignment(alignPanel.getAlignment(), true))
+ {
+ tcoffeeColour.setEnabled(true);
+ tcoffeeColour.setSelected(true);
+ // switch to this color
+ changeColour(new TCoffeeColourScheme(alignPanel.getAlignment()));
+ } else {
+ tcoffeeColour.setEnabled(false);
+ tcoffeeColour.setSelected(false);
+ }
}
catch (Exception ex) {
JOptionPane.showMessageDialog(
@Override
protected void tcoffeeColorScheme_actionPerformed(ActionEvent e) {
- if( tcoffeeScoreFile != null ) {
- changeColour( new TCoffeeColourScheme(tcoffeeScoreFile) );
- }
+ changeColour( new TCoffeeColourScheme(alignPanel.getAlignment()) );
}
// /**