+
+ public void scrollTo(int row, int column)
+ {
+ alignPanel.seqPanel.scrollTo(row, column);
+ }
+
+ public void scrollToRow(int row)
+ {
+ alignPanel.seqPanel.scrollToRow(row);
+ }
+
+ public void scrollToColumn(int column)
+ {
+ alignPanel.seqPanel.scrollToColumn(column);
+ }
+
+ /**
+ * @return the alignments unique ID.
+ */
+ public String getSequenceSetId()
+ {
+ return viewport.getSequenceSetId();
+ }
+
+ /**
+ * Load the (T-Coffee) score file from the specified url
+ *
+ * @param source
+ * File/URL/T-COFFEE score file contents
+ * @throws IOException
+ * @return true if alignment was annotated with data from source
+ */
+ public boolean loadScoreFile(String source) throws IOException
+ {
+
+ TCoffeeScoreFile file = new TCoffeeScoreFile(source,
+ AppletFormatAdapter.checkProtocol(source));
+ if (!file.isValid())
+ {
+ // TODO: raise dialog for gui
+ System.err.println("Problems parsing T-Coffee scores: "
+ + file.getWarningMessage());
+ System.err.println("Origin was:\n" + source);
+ return false;
+ }
+
+ /*
+ * check that the score matrix matches the alignment dimensions
+ */
+ AlignmentI aln;
+ if ((aln = viewport.getAlignment()) != null
+ && (aln.getHeight() != file.getHeight() || aln.getWidth() != file
+ .getWidth()))
+ {
+ // TODO: raise a dialog box here rather than bomb out.
+ System.err
+ .println("The scores matrix does not match the alignment dimensions");
+
+ }
+
+ // TODO add parameter to indicate if matching should be done
+ if (file.annotateAlignment(alignPanel.getAlignment(), false))
+ {
+ alignPanel.fontChanged();
+ tcoffeeColour.setEnabled(true);
+ // switch to this color
+ changeColour(new TCoffeeColourScheme(alignPanel.getAlignment()));
+ return true;
+ }
+ else
+ {
+ System.err.println("Problems resolving T-Coffee scores:");
+ if (file.getWarningMessage() != null)
+ {
+ System.err.println(file.getWarningMessage());
+ }
+ }
+ return false;
+ }
+