X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fjalview%2Fgui%2FAlignFrame.java;h=3ba73192be43525bca54f8dce58871939b09e35b;hb=1379350f04bc63ca05bd428afb86717c4764755d;hp=b3e34fb7f6d00cb08d5e712edea2d9399caeaf52;hpb=34d8b4dc08dcd27c3b5ac3bf7811f709b4db5938;p=jalview.git diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index b3e34fb..3ba7319 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -1016,7 +1016,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } FormatAdapter f = new FormatAdapter(); String output = f.formatSequences(format, - (Alignment) viewport.alignment, // class cast exceptions will + viewport.alignment, // class cast exceptions will // occur in the distant future omitHidden, f.getCacheSuffixDefault(format), viewport.colSel); @@ -3067,7 +3067,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { try { - sg.cs = (ColourSchemeI) cs.getClass().newInstance(); + sg.cs = cs.getClass().newInstance(); } catch (Exception ex) { } @@ -3883,9 +3883,18 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, 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"); } + if( result == null ) { + throw new RuntimeException("The file provided does not match the T-Coffee scores file format"); + } + + /* + * check that the score matrix matches the alignment dimensions + */ + AlignmentI aln; + if( (aln=viewport.alignment) != null && (aln.getHeight() != result.getHeight() || aln.getWidth() != result.getWidth()) ) { + throw new RuntimeException("The scores matrix does not match the alignment dimensions"); + } - // TODO check that the loaded scores matches the current MSA 'dimension' changeColour( new TCoffeeColourScheme(result) ); tcoffeeScoreFile = result; tcoffeeColour.setEnabled(true);