+
+ @Override
+ public void loadScores_actionPerformed(ActionEvent e)
+ {
+ // Pick the tree file
+ JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
+ chooser.setFileView(new JalviewFileView());
+ chooser.setDialogTitle("Select a T-Coffee scores ascii file");
+ chooser.setToolTipText("Load a score file");
+
+ int value = chooser.showOpenDialog(null);
+
+ if (value == JalviewFileChooser.APPROVE_OPTION)
+ {
+ String sFilePath = chooser.getSelectedFile().getPath();
+ jalview.bin.Cache.setProperty("LAST_DIRECTORY", sFilePath);
+
+
+ try
+ {
+ TCoffeeScoreFile result = TCoffeeScoreFile.load(new File(sFilePath));
+ 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);
+
+ }
+ catch (Exception ex) {
+ JOptionPane.showMessageDialog(
+ Desktop.desktop,
+ ex.getMessage(),
+ "Problem reading tree file",
+ JOptionPane.WARNING_MESSAGE);
+
+ ex.printStackTrace();
+ }
+ }
+
+ }
+
+
+ @Override
+ protected void tcoffeeColorScheme_actionPerformed(ActionEvent e) {
+ if( tcoffeeScoreFile != null ) {
+ changeColour( new TCoffeeColourScheme(tcoffeeScoreFile) );
+ }
+ }
+
+// /**
+// * Load the (T-Coffee) score file from the specified url
+// *
+// * @param url The absolute path from where download and read the score file
+// * @throws IOException
+// */
+// public void loadScoreFile(URL url ) throws IOException {
+//
+// TCoffeeScoreFile result = new TCoffeeScoreFile();
+// result.parse( new InputStreamReader( url.openStream() ) );
+// tcoffeeScoreFile = result;
+// }
+